LLVMFuzzerTestOneInput:
   52|  9.05k|{
   53|       |  // The first 2 bytes are used to control decoder options:
   54|       |  //   byte 0 bit 1: force planar mode
   55|       |  //   byte 0 bit 2: force interleaved mode
   56|       |  //   byte 1: number of resolutions to skip (0-7)
   57|  9.05k|  if (Size < 3)
  ------------------
  |  Branch (57:7): [True: 2, False: 9.05k]
  ------------------
   58|      2|    return 0;
   59|       |
   60|  9.05k|  uint8_t opts = Data[0];
   61|  9.05k|  uint8_t skip_res = Data[1] & 0x07;
   62|  9.05k|  Data += 2;
   63|  9.05k|  Size -= 2;
   64|       |
   65|  9.05k|  bool force_planar = (opts & 0x02) != 0;
   66|  9.05k|  bool force_interleaved = (opts & 0x04) != 0;
   67|       |
   68|  9.05k|  try
   69|  9.05k|  {
   70|  9.05k|    ojph::mem_infile infile;
   71|  9.05k|    infile.open(reinterpret_cast<const ojph::ui8 *>(Data), Size);
   72|       |
   73|  9.05k|    ojph::codestream cs;
   74|       |
   75|       |    // Always enable resilience: all fuzzer inputs are untrusted/mutated,
   76|       |    // so the decoder must use its error-recovery path.
   77|  9.05k|    cs.enable_resilience();
   78|       |
   79|  9.05k|    cs.read_headers(&infile);
   80|       |
   81|       |    // Guard against inputs that cause excessive decoding work.
   82|  9.05k|    {
   83|  9.05k|      ojph::param_siz siz = cs.access_siz();
   84|  9.05k|      ojph::point extent = siz.get_image_extent();
   85|  9.05k|      ojph::point offset = siz.get_image_offset();
   86|  9.05k|      ojph::ui64 w = extent.x - offset.x;
   87|  9.05k|      ojph::ui64 h = extent.y - offset.y;
   88|  9.05k|      if (w * h * siz.get_num_components() > 65536)
  ------------------
  |  Branch (88:11): [True: 63, False: 8.98k]
  ------------------
   89|     63|      {
   90|     63|        cs.close();
   91|     63|        return 0;
   92|     63|      }
   93|       |
   94|  8.98k|      ojph::param_cod cod = cs.access_cod();
   95|  8.98k|      if (cod.get_num_decompositions() > 5)
  ------------------
  |  Branch (95:11): [True: 1, False: 8.98k]
  ------------------
   96|      1|      {
   97|      1|        cs.close();
   98|      1|        return 0;
   99|      1|      }
  100|       |
  101|       |      // Large precincts cause huge internal buffers and very expensive
  102|       |      // per-row wavelet transforms even for small images.
  103|  49.7k|      for (ojph::ui32 lev = 0; lev <= cod.get_num_decompositions(); ++lev)
  ------------------
  |  Branch (103:32): [True: 40.8k, False: 8.97k]
  ------------------
  104|  40.8k|      {
  105|  40.8k|        ojph::size psiz = cod.get_precinct_size(lev);
  106|  40.8k|        if (psiz.w > 256 || psiz.h > 256)
  ------------------
  |  Branch (106:13): [True: 13, False: 40.7k]
  |  Branch (106:29): [True: 2, False: 40.7k]
  ------------------
  107|     15|        {
  108|     15|          cs.close();
  109|     15|          return 0;
  110|     15|        }
  111|  40.8k|      }
  112|  8.98k|    }
  113|       |
  114|  8.97k|    if (skip_res > 0)
  ------------------
  |  Branch (114:9): [True: 1.73k, False: 7.23k]
  ------------------
  115|  1.73k|      cs.restrict_input_resolution(skip_res, skip_res);
  116|       |
  117|  8.97k|    if (force_planar)
  ------------------
  |  Branch (117:9): [True: 3.32k, False: 5.64k]
  ------------------
  118|  3.32k|      cs.set_planar(true);
  119|  5.64k|    else if (force_interleaved)
  ------------------
  |  Branch (119:14): [True: 1.15k, False: 4.49k]
  ------------------
  120|  1.15k|      cs.set_planar(false);
  121|       |
  122|  8.97k|    cs.create();
  123|       |
  124|  8.97k|    ojph::param_siz siz = cs.access_siz();
  125|       |
  126|       |    // Second guard: cap reconstructed dimensions after create().
  127|  8.97k|    {
  128|  8.97k|      ojph::ui64 total_recon = 0;
  129|  17.3k|      for (ojph::ui32 c = 0; c < siz.get_num_components(); ++c)
  ------------------
  |  Branch (129:30): [True: 8.39k, False: 8.97k]
  ------------------
  130|  8.39k|        total_recon += (ojph::ui64)siz.get_recon_width(c)
  131|  8.39k|                     * (ojph::ui64)siz.get_recon_height(c);
  132|  8.97k|      if (total_recon > 65536)
  ------------------
  |  Branch (132:11): [True: 0, False: 8.97k]
  ------------------
  133|      0|      {
  134|      0|        cs.close();
  135|      0|        return 0;
  136|      0|      }
  137|  8.97k|    }
  138|       |
  139|       |    // Time budget: abort if decoding takes too long.
  140|  8.97k|    auto start_ts = std::chrono::steady_clock::now();
  141|  8.97k|    ojph::ui32 pull_count = 0;
  142|  8.97k|    const auto MAX_SECONDS = std::chrono::seconds(10u);
  143|  8.97k|    bool timed_out = false;
  144|       |
  145|  8.97k|    if (cs.is_planar())
  ------------------
  |  Branch (145:9): [True: 5.40k, False: 3.56k]
  ------------------
  146|  5.40k|    {
  147|  12.3k|      for (ojph::ui32 c = 0; c < siz.get_num_components() && !timed_out; ++c)
  ------------------
  |  Branch (147:30): [True: 6.98k, False: 5.40k]
  |  Branch (147:62): [True: 6.98k, False: 0]
  ------------------
  148|  6.98k|      {
  149|  6.98k|        ojph::ui32 height = siz.get_recon_height(c);
  150|  2.10M|        for (ojph::ui32 i = height; i > 0 && !timed_out; --i)
  ------------------
  |  Branch (150:37): [True: 2.10M, False: 6.98k]
  |  Branch (150:46): [True: 2.10M, False: 0]
  ------------------
  151|  2.10M|        {
  152|  2.10M|          ojph::ui32 comp_num;
  153|  2.10M|          cs.pull(comp_num);
  154|  2.10M|          if (++pull_count % 64 == 0)
  ------------------
  |  Branch (154:15): [True: 31.5k, False: 2.06M]
  ------------------
  155|  31.5k|          {
  156|  31.5k|            auto now = std::chrono::steady_clock::now();
  157|  31.5k|            if (now - start_ts >= MAX_SECONDS)
  ------------------
  |  Branch (157:17): [True: 0, False: 31.5k]
  ------------------
  158|      0|              timed_out = true;
  159|  31.5k|          }
  160|  2.10M|        }
  161|  6.98k|      }
  162|  5.40k|    }
  163|  3.56k|    else
  164|  3.56k|    {
  165|  3.56k|      ojph::ui32 height = siz.get_recon_height(0);
  166|  1.85M|      for (ojph::ui32 i = 0; i < height && !timed_out; ++i)
  ------------------
  |  Branch (166:30): [True: 1.85M, False: 3.56k]
  |  Branch (166:44): [True: 1.85M, False: 0]
  ------------------
  167|  1.85M|      {
  168|  3.70M|        for (ojph::ui32 c = 0; c < siz.get_num_components(); ++c)
  ------------------
  |  Branch (168:32): [True: 1.85M, False: 1.85M]
  ------------------
  169|  1.85M|        {
  170|  1.85M|          ojph::ui32 comp_num;
  171|  1.85M|          cs.pull(comp_num);
  172|  1.85M|          if (++pull_count % 64 == 0)
  ------------------
  |  Branch (172:15): [True: 28.6k, False: 1.82M]
  ------------------
  173|  28.6k|          {
  174|  28.6k|            auto now = std::chrono::steady_clock::now();
  175|  28.6k|            if (now - start_ts >= MAX_SECONDS)
  ------------------
  |  Branch (175:17): [True: 0, False: 28.6k]
  ------------------
  176|      0|              timed_out = true;
  177|  28.6k|          }
  178|  1.85M|        }
  179|  1.85M|      }
  180|  3.56k|    }
  181|       |
  182|  8.97k|    cs.close();
  183|  8.97k|  }
  184|  9.05k|  catch (const std::exception &)
  185|  9.05k|  {
  186|  2.39k|  }
  187|       |
  188|  8.97k|  return 0;
  189|  9.05k|}

ojph_precinct.cpp:_ZN4ojph5localL7bb_initEPNS0_12bit_read_bufEjPNS_11infile_baseE:
   69|   364k|    {
   70|   364k|      bbp->avail_bits = 0;
   71|   364k|      bbp->file = file;
   72|   364k|      bbp->bytes_left = bytes_left;
   73|   364k|      bbp->tmp = 0;
   74|   364k|      bbp->unstuff = false;
   75|   364k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_skip_sopEPNS0_12bit_read_bufE:
  185|  54.9k|    {
  186|  54.9k|      if (bbp->bytes_left >= 2)
  ------------------
  |  Branch (186:11): [True: 54.3k, False: 575]
  ------------------
  187|  54.3k|      {
  188|  54.3k|        ui8 marker[2];
  189|  54.3k|        if (bbp->file->read(marker, 2) != 2)
  ------------------
  |  Branch (189:13): [True: 1.68k, False: 52.6k]
  ------------------
  190|  1.68k|          throw "error reading from file";
  191|  52.6k|        if ((int)marker[0] == (SOP >> 8) && (int)marker[1] == (SOP & 0xFF))
  ------------------
  |  Branch (191:13): [True: 4.52k, False: 48.1k]
  |  Branch (191:45): [True: 1.62k, False: 2.89k]
  ------------------
  192|  1.62k|        {
  193|  1.62k|          bbp->bytes_left -= 2;
  194|  1.62k|          if (bbp->bytes_left >= 4)
  ------------------
  |  Branch (194:15): [True: 1.42k, False: 205]
  ------------------
  195|  1.42k|          {
  196|  1.42k|            ui16 com_len;
  197|  1.42k|            if (bbp->file->read(&com_len, 2) != 2)
  ------------------
  |  Branch (197:17): [True: 215, False: 1.20k]
  ------------------
  198|    215|              throw "error reading from file";
  199|  1.20k|            com_len = swap_bytes_if_le(com_len);
  200|  1.20k|            if (com_len != 4)
  ------------------
  |  Branch (200:17): [True: 319, False: 889]
  ------------------
  201|    319|              throw "something is wrong with SOP length";
  202|    889|            int result = 
  203|    889|              bbp->file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
  204|    889|            if (result != 0)
  ------------------
  |  Branch (204:17): [True: 394, False: 495]
  ------------------
  205|    394|              throw "error seeking file";
  206|    495|            bbp->bytes_left -= com_len;
  207|    495|          }
  208|    205|          else
  209|    205|            throw "precinct truncated early";
  210|    495|          return true;
  211|  1.62k|        }
  212|  51.0k|        else
  213|  51.0k|        {
  214|       |          //put the bytes back
  215|  51.0k|          if (bbp->file->seek(-2, infile_base::OJPH_SEEK_CUR) != 0)
  ------------------
  |  Branch (215:15): [True: 0, False: 51.0k]
  ------------------
  216|      0|            throw "error seeking file";
  217|  51.0k|          return false;
  218|  51.0k|        }
  219|  52.6k|      }
  220|       |
  221|    575|      return false;
  222|  54.9k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_read_bitEPNS0_12bit_read_bufERj:
  104|   224M|    {
  105|   224M|      bool result = true;
  106|   224M|      if (bbp->avail_bits == 0)
  ------------------
  |  Branch (106:11): [True: 31.7M, False: 192M]
  ------------------
  107|  31.7M|        result = bb_read(bbp);
  108|   224M|      bit = (bbp->tmp >> --bbp->avail_bits) & 1;
  109|   224M|      return result;
  110|   224M|    }
ojph_precinct.cpp:_ZN4ojph5localL7bb_readEPNS0_12bit_read_bufE:
   80|  54.0M|    {
   81|  54.0M|      if (bbp->bytes_left > 0)
  ------------------
  |  Branch (81:11): [True: 54.0M, False: 3.70k]
  ------------------
   82|  54.0M|      {
   83|  54.0M|        ui8 t = 0;
   84|  54.0M|        if (bbp->file->read(&t, 1) != 1)
  ------------------
  |  Branch (84:13): [True: 18.0k, False: 54.0M]
  ------------------
   85|  18.0k|          throw "error reading from file";
   86|  54.0M|        bbp->tmp = t;
   87|  54.0M|        bbp->avail_bits = 8 - bbp->unstuff;
   88|  54.0M|        bbp->unstuff = (t == 0xFF);
   89|  54.0M|        --bbp->bytes_left;
   90|  54.0M|        return true;
   91|  54.0M|      }
   92|  3.70k|      else
   93|  3.70k|      {
   94|  3.70k|        bbp->tmp = 0;
   95|  3.70k|        bbp->avail_bits = 8 - bbp->unstuff;
   96|  3.70k|        bbp->unstuff = false;
   97|  3.70k|        return false;
   98|  3.70k|      }
   99|  54.0M|    }
ojph_precinct.cpp:_ZN4ojph5localL12bb_terminateEPNS0_12bit_read_bufEb:
  170|   331k|    {
  171|   331k|      bool result = true;
  172|   331k|      if (bbp->unstuff)
  ------------------
  |  Branch (172:11): [True: 3.18k, False: 327k]
  ------------------
  173|  3.18k|        result = bb_read(bbp);
  174|   331k|      assert(bbp->unstuff == false);
  175|   331k|      if (uses_eph)
  ------------------
  |  Branch (175:11): [True: 3.47k, False: 327k]
  ------------------
  176|  3.47k|        bb_skip_eph(bbp);
  177|   331k|      bbp->tmp = 0;
  178|   331k|      bbp->avail_bits = 0;
  179|   331k|      return result;
  180|   331k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_skip_ephEPNS0_12bit_read_bufE:
  155|  3.47k|    {
  156|  3.47k|      if (bbp->bytes_left >= 2)
  ------------------
  |  Branch (156:11): [True: 2.54k, False: 931]
  ------------------
  157|  2.54k|      {
  158|  2.54k|        ui8 marker[2];
  159|  2.54k|        if (bbp->file->read(marker, 2) != 2)
  ------------------
  |  Branch (159:13): [True: 489, False: 2.05k]
  ------------------
  160|    489|          throw "error reading from file";
  161|  2.05k|        bbp->bytes_left -= 2;
  162|  2.05k|        if ((int)marker[0] != (EPH >> 8) || (int)marker[1] != (EPH & 0xFF))
  ------------------
  |  Branch (162:13): [True: 1.26k, False: 785]
  |  Branch (162:45): [True: 573, False: 212]
  ------------------
  163|  1.83k|          throw "should find EPH, but found something else";
  164|  2.05k|      }
  165|  3.47k|    }
ojph_precinct.cpp:_ZN4ojph5localL12bb_read_bitsEPNS0_12bit_read_bufEiRj:
  115|   294k|    {
  116|   294k|      assert(num_bits <= 32);
  117|       |
  118|   294k|      bits = 0;
  119|   294k|      bool result = true;
  120|  22.8M|      while (num_bits) {
  ------------------
  |  Branch (120:14): [True: 22.5M, False: 294k]
  ------------------
  121|  22.5M|        if (bbp->avail_bits == 0)
  ------------------
  |  Branch (121:13): [True: 22.3M, False: 265k]
  ------------------
  122|  22.3M|          result = bb_read(bbp);
  123|  22.5M|        int tx_bits = ojph_min(bbp->avail_bits, num_bits);
  ------------------
  |  |   76|  22.5M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 22.2M, False: 294k]
  |  |  ------------------
  ------------------
  124|  22.5M|        bits <<= tx_bits;
  125|  22.5M|        bbp->avail_bits -= tx_bits;
  126|  22.5M|        num_bits -= tx_bits;
  127|  22.5M|        bits |= (bbp->tmp >> bbp->avail_bits) & ((1 << tx_bits) - 1);
  128|  22.5M|      }
  129|   294k|      return result;
  130|   294k|    }
ojph_precinct.cpp:_ZN4ojph5localL13bb_read_chunkEPNS0_12bit_read_bufEjRPNS_11coded_listsEPNS_21mem_elastic_allocatorE:
  137|  78.9k|    {
  138|  78.9k|      assert(bbp->avail_bits == 0 && bbp->unstuff == false);
  139|  78.9k|      elastic->get_buffer(num_bytes + coded_cb_header::prefix_buf_size
  140|  78.9k|        + coded_cb_header::suffix_buf_size, cur_coded_list);
  141|  78.9k|      ui32 bytes = ojph_min(num_bytes, bbp->bytes_left);
  ------------------
  |  |   76|  78.9k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 78.1k, False: 721]
  |  |  ------------------
  ------------------
  142|  78.9k|      ui32 bytes_read = (ui32)bbp->file->read(
  143|  78.9k|        cur_coded_list->buf + coded_cb_header::prefix_buf_size, bytes);
  144|  78.9k|      if (num_bytes > bytes_read)
  ------------------
  |  Branch (144:11): [True: 11.0k, False: 67.9k]
  ------------------
  145|  11.0k|        memset(
  146|  11.0k|          cur_coded_list->buf + coded_cb_header::prefix_buf_size + bytes_read,
  147|  11.0k|          0, num_bytes - bytes_read);
  148|  78.9k|      bbp->bytes_left -= bytes_read;
  149|  78.9k|      return bytes_read == bytes;
  150|  78.9k|    }

_ZN4ojph5local9codeblock9pre_allocEPNS0_10codestreamERKNS_4sizeEj:
   58|  5.85M|    {
   59|  5.85M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   60|       |
   61|  5.85M|      assert(byte_alignment / sizeof(ui32) > 1);
   62|  5.85M|      const ui32 f = byte_alignment / sizeof(ui32) - 1;
   63|  5.85M|      ui32 stride = (nominal.w + f) & ~f; // a multiple of 8
   64|       |
   65|  5.85M|      if (precision <= 32)
  ------------------
  |  Branch (65:11): [True: 4.04M, False: 1.81M]
  ------------------
   66|  4.04M|        allocator->pre_alloc_data<ui32>(nominal.h * (size_t)stride, 0);
   67|  1.81M|      else
   68|  1.81M|        allocator->pre_alloc_data<ui64>(nominal.h * (size_t)stride, 0);
   69|  5.85M|    }
_ZN4ojph5local9codeblock14finalize_allocEPNS0_10codestreamEPNS0_7subbandERKNS_4sizeES8_PNS0_15coded_cb_headerEjijj:
   78|  5.64M|    {
   79|  5.64M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   80|       |
   81|  5.64M|      const ui32 f = byte_alignment / sizeof(ui32) - 1;
   82|  5.64M|      this->stride = (nominal.w + f) & ~f; // a multiple of 8
   83|  5.64M|      this->buf_size = this->stride * nominal.h;
   84|       |
   85|  5.64M|      if (precision <= 32) {
  ------------------
  |  Branch (85:11): [True: 3.86M, False: 1.77M]
  ------------------
   86|  3.86M|        this->precision = BUF32;
   87|  3.86M|        this->buf32 = allocator->post_alloc_data<ui32>(this->buf_size, 0);
   88|  3.86M|      }
   89|  1.77M|      else {
   90|  1.77M|        this->precision = BUF64;
   91|  1.77M|        this->buf64 = allocator->post_alloc_data<ui64>(this->buf_size, 0);
   92|  1.77M|      }
   93|       |
   94|  5.64M|      this->nominal_size = nominal;
   95|  5.64M|      this->cb_size = cb_size;
   96|  5.64M|      this->parent = parent;
   97|  5.64M|      this->line_offset = line_offset;
   98|  5.64M|      this->cur_line = 0;
   99|  5.64M|      this->delta = parent->get_delta();
  100|  5.64M|      this->delta_inv = 1.0f / this->delta;
  101|  5.64M|      this->K_max = K_max;
  102|  28.2M|      for (int i = 0; i < 4; ++i)
  ------------------
  |  Branch (102:23): [True: 22.5M, False: 5.64M]
  ------------------
  103|  22.5M|        this->max_val64[i] = 0;
  104|  5.64M|      const param_cod* coc = codestream->get_coc(comp_idx);
  105|  5.64M|      this->reversible = coc->is_reversible();
  106|  5.64M|      this->resilient = codestream->is_resilient();
  107|  5.64M|      this->stripe_causal = coc->get_block_vertical_causality();
  108|  5.64M|      this->zero_block = false;
  109|  5.64M|      this->coded_cb = coded_cb;
  110|       |
  111|  5.64M|      this->codeblock_functions.init(reversible);
  112|  5.64M|    }
_ZN4ojph5local9codeblock8recreateERKNS_4sizeEPNS0_15coded_cb_headerE:
  179|  12.6M|    {
  180|  12.6M|      assert(cb_size.h * stride <= buf_size && cb_size.w <= stride);
  181|  12.6M|      this->cb_size = cb_size;
  182|  12.6M|      this->coded_cb = coded_cb;
  183|  12.6M|      this->cur_line = 0;
  184|  63.2M|      for (int i = 0; i < 4; ++i)
  ------------------
  |  Branch (184:23): [True: 50.5M, False: 12.6M]
  ------------------
  185|  50.5M|        this->max_val64[i] = 0;
  186|  12.6M|      this->zero_block = false;
  187|  12.6M|    }
_ZN4ojph5local9codeblock6decodeEv:
  191|  12.6M|    {
  192|  12.6M|      if (coded_cb->pass_length[0] > 0 && coded_cb->num_passes > 0 &&
  ------------------
  |  Branch (192:11): [True: 74.3k, False: 12.5M]
  |  Branch (192:43): [True: 74.3k, False: 0]
  ------------------
  193|  74.3k|          coded_cb->next_coded != NULL)
  ------------------
  |  Branch (193:11): [True: 68.5k, False: 5.83k]
  ------------------
  194|  68.5k|      {
  195|  68.5k|        bool result;
  196|  68.5k|        if (precision == BUF32)
  ------------------
  |  Branch (196:13): [True: 42.3k, False: 26.2k]
  ------------------
  197|  42.3k|        {
  198|  42.3k|          result = this->codeblock_functions.decode_cb32(
  199|  42.3k|            coded_cb->next_coded->buf + coded_cb_header::prefix_buf_size,
  200|  42.3k|            buf32, coded_cb->missing_msbs, coded_cb->num_passes,
  201|  42.3k|            coded_cb->pass_length[0], coded_cb->pass_length[1],
  202|  42.3k|            cb_size.w, cb_size.h, stride, stripe_causal);
  203|  42.3k|        }
  204|  26.2k|        else
  205|  26.2k|        {
  206|  26.2k|          assert(precision == BUF64);
  207|  26.2k|          result = this->codeblock_functions.decode_cb64(
  208|  26.2k|            coded_cb->next_coded->buf + coded_cb_header::prefix_buf_size,
  209|  26.2k|            buf64, coded_cb->missing_msbs, coded_cb->num_passes,
  210|  26.2k|            coded_cb->pass_length[0], coded_cb->pass_length[1],
  211|  26.2k|            cb_size.w, cb_size.h, stride, stripe_causal);
  212|  26.2k|        }
  213|       |
  214|  68.5k|        if (result == false)
  ------------------
  |  Branch (214:13): [True: 37.7k, False: 30.7k]
  ------------------
  215|  37.7k|        {
  216|  37.7k|          if (resilient == true) {
  ------------------
  |  Branch (216:15): [True: 37.7k, False: 0]
  ------------------
  217|  37.7k|            OJPH_INFO(0x000300A1, "Error decoding a codeblock.");
  ------------------
  |  |  285|  37.7k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  37.7k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 37.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|  37.7k|            zero_block = true;
  219|  37.7k|          }
  220|      0|          else
  221|      0|            OJPH_ERROR(0x000300A1, "Error decoding a codeblock.");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|  37.7k|        }
  223|  68.5k|      }
  224|  12.5M|      else
  225|  12.5M|        zero_block = true;
  226|  12.6M|    }
_ZN4ojph5local9codeblock9pull_lineEPNS_8line_bufE:
  231|  39.3M|    {
  232|       |      //convert to sign and magnitude
  233|  39.3M|      if (precision == BUF32)
  ------------------
  |  Branch (233:11): [True: 24.4M, False: 14.9M]
  ------------------
  234|  24.4M|      {
  235|  24.4M|        assert(line->flags & line_buf::LFT_32BIT);
  236|  24.4M|        void *dp = (line->flags & line_buf::LFT_INTEGER)
  ------------------
  |  Branch (236:20): [True: 20.5M, False: 3.86M]
  ------------------
  237|  24.4M|          ? (void*)(line->i32 + line_offset)
  238|  24.4M|          : (void*)(line->f32 + line_offset);
  239|  24.4M|        if (!zero_block)
  ------------------
  |  Branch (239:13): [True: 290k, False: 24.1M]
  ------------------
  240|   290k|        {
  241|   290k|          const ui32 *sp = buf32 + cur_line * stride;
  242|   290k|          this->codeblock_functions.tx_from_cb32(sp, dp, K_max, delta,
  243|   290k|                                                 cb_size.w);
  244|   290k|        }
  245|  24.1M|        else
  246|  24.1M|          this->codeblock_functions.mem_clear(dp, cb_size.w * sizeof(ui32));
  247|  24.4M|      }
  248|  14.9M|      else
  249|  14.9M|      {
  250|  14.9M|        assert(precision == BUF64);
  251|  14.9M|        assert((reversible && (line->flags & line_buf::LFT_64BIT))
  252|  14.9M|               || (!reversible && (line->flags & line_buf::LFT_32BIT)));
  253|  14.9M|        si64 *dp = line->i64 + line_offset;
  254|  14.9M|        if (!zero_block)
  ------------------
  |  Branch (254:13): [True: 200k, False: 14.7M]
  ------------------
  255|   200k|        {
  256|   200k|          const ui64 *sp = buf64 + cur_line * stride;
  257|   200k|          this->codeblock_functions.tx_from_cb64(sp, dp, K_max, delta,
  258|   200k|                                                 cb_size.w);
  259|   200k|        }
  260|  14.7M|        else
  261|  14.7M|          this->codeblock_functions.mem_clear(dp, cb_size.w * sizeof(*dp));
  262|  14.9M|      }
  263|       |
  264|  39.3M|      ++cur_line;
  265|       |      assert(cur_line <= cb_size.h);
  266|  39.3M|    }

_ZN4ojph5local13codeblock_fun4initEb:
  147|  5.64M|    void codeblock_fun::init(bool reversible) {
  148|       |
  149|  5.64M|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  150|       |
  151|       |      // Default path, no acceleration.  We may change this later
  152|  5.64M|      decode_cb32 = ojph_decode_codeblock32;
  153|  5.64M|      find_max_val32 = gen_find_max_val32;
  154|  5.64M|      mem_clear = gen_mem_clear;
  155|  5.64M|      if (reversible) {
  ------------------
  |  Branch (155:11): [True: 4.12M, False: 1.51M]
  ------------------
  156|  4.12M|        tx_to_cb32 = gen_rev_tx_to_cb32;
  157|  4.12M|        tx_from_cb32 = gen_rev_tx_from_cb32;
  158|  4.12M|      }
  159|  1.51M|      else
  160|  1.51M|      {
  161|  1.51M|        tx_to_cb32 = gen_irv_tx_to_cb32;
  162|  1.51M|        tx_from_cb32 = gen_irv_tx_from_cb32;
  163|  1.51M|      }
  164|  5.64M|      encode_cb32 = ojph_encode_codeblock32;
  165|       |
  166|  5.64M|      decode_cb64 = ojph_decode_codeblock64;
  167|  5.64M|      find_max_val64 = gen_find_max_val64;
  168|  5.64M|      if (reversible) {
  ------------------
  |  Branch (168:11): [True: 4.12M, False: 1.51M]
  ------------------
  169|  4.12M|        tx_to_cb64 = gen_rev_tx_to_cb64;
  170|  4.12M|        tx_from_cb64 = gen_rev_tx_from_cb64;
  171|  4.12M|      }
  172|  1.51M|      else
  173|  1.51M|      {
  174|  1.51M|        tx_to_cb64 = NULL;
  175|  1.51M|        tx_from_cb64 = gen_irv_tx_from_cb64;
  176|  1.51M|      }
  177|  5.64M|      encode_cb64 = ojph_encode_codeblock64;
  178|  5.64M|      bool result = initialize_block_encoder_tables();
  179|  5.64M|      assert(result); ojph_unused(result);
  ------------------
  |  |   78|  5.64M|#define ojph_unused(x) (void)(x)
  ------------------
  180|       |
  181|  5.64M|  #ifndef OJPH_DISABLE_SIMD
  182|       |
  183|  5.64M|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  184|       |
  185|       |      // Accelerated functions for INTEL/AMD CPUs
  186|  5.64M|      #ifndef OJPH_DISABLE_SSE
  187|  5.64M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  ------------------
  |  Branch (187:13): [True: 5.64M, False: 0]
  ------------------
  188|  5.64M|          mem_clear = sse_mem_clear;
  189|  5.64M|      #endif // !OJPH_DISABLE_SSE
  190|       |
  191|  5.64M|      #ifndef OJPH_DISABLE_SSE2
  192|  5.64M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2) {
  ------------------
  |  Branch (192:13): [True: 5.64M, False: 0]
  ------------------
  193|  5.64M|          find_max_val32 = sse2_find_max_val32;
  194|  5.64M|          if (reversible) {
  ------------------
  |  Branch (194:15): [True: 4.12M, False: 1.51M]
  ------------------
  195|  4.12M|            tx_to_cb32 = sse2_rev_tx_to_cb32;
  196|  4.12M|            tx_from_cb32 = sse2_rev_tx_from_cb32;
  197|  4.12M|          }
  198|  1.51M|          else {
  199|  1.51M|            tx_to_cb32 = sse2_irv_tx_to_cb32;
  200|  1.51M|            tx_from_cb32 = sse2_irv_tx_from_cb32;
  201|  1.51M|          }
  202|  5.64M|          find_max_val64 = sse2_find_max_val64;
  203|  5.64M|          if (reversible) {
  ------------------
  |  Branch (203:15): [True: 4.12M, False: 1.51M]
  ------------------
  204|  4.12M|            tx_to_cb64 = sse2_rev_tx_to_cb64;
  205|  4.12M|            tx_from_cb64 = sse2_rev_tx_from_cb64;
  206|  4.12M|          }
  207|  1.51M|          else
  208|  1.51M|          {
  209|  1.51M|            tx_to_cb64 = NULL;
  210|  1.51M|            tx_from_cb64 = gen_irv_tx_from_cb64;
  211|  1.51M|          }
  212|  5.64M|        }
  213|  5.64M|      #endif // !OJPH_DISABLE_SSE2
  214|       |
  215|  5.64M|      #ifndef OJPH_DISABLE_SSSE3
  216|  5.64M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSSE3)
  ------------------
  |  Branch (216:13): [True: 5.64M, False: 0]
  ------------------
  217|  5.64M|          decode_cb32 = ojph_decode_codeblock_ssse3;
  218|  5.64M|      #endif // !OJPH_DISABLE_SSSE3
  219|       |
  220|  5.64M|      #ifndef OJPH_DISABLE_AVX
  221|  5.64M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  ------------------
  |  Branch (221:13): [True: 5.64M, False: 0]
  ------------------
  222|  5.64M|          mem_clear = avx_mem_clear;
  223|  5.64M|      #endif // !OJPH_DISABLE_AVX
  224|       |
  225|  5.64M|      #ifndef OJPH_DISABLE_AVX2
  226|  5.64M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2) {
  ------------------
  |  Branch (226:13): [True: 5.64M, False: 0]
  ------------------
  227|  5.64M|          decode_cb32 = ojph_decode_codeblock_avx2;
  228|  5.64M|          find_max_val32 = avx2_find_max_val32;
  229|  5.64M|          if (reversible) {
  ------------------
  |  Branch (229:15): [True: 4.12M, False: 1.51M]
  ------------------
  230|  4.12M|            tx_to_cb32 = avx2_rev_tx_to_cb32;
  231|  4.12M|            tx_from_cb32 = avx2_rev_tx_from_cb32;
  232|  4.12M|          }
  233|  1.51M|          else {
  234|  1.51M|            tx_to_cb32 = avx2_irv_tx_to_cb32;
  235|  1.51M|            tx_from_cb32 = avx2_irv_tx_from_cb32;
  236|  1.51M|          }
  237|  5.64M|          encode_cb32 = ojph_encode_codeblock_avx2;
  238|  5.64M|          bool result = initialize_block_encoder_tables_avx2();
  239|  5.64M|          assert(result); ojph_unused(result);
  ------------------
  |  |   78|  5.64M|#define ojph_unused(x) (void)(x)
  ------------------
  240|       |
  241|  5.64M|          find_max_val64 = avx2_find_max_val64;
  242|  5.64M|          if (reversible) {
  ------------------
  |  Branch (242:15): [True: 4.12M, False: 1.51M]
  ------------------
  243|  4.12M|            tx_to_cb64 = avx2_rev_tx_to_cb64;
  244|  4.12M|            tx_from_cb64 = avx2_rev_tx_from_cb64;
  245|  4.12M|          }
  246|  1.51M|          else
  247|  1.51M|          {
  248|  1.51M|            tx_to_cb64 = NULL;
  249|  1.51M|            tx_from_cb64 = gen_irv_tx_from_cb64;
  250|  1.51M|          }
  251|  5.64M|        }
  252|  5.64M|      #endif // !OJPH_DISABLE_AVX2
  253|       |
  254|  5.64M|      #if (defined(OJPH_ARCH_X86_64) && !defined(OJPH_DISABLE_AVX512))
  255|  5.64M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX512) {
  ------------------
  |  Branch (255:13): [True: 0, False: 5.64M]
  ------------------
  256|      0|          encode_cb32 = ojph_encode_codeblock_avx512;
  257|      0|          bool result = initialize_block_encoder_tables_avx512();
  258|      0|          assert(result); ojph_unused(result);
  ------------------
  |  |   78|      0|#define ojph_unused(x) (void)(x)
  ------------------
  259|      0|        }
  260|  5.64M|      #endif // !OJPH_DISABLE_AVX512
  261|       |
  262|       |    #elif defined(OJPH_ARCH_ARM)
  263|       |
  264|       |    #elif defined(OJPH_ARCH_PPC64LE)
  265|       |
  266|       |      // 128-bit VSX kernels; see ojph_simd_vsx.h.
  267|       |      // The SIMD block decoder is used everywhere on POWER10 (ISA 3.1),
  268|       |      // where it beats the scalar decoder on all measured content.  On
  269|       |      // POWER9 it wins for irreversible content (more magnitude bits
  270|       |      // per sample) but trails the scalar decoder slightly on
  271|       |      // reversible content, so it is dispatched only for the former.
  272|       |      // POWER8 (ISA 2.07) keeps the scalar decoder: it has less vector
  273|       |      // load/permute throughput than POWER9, which already loses on
  274|       |      // reversible content, so the SIMD decoder is not expected to win.
  275|       |      // Because it is never dispatched below POWER9, the decoder is
  276|       |      // built at the POWER9 baseline; see src/core/CMakeLists.txt.
  277|       |      // The remaining kernels below are a gain at every level.
  278|       |      if (get_cpu_ext_level() >= PPC_CPU_EXT_LEVEL_ARCH_3_1 ||
  279|       |          (!reversible &&
  280|       |           get_cpu_ext_level() >= PPC_CPU_EXT_LEVEL_ARCH_3_00))
  281|       |        decode_cb32 = ojph_decode_codeblock_vsx;
  282|       |      if (get_cpu_ext_level() >= PPC_CPU_EXT_LEVEL_ARCH_2_07) {
  283|       |        find_max_val32 = vsx_find_max_val32;
  284|       |        mem_clear = vsx_mem_clear;
  285|       |        if (reversible) {
  286|       |          tx_to_cb32 = vsx_rev_tx_to_cb32;
  287|       |          tx_from_cb32 = vsx_rev_tx_from_cb32;
  288|       |        }
  289|       |        else {
  290|       |          tx_to_cb32 = vsx_irv_tx_to_cb32;
  291|       |          tx_from_cb32 = vsx_irv_tx_from_cb32;
  292|       |        }
  293|       |        find_max_val64 = vsx_find_max_val64;
  294|       |        if (reversible) {
  295|       |          tx_to_cb64 = vsx_rev_tx_to_cb64;
  296|       |          tx_from_cb64 = vsx_rev_tx_from_cb64;
  297|       |        }
  298|       |        else {
  299|       |          tx_to_cb64 = NULL;
  300|       |          tx_from_cb64 = gen_irv_tx_from_cb64;
  301|       |        }
  302|       |      }
  303|       |
  304|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  305|       |
  306|  5.64M|  #endif // !OJPH_DISABLE_SIMD
  307|       |
  308|       |#else // OJPH_ENABLE_WASM_SIMD
  309|       |
  310|       |      // Accelerated functions for WASM SIMD.
  311|       |      decode_cb32 = ojph_decode_codeblock_wasm;
  312|       |      find_max_val32 = wasm_find_max_val32;
  313|       |      mem_clear = wasm_mem_clear;
  314|       |      if (reversible) {
  315|       |        tx_to_cb32 = wasm_rev_tx_to_cb32;
  316|       |        tx_from_cb32 = wasm_rev_tx_from_cb32;
  317|       |      }
  318|       |      else {
  319|       |        tx_to_cb32 = wasm_irv_tx_to_cb32;
  320|       |        tx_from_cb32 = wasm_irv_tx_from_cb32;
  321|       |      }
  322|       |      encode_cb32 = ojph_encode_codeblock32;
  323|       |
  324|       |      decode_cb64 = ojph_decode_codeblock64;
  325|       |      find_max_val64 = wasm_find_max_val64;
  326|       |      if (reversible) {
  327|       |        tx_to_cb64 = wasm_rev_tx_to_cb64;
  328|       |        tx_from_cb64 = wasm_rev_tx_from_cb64;
  329|       |      }
  330|       |      else
  331|       |      {
  332|       |        tx_to_cb64 = NULL;
  333|       |        tx_from_cb64 = gen_irv_tx_from_cb64;
  334|       |      }
  335|       |      encode_cb64 = ojph_encode_codeblock64;
  336|       |      bool result = initialize_block_encoder_tables();
  337|       |      assert(result); ojph_unused(result);
  338|       |
  339|       |#endif // !OJPH_ENABLE_WASM_SIMD
  340|       |
  341|  5.64M|    }

_ZN4ojph10codestreamD2Ev:
   59|  9.05k|  {
   60|  9.05k|    if (state)
  ------------------
  |  Branch (60:9): [True: 9.05k, False: 0]
  ------------------
   61|  9.05k|      delete state;
   62|       |    state = NULL;
   63|  9.05k|  }
_ZN4ojph10codestreamC2Ev:
   67|  9.05k|  {
   68|  9.05k|    state = new local::codestream;
   69|  9.05k|  }
_ZN4ojph10codestream10access_sizEv:
   80|  13.6k|  {
   81|  13.6k|    return param_siz(&state->siz);
   82|  13.6k|  }
_ZN4ojph10codestream10access_codEv:
   86|  6.98k|  {
   87|  6.98k|    return param_cod(&state->cod);
   88|  6.98k|  }
_ZN4ojph10codestream10set_planarEb:
  104|  4.47k|  {
  105|  4.47k|    state->set_planar(planar ? 1 : 0);
  ------------------
  |  Branch (105:23): [True: 3.32k, False: 1.15k]
  ------------------
  106|  4.47k|  }
_ZNK4ojph10codestream9is_planarEv:
  154|  6.58k|  {
  155|  6.58k|    return state->is_planar();
  156|  6.58k|  }
_ZN4ojph10codestream17enable_resilienceEv:
  168|  9.05k|  {
  169|  9.05k|    state->enable_resilience();
  170|  9.05k|  }
_ZN4ojph10codestream12read_headersEPNS_11infile_baseE:
  174|  9.05k|  {
  175|  9.05k|    state->read_headers(file);
  176|  9.05k|  }
_ZN4ojph10codestream25restrict_input_resolutionEjj:
  181|  1.73k|  {
  182|  1.73k|    state->restrict_input_resolution(skipped_res_for_read,
  183|  1.73k|      skipped_res_for_recon);
  184|  1.73k|  }
_ZN4ojph10codestream6createEv:
  188|  6.96k|  {
  189|  6.96k|    state->read();
  190|  6.96k|  }
_ZN4ojph10codestream4pullERj:
  194|  3.95M|  {
  195|  3.95M|    return state->pull(comp_num);
  196|  3.95M|  }
_ZN4ojph10codestream5closeEv:
  207|  6.66k|  {
  208|  6.66k|    state->close();
  209|  6.66k|  }

_ZN4ojph5local13avx_mem_clearEPvm:
   48|  38.8M|    {
   49|  38.8M|      __m256i zero = _mm256_setzero_si256();
   50|  89.2M|      for (size_t i = 0; i < count; i += 32, addr = (char*)addr + 32)
  ------------------
  |  Branch (50:26): [True: 50.3M, False: 38.8M]
  ------------------
   51|  50.3M|        _mm256_storeu_si256((__m256i*)addr, zero);
   52|  38.8M|    }

_ZN4ojph5local21avx2_rev_tx_from_cb32EPKjPvjfj:
  169|   277k|    {
  170|   277k|      ojph_unused(delta);
  ------------------
  |  |   78|   277k|#define ojph_unused(x) (void)(x)
  ------------------
  171|   277k|      ui32 shift = 31 - K_max;
  172|   277k|      __m256i m1 = _mm256_set1_epi32(INT_MAX);
  173|   277k|      si32 *p = (si32*)dp;
  174|   639k|      for (ui32 i = 0; i < count; i += 8, sp += 8, p += 8)
  ------------------
  |  Branch (174:24): [True: 362k, False: 277k]
  ------------------
  175|   362k|      {
  176|   362k|        __m256i v = _mm256_load_si256((__m256i*)sp);
  177|   362k|        __m256i val = _mm256_and_si256(v, m1);
  178|   362k|        val = _mm256_srli_epi32(val, (int)shift);
  179|   362k|        val = _mm256_sign_epi32(val, v);
  180|   362k|        _mm256_storeu_si256((__m256i*)p, val);
  181|   362k|      }
  182|   277k|    }
_ZN4ojph5local21avx2_irv_tx_from_cb32EPKjPvjfj:
  187|  12.9k|    {
  188|  12.9k|      ojph_unused(K_max);
  ------------------
  |  |   78|  12.9k|#define ojph_unused(x) (void)(x)
  ------------------
  189|  12.9k|      __m256i m1 = _mm256_set1_epi32(INT_MAX);
  190|  12.9k|      __m256 d = _mm256_set1_ps(delta);
  191|  12.9k|      float *p = (float*)dp;
  192|  43.7k|      for (ui32 i = 0; i < count; i += 8, sp += 8, p += 8)
  ------------------
  |  Branch (192:24): [True: 30.8k, False: 12.9k]
  ------------------
  193|  30.8k|      {
  194|  30.8k|        __m256i v = _mm256_load_si256((__m256i*)sp);
  195|  30.8k|        __m256i vali = _mm256_and_si256(v, m1);
  196|  30.8k|        __m256  valf = _mm256_cvtepi32_ps(vali);
  197|  30.8k|        valf = _mm256_mul_ps(valf, d);
  198|  30.8k|        __m256i sign = _mm256_andnot_si256(m1, v);
  199|  30.8k|        valf = _mm256_or_ps(valf, _mm256_castsi256_ps(sign));
  200|  30.8k|        _mm256_storeu_ps(p, valf);
  201|  30.8k|      }
  202|  12.9k|    }
_ZN4ojph5local21avx2_rev_tx_from_cb64EPKmPvjfj:
  255|   185k|    {
  256|   185k|      ojph_unused(delta);
  ------------------
  |  |   78|   185k|#define ojph_unused(x) (void)(x)
  ------------------
  257|       |      
  258|   185k|      ui32 shift = 63 - K_max;
  259|   185k|      __m256i m1 = _mm256_set1_epi64x(LLONG_MAX);
  260|   185k|      __m256i zero = _mm256_setzero_si256();
  261|   185k|      __m256i one = _mm256_set1_epi64x(1);
  262|   185k|      si64 *p = (si64*)dp;
  263|   561k|      for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
  ------------------
  |  Branch (263:24): [True: 376k, False: 185k]
  ------------------
  264|   376k|      {
  265|   376k|        __m256i v = _mm256_load_si256((__m256i*)sp);
  266|   376k|        __m256i val = _mm256_and_si256(v, m1);
  267|   376k|        val = _mm256_srli_epi64(val, (int)shift);
  268|   376k|        __m256i sign = _mm256_cmpgt_epi64(zero, v);
  269|   376k|        val = _mm256_xor_si256(val, sign); // negate 1's complement
  270|   376k|        __m256i ones = _mm256_and_si256(sign, one);
  271|   376k|        val = _mm256_add_epi64(val, ones); // 2's complement
  272|   376k|        _mm256_storeu_si256((__m256i*)p, val);
  273|   376k|      }
  274|   185k|    }

_ZN4ojph5local20gen_irv_tx_from_cb64EPKmPvjfj:
  173|  15.3k|    {
  174|  15.3k|      ojph_unused(K_max);
  ------------------
  |  |   78|  15.3k|#define ojph_unused(x) (void)(x)
  ------------------
  175|       |      //convert to sign and magnitude
  176|  15.3k|      float *p = (float*)dp;
  177|   272k|      for (ui32 i = count; i > 0; --i)
  ------------------
  |  Branch (177:28): [True: 257k, False: 15.3k]
  ------------------
  178|   257k|      {
  179|   257k|        ui64 v = *sp++;
  180|   257k|        float val = (float)(v & LLONG_MAX) * delta;
  181|   257k|        *p++ = (v & (ui64)LLONG_MIN) ? -val : val;
  ------------------
  |  Branch (181:16): [True: 45.8k, False: 211k]
  ------------------
  182|   257k|      }
  183|  15.3k|    }

_ZN4ojph5local10codestreamC2Ev:
   57|  9.05k|    : precinct_scratch(NULL), allocator(NULL), elastic_alloc(NULL)
   58|  9.05k|    {
   59|  9.05k|      allocator = new mem_fixed_allocator;
   60|  9.05k|      elastic_alloc = new mem_elastic_allocator(1048576); // 1 megabyte
   61|       |
   62|  9.05k|      init_colour_transform_functions();
   63|  9.05k|      init_wavelet_transform_functions();
   64|       |
   65|  9.05k|      restart();
   66|  9.05k|    }
_ZN4ojph5local10codestreamD2Ev:
   70|  9.05k|    {
   71|  9.05k|      if (allocator)
  ------------------
  |  Branch (71:11): [True: 9.05k, False: 0]
  ------------------
   72|  9.05k|        delete allocator;
   73|  9.05k|      if (elastic_alloc)
  ------------------
  |  Branch (73:11): [True: 9.05k, False: 0]
  ------------------
   74|  9.05k|        delete elastic_alloc;
   75|  9.05k|    }
_ZN4ojph5local10codestream7restartEv:
   79|  9.05k|    {
   80|  9.05k|      tiles = NULL;
   81|  9.05k|      lines = NULL;
   82|  9.05k|      comp_size = NULL;
   83|  9.05k|      recon_comp_size = NULL;
   84|  9.05k|      outfile = NULL;
   85|  9.05k|      infile = NULL;
   86|       |
   87|  9.05k|      num_comps = 0;
   88|  9.05k|      employ_color_transform = false;
   89|  9.05k|      planar = -1;
   90|  9.05k|      profile = OJPH_PN_UNDEFINED;
   91|  9.05k|      tilepart_div = OJPH_TILEPART_NO_DIVISIONS;
   92|  9.05k|      need_tlm = false;
   93|       |
   94|  9.05k|      cur_comp = 0;
   95|  9.05k|      cur_line = 0;
   96|  9.05k|      cur_tile_row = 0;
   97|  9.05k|      resilient = false;
   98|  9.05k|      skipped_res_for_read = skipped_res_for_recon = 0;
   99|       |
  100|  9.05k|      precinct_scratch_needed_bytes = 0;
  101|       |
  102|  9.05k|      cod.restart();
  103|  9.05k|      qcd.restart();
  104|  9.05k|      nlt.restart();
  105|  9.05k|      dfs.restart();
  106|  9.05k|      atk.restart();
  107|       |
  108|  9.05k|      allocator->restart();
  109|  9.05k|      elastic_alloc->restart();
  110|  9.05k|    }
_ZN4ojph5local10codestream9pre_allocEv:
  114|  6.96k|    {
  115|  6.96k|      ojph::param_siz sz = access_siz();
  116|  6.96k|      num_tiles.w = sz.get_image_extent().x - sz.get_tile_offset().x;
  117|  6.96k|      num_tiles.w = ojph_div_ceil(num_tiles.w, sz.get_tile_size().w);
  ------------------
  |  |   70|  6.96k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  118|  6.96k|      num_tiles.h = sz.get_image_extent().y - sz.get_tile_offset().y;
  119|  6.96k|      num_tiles.h = ojph_div_ceil(num_tiles.h, sz.get_tile_size().h);
  ------------------
  |  |   70|  6.96k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  120|  6.96k|      if (num_tiles.area() > 65535)
  ------------------
  |  Branch (120:11): [True: 1, False: 6.96k]
  ------------------
  121|      1|        OJPH_ERROR(0x00030011, "the number of tiles cannot exceed 65535");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  122|  6.96k|      if (num_tiles.area() == 0)
  ------------------
  |  Branch (122:11): [True: 1, False: 6.96k]
  ------------------
  123|      1|        OJPH_ERROR(0x00030012, "the number of tiles cannot be 0");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|       |
  125|       |      //allocate tiles
  126|  6.96k|      allocator->pre_alloc_obj<tile>((size_t)num_tiles.area());
  127|       |
  128|  6.96k|      ui32 num_tileparts = 0;
  129|  6.96k|      point index;
  130|  6.96k|      rect tile_rect, recon_tile_rect;
  131|  6.96k|      ui32 ds = 1 << skipped_res_for_recon;
  132|   703k|      for (index.y = 0; index.y < num_tiles.h; ++index.y)
  ------------------
  |  Branch (132:25): [True: 696k, False: 6.96k]
  ------------------
  133|   696k|      {
  134|   696k|        ui32 y0 = sz.get_tile_offset().y
  135|   696k|                + index.y * sz.get_tile_size().h;
  136|   696k|        ui32 y1 = y0 + sz.get_tile_size().h; //end of tile
  137|       |
  138|   696k|        tile_rect.org.y = ojph_max(y0, sz.get_image_offset().y);
  ------------------
  |  |   73|   696k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 689k, False: 6.96k]
  |  |  ------------------
  ------------------
  139|   696k|        tile_rect.siz.h =
  140|   696k|          ojph_min(y1, sz.get_image_extent().y) - tile_rect.org.y;
  ------------------
  |  |   76|   696k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 689k, False: 6.93k]
  |  |  ------------------
  ------------------
  141|       |
  142|   696k|        recon_tile_rect.org.y = ojph_max(ojph_div_ceil(y0, ds),
  ------------------
  |  |   73|   696k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 689k, False: 7.14k]
  |  |  ------------------
  ------------------
  143|   696k|          ojph_div_ceil(sz.get_image_offset().y, ds));
  144|   696k|        recon_tile_rect.siz.h = ojph_min(ojph_div_ceil(y1, ds),
  ------------------
  |  |   76|   696k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 689k, False: 7.10k]
  |  |  ------------------
  ------------------
  145|   696k|          ojph_div_ceil(sz.get_image_extent().y, ds))
  146|   696k|          - recon_tile_rect.org.y;
  147|       |
  148|  1.86M|        for (index.x = 0; index.x < num_tiles.w; ++index.x)
  ------------------
  |  Branch (148:27): [True: 1.17M, False: 696k]
  ------------------
  149|  1.17M|        {
  150|  1.17M|          ui32 x0 = sz.get_tile_offset().x
  151|  1.17M|                  + index.x * sz.get_tile_size().w;
  152|  1.17M|          ui32 x1 = x0 + sz.get_tile_size().w;
  153|       |
  154|  1.17M|          tile_rect.org.x = ojph_max(x0, sz.get_image_offset().x);
  ------------------
  |  |   73|  1.17M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 474k, False: 696k]
  |  |  ------------------
  ------------------
  155|  1.17M|          tile_rect.siz.w =
  156|  1.17M|            ojph_min(x1, sz.get_image_extent().x) - tile_rect.org.x;
  ------------------
  |  |   76|  1.17M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 474k, False: 696k]
  |  |  ------------------
  ------------------
  157|       |
  158|  1.17M|          recon_tile_rect.org.x = ojph_max(ojph_div_ceil(x0, ds),
  ------------------
  |  |   73|  1.17M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 474k, False: 696k]
  |  |  ------------------
  ------------------
  159|  1.17M|            ojph_div_ceil(sz.get_image_offset().x, ds));
  160|  1.17M|          recon_tile_rect.siz.w = ojph_min(ojph_div_ceil(x1, ds),
  ------------------
  |  |   76|  1.17M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 473k, False: 697k]
  |  |  ------------------
  ------------------
  161|  1.17M|            ojph_div_ceil(sz.get_image_extent().x, ds))
  162|  1.17M|            - recon_tile_rect.org.x;
  163|       |
  164|  1.17M|          ui32 tps = 0; // number of tileparts for this tile
  165|  1.17M|          tile::pre_alloc(this, tile_rect, recon_tile_rect, tps);
  166|  1.17M|          num_tileparts += tps;
  167|  1.17M|        }
  168|   696k|      }
  169|       |
  170|       |      //allocate lines
  171|       |      //These lines are used by codestream to exchange data with external
  172|       |      // world
  173|  6.96k|      ui32 num_comps = sz.get_num_components();
  174|  6.96k|      allocator->pre_alloc_obj<line_buf>(num_comps);
  175|  6.96k|      allocator->pre_alloc_obj<size>(num_comps); //for *comp_size
  176|  6.96k|      allocator->pre_alloc_obj<size>(num_comps); //for *recon_comp_size
  177|  15.4k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (177:24): [True: 8.53k, False: 6.96k]
  ------------------
  178|  8.53k|        allocator->pre_alloc_data<si32>(siz.get_recon_width(i), 0);
  179|       |
  180|       |      //allocate tlm
  181|  6.96k|      if (outfile != NULL && need_tlm)
  ------------------
  |  Branch (181:11): [True: 0, False: 6.96k]
  |  Branch (181:30): [True: 0, False: 0]
  ------------------
  182|      0|        allocator->pre_alloc_obj<param_tlm::Ttlm_Ptlm_pair>(num_tileparts);
  183|       |
  184|       |      //precinct scratch buffer
  185|       |      // The precinct scratch is shared by all components, but each component
  186|       |      // may override the codeblock/precinct geometry via a COC marker.  The
  187|       |      // per-component tag-tree storage (resolution.cpp) is derived from that
  188|       |      // component's effective params, so size the shared buffer from the
  189|       |      // largest ratio across every component (the main COD and all COC
  190|       |      // overrides).  Sizing from the COD alone under-reserves the buffer for
  191|       |      // any component whose COC declares a smaller codeblock than the COD.
  192|  6.96k|      size ratio;
  193|  15.4k|      for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (193:24): [True: 8.53k, False: 6.96k]
  ------------------
  194|  8.53k|      {
  195|  8.53k|        const param_cod* cdp = cod.get_coc(c);
  196|  8.53k|        ui32 num_decomps = cdp->get_num_decompositions();
  197|  8.53k|        size log_cb = cdp->get_log_block_dims();
  198|  58.2k|        for (ui32 r = 0; r <= num_decomps; ++r)
  ------------------
  |  Branch (198:26): [True: 49.6k, False: 8.53k]
  ------------------
  199|  49.6k|        {
  200|  49.6k|          size log_PP = cdp->get_log_precinct_size(r);
  201|  49.6k|          ratio.w = ojph_max(ratio.w, log_PP.w - ojph_min(log_cb.w, log_PP.w));
  ------------------
  |  |   73|  99.3k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 12.6k, False: 37.0k]
  |  |  |  Branch (73:33): [True: 12.5k, False: 37.1k]
  |  |  |  Branch (73:46): [True: 10.2k, False: 26.7k]
  |  |  ------------------
  ------------------
  202|  49.6k|          ratio.h = ojph_max(ratio.h, log_PP.h - ojph_min(log_cb.h, log_PP.h));
  ------------------
  |  |   73|  99.3k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 11.1k, False: 38.5k]
  |  |  |  Branch (73:33): [True: 9.78k, False: 39.9k]
  |  |  |  Branch (73:46): [True: 9.02k, False: 29.5k]
  |  |  ------------------
  ------------------
  203|  49.6k|        }
  204|  8.53k|      }
  205|  6.96k|      ui32 max_ratio = ojph_max(ratio.w, ratio.h);
  ------------------
  |  |   73|  6.96k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 2.16k, False: 4.80k]
  |  |  ------------------
  ------------------
  206|  6.96k|      max_ratio = 1 << max_ratio;
  207|       |      // assuming that we have a hierarchy of n levels.
  208|       |      // This needs 4/3 times the area, rounded up
  209|       |      // (rounding up leaves one extra entry).
  210|       |      // This exta entry is necessary
  211|       |      // We need 4 such tables. These tables store
  212|       |      // 1. missing msbs and 2. their flags,
  213|       |      // 3. number of layers and 4. their flags
  214|  6.96k|      precinct_scratch_needed_bytes =
  215|  6.96k|        4 * ((max_ratio * max_ratio * 4 + 2) / 3);
  216|       |
  217|  6.96k|      allocator->pre_alloc_obj<ui8>(precinct_scratch_needed_bytes);
  218|  6.96k|    }
_ZN4ojph5local10codestream14finalize_allocEv:
  222|  6.65k|    {
  223|  6.65k|      allocator->alloc();
  224|       |
  225|       |      //precinct scratch buffer
  226|  6.65k|      precinct_scratch =
  227|  6.65k|        allocator->post_alloc_obj<ui8>(precinct_scratch_needed_bytes);
  228|       |
  229|       |      //get tiles
  230|  6.65k|      tiles = this->allocator->post_alloc_obj<tile>((size_t)num_tiles.area());
  231|       |
  232|  6.65k|      ui32 num_tileparts = 0;
  233|  6.65k|      point index;
  234|  6.65k|      rect tile_rect;
  235|  6.65k|      ojph::param_siz sz = access_siz();
  236|   702k|      for (index.y = 0; index.y < num_tiles.h; ++index.y)
  ------------------
  |  Branch (236:25): [True: 695k, False: 6.65k]
  ------------------
  237|   695k|      {
  238|   695k|        ui32 y0 = sz.get_tile_offset().y
  239|   695k|                + index.y * sz.get_tile_size().h;
  240|   695k|        ui32 y1 = y0 + sz.get_tile_size().h; //end of tile
  241|       |
  242|   695k|        tile_rect.org.y = ojph_max(y0, sz.get_image_offset().y);
  ------------------
  |  |   73|   695k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 689k, False: 6.65k]
  |  |  ------------------
  ------------------
  243|   695k|        tile_rect.siz.h =
  244|   695k|          ojph_min(y1, sz.get_image_extent().y) - tile_rect.org.y;
  ------------------
  |  |   76|   695k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 689k, False: 6.64k]
  |  |  ------------------
  ------------------
  245|       |
  246|   695k|        ui32 offset = 0;
  247|  1.78M|        for (index.x = 0; index.x < num_tiles.w; ++index.x)
  ------------------
  |  Branch (247:27): [True: 1.09M, False: 695k]
  ------------------
  248|  1.09M|        {
  249|  1.09M|          ui32 x0 = sz.get_tile_offset().x
  250|  1.09M|                  + index.x * sz.get_tile_size().w;
  251|  1.09M|          ui32 x1 = x0 + sz.get_tile_size().w;
  252|       |
  253|  1.09M|          tile_rect.org.x = ojph_max(x0, sz.get_image_offset().x);
  ------------------
  |  |   73|  1.09M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 396k, False: 695k]
  |  |  ------------------
  ------------------
  254|  1.09M|          tile_rect.siz.w =
  255|  1.09M|            ojph_min(x1, sz.get_image_extent().x) - tile_rect.org.x;
  ------------------
  |  |   76|  1.09M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 396k, False: 695k]
  |  |  ------------------
  ------------------
  256|       |
  257|  1.09M|          ui32 tps = 0; // number of tileparts for this tile
  258|  1.09M|          ui32 idx = index.y * num_tiles.w + index.x;
  259|  1.09M|          tiles[idx].finalize_alloc(this, tile_rect, idx, offset, tps);
  260|  1.09M|          num_tileparts += tps;
  261|  1.09M|        }
  262|   695k|      }
  263|       |
  264|       |      //allocate lines
  265|       |      //These lines are used by codestream to exchange data with external
  266|       |      // world
  267|  6.65k|      this->num_comps = sz.get_num_components();
  268|  6.65k|      lines = allocator->post_alloc_obj<line_buf>(this->num_comps);
  269|  6.65k|      comp_size = allocator->post_alloc_obj<size>(this->num_comps);
  270|  6.65k|      recon_comp_size = allocator->post_alloc_obj<size>(this->num_comps);
  271|  6.65k|      employ_color_transform = cod.is_employing_color_transform();
  272|  15.0k|      for (ui32 i = 0; i < this->num_comps; ++i)
  ------------------
  |  Branch (272:24): [True: 8.39k, False: 6.65k]
  ------------------
  273|  8.39k|      {
  274|  8.39k|        comp_size[i].w = siz.get_width(i);
  275|  8.39k|        comp_size[i].h = siz.get_height(i);
  276|  8.39k|        ui32 cw = siz.get_recon_width(i);
  277|  8.39k|        recon_comp_size[i].w = cw;
  278|  8.39k|        recon_comp_size[i].h = siz.get_recon_height(i);
  279|  8.39k|        lines[i].wrap(allocator->post_alloc_data<si32>(cw, 0), cw, 0);
  280|  8.39k|      }
  281|       |
  282|  6.65k|      cur_comp = 0;
  283|  6.65k|      cur_line = 0;
  284|       |
  285|       |      //allocate tlm
  286|  6.65k|      if (outfile != NULL && need_tlm)
  ------------------
  |  Branch (286:11): [True: 0, False: 6.65k]
  |  Branch (286:30): [True: 0, False: 0]
  ------------------
  287|      0|        tlm.init(num_tileparts,
  288|      0|          allocator->post_alloc_obj<param_tlm::Ttlm_Ptlm_pair>(num_tileparts));
  289|  6.65k|    }
_ZN4ojph5local10codestream12read_headersEPNS_11infile_baseE:
  770|  9.05k|    {
  771|  9.05k|      ui16 marker_list[20] = { SOC, SIZ, CAP, PRF, CPF, COD, COC, QCD, QCC,
  772|  9.05k|        RGN, POC, PPM, TLM, PLM, CRG, COM, DFS, ATK, NLT, SOT };
  773|  9.05k|      find_marker(file, marker_list, 1); //find SOC
  774|  9.05k|      find_marker(file, marker_list + 1, 1); //find SIZ
  775|  9.05k|      siz.read(file);
  776|  9.05k|      int marker_idx = 0;
  777|  9.05k|      int received_markers = 0; //check that COD, & QCD received
  778|   692k|      while (true)
  ------------------
  |  Branch (778:14): [True: 690k, Folded]
  ------------------
  779|   690k|      {
  780|   690k|        marker_idx = find_marker(file, marker_list + 2, 18);
  781|   690k|        if (marker_idx == 0)
  ------------------
  |  Branch (781:13): [True: 372, False: 690k]
  ------------------
  782|    372|          cap.read(file);
  783|   690k|        else if (marker_idx == 1)
  ------------------
  |  Branch (783:18): [True: 248, False: 689k]
  ------------------
  784|       |          //Skipping PRF marker segment; this should not cause any issues
  785|    248|          skip_marker(file, "PRF", NULL, OJPH_MSG_NO_MSG, false);
  786|   689k|        else if (marker_idx == 2)
  ------------------
  |  Branch (786:18): [True: 220, False: 689k]
  ------------------
  787|       |          //Skipping CPF marker segment; this should not cause any issues
  788|    220|          skip_marker(file, "CPF", NULL, OJPH_MSG_NO_MSG, false);
  789|   689k|        else if (marker_idx == 3)
  ------------------
  |  Branch (789:18): [True: 8.14k, False: 681k]
  ------------------
  790|  8.14k|        {
  791|  8.14k|          cod.read(file);
  792|  8.14k|          received_markers |= 1;
  793|  8.14k|          ojph::param_cod c(&cod);
  794|  8.14k|          int num_qlayers = c.get_num_layers();
  795|  8.14k|          if (num_qlayers != 1)
  ------------------
  |  Branch (795:15): [True: 16, False: 8.13k]
  ------------------
  796|     16|            OJPH_ERROR(0x00030053, "The current implementation supports "
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  797|  8.14k|              "1 quality layer only.  This codestream has %d quality layers",
  798|  8.14k|              num_qlayers);
  799|  8.14k|        }
  800|   681k|        else if (marker_idx == 4)
  ------------------
  |  Branch (800:18): [True: 1.03k, False: 680k]
  ------------------
  801|  1.03k|        {
  802|  1.03k|          param_cod* p = cod.add_coc_object(param_cod::OJPH_COD_UNKNOWN);
  803|  1.03k|          p->read_coc(file, siz.get_num_components(), &cod);
  804|  1.03k|          if (p->get_comp_idx() >= siz.get_num_components())
  ------------------
  |  Branch (804:15): [True: 209, False: 828]
  ------------------
  805|    209|            OJPH_INFO(0x00030056, "The codestream carries a COC marker "
  ------------------
  |  |  285|    209|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    209|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 209, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  806|  1.03k|              "segment for a component indexed by %d, which is more than the "
  807|  1.03k|              "allowed index number, since the codestream has %d components",
  808|  1.03k|              p->get_comp_idx(), num_comps);
  809|  1.03k|          param_cod *q = cod.get_coc(p->get_comp_idx());
  810|  1.03k|          if (p != q && p->get_comp_idx() == q->get_comp_idx())
  ------------------
  |  Branch (810:15): [True: 11, False: 1.02k]
  |  Branch (810:25): [True: 11, False: 0]
  ------------------
  811|     11|            OJPH_ERROR(0x00030057, "The codestream has two COC marker "
  ------------------
  |  |  289|     11|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     11|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  812|  1.03k|              "segments for one component of index %d",  p->get_comp_idx());
  813|  1.03k|        }
  814|   680k|        else if (marker_idx == 5)
  ------------------
  |  Branch (814:18): [True: 8.24k, False: 672k]
  ------------------
  815|  8.24k|        {
  816|  8.24k|          qcd.read(file);
  817|  8.24k|          received_markers |= 2;
  818|  8.24k|        }
  819|   672k|        else if (marker_idx == 6)
  ------------------
  |  Branch (819:18): [True: 321, False: 671k]
  ------------------
  820|    321|        {
  821|    321|          param_qcd* p = qcd.add_qcc_object(param_qcd::OJPH_QCD_UNKNOWN);
  822|    321|          p->read_qcc(file, siz.get_num_components());
  823|    321|          if (p->get_comp_idx() >= siz.get_num_components())
  ------------------
  |  Branch (823:15): [True: 20, False: 301]
  ------------------
  824|     20|            OJPH_ERROR(0x00030054, "The codestream carries a QCC marker "
  ------------------
  |  |  289|     20|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     20|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  825|    321|              "segment for a component indexed by %d, which is more than the "
  826|    321|              "allowed index number, since the codestream has %d components",
  827|    321|              p->get_comp_idx(), num_comps);
  828|    321|          param_qcd *q = qcd.get_qcc(p->get_comp_idx());
  829|    321|          if (p != q && p->get_comp_idx() == q->get_comp_idx())
  ------------------
  |  Branch (829:15): [True: 12, False: 309]
  |  Branch (829:25): [True: 12, False: 0]
  ------------------
  830|     12|            OJPH_ERROR(0x00030055, "The codestream has two QCC marker "
  ------------------
  |  |  289|     12|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     12|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  831|    321|              "segments for one component of index %d", p->get_comp_idx());
  832|    321|        }
  833|   671k|        else if (marker_idx == 7)
  ------------------
  |  Branch (833:18): [True: 437, False: 671k]
  ------------------
  834|    437|          skip_marker(file, "RGN", "RGN is not supported yet",
  835|    437|            OJPH_MSG_WARN, false);
  836|   671k|        else if (marker_idx == 8)
  ------------------
  |  Branch (836:18): [True: 212, False: 671k]
  ------------------
  837|    212|          skip_marker(file, "POC", "POC is not supported yet",
  838|    212|            OJPH_MSG_WARN, false);
  839|   671k|        else if (marker_idx == 9)
  ------------------
  |  Branch (839:18): [True: 294, False: 670k]
  ------------------
  840|    294|          skip_marker(file, "PPM", "PPM is not supported yet",
  841|    294|            OJPH_MSG_WARN, false);
  842|   670k|        else if (marker_idx == 10)
  ------------------
  |  Branch (842:18): [True: 242, False: 670k]
  ------------------
  843|       |          //Skipping TLM marker segment; this should not cause any issues
  844|    242|          skip_marker(file, "TLM", NULL, OJPH_MSG_NO_MSG, false);
  845|   670k|        else if (marker_idx == 11)
  ------------------
  |  Branch (845:18): [True: 214, False: 670k]
  ------------------
  846|       |          //Skipping PLM marker segment; this should not cause any issues
  847|    214|          skip_marker(file, "PLM", NULL, OJPH_MSG_NO_MSG, false);
  848|   670k|        else if (marker_idx == 12)
  ------------------
  |  Branch (848:18): [True: 291, False: 670k]
  ------------------
  849|       |          //Skipping CRG marker segment;
  850|    291|          skip_marker(file, "CRG", "CRG has been ignored; CRG is related to"
  851|    291|            " where the Cb and Cr colour components are co-sited or located"
  852|    291|            " with respect to the Y' luma component. Perhaps, it is better"
  853|    291|            " to get the individual components and assemble the samples"
  854|    291|            " according to your needs",
  855|    291|            OJPH_MSG_INFO, false);
  856|   670k|        else if (marker_idx == 13)
  ------------------
  |  Branch (856:18): [True: 226, False: 669k]
  ------------------
  857|    226|          skip_marker(file, "COM", NULL, OJPH_MSG_NO_MSG, false);
  858|   669k|        else if (marker_idx == 14)
  ------------------
  |  Branch (858:18): [True: 657k, False: 12.9k]
  ------------------
  859|   657k|          dfs.read(file);
  860|  12.9k|        else if (marker_idx == 15)
  ------------------
  |  Branch (860:18): [True: 556, False: 12.3k]
  ------------------
  861|    556|          atk.read(file);
  862|  12.3k|        else if (marker_idx == 16)
  ------------------
  |  Branch (862:18): [True: 4.79k, False: 7.59k]
  ------------------
  863|  4.79k|          nlt.read(file);
  864|  7.59k|        else if (marker_idx == 17)
  ------------------
  |  Branch (864:18): [True: 7.11k, False: 484]
  ------------------
  865|  7.11k|          break;
  866|    484|        else
  867|   683k|          OJPH_ERROR(0x00030051, "File ended before finding a tile segment");
  ------------------
  |  |  289|    484|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    484|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 484, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  868|   683k|      }
  869|       |
  870|  9.05k|      cod.update_atk(&atk);
  871|  9.05k|      siz.link(&cod);
  872|  9.05k|      if (dfs.exists())
  ------------------
  |  Branch (872:11): [True: 340, False: 8.71k]
  ------------------
  873|    340|        siz.link(&dfs);
  874|       |
  875|  9.05k|      if (received_markers != 3)
  ------------------
  |  Branch (875:11): [True: 31, False: 9.02k]
  ------------------
  876|     31|        OJPH_ERROR(0x00030052, "markers error, COD and QCD are required");
  ------------------
  |  |  289|     31|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     31|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 31, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  877|       |
  878|       |      // A LUT style nonlinearity, type 2 or type 4, cannot currently be
  879|       |      // applied with the reversible wavelet.  A codestream may still carry
  880|       |      // that combination, but this library cannot decode this codestream yet.
  881|  9.05k|      int unsupported_nlt = nlt.find_unsupported_nlt(siz, cod);
  882|  9.05k|      if (unsupported_nlt >= 0)
  ------------------
  |  Branch (882:11): [True: 17, False: 9.03k]
  ------------------
  883|     17|        OJPH_ERROR(0x00030059, "The codestream uses a LUT style nonlinearity "
  ------------------
  |  |  289|     17|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     17|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 17, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  884|  9.05k|          "(type 2 or type 4) together with the reversible (5/3) wavelet for "
  885|  9.05k|          "component %d.  This does not make sense since LUT itself is not "
  886|  9.05k|          "reversible. This library does not implement the processing path "
  887|  9.05k|          "needed for this conbination.", unsupported_nlt);
  888|       |
  889|  9.05k|      this->infile = file;
  890|  9.05k|      planar = cod.is_employing_color_transform() ? 0 : 1;
  ------------------
  |  Branch (890:16): [True: 517, False: 8.53k]
  ------------------
  891|  9.05k|    }
_ZN4ojph5local10codestream25restrict_input_resolutionEjj:
  896|  1.73k|    {
  897|  1.73k|      if (skipped_res_for_read < skipped_res_for_recon)
  ------------------
  |  Branch (897:11): [True: 0, False: 1.73k]
  ------------------
  898|      0|        OJPH_ERROR(0x000300A1,
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  899|  1.73k|          "skipped_resolution for data %d must be equal or smaller than "
  900|  1.73k|          " skipped_resolution for reconstruction %d\n",
  901|  1.73k|          skipped_res_for_read, skipped_res_for_recon);
  902|  1.73k|      if (skipped_res_for_read > cod.get_num_decompositions())
  ------------------
  |  Branch (902:11): [True: 4, False: 1.73k]
  ------------------
  903|      4|        OJPH_ERROR(0x000300A2,
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  904|  1.73k|          "skipped_resolution for data %d must be smaller than "
  905|  1.73k|          " the number of decomposition levels %d\n",
  906|  1.73k|          skipped_res_for_read, cod.get_num_decompositions());
  907|       |
  908|  1.73k|      this->skipped_res_for_read = skipped_res_for_read;
  909|  1.73k|      this->skipped_res_for_recon = skipped_res_for_recon;
  910|  1.73k|      siz.set_skipped_resolutions(skipped_res_for_recon);
  911|  1.73k|    }
_ZN4ojph5local10codestream17enable_resilienceEv:
  915|  9.05k|    {
  916|  9.05k|      if (infile != NULL)
  ------------------
  |  Branch (916:11): [True: 0, False: 9.05k]
  ------------------
  917|      0|        OJPH_ERROR(0x000300A3, "Codestream resilience must be enabled before"
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  918|  9.05k|          " reading file headers.\n");
  919|  9.05k|      this->resilient = true;
  920|  9.05k|    }
_ZN4ojph5local10codestream4readEv:
  924|  6.96k|    {
  925|  6.96k|      this->pre_alloc();
  926|  6.96k|      this->finalize_alloc();
  927|       |
  928|   239k|      while (true)
  ------------------
  |  Branch (928:14): [True: 239k, Folded]
  ------------------
  929|   239k|      {
  930|   239k|        param_sot sot;
  931|   239k|        if (sot.read(infile, resilient))
  ------------------
  |  Branch (931:13): [True: 230k, False: 9.03k]
  ------------------
  932|   230k|        {
  933|   230k|          ui64 tile_start_location = (ui64)infile->tell();
  934|   230k|          bool skip_tile = false;
  935|       |
  936|   230k|          if (sot.get_tile_index() >= (int)num_tiles.area())
  ------------------
  |  Branch (936:15): [True: 7.00k, False: 223k]
  ------------------
  937|  7.00k|          {
  938|  7.00k|            if (resilient) {
  ------------------
  |  Branch (938:17): [True: 7.00k, False: 0]
  ------------------
  939|  7.00k|              OJPH_INFO(0x00030061, "wrong tile index")
  ------------------
  |  |  285|  7.00k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  7.00k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7.00k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  940|  7.00k|              skip_tile = true; // skip the faulty tile
  941|  7.00k|            }
  942|      0|            else
  943|      0|              OJPH_ERROR(0x00030061, "wrong tile index")
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  944|  7.00k|          }
  945|       |
  946|   230k|          if (!skip_tile)
  ------------------
  |  Branch (946:15): [True: 223k, False: 7.00k]
  ------------------
  947|   223k|          {
  948|   223k|            if (sot.get_tile_part_index())
  ------------------
  |  Branch (948:17): [True: 193k, False: 29.5k]
  ------------------
  949|   193k|            { //tile part
  950|   193k|              if (sot.get_num_tile_parts() &&
  ------------------
  |  Branch (950:19): [True: 190k, False: 3.39k]
  ------------------
  951|   190k|                sot.get_tile_part_index() >= sot.get_num_tile_parts())
  ------------------
  |  Branch (951:17): [True: 4.64k, False: 185k]
  ------------------
  952|  4.64k|              {
  953|  4.64k|                if (resilient)
  ------------------
  |  Branch (953:21): [True: 4.64k, False: 0]
  ------------------
  954|  4.64k|                  OJPH_INFO(0x00030062,
  ------------------
  |  |  285|  4.64k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  4.64k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4.64k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  955|  4.64k|                    "error in tile part number, should be smaller than total"
  956|  4.64k|                    " number of tile parts")
  957|      0|                else
  958|      0|                  OJPH_ERROR(0x00030062,
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  959|  4.64k|                    "error in tile part number, should be smaller than total"
  960|  4.64k|                    " number of tile parts")
  961|  4.64k|              }
  962|       |
  963|   193k|              bool sod_found = false;
  964|   193k|              ui16 other_tile_part_markers[7] = { SOT, POC, PPT, PLT, COM,
  965|   193k|                NLT, SOD };
  966|   199k|              while (true)
  ------------------
  |  Branch (966:22): [True: 199k, Folded]
  ------------------
  967|   199k|              {
  968|   199k|                int marker_idx = 0;
  969|   199k|                int result = 0;
  970|   199k|                marker_idx = find_marker(infile, other_tile_part_markers+1, 6);
  971|   199k|                if (marker_idx == 0)
  ------------------
  |  Branch (971:21): [True: 301, False: 199k]
  ------------------
  972|    301|                  result = skip_marker(infile, "POC",
  973|    301|                    "POC marker segment in a tile is not supported yet",
  974|    301|                    OJPH_MSG_WARN, resilient);
  975|   199k|                else if (marker_idx == 1)
  ------------------
  |  Branch (975:26): [True: 612, False: 198k]
  ------------------
  976|    612|                  result = skip_marker(infile, "PPT",
  977|    612|                    "PPT marker segment in a tile is not supported yet",
  978|    612|                    OJPH_MSG_WARN, resilient);
  979|   198k|                else if (marker_idx == 2)
  ------------------
  |  Branch (979:26): [True: 3.27k, False: 195k]
  ------------------
  980|       |                  //Skipping PLT marker segment;this should not cause any issues
  981|  3.27k|                  result = skip_marker(infile, "PLT", NULL,
  982|  3.27k|                    OJPH_MSG_NO_MSG, resilient);
  983|   195k|                else if (marker_idx == 3)
  ------------------
  |  Branch (983:26): [True: 372, False: 194k]
  ------------------
  984|    372|                  result = skip_marker(infile, "COM", NULL,
  985|    372|                    OJPH_MSG_NO_MSG, resilient);
  986|   194k|                else if (marker_idx == 4)
  ------------------
  |  Branch (986:26): [True: 1.29k, False: 193k]
  ------------------
  987|  1.29k|                  result = skip_marker(infile, "NLT",
  988|  1.29k|                    "NLT marker in tile is not supported yet",
  989|  1.29k|                    OJPH_MSG_WARN, resilient);
  990|   193k|                else if (marker_idx == 5)
  ------------------
  |  Branch (990:26): [True: 193k, False: 252]
  ------------------
  991|   193k|                {
  992|   193k|                  sod_found = true;
  993|   193k|                  break;
  994|   193k|                }
  995|       |
  996|  6.10k|                if (marker_idx == -1) //marker not found
  ------------------
  |  Branch (996:21): [True: 252, False: 5.85k]
  ------------------
  997|    252|                {
  998|    252|                  if (resilient)
  ------------------
  |  Branch (998:23): [True: 252, False: 0]
  ------------------
  999|    252|                    OJPH_INFO(0x00030063,
  ------------------
  |  |  285|    252|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    252|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 252, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1000|    252|                      "File terminated early before start of data is found"
 1001|    252|                      " for tile indexed %d and tile part %d",
 1002|    252|                      sot.get_tile_index(), sot.get_tile_part_index())
 1003|      0|                  else
 1004|      0|                    OJPH_ERROR(0x00030063,
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1005|    252|                      "File terminated early before start of data is found"
 1006|    252|                      " for tile indexed %d and tile part %d",
 1007|    252|                      sot.get_tile_index(), sot.get_tile_part_index())
 1008|    252|                  break;
 1009|    252|                }
 1010|  5.85k|                if (result == -1) //file terminated during marker seg. skipping
  ------------------
  |  Branch (1010:21): [True: 13, False: 5.84k]
  ------------------
 1011|     13|                {
 1012|     13|                  if (resilient)
  ------------------
  |  Branch (1012:23): [True: 13, False: 0]
  ------------------
 1013|     13|                    OJPH_INFO(0x00030064,
  ------------------
  |  |  285|     13|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     13|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1014|     13|                      "File terminated during marker segment skipping")
 1015|      0|                  else
 1016|      0|                    OJPH_ERROR(0x00030064,
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1017|     13|                      "File terminated during marker segment skipping")
 1018|     13|                  break;
 1019|     13|                }
 1020|  5.85k|              }
 1021|   193k|              if (sod_found)
  ------------------
  |  Branch (1021:19): [True: 193k, False: 265]
  ------------------
 1022|   193k|                tiles[sot.get_tile_index()].parse_tile_header(sot, infile,
 1023|   193k|                  tile_start_location);
 1024|   193k|            }
 1025|  29.5k|            else
 1026|  29.5k|            { //first tile part
 1027|  29.5k|              bool sod_found = false;
 1028|  29.5k|              ui16 first_tile_part_markers[12] = { SOT, COD, COC, QCD, QCC, RGN,
 1029|  29.5k|                POC, PPT, PLT, COM, NLT, SOD };
 1030|  49.6k|              while (true)
  ------------------
  |  Branch (1030:22): [True: 49.6k, Folded]
  ------------------
 1031|  49.6k|              {
 1032|  49.6k|                int marker_idx = 0;
 1033|  49.6k|                int result = 0;
 1034|  49.6k|                marker_idx = find_marker(infile, first_tile_part_markers+1, 11);
 1035|  49.6k|                if (marker_idx == 0)
  ------------------
  |  Branch (1035:21): [True: 6.18k, False: 43.4k]
  ------------------
 1036|  6.18k|                  result = skip_marker(infile, "COD",
 1037|  6.18k|                    "COD marker segment in a tile is not supported yet",
 1038|  6.18k|                    OJPH_MSG_WARN, resilient);
 1039|  43.4k|                else if (marker_idx == 1)
  ------------------
  |  Branch (1039:26): [True: 548, False: 42.9k]
  ------------------
 1040|    548|                  result = skip_marker(infile, "COC",
 1041|    548|                    "COC marker segment in a tile is not supported yet",
 1042|    548|                    OJPH_MSG_WARN, resilient);
 1043|  42.9k|                else if (marker_idx == 2)
  ------------------
  |  Branch (1043:26): [True: 7.04k, False: 35.8k]
  ------------------
 1044|  7.04k|                  result = skip_marker(infile, "QCD",
 1045|  7.04k|                    "QCD marker segment in a tile is not supported yet",
 1046|  7.04k|                    OJPH_MSG_WARN, resilient);
 1047|  35.8k|                else if (marker_idx == 3)
  ------------------
  |  Branch (1047:26): [True: 509, False: 35.3k]
  ------------------
 1048|    509|                  result = skip_marker(infile, "QCC",
 1049|    509|                    "QCC marker segment in a tile is not supported yet",
 1050|    509|                    OJPH_MSG_WARN, resilient);
 1051|  35.3k|                else if (marker_idx == 4)
  ------------------
  |  Branch (1051:26): [True: 247, False: 35.1k]
  ------------------
 1052|    247|                  result = skip_marker(infile, "RGN",
 1053|    247|                    "RGN marker segment in a tile is not supported yet",
 1054|    247|                    OJPH_MSG_WARN, resilient);
 1055|  35.1k|                else if (marker_idx == 5)
  ------------------
  |  Branch (1055:26): [True: 596, False: 34.5k]
  ------------------
 1056|    596|                  result = skip_marker(infile, "POC",
 1057|    596|                    "POC marker segment in a tile is not supported yet",
 1058|    596|                    OJPH_MSG_WARN, resilient);
 1059|  34.5k|                else if (marker_idx == 6)
  ------------------
  |  Branch (1059:26): [True: 392, False: 34.1k]
  ------------------
 1060|    392|                  result = skip_marker(infile, "PPT",
 1061|    392|                    "PPT marker segment in a tile is not supported yet",
 1062|    392|                    OJPH_MSG_WARN, resilient);
 1063|  34.1k|                else if (marker_idx == 7)
  ------------------
  |  Branch (1063:26): [True: 2.15k, False: 31.9k]
  ------------------
 1064|       |                  //Skipping PLT marker segment;this should not cause any issues
 1065|  2.15k|                  result = skip_marker(infile, "PLT", NULL,
 1066|  2.15k|                    OJPH_MSG_NO_MSG, resilient);
 1067|  31.9k|                else if (marker_idx == 8)
  ------------------
  |  Branch (1067:26): [True: 1.17k, False: 30.8k]
  ------------------
 1068|  1.17k|                  result = skip_marker(infile, "COM", NULL,
 1069|  1.17k|                    OJPH_MSG_NO_MSG, resilient);
 1070|  30.8k|                else if (marker_idx == 9)
  ------------------
  |  Branch (1070:26): [True: 1.28k, False: 29.5k]
  ------------------
 1071|  1.28k|                  result = skip_marker(infile, "NLT",
 1072|  1.28k|                    "PPT marker segment in a tile is not supported yet",
 1073|  1.28k|                    OJPH_MSG_WARN, resilient);
 1074|  29.5k|                else if (marker_idx == 10)
  ------------------
  |  Branch (1074:26): [True: 29.3k, False: 192]
  ------------------
 1075|  29.3k|                {
 1076|  29.3k|                  sod_found = true;
 1077|  29.3k|                  break;
 1078|  29.3k|                }
 1079|       |
 1080|  20.3k|                if (marker_idx == -1) //marker not found
  ------------------
  |  Branch (1080:21): [True: 192, False: 20.1k]
  ------------------
 1081|    192|                {
 1082|    192|                  if (resilient)
  ------------------
  |  Branch (1082:23): [True: 192, False: 0]
  ------------------
 1083|    192|                    OJPH_INFO(0x00030065,
  ------------------
  |  |  285|    192|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    192|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 192, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1084|    192|                      "File terminated early before start of data is found"
 1085|    192|                      " for tile indexed %d and tile part %d",
 1086|    192|                      sot.get_tile_index(), sot.get_tile_part_index())
 1087|      0|                  else
 1088|      0|                    OJPH_ERROR(0x00030065,
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1089|    192|                      "File terminated early before start of data is found"
 1090|    192|                      " for tile indexed %d and tile part %d",
 1091|    192|                      sot.get_tile_index(), sot.get_tile_part_index())
 1092|    192|                  break;
 1093|    192|                }
 1094|  20.1k|                if (result == -1) //file terminated during marker seg. skipping
  ------------------
  |  Branch (1094:21): [True: 18, False: 20.1k]
  ------------------
 1095|     18|                {
 1096|     18|                  if (resilient)
  ------------------
  |  Branch (1096:23): [True: 18, False: 0]
  ------------------
 1097|     18|                    OJPH_INFO(0x00030066,
  ------------------
  |  |  285|     18|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     18|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 18, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1098|     18|                      "File terminated during marker segment skipping")
 1099|      0|                  else
 1100|      0|                    OJPH_ERROR(0x00030066,
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1101|     18|                      "File terminated during marker segment skipping")
 1102|     18|                  break;
 1103|     18|                }
 1104|  20.1k|              }
 1105|  29.5k|              if (sod_found)
  ------------------
  |  Branch (1105:19): [True: 29.3k, False: 210]
  ------------------
 1106|  29.3k|                tiles[sot.get_tile_index()].parse_tile_header(sot, infile,
 1107|  29.3k|                  tile_start_location);
 1108|  29.5k|            }
 1109|   223k|          }
 1110|   230k|        }
 1111|       |
 1112|       |        // check the next marker; either SOT or EOC,
 1113|       |        // if something is broken, just an end of file
 1114|   239k|        ui16 next_markers[2] = { SOT, EOC };
 1115|   239k|        int marker_idx = find_marker(infile, next_markers, 2);
 1116|   239k|        if (marker_idx == -1)
  ------------------
  |  Branch (1116:13): [True: 6.56k, False: 232k]
  ------------------
 1117|  6.56k|        {
 1118|  6.56k|          OJPH_INFO(0x00030067, "File terminated early");
  ------------------
  |  |  285|  6.56k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  6.56k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6.56k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1119|  6.56k|          break;
 1120|  6.56k|        }
 1121|   232k|        else if (marker_idx == 0)
  ------------------
  |  Branch (1121:18): [True: 232k, False: 15]
  ------------------
 1122|   232k|          ;
 1123|     15|        else if (marker_idx == 1)
  ------------------
  |  Branch (1123:18): [True: 15, False: 0]
  ------------------
 1124|     15|          break;
 1125|   239k|      }
 1126|  6.96k|    }
_ZN4ojph5local10codestream10set_planarEi:
 1130|  4.47k|    {
 1131|  4.47k|      this->planar = planar;
 1132|  4.47k|    }
_ZN4ojph5local10codestream5closeEv:
 1179|  6.66k|    {
 1180|  6.66k|      if (infile)
  ------------------
  |  Branch (1180:11): [True: 6.66k, False: 0]
  ------------------
 1181|  6.66k|        infile->close();
 1182|  6.66k|      if (outfile)
  ------------------
  |  Branch (1182:11): [True: 0, False: 6.66k]
  ------------------
 1183|      0|        outfile->close();
 1184|  6.66k|    }
_ZN4ojph5local10codestream4pullERj:
 1239|  3.95M|    {
 1240|  3.95M|      bool success = false;
 1241|  8.60M|      while (!success)
  ------------------
  |  Branch (1241:14): [True: 4.65M, False: 3.95M]
  ------------------
 1242|  4.65M|      {
 1243|  4.65M|        success = true;
 1244|  9.08M|        for (ui32 i = 0; i < num_tiles.w; ++i)
  ------------------
  |  Branch (1244:26): [True: 5.13M, False: 3.95M]
  ------------------
 1245|  5.13M|        {
 1246|  5.13M|          ui32 idx = i + cur_tile_row * num_tiles.w;
 1247|  5.13M|          if ((success &= tiles[idx].pull(lines + cur_comp, cur_comp)) == false)
  ------------------
  |  Branch (1247:15): [True: 694k, False: 4.43M]
  ------------------
 1248|   694k|            break;
 1249|  5.13M|        }
 1250|  4.65M|        cur_tile_row += success == false ? 1 : 0;
  ------------------
  |  Branch (1250:25): [True: 694k, False: 3.95M]
  ------------------
 1251|  4.65M|        if (cur_tile_row >= num_tiles.h)
  ------------------
  |  Branch (1251:13): [True: 3, False: 4.65M]
  ------------------
 1252|      3|          cur_tile_row = 0;
 1253|  4.65M|      }
 1254|  3.95M|      comp_num = cur_comp;
 1255|       |
 1256|  3.95M|      if (planar) //process one component at a time
  ------------------
  |  Branch (1256:11): [True: 2.10M, False: 1.85M]
  ------------------
 1257|  2.10M|      {
 1258|  2.10M|        if (++cur_line >= recon_comp_size[cur_comp].h)
  ------------------
  |  Branch (1258:13): [True: 6.76k, False: 2.09M]
  ------------------
 1259|  6.76k|        {
 1260|  6.76k|          cur_line = 0;
 1261|  6.76k|          cur_tile_row = 0;
 1262|  6.76k|          if (cur_comp++ >= num_comps)
  ------------------
  |  Branch (1262:15): [True: 0, False: 6.76k]
  ------------------
 1263|      0|          {
 1264|      0|            comp_num = 0;
 1265|      0|            return NULL;
 1266|      0|          }
 1267|  6.76k|        }
 1268|  2.10M|      }
 1269|  1.85M|      else //process all component for a line
 1270|  1.85M|      {
 1271|  1.85M|        if (++cur_comp >= num_comps)
  ------------------
  |  Branch (1271:13): [True: 1.85M, False: 2.98k]
  ------------------
 1272|  1.85M|        {
 1273|  1.85M|          cur_comp = 0;
 1274|  1.85M|          if (cur_line++ >= recon_comp_size[cur_comp].h)
  ------------------
  |  Branch (1274:15): [True: 0, False: 1.85M]
  ------------------
 1275|      0|          {
 1276|      0|            comp_num = 0;
 1277|      0|            return NULL;
 1278|      0|          }
 1279|  1.85M|        }
 1280|  1.85M|      }
 1281|       |
 1282|  3.95M|      return lines + comp_num;
 1283|  3.95M|    }
ojph_codestream_local.cpp:_ZN4ojph5localL11find_markerEPNS_11infile_baseEPKti:
  709|  1.19M|    {
  710|       |      //returns the marker index in char_list, or -1
  711|  73.1M|      while (!f->eof())
  ------------------
  |  Branch (711:14): [True: 73.1M, False: 7.32k]
  ------------------
  712|  73.1M|      {
  713|  73.1M|        ui8 new_char;
  714|  73.1M|        size_t num_bytes = f->read(&new_char, 1);
  715|  73.1M|        if (num_bytes != 1)
  ------------------
  |  Branch (715:13): [True: 0, False: 73.1M]
  ------------------
  716|      0|            return -1;
  717|  73.1M|        if (new_char == 0xFF)
  ------------------
  |  Branch (717:13): [True: 9.59M, False: 63.5M]
  ------------------
  718|  9.59M|        {
  719|  9.59M|          size_t num_bytes = f->read(&new_char, 1);
  720|       |
  721|  9.59M|          if (num_bytes != 1)
  ------------------
  |  Branch (721:15): [True: 346, False: 9.59M]
  ------------------
  722|    346|              return -1;
  723|       |
  724|  75.7M|          for (int i = 0; i < list_len; ++i)
  ------------------
  |  Branch (724:27): [True: 67.3M, False: 8.40M]
  ------------------
  725|  67.3M|            if (new_char == (char_list[i] & 0xFF))
  ------------------
  |  Branch (725:17): [True: 1.18M, False: 66.1M]
  ------------------
  726|  1.18M|              return i;
  727|  9.59M|        }
  728|  73.1M|      }
  729|  7.32k|      return -1;
  730|  1.19M|    }
ojph_codestream_local.cpp:_ZN4ojph5localL11skip_markerEPNS_11infile_baseEPKcS4_ib:
  736|  28.3k|    {
  737|  28.3k|      ojph_unused(marker);
  ------------------
  |  |   78|  28.3k|#define ojph_unused(x) (void)(x)
  ------------------
  738|  28.3k|      ui16 com_len;
  739|  28.3k|      if (file->read(&com_len, 2) != 2)
  ------------------
  |  Branch (739:11): [True: 59, False: 28.3k]
  ------------------
  740|     59|      {
  741|     59|        if (resilient)
  ------------------
  |  Branch (741:13): [True: 31, False: 28]
  ------------------
  742|     31|          return -1;
  743|     28|        else
  744|     28|          OJPH_ERROR(0x00030041, "error reading marker");
  ------------------
  |  |  289|     28|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     28|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 28, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|     28|      }
  746|  28.3k|      com_len = swap_bytes_if_le(com_len);
  747|  28.3k|      file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
  748|  28.3k|      if (msg != NULL && msg_level != OJPH_MSG_NO_MSG)
  ------------------
  |  Branch (748:11): [True: 20.2k, False: 8.13k]
  |  Branch (748:26): [True: 20.2k, False: 0]
  ------------------
  749|  20.2k|      {
  750|  20.2k|        if (msg_level == OJPH_MSG_INFO)
  ------------------
  |  Branch (750:13): [True: 288, False: 19.9k]
  ------------------
  751|    288|        {
  752|    288|          OJPH_INFO(0x00030001, "%s", msg);
  ------------------
  |  |  285|    288|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    288|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 288, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  753|    288|        }
  754|  19.9k|        else if (msg_level == OJPH_MSG_WARN)
  ------------------
  |  Branch (754:18): [True: 19.9k, False: 0]
  ------------------
  755|  19.9k|        {
  756|  19.9k|          OJPH_WARN(0x00030001, "%s", msg);
  ------------------
  |  |  287|  19.9k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  19.9k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 19.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|  19.9k|        }
  758|      0|        else if (msg_level == OJPH_MSG_ERROR)
  ------------------
  |  Branch (758:18): [True: 0, False: 0]
  ------------------
  759|      0|        {
  760|      0|          OJPH_ERROR(0x00030001, "%s", msg);
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  761|      0|        }
  762|      0|        else // there is the option of ALL_MSG but it should not be used here
  763|       |          assert(0);
  764|  20.2k|      }
  765|  28.3k|      return 0;
  766|  28.3k|    }

_ZNK4ojph5local10codestream16get_tilepart_divEv:
  116|  3.35M|      ui32 get_tilepart_div() const { return tilepart_div; };
_ZNK4ojph5local10codestream13is_tlm_neededEv:
  117|  1.09M|      bool is_tlm_needed() const { return need_tlm; };
_ZNK4ojph5local10codestream9is_planarEv:
  114|  6.58k|      bool is_planar() const { return planar != 0; }
_ZN4ojph5local10codestream10access_sizEv:
   78|  13.6k|      { return ojph::param_siz(&siz); }
_ZN4ojph5local10codestream7get_sizEv:
   80|  3.38M|      { return &siz; }
_ZN4ojph5local10codestream10access_codEv:
   82|  1.09M|      { return ojph::param_cod(&cod); }
_ZN4ojph5local10codestream7get_codEv:
   84|  2.26M|      { return &cod; }
_ZN4ojph5local10codestream7get_cocEj:
   86|  39.6M|      { return cod.get_coc(comp_num); }
_ZN4ojph5local10codestream10access_qcdEv:
   88|  28.3M|      { return &qcd; }
_ZN4ojph5local10codestream10access_dfsEv:
   90|  1.29M|      { if (dfs.exists()) return &dfs; else return NULL; }
  ------------------
  |  Branch (90:13): [True: 1.29M, False: 5]
  ------------------
_ZN4ojph5local10codestream7get_nltEv:
   92|  1.09M|      { return &nlt; }
_ZN4ojph5local10codestream13get_allocatorEv:
   93|  62.9M|      mem_fixed_allocator* get_allocator() { return allocator; }
_ZN4ojph5local10codestream17get_elastic_allocEv:
   94|  22.5M|      mem_elastic_allocator* get_elastic_alloc() { return elastic_alloc; }
_ZN4ojph5local10codestream12is_resilientEv:
  101|  6.73M|      bool is_resilient() { return resilient; }
_ZNK4ojph5local10codestream11get_profileEv:
  115|  1.09M|      si32 get_profile() const { return profile; };
_ZN4ojph5local10codestream20get_precinct_scratchEv:
  122|  9.47M|      ui8* get_precinct_scratch() { return precinct_scratch; }
_ZN4ojph5local10codestream25get_skipped_res_for_reconEv:
  124|  13.1M|      { return skipped_res_for_recon; }
_ZN4ojph5local10codestream24get_skipped_res_for_readEv:
  126|  7.44M|      { return skipped_res_for_read; }

_ZNK4ojph9param_siz16get_image_extentEv:
  100|  7.65M|  {
  101|  7.65M|    return point(state->Xsiz, state->Ysiz);
  102|  7.65M|  }
_ZNK4ojph9param_siz16get_image_offsetEv:
  106|  7.63M|  {
  107|  7.63M|    return point(state->XOsiz, state->YOsiz);
  108|  7.63M|  }
_ZNK4ojph9param_siz13get_tile_sizeEv:
  112|  7.33M|  {
  113|  7.33M|    return size(state->XTsiz, state->YTsiz);
  114|  7.33M|  }
_ZNK4ojph9param_siz15get_tile_offsetEv:
  118|  3.66M|  {
  119|  3.66M|    return point(state->XTOsiz, state->YTOsiz);
  120|  3.66M|  }
_ZNK4ojph9param_siz18get_num_componentsEv:
  124|  3.75M|  {
  125|  3.75M|    return state->Csiz;
  126|  3.75M|  }
_ZNK4ojph9param_siz15get_recon_widthEj:
  148|  8.39k|  {
  149|  8.39k|    return state->get_recon_width(comp_num);
  150|  8.39k|  }
_ZNK4ojph9param_siz16get_recon_heightEj:
  154|  16.5k|  {
  155|  16.5k|    return state->get_recon_height(comp_num);
  156|  16.5k|  }
_ZNK4ojph9param_cod22get_num_decompositionsEv:
  287|  54.7k|  {
  288|  54.7k|    return state->get_num_decompositions();
  289|  54.7k|  }
_ZNK4ojph9param_cod17get_precinct_sizeEj:
  311|  40.8k|  {
  312|  40.8k|    return state->get_precinct_size(level_num);
  313|  40.8k|  }
_ZNK4ojph9param_cod21get_progression_orderEv:
  323|  1.09M|  {
  324|  1.09M|    return state->SGCod.prog_order;
  325|  1.09M|  }
_ZNK4ojph9param_cod14get_num_layersEv:
  347|  8.03k|  {
  348|  8.03k|    return state->SGCod.num_layers;
  349|  8.03k|  }
_ZN4ojph5local9param_siz4readEPNS_11infile_baseE:
  890|  9.05k|    {
  891|  9.05k|      if (file->read(&Lsiz, 2) != 2)
  ------------------
  |  Branch (891:11): [True: 114, False: 8.93k]
  ------------------
  892|    114|        OJPH_ERROR(0x00050041, "error reading SIZ marker");
  ------------------
  |  |  289|    114|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    114|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 114, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  893|  9.05k|      Lsiz = swap_bytes_if_le(Lsiz);
  894|  9.05k|      int num_comps = (Lsiz - 38) / 3;
  895|  9.05k|      if (Lsiz != 38 + 3 * num_comps)
  ------------------
  |  Branch (895:11): [True: 16, False: 9.03k]
  ------------------
  896|     16|        OJPH_ERROR(0x00050042, "error in SIZ marker length");
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  897|  9.05k|      if (file->read(&Rsiz, 2) != 2)
  ------------------
  |  Branch (897:11): [True: 3, False: 9.04k]
  ------------------
  898|      3|        OJPH_ERROR(0x00050043, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  899|  9.05k|      Rsiz = swap_bytes_if_le(Rsiz);
  900|  9.05k|      if ((Rsiz & 0x4000) == 0)
  ------------------
  |  Branch (900:11): [True: 1, False: 9.05k]
  ------------------
  901|      1|        OJPH_ERROR(0x00050044,
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  902|  9.05k|          "Rsiz bit 14 is not set (this is not a JPH file)");
  903|  9.05k|      if ((Rsiz & 0x8000) != 0 && (Rsiz & 0xD5F) != 0)
  ------------------
  |  Branch (903:11): [True: 592, False: 8.46k]
  |  Branch (903:35): [True: 578, False: 14]
  ------------------
  904|    578|        OJPH_WARN(0x00050001, "Rsiz in SIZ has unimplemented fields");
  ------------------
  |  |  287|    578|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    578|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 578, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  905|  9.05k|      if (file->read(&Xsiz, 4) != 4)
  ------------------
  |  Branch (905:11): [True: 29, False: 9.02k]
  ------------------
  906|     29|        OJPH_ERROR(0x00050045, "error reading SIZ marker");
  ------------------
  |  |  289|     29|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     29|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 29, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  907|  9.05k|      Xsiz = swap_bytes_if_le(Xsiz);
  908|  9.05k|      if (file->read(&Ysiz, 4) != 4)
  ------------------
  |  Branch (908:11): [True: 3, False: 9.04k]
  ------------------
  909|      3|        OJPH_ERROR(0x00050046, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  910|  9.05k|      Ysiz = swap_bytes_if_le(Ysiz);
  911|  9.05k|      ui32 t_XOsiz, t_YOsiz;
  912|  9.05k|      if (file->read(&t_XOsiz, 4) != 4)
  ------------------
  |  Branch (912:11): [True: 3, False: 9.04k]
  ------------------
  913|      3|        OJPH_ERROR(0x00050047, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  914|  9.05k|      if (file->read(&t_YOsiz, 4) != 4)
  ------------------
  |  Branch (914:11): [True: 3, False: 9.04k]
  ------------------
  915|      3|        OJPH_ERROR(0x00050048, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  916|  9.05k|      set_image_offset(point(
  917|  9.05k|        swap_bytes_if_le(t_XOsiz),
  918|  9.05k|        swap_bytes_if_le(t_YOsiz)));
  919|  9.05k|      ui32 t_XTsiz, t_YTsiz;
  920|  9.05k|      if (file->read(&t_XTsiz, 4) != 4)
  ------------------
  |  Branch (920:11): [True: 6, False: 9.04k]
  ------------------
  921|      6|        OJPH_ERROR(0x00050049, "error reading SIZ marker");
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  922|  9.05k|      if (file->read(&t_YTsiz, 4) != 4)
  ------------------
  |  Branch (922:11): [True: 3, False: 9.04k]
  ------------------
  923|      3|        OJPH_ERROR(0x0005004A, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  924|  9.05k|      set_tile_size(size(
  925|  9.05k|        swap_bytes_if_le(t_XTsiz),
  926|  9.05k|        swap_bytes_if_le(t_YTsiz)));
  927|  9.05k|      ui32 t_XTOsiz, t_YTOsiz;
  928|  9.05k|      if (file->read(&t_XTOsiz, 4) != 4)
  ------------------
  |  Branch (928:11): [True: 3, False: 9.04k]
  ------------------
  929|      3|        OJPH_ERROR(0x0005004B, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  930|  9.05k|      if (file->read(&t_YTOsiz, 4) != 4)
  ------------------
  |  Branch (930:11): [True: 3, False: 9.04k]
  ------------------
  931|      3|        OJPH_ERROR(0x0005004C, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  932|  9.05k|      set_tile_offset(point(
  933|  9.05k|        swap_bytes_if_le(t_XTOsiz),
  934|  9.05k|        swap_bytes_if_le(t_YTOsiz)));
  935|  9.05k|      if (file->read(&Csiz, 2) != 2)
  ------------------
  |  Branch (935:11): [True: 2, False: 9.05k]
  ------------------
  936|      2|        OJPH_ERROR(0x0005004D, "error reading SIZ marker");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  937|  9.05k|      Csiz = swap_bytes_if_le(Csiz);
  938|  9.05k|      if (Csiz != num_comps)
  ------------------
  |  Branch (938:11): [True: 43, False: 9.00k]
  ------------------
  939|     43|        OJPH_ERROR(0x0005004E, "Csiz does not match the SIZ marker size");
  ------------------
  |  |  289|     43|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     43|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 43, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  940|  9.05k|      if (Csiz == 0)
  ------------------
  |  Branch (940:11): [True: 5, False: 9.04k]
  ------------------
  941|      5|        OJPH_ERROR(0x0005004F, "Wrong Csiz value of 0 in SIZ marker segment");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  942|  9.05k|      set_num_components(Csiz);
  943|  85.5k|      for (int c = 0; c < Csiz; ++c)
  ------------------
  |  Branch (943:23): [True: 76.5k, False: 9.05k]
  ------------------
  944|  76.5k|      {
  945|  76.5k|        if (file->read(&cptr[c].SSiz, 1) != 1)
  ------------------
  |  Branch (945:13): [True: 8, False: 76.4k]
  ------------------
  946|      8|          OJPH_ERROR(0x00050051, "error reading SIZ marker");
  ------------------
  |  |  289|      8|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      8|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  947|  76.5k|        if (file->read(&cptr[c].XRsiz, 1) != 1)
  ------------------
  |  Branch (947:13): [True: 5, False: 76.4k]
  ------------------
  948|      5|          OJPH_ERROR(0x00050052, "error reading SIZ marker");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  949|  76.5k|        if (file->read(&cptr[c].YRsiz, 1) != 1)
  ------------------
  |  Branch (949:13): [True: 5, False: 76.4k]
  ------------------
  950|      5|          OJPH_ERROR(0x00050053, "error reading SIZ marker");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  951|  76.5k|        if ((cptr[c].SSiz & 0x7F) > 37)
  ------------------
  |  Branch (951:13): [True: 9, False: 76.4k]
  ------------------
  952|      9|          OJPH_ERROR(0x00050054, "Wrong SIZ-SSiz value of %d", cptr[c].SSiz);
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  953|  76.5k|        if (cptr[c].XRsiz == 0)
  ------------------
  |  Branch (953:13): [True: 2, False: 76.5k]
  ------------------
  954|      2|          OJPH_ERROR(0x00050055, "Wrong SIZ-XRsiz value of %d", cptr[c].XRsiz);
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  955|  76.5k|        if (cptr[c].YRsiz == 0)
  ------------------
  |  Branch (955:13): [True: 2, False: 76.5k]
  ------------------
  956|      2|          OJPH_ERROR(0x00050056, "Wrong SIZ-YRsiz value of %d", cptr[c].YRsiz);
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  957|  76.5k|      }
  958|       |
  959|  9.05k|      ws_kern_support_needed = (Rsiz & 0x20) != 0;
  960|  9.05k|      dfs_support_needed = (Rsiz & 0x80) != 0;
  961|       |
  962|  9.05k|      check_validity();
  963|  9.05k|    }
_ZNK4ojph5local9param_siz22get_recon_downsamplingEj:
  967|  1.17M|    {
  968|  1.17M|      assert(comp_num < get_num_components());
  969|       |
  970|  1.17M|      point factor(1u << skipped_resolutions, 1u << skipped_resolutions);
  971|  1.17M|      const param_cod* cdp = cod->get_coc(comp_num);
  972|  1.17M|      if (dfs && cdp && cdp->is_dfs_defined()) {
  ------------------
  |  Branch (972:11): [True: 74.3k, False: 1.09M]
  |  Branch (972:18): [True: 74.3k, False: 0]
  |  Branch (972:25): [True: 67.8k, False: 6.55k]
  ------------------
  973|  67.8k|        ui16 dfs_idx = cdp->get_dfs_index();
  974|  67.8k|        const param_dfs* d = dfs->get_dfs(dfs_idx);
  975|  67.8k|        if (d != NULL)
  ------------------
  |  Branch (975:13): [True: 67.8k, False: 0]
  ------------------
  976|  67.8k|          factor = d->get_res_downsamp(skipped_resolutions);
  977|  67.8k|      }
  978|  1.17M|      factor.x *= (ui32)cptr[comp_num].XRsiz;
  979|  1.17M|      factor.y *= (ui32)cptr[comp_num].YRsiz;
  980|  1.17M|      return factor;
  981|  1.17M|    }
_ZNK4ojph5local9param_siz14get_recon_sizeEj:
  985|  50.2k|    {
  986|  50.2k|      assert(comp_num < get_num_components());
  987|       |
  988|  50.2k|      point factor = get_recon_downsampling(comp_num);
  989|  50.2k|      point r;
  990|  50.2k|      r.x = ojph_div_ceil(Xsiz, factor.x) - ojph_div_ceil(XOsiz, factor.x);
  ------------------
  |  |   70|  50.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
                    r.x = ojph_div_ceil(Xsiz, factor.x) - ojph_div_ceil(XOsiz, factor.x);
  ------------------
  |  |   70|  50.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  991|  50.2k|      r.y = ojph_div_ceil(Ysiz, factor.y) - ojph_div_ceil(YOsiz, factor.y);
  ------------------
  |  |   70|  50.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
                    r.y = ojph_div_ceil(Ysiz, factor.y) - ojph_div_ceil(YOsiz, factor.y);
  ------------------
  |  |   70|  50.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  992|  50.2k|      return r;
  993|  50.2k|    }
_ZN4ojph5local9param_cap4readEPNS_11infile_baseE:
 1030|    372|    {
 1031|    372|      if (file->read(&Lcap, 2) != 2)
  ------------------
  |  Branch (1031:11): [True: 1, False: 371]
  ------------------
 1032|      1|        OJPH_ERROR(0x00050061, "error reading CAP marker");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1033|    372|      Lcap = swap_bytes_if_le(Lcap);
 1034|    372|      if (file->read(&Pcap, 4) != 4)
  ------------------
  |  Branch (1034:11): [True: 10, False: 362]
  ------------------
 1035|     10|        OJPH_ERROR(0x00050062, "error reading CAP marker");
  ------------------
  |  |  289|     10|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     10|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1036|    372|      Pcap = swap_bytes_if_le(Pcap);
 1037|    372|      ui32 count = population_count(Pcap);
 1038|    372|      if (Pcap & 0xFFFDFFFF)
  ------------------
  |  Branch (1038:11): [True: 42, False: 330]
  ------------------
 1039|     42|        OJPH_ERROR(0x00050063,
  ------------------
  |  |  289|     42|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     42|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 42, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1040|    372|          "error Pcap in CAP has options that are not supported");
 1041|    372|      if ((Pcap & 0x00020000) == 0)
  ------------------
  |  Branch (1041:11): [True: 5, False: 367]
  ------------------
 1042|      5|        OJPH_ERROR(0x00050064,
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1043|    372|          "error Pcap should have its 15th MSB set, Pcap^15. "
 1044|    372|          " This is not a JPH file");
 1045|    686|      for (ui32 i = 0; i < count; ++i)
  ------------------
  |  Branch (1045:24): [True: 314, False: 372]
  ------------------
 1046|    314|        if (file->read(Ccap+i, 2) != 2)
  ------------------
  |  Branch (1046:13): [True: 2, False: 312]
  ------------------
 1047|      2|          OJPH_ERROR(0x00050065, "error reading CAP marker");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|    372|      if (Lcap != 6 + 2 * count)
  ------------------
  |  Branch (1048:11): [True: 16, False: 356]
  ------------------
 1049|     16|        OJPH_ERROR(0x00050066, "error in CAP marker length");
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1050|    372|    }
_ZNK4ojph5local9param_cod13is_reversibleEv:
 1062|  6.78M|    {
 1063|  6.78M|      if (SPcod.wavelet_trans <= 1)
  ------------------
  |  Branch (1063:11): [True: 6.77M, False: 6.22k]
  ------------------
 1064|  6.77M|        return get_wavelet_kern() == local::param_cod::DWT_REV53;
 1065|  6.22k|      else {
 1066|       |        assert(atk != NULL);
 1067|  6.22k|        return atk->is_reversible();
 1068|  6.22k|      }
 1069|  6.78M|    }
_ZN4ojph5local9param_cod4readEPNS_11infile_baseE:
 1184|  8.14k|    {
 1185|  8.14k|      assert(type == COD_MAIN);
 1186|       |
 1187|  8.14k|      if (file->read(&Lcod, 2) != 2)
  ------------------
  |  Branch (1187:11): [True: 5, False: 8.14k]
  ------------------
 1188|      5|        OJPH_ERROR(0x00050071, "error reading COD segment");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1189|  8.14k|      Lcod = swap_bytes_if_le(Lcod);
 1190|  8.14k|      if (file->read(&Scod, 1) != 1)
  ------------------
  |  Branch (1190:11): [True: 4, False: 8.14k]
  ------------------
 1191|      4|        OJPH_ERROR(0x00050072, "error reading COD segment");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1192|  8.14k|      if (file->read(&SGCod.prog_order, 1) != 1)
  ------------------
  |  Branch (1192:11): [True: 6, False: 8.14k]
  ------------------
 1193|      6|        OJPH_ERROR(0x00050073, "error reading COD segment");
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1194|  8.14k|      if (file->read(&SGCod.num_layers, 2) != 2)
  ------------------
  |  Branch (1194:11): [True: 8, False: 8.14k]
  ------------------
 1195|      8|      { OJPH_ERROR(0x00050074, "error reading COD segment"); }
  ------------------
  |  |  289|      8|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      8|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1196|  8.14k|      else
 1197|  8.14k|        SGCod.num_layers = swap_bytes_if_le(SGCod.num_layers);
 1198|  8.14k|      if (file->read(&SGCod.mc_trans, 1) != 1)
  ------------------
  |  Branch (1198:11): [True: 5, False: 8.14k]
  ------------------
 1199|      5|        OJPH_ERROR(0x00050075, "error reading COD segment");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1200|  8.14k|      if (file->read(&SPcod.num_decomp, 1) != 1)
  ------------------
  |  Branch (1200:11): [True: 4, False: 8.14k]
  ------------------
 1201|      4|        OJPH_ERROR(0x00050076, "error reading COD segment");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1202|  8.14k|      if (file->read(&SPcod.block_width, 1) != 1)
  ------------------
  |  Branch (1202:11): [True: 4, False: 8.14k]
  ------------------
 1203|      4|        OJPH_ERROR(0x00050077, "error reading COD segment");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1204|  8.14k|      if (file->read(&SPcod.block_height, 1) != 1)
  ------------------
  |  Branch (1204:11): [True: 7, False: 8.14k]
  ------------------
 1205|      7|        OJPH_ERROR(0x00050078, "error reading COD segment");
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1206|  8.14k|      if (file->read(&SPcod.block_style, 1) != 1)
  ------------------
  |  Branch (1206:11): [True: 5, False: 8.14k]
  ------------------
 1207|      5|        OJPH_ERROR(0x00050079, "error reading COD segment");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1208|  8.14k|      if (file->read(&SPcod.wavelet_trans, 1) != 1)
  ------------------
  |  Branch (1208:11): [True: 5, False: 8.14k]
  ------------------
 1209|      5|        OJPH_ERROR(0x0005007A, "error reading COD segment");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1210|       |
 1211|  8.14k|      if (get_num_decompositions() > 32
  ------------------
  |  Branch (1211:11): [True: 58, False: 8.09k]
  ------------------
 1212|  8.09k|        || SPcod.block_width > 8
  ------------------
  |  Branch (1212:12): [True: 6, False: 8.08k]
  ------------------
 1213|  8.08k|        || SPcod.block_height > 8
  ------------------
  |  Branch (1213:12): [True: 11, False: 8.07k]
  ------------------
 1214|  8.07k|        || SPcod.block_width + SPcod.block_height > 8
  ------------------
  |  Branch (1214:12): [True: 1, False: 8.07k]
  ------------------
 1215|  8.07k|        || (SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1215:12): [True: 4, False: 8.06k]
  ------------------
 1216|  8.06k|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1216:12): [True: 6, False: 8.06k]
  ------------------
 1217|     33|        OJPH_ERROR(0x0005007D, "wrong settings in a COD-SPcod parameter");
  ------------------
  |  |  289|     33|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     33|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 33, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|  8.14k|      if ((SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1218:11): [True: 86, False: 8.06k]
  ------------------
 1219|  8.06k|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1219:12): [True: 0, False: 8.06k]
  ------------------
 1220|      0|        OJPH_ERROR(0x0005007E, "unsupported settings in a COD-SPcod parameter");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1221|       |
 1222|  8.14k|      ui8 num_decompositions =  get_num_decompositions();
 1223|  8.14k|      if (Scod & 1) {
  ------------------
  |  Branch (1223:11): [True: 7.74k, False: 408]
  ------------------
 1224|  51.9k|        for (int i = 0; i <= num_decompositions; ++i) {
  ------------------
  |  Branch (1224:25): [True: 44.2k, False: 7.74k]
  ------------------
 1225|  44.2k|          if (file->read(&SPcod.precinct_size[i], 1) != 1)
  ------------------
  |  Branch (1225:15): [True: 14, False: 44.2k]
  ------------------
 1226|     14|            OJPH_ERROR(0x0005007B, "error reading COD segment");
  ------------------
  |  |  289|     14|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     14|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1227|  44.2k|          if (i)
  ------------------
  |  Branch (1227:15): [True: 36.4k, False: 7.75k]
  ------------------
 1228|  36.4k|            if ((SPcod.precinct_size[i] & 0x0F) == 0 ||
  ------------------
  |  Branch (1228:17): [True: 8, False: 36.4k]
  ------------------
 1229|  36.4k|              (SPcod.precinct_size[i] >> 4) == 0)
  ------------------
  |  Branch (1229:15): [True: 5, False: 36.4k]
  ------------------
 1230|     13|              OJPH_ERROR(0x0005007F,
  ------------------
  |  |  289|     13|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     13|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1231|  44.2k|                "Precinct width or height for resolutions other than the"
 1232|  44.2k|                " coarsest must be larger than 1; here, they are %d and %d,"
 1233|  44.2k|                " respectively.",
 1234|  44.2k|                1 << (SPcod.precinct_size[i] & 0x0F),
 1235|  44.2k|                1 << (SPcod.precinct_size[i] >> 4));
 1236|  44.2k|        }
 1237|  7.74k|      }
 1238|  8.14k|      if (Lcod != 12 + ((Scod & 1) ? 1 + SPcod.num_decomp : 0))
  ------------------
  |  Branch (1238:11): [True: 3, False: 8.14k]
  |  Branch (1238:25): [True: 7.71k, False: 435]
  ------------------
 1239|      3|        OJPH_ERROR(0x0005007C, "error in COD segment length");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1240|  8.14k|    }
_ZN4ojph5local9param_cod8read_cocEPNS_11infile_baseEjPS1_:
 1245|  1.03k|    {
 1246|  1.03k|      assert(type == COC_MAIN);
 1247|  1.03k|      assert(top_cod != NULL);
 1248|       |
 1249|  1.03k|      this->SGCod = top_cod->SGCod;
 1250|  1.03k|      this->top_cod = top_cod;
 1251|  1.03k|      if (file->read(&Lcod, 2) != 2)
  ------------------
  |  Branch (1251:11): [True: 5, False: 1.03k]
  ------------------
 1252|      5|        OJPH_ERROR(0x00050121, "error reading COC segment");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1253|  1.03k|      Lcod = swap_bytes_if_le(Lcod);
 1254|  1.03k|      if (num_comps < 257) {
  ------------------
  |  Branch (1254:11): [True: 1.02k, False: 12]
  ------------------
 1255|  1.02k|        ui8 t;
 1256|  1.02k|        if (file->read(&t, 1) != 1)
  ------------------
  |  Branch (1256:13): [True: 7, False: 1.01k]
  ------------------
 1257|      7|          OJPH_ERROR(0x00050122, "error reading COC segment");
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1258|  1.02k|        comp_idx = t;
 1259|  1.02k|      }
 1260|     12|      else {
 1261|     12|        if (file->read(&comp_idx, 2) != 2)
  ------------------
  |  Branch (1261:13): [True: 1, False: 11]
  ------------------
 1262|      1|          OJPH_ERROR(0x00050123, "error reading COC segment");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1263|     12|        comp_idx = swap_bytes_if_le(comp_idx);
 1264|     12|      }
 1265|  1.03k|      if (file->read(&Scod, 1) != 1)
  ------------------
  |  Branch (1265:11): [True: 2, False: 1.03k]
  ------------------
 1266|      2|        OJPH_ERROR(0x00050124, "error reading COC segment");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1267|  1.03k|      if (Scod & 0xF8)
  ------------------
  |  Branch (1267:11): [True: 754, False: 283]
  ------------------
 1268|    754|        OJPH_WARN(0x00050011,
  ------------------
  |  |  287|    754|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    754|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 754, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1269|  1.03k|          "Unsupported options in Scoc field of the COC segment");
 1270|  1.03k|      if (file->read(&SPcod.num_decomp, 1) != 1)
  ------------------
  |  Branch (1270:11): [True: 6, False: 1.03k]
  ------------------
 1271|      6|        OJPH_ERROR(0x00050125, "error reading COC segment");
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1272|  1.03k|      if (file->read(&SPcod.block_width, 1) != 1)
  ------------------
  |  Branch (1272:11): [True: 4, False: 1.03k]
  ------------------
 1273|      4|        OJPH_ERROR(0x00050126, "error reading COC segment");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1274|  1.03k|      if (file->read(&SPcod.block_height, 1) != 1)
  ------------------
  |  Branch (1274:11): [True: 3, False: 1.03k]
  ------------------
 1275|      3|        OJPH_ERROR(0x00050127, "error reading COC segment");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1276|  1.03k|      if (file->read(&SPcod.block_style, 1) != 1)
  ------------------
  |  Branch (1276:11): [True: 5, False: 1.03k]
  ------------------
 1277|      5|        OJPH_ERROR(0x00050128, "error reading COC segment");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1278|  1.03k|      if (file->read(&SPcod.wavelet_trans, 1) != 1)
  ------------------
  |  Branch (1278:11): [True: 2, False: 1.03k]
  ------------------
 1279|      2|        OJPH_ERROR(0x00050129, "error reading COC segment");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1280|       |
 1281|  1.03k|      if (get_num_decompositions() > 32
  ------------------
  |  Branch (1281:11): [True: 41, False: 996]
  ------------------
 1282|    996|        || SPcod.block_width > 8
  ------------------
  |  Branch (1282:12): [True: 7, False: 989]
  ------------------
 1283|    989|        || SPcod.block_height > 8
  ------------------
  |  Branch (1283:12): [True: 8, False: 981]
  ------------------
 1284|    981|        || SPcod.block_width + SPcod.block_height > 8
  ------------------
  |  Branch (1284:12): [True: 1, False: 980]
  ------------------
 1285|    980|        || (SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1285:12): [True: 5, False: 975]
  ------------------
 1286|    975|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1286:12): [True: 6, False: 969]
  ------------------
 1287|     33|        OJPH_ERROR(0x0005012C, "wrong settings in a COC-SPcoc parameter");
  ------------------
  |  |  289|     33|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     33|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 33, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1288|  1.03k|      if ((SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1288:11): [True: 68, False: 969]
  ------------------
 1289|    969|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1289:12): [True: 0, False: 969]
  ------------------
 1290|      0|        OJPH_ERROR(0x0005012D, "unsupported settings in a COC-SPcoc parameter");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1291|       |
 1292|  1.03k|      ui8 num_decompositions =  get_num_decompositions();
 1293|  1.03k|      if (Scod & 1) {
  ------------------
  |  Branch (1293:11): [True: 200, False: 837]
  ------------------
 1294|    973|        for (int i = 0; i <= num_decompositions; ++i) {
  ------------------
  |  Branch (1294:25): [True: 773, False: 200]
  ------------------
 1295|    773|          if (file->read(&SPcod.precinct_size[i], 1) != 1)
  ------------------
  |  Branch (1295:15): [True: 6, False: 767]
  ------------------
 1296|      6|            OJPH_ERROR(0x0005012A, "error reading COC segment");
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1297|    773|          if (i)
  ------------------
  |  Branch (1297:15): [True: 568, False: 205]
  ------------------
 1298|    568|            if ((SPcod.precinct_size[i] & 0x0F) == 0 ||
  ------------------
  |  Branch (1298:17): [True: 6, False: 562]
  ------------------
 1299|    562|              (SPcod.precinct_size[i] >> 4) == 0)
  ------------------
  |  Branch (1299:15): [True: 5, False: 557]
  ------------------
 1300|     11|              OJPH_ERROR(0x0005012E,
  ------------------
  |  |  289|     11|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     11|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1301|    773|                "Precinct width or height for resolutions other than the"
 1302|    773|                " coarsest must be larger than 1; here, they are %d and %d,"
 1303|    773|                " respectively.",
 1304|    773|                1 << (SPcod.precinct_size[i] & 0x0F),
 1305|    773|                1 << (SPcod.precinct_size[i] >> 4));
 1306|    773|        }
 1307|    200|      }
 1308|  1.03k|      ui32 t = 9;
 1309|  1.03k|      t += num_comps < 257 ? 0 : 1;
  ------------------
  |  Branch (1309:12): [True: 946, False: 91]
  ------------------
 1310|  1.03k|      t += (Scod & 1) ? 1 + num_decompositions : 0;
  ------------------
  |  Branch (1310:12): [True: 183, False: 854]
  ------------------
 1311|  1.03k|      if (Lcod != t)
  ------------------
  |  Branch (1311:11): [True: 9, False: 1.02k]
  ------------------
 1312|      9|        OJPH_ERROR(0x0005012B, "error in COC segment length");
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1313|  1.03k|    }
_ZN4ojph5local9param_cod10update_atkEPNS0_9param_atkE:
 1317|  7.11k|    {
 1318|  7.11k|      assert(type == COD_MAIN);
 1319|  7.11k|      this->atk = atk->get_atk(SPcod.wavelet_trans);
 1320|  7.11k|      if (this->atk == NULL)
  ------------------
  |  Branch (1320:11): [True: 9, False: 7.10k]
  ------------------
 1321|      9|        OJPH_ERROR(0x00050131, "A COD segment employs the DWT kernel "
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1322|  7.11k|          "atk = %d, but a corresponding ATK segment cannot be found.",
 1323|  7.11k|          SPcod.wavelet_trans);
 1324|  7.11k|      param_cod *p = next;
 1325|  7.88k|      while (p)
  ------------------
  |  Branch (1325:14): [True: 776, False: 7.11k]
  ------------------
 1326|    776|      {
 1327|    776|        p->atk = atk->get_atk(p->SPcod.wavelet_trans);
 1328|    776|        if (p->atk == NULL)
  ------------------
  |  Branch (1328:13): [True: 1, False: 775]
  ------------------
 1329|      1|          OJPH_ERROR(0x00050132, "A COC segment employs the DWT kernel "
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1330|    776|            "atk = %d, but a corresponding ATK segment cannot be found",
 1331|    776|            SPcod.wavelet_trans);
 1332|    776|        p = p->next;
 1333|    776|      }
 1334|  7.11k|    }
_ZNK4ojph5local9param_cod7get_cocEj:
 1338|  69.1M|    {
 1339|  69.1M|      assert(this->type == COD_MAIN || this->top_cod->type == COD_MAIN);
 1340|  69.1M|      const param_cod *p, *q;
 1341|  69.1M|      if (this->type == COD_MAIN)
  ------------------
  |  Branch (1341:11): [True: 68.2M, False: 973k]
  ------------------
 1342|  68.2M|        q = p = this;
 1343|   973k|      else
 1344|   973k|        q = p = this->top_cod;
 1345|   110M|      while (p && p->comp_idx != comp_idx)
  ------------------
  |  Branch (1345:14): [True: 71.4M, False: 38.9M]
  |  Branch (1345:19): [True: 41.2M, False: 30.2M]
  ------------------
 1346|  41.2M|        p = p->next;
 1347|  69.1M|      return p ? p : q;
  ------------------
  |  Branch (1347:14): [True: 30.2M, False: 38.9M]
  ------------------
 1348|  69.1M|    }
_ZN4ojph5local9param_cod7get_cocEj:
 1352|  39.6M|    {
 1353|       |      // cast object to constant
 1354|  39.6M|      const param_cod* const_p = const_cast<const param_cod*>(this);
 1355|       |      // call using the constant object, then cast to non-const
 1356|  39.6M|      return const_cast<param_cod*>(const_p->get_coc(comp_idx));
 1357|  39.6M|    }
_ZN4ojph5local9param_cod14add_coc_objectEj:
 1361|  1.03k|    {
 1362|  1.03k|      assert(type == COD_MAIN);
 1363|  1.03k|      param_cod *p = this;
 1364|  1.58k|      while (p->next != NULL)
  ------------------
  |  Branch (1364:14): [True: 543, False: 1.03k]
  ------------------
 1365|    543|        p = p->next;
 1366|  1.03k|      if (avail)
  ------------------
  |  Branch (1366:11): [True: 0, False: 1.03k]
  ------------------
 1367|      0|      {
 1368|      0|        p->next = avail;
 1369|      0|        avail = avail->next;
 1370|      0|        p->next->init(this, (ui16)comp_idx);
 1371|      0|      }
 1372|  1.03k|      else
 1373|  1.03k|        p->next = new param_cod(this, (ui16)comp_idx);
 1374|  1.03k|      return p->next;
 1375|  1.03k|    }
_ZNK4ojph5local9param_qcd15get_irrev_deltaEPKNS0_9param_dfsEjjjj:
 1717|  1.76M|    {
 1718|  1.76M|      float arr[] = { 1.0f, 2.0f, 2.0f, 4.0f };
 1719|  1.76M|      if ((Sqcd & 0x1F) != 2)
  ------------------
  |  Branch (1719:11): [True: 64, False: 1.76M]
  ------------------
 1720|     64|        OJPH_ERROR(0x00050101, "There is something wrong in the configuration "
  ------------------
  |  |  289|     64|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     64|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 64, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1721|  1.76M|          "of the codestream; for component %d, the codestream defines an "
 1722|  1.76M|          "irreversible transform, for which the codestream provides a "
 1723|  1.76M|          "reversible (no quantization) step sizes in Sqcd/Sqcc.", comp_num);
 1724|       |
 1725|  1.76M|      ui32 idx;
 1726|  1.76M|      if (dfs != NULL && dfs->exists())
  ------------------
  |  Branch (1726:11): [True: 96.7k, False: 1.67M]
  |  Branch (1726:26): [True: 96.2k, False: 511]
  ------------------
 1727|  96.2k|        idx = dfs->get_subband_idx(num_decompositions, resolution, subband);
 1728|  1.67M|      else
 1729|  1.67M|        idx = resolution ? (resolution - 1) * 3 + subband : 0;
  ------------------
  |  Branch (1729:15): [True: 1.56M, False: 106k]
  ------------------
 1730|  1.76M|      if (idx >= num_subbands) {
  ------------------
  |  Branch (1730:11): [True: 1.15M, False: 615k]
  ------------------
 1731|  1.15M|        OJPH_INFO(0x00050102, "Trying to access quantization step size for "
  ------------------
  |  |  285|  1.15M|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  1.15M|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1.15M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1732|  1.15M|          "subband %d when the QCD/QCC marker segment specifies "
 1733|  1.15M|          "quantization step sizes for %d subbands only.  To continue "
 1734|  1.15M|          "decoding, we are using the step size for subband %d, which can "
 1735|  1.15M|          "produce incorrect results",
 1736|  1.15M|          idx + 1, num_subbands, num_subbands - 1);
 1737|  1.15M|        idx = num_subbands - 1;
 1738|  1.15M|      }
 1739|  1.76M|      int eps = SPqcd.u16[idx] >> 11;
 1740|  1.76M|      float mantissa;
 1741|  1.76M|      mantissa = (float)((SPqcd.u16[idx] & 0x7FF) | 0x800) * arr[subband];
 1742|  1.76M|      mantissa /= (float)(1 << 11);
 1743|  1.76M|      mantissa /= (float)(1u << eps);
 1744|  1.76M|      return mantissa;
 1745|  1.76M|    }
_ZNK4ojph5local9param_qcd17propose_precisionEPKNS0_9param_codE:
 1749|  28.3M|    {
 1750|  28.3M|      ui32 comp_idx = cod->get_comp_idx();
 1751|  28.3M|      ui32 precision = 0;
 1752|  28.3M|      const param_cod *main =
 1753|  28.3M|        cod->get_coc(param_cod::OJPH_COD_DEFAULT);
 1754|  28.3M|      if (main->is_employing_color_transform() && comp_idx < 3)
  ------------------
  |  Branch (1754:11): [True: 554k, False: 27.7M]
  |  Branch (1754:51): [True: 7.87k, False: 546k]
  ------------------
 1755|  7.87k|      {
 1756|  31.5k|        for (ui32 i = 0; i < 3; ++i) {
  ------------------
  |  Branch (1756:26): [True: 23.6k, False: 7.87k]
  ------------------
 1757|  23.6k|          const param_qcd* p = this->get_qcc(i);
 1758|  23.6k|          precision = ojph_max(precision, p->get_largest_Kmax());
  ------------------
  |  |   73|  23.6k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.69k, False: 21.9k]
  |  |  ------------------
  ------------------
 1759|  23.6k|        }
 1760|  7.87k|      }
 1761|  28.3M|      else {
 1762|  28.3M|        precision = get_largest_Kmax();
 1763|  28.3M|      }
 1764|       |      // ``precision'' now holds the largest K_max, which excludes the sign
 1765|       |      // bit.
 1766|       |      // + 1 for the sign bit
 1767|       |      // + 1 because my block decoder/encoder does not supports up to 30
 1768|       |      //     bits (not 31), so we bump it by one more bit.
 1769|  28.3M|      return precision + 1 + 1;
 1770|  28.3M|    }
_ZNK4ojph5local9param_qcd18get_num_guard_bitsEv:
 1774|  44.6M|    {
 1775|  44.6M|      return (Sqcd >> 5);
 1776|  44.6M|    }
_ZNK4ojph5local9param_qcd8get_KmaxEPKNS0_9param_dfsEjjj:
 1781|  16.2M|    {
 1782|  16.2M|      ui32 idx;
 1783|  16.2M|      if (dfs != NULL && dfs->exists())
  ------------------
  |  Branch (1783:11): [True: 498k, False: 15.7M]
  |  Branch (1783:26): [True: 497k, False: 513]
  ------------------
 1784|   497k|        idx = dfs->get_subband_idx(num_decompositions, resolution, subband);
 1785|  15.7M|      else
 1786|  15.7M|        idx = resolution ? (resolution - 1) * 3 + subband : 0;
  ------------------
  |  Branch (1786:15): [True: 14.6M, False: 1.05M]
  ------------------
 1787|  16.2M|      if (idx >= num_subbands) {
  ------------------
  |  Branch (1787:11): [True: 8.34M, False: 7.89M]
  ------------------
 1788|  8.34M|        OJPH_INFO(0x00050111, "Trying to access quantization step size for "
  ------------------
  |  |  285|  8.34M|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  8.34M|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8.34M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1789|  8.34M|          "subband %d when the QCD/QCC marker segment specifies "
 1790|  8.34M|          "quantization step sizes for %d subbands only.  To continue "
 1791|  8.34M|          "decoding, we are using the step size for subband %d, which can "
 1792|  8.34M|          "produce incorrect results",
 1793|  8.34M|          idx + 1, num_subbands, num_subbands - 1);
 1794|  8.34M|        idx = num_subbands - 1;
 1795|  8.34M|      }
 1796|       |
 1797|  16.2M|      int irrev = Sqcd & 0x1F;
 1798|  16.2M|      ui32 num_bits = 0;
 1799|  16.2M|      if (irrev == 0) // reversible; this is (10.22) from the J2K book
  ------------------
  |  Branch (1799:11): [True: 13.6M, False: 2.62M]
  ------------------
 1800|  13.6M|      {
 1801|  13.6M|        num_bits = decode_SPqcd(SPqcd.u8[idx]);
 1802|  13.6M|        num_bits = num_bits == 0 ? 0 : num_bits - 1;
  ------------------
  |  Branch (1802:20): [True: 5.63M, False: 7.97M]
  ------------------
 1803|  13.6M|      }
 1804|  2.62M|      else if (irrev == 1)
  ------------------
  |  Branch (1804:16): [True: 0, False: 2.62M]
  ------------------
 1805|  2.62M|        assert(0);
 1806|  2.62M|      else if (irrev == 2) //scalar expounded
  ------------------
  |  Branch (1806:16): [True: 2.62M, False: 0]
  ------------------
 1807|  2.62M|        num_bits = (SPqcd.u16[idx] >> 11) - 1;
 1808|      0|      else
 1809|  2.62M|        assert(0);
 1810|       |
 1811|  16.2M|      return num_bits + get_num_guard_bits();
 1812|  16.2M|    }
_ZNK4ojph5local9param_qcd16get_largest_KmaxEv:
 1816|  28.3M|    {
 1817|  28.3M|      int irrev = Sqcd & 0x1F;
 1818|  28.3M|      ui32 num_bits = 0;
 1819|  28.3M|      if (irrev == 0) // reversible; this is (10.22) from the J2K book
  ------------------
  |  Branch (1819:11): [True: 23.2M, False: 5.14M]
  ------------------
 1820|  23.2M|      {
 1821|   218M|        for (ui32 i = 0; i < num_subbands; ++i) {
  ------------------
  |  Branch (1821:26): [True: 195M, False: 23.2M]
  ------------------
 1822|   195M|          ui32 t = decode_SPqcd(SPqcd.u8[i]);
 1823|   195M|          num_bits = ojph_max(num_bits, t == 0 ? 0 : t - 1);
  ------------------
  |  |   73|   390M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 145M, False: 49.3M]
  |  |  |  Branch (73:33): [True: 103M, False: 91.4M]
  |  |  |  Branch (73:46): [True: 2.33M, False: 46.9M]
  |  |  ------------------
  ------------------
 1824|   195M|        }
 1825|  23.2M|      }
 1826|  5.14M|      else if (irrev == 1)
  ------------------
  |  Branch (1826:16): [True: 0, False: 5.14M]
  ------------------
 1827|  5.14M|        assert(0);
 1828|  5.14M|      else if (irrev == 2) //scalar expounded
  ------------------
  |  Branch (1828:16): [True: 5.14M, False: 0]
  ------------------
 1829|  5.14M|      {
 1830|  29.9M|        for (ui32 i = 0; i < num_subbands; ++i) {
  ------------------
  |  Branch (1830:26): [True: 24.8M, False: 5.14M]
  ------------------
 1831|  24.8M|          ui32 t = (SPqcd.u16[i] >> 11) - 1;
 1832|  24.8M|          num_bits = ojph_max(num_bits, t);
  ------------------
  |  |   73|  24.8M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 7.06M, False: 17.7M]
  |  |  ------------------
  ------------------
 1833|  24.8M|        }
 1834|  5.14M|      }
 1835|      0|      else
 1836|  5.14M|        assert(0);
 1837|       |
 1838|  28.3M|      return num_bits + get_num_guard_bits();
 1839|  28.3M|    }
_ZN4ojph5local9param_qcd4readEPNS_11infile_baseE:
 1968|  8.24k|    {
 1969|  8.24k|      if (file->read(&Lqcd, 2) != 2)
  ------------------
  |  Branch (1969:11): [True: 13, False: 8.23k]
  ------------------
 1970|     13|        OJPH_ERROR(0x00050081, "error reading QCD marker");
  ------------------
  |  |  289|     13|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     13|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1971|  8.24k|      Lqcd = swap_bytes_if_le(Lqcd);
 1972|  8.24k|      if (file->read(&Sqcd, 1) != 1)
  ------------------
  |  Branch (1972:11): [True: 7, False: 8.23k]
  ------------------
 1973|      7|        OJPH_ERROR(0x00050082, "error reading QCD marker");
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1974|  8.24k|      if ((Sqcd & 0x1F) == 0)
  ------------------
  |  Branch (1974:11): [True: 5.49k, False: 2.75k]
  ------------------
 1975|  5.49k|      {
 1976|  5.49k|        num_subbands = (Lqcd - 3);
 1977|  5.49k|        if (num_subbands == 0)
  ------------------
  |  Branch (1977:13): [True: 1, False: 5.48k]
  ------------------
 1978|      1|          OJPH_ERROR(0x0005008A, "QCD marker segment that specifies no "
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1979|  5.49k|            "quantization informtion");
 1980|  5.49k|        if (num_subbands > MAX_SUBBAND_COUNT || Lqcd != 3 + num_subbands)
  ------------------
  |  Branch (1980:13): [True: 14, False: 5.47k]
  |  Branch (1980:49): [True: 0, False: 5.47k]
  ------------------
 1981|     13|          OJPH_ERROR(0x00050083, "wrong Lqcd value of %d in QCD marker", Lqcd);
  ------------------
  |  |  289|     13|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     13|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1982|  52.7k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1982:26): [True: 47.2k, False: 5.49k]
  ------------------
 1983|  47.2k|          if (file->read(&SPqcd.u8[i], 1) != 1)
  ------------------
  |  Branch (1983:15): [True: 13, False: 47.2k]
  ------------------
 1984|     13|            OJPH_ERROR(0x00050084, "error reading QCD marker");
  ------------------
  |  |  289|     13|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     13|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1985|  5.49k|      }
 1986|  2.75k|      else if ((Sqcd & 0x1F) == 1)
  ------------------
  |  Branch (1986:16): [True: 1, False: 2.75k]
  ------------------
 1987|      1|      {
 1988|      1|        num_subbands = 0;
 1989|      1|        OJPH_ERROR(0x00050089,
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1990|      1|          "Scalar derived quantization is not supported yet in QCD marker");
 1991|      1|        if (Lqcd != 5)
  ------------------
  |  Branch (1991:13): [True: 0, False: 1]
  ------------------
 1992|      0|          OJPH_ERROR(0x00050085, "wrong Lqcd value in QCD marker");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1993|      1|      }
 1994|  2.75k|      else if ((Sqcd & 0x1F) == 2)
  ------------------
  |  Branch (1994:16): [True: 2.72k, False: 30]
  ------------------
 1995|  2.72k|      {
 1996|  2.72k|        num_subbands = (Lqcd - 3) / 2;
 1997|  2.72k|        if (num_subbands == 0)
  ------------------
  |  Branch (1997:13): [True: 1, False: 2.72k]
  ------------------
 1998|      1|          OJPH_ERROR(0x0005008B, "QCD marker segment that specifies no "
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1999|  2.72k|            "quantization informtion");
 2000|  2.72k|        if (num_subbands > MAX_SUBBAND_COUNT || Lqcd != 3 + 2 * num_subbands)
  ------------------
  |  Branch (2000:13): [True: 16, False: 2.70k]
  |  Branch (2000:49): [True: 6, False: 2.70k]
  ------------------
 2001|     21|          OJPH_ERROR(0x00050086, "wrong Lqcd value of %d in QCD marker", Lqcd);
  ------------------
  |  |  289|     21|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     21|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2002|  15.2k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (2002:26): [True: 12.5k, False: 2.72k]
  ------------------
 2003|  12.5k|        {
 2004|  12.5k|          if (file->read(&SPqcd.u16[i], 2) != 2)
  ------------------
  |  Branch (2004:15): [True: 15, False: 12.5k]
  ------------------
 2005|     15|            OJPH_ERROR(0x00050087, "error reading QCD marker");
  ------------------
  |  |  289|     15|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     15|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2006|  12.5k|          SPqcd.u16[i] = swap_bytes_if_le(SPqcd.u16[i]);
 2007|  12.5k|        }
 2008|  2.72k|      }
 2009|     30|      else
 2010|     30|        OJPH_ERROR(0x00050088, "wrong Sqcd value in QCD marker");
  ------------------
  |  |  289|     30|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     30|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 10, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2011|  8.24k|    }
_ZN4ojph5local9param_qcd8read_qccEPNS_11infile_baseEj:
 2015|    321|    {
 2016|    321|      if (file->read(&Lqcd, 2) != 2)
  ------------------
  |  Branch (2016:11): [True: 4, False: 317]
  ------------------
 2017|      4|        OJPH_ERROR(0x000500A1, "error reading QCC marker");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2018|    321|      Lqcd = swap_bytes_if_le(Lqcd);
 2019|    321|      if (num_comps < 257)
  ------------------
  |  Branch (2019:11): [True: 221, False: 100]
  ------------------
 2020|    221|      {
 2021|    221|        ui8 v;
 2022|    221|        if (file->read(&v, 1) != 1)
  ------------------
  |  Branch (2022:13): [True: 2, False: 219]
  ------------------
 2023|      2|          OJPH_ERROR(0x000500A2, "error reading QCC marker");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2024|    221|        comp_idx = v;
 2025|    221|      }
 2026|    100|      else
 2027|    100|      {
 2028|    100|        if (file->read(&comp_idx, 2) != 2)
  ------------------
  |  Branch (2028:13): [True: 1, False: 99]
  ------------------
 2029|      1|          OJPH_ERROR(0x000500A3, "error reading QCC marker");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2030|    100|        comp_idx = swap_bytes_if_le(comp_idx);
 2031|    100|      }
 2032|    321|      if (file->read(&Sqcd, 1) != 1)
  ------------------
  |  Branch (2032:11): [True: 1, False: 320]
  ------------------
 2033|      1|        OJPH_ERROR(0x000500A4, "error reading QCC marker");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2034|    321|      ui32 offset = num_comps < 257 ? 4 : 5;
  ------------------
  |  Branch (2034:21): [True: 218, False: 103]
  ------------------
 2035|    321|      if ((Sqcd & 0x1F) == 0)
  ------------------
  |  Branch (2035:11): [True: 202, False: 119]
  ------------------
 2036|    202|      {
 2037|    202|        num_subbands = (Lqcd - offset);
 2038|    202|        if (num_subbands == 0)
  ------------------
  |  Branch (2038:13): [True: 1, False: 201]
  ------------------
 2039|      1|          OJPH_ERROR(0x000500AC, "QCC marker segment that specifies no "
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2040|    202|            "quantization informtion");
 2041|    202|        if (num_subbands > MAX_SUBBAND_COUNT || Lqcd != offset + num_subbands)
  ------------------
  |  Branch (2041:13): [True: 21, False: 181]
  |  Branch (2041:49): [True: 0, False: 181]
  ------------------
 2042|     20|          OJPH_ERROR(0x000500A5, "wrong Lqcd value of %d in QCC marker", Lqcd);
  ------------------
  |  |  289|     20|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     20|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2043|  3.90k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (2043:26): [True: 3.70k, False: 202]
  ------------------
 2044|  3.70k|          if (file->read(&SPqcd.u8[i], 1) != 1)
  ------------------
  |  Branch (2044:15): [True: 15, False: 3.68k]
  ------------------
 2045|     15|            OJPH_ERROR(0x000500A6, "error reading QCC marker");
  ------------------
  |  |  289|     15|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     15|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2046|    202|      }
 2047|    119|      else if ((Sqcd & 0x1F) == 1)
  ------------------
  |  Branch (2047:16): [True: 1, False: 118]
  ------------------
 2048|      1|      {
 2049|      1|        num_subbands = 0;
 2050|      1|        OJPH_ERROR(0x000500AB,
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2051|      1|          "Scalar derived quantization is not supported yet in QCC marker");
 2052|      1|        if (Lqcd != offset)
  ------------------
  |  Branch (2052:13): [True: 0, False: 1]
  ------------------
 2053|      0|          OJPH_ERROR(0x000500A7, "wrong Lqcc value in QCC marker");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2054|      1|      }
 2055|    118|      else if ((Sqcd & 0x1F) == 2)
  ------------------
  |  Branch (2055:16): [True: 99, False: 19]
  ------------------
 2056|     99|      {
 2057|     99|        num_subbands = (Lqcd - offset) / 2;
 2058|     99|        if (num_subbands == 0)
  ------------------
  |  Branch (2058:13): [True: 2, False: 97]
  ------------------
 2059|      2|          OJPH_ERROR(0x000500AD, "QCC marker segment that specifies no "
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2060|     99|            "quantization informtion");
 2061|     99|        if (num_subbands>MAX_SUBBAND_COUNT || Lqcd != offset + 2*num_subbands)
  ------------------
  |  Branch (2061:13): [True: 15, False: 84]
  |  Branch (2061:47): [True: 3, False: 81]
  ------------------
 2062|     16|          OJPH_ERROR(0x000500A8, "wrong Lqcc value of %d in QCC marker", Lqcd);
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2063|    704|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (2063:26): [True: 605, False: 99]
  ------------------
 2064|    605|        {
 2065|    605|          if (file->read(&SPqcd.u16[i], 2) != 2)
  ------------------
  |  Branch (2065:15): [True: 11, False: 594]
  ------------------
 2066|     11|            OJPH_ERROR(0x000500A9, "error reading QCC marker");
  ------------------
  |  |  289|     11|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     11|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2067|    605|          SPqcd.u16[i] = swap_bytes_if_le(SPqcd.u16[i]);
 2068|    605|        }
 2069|     99|      }
 2070|     19|      else
 2071|     19|        OJPH_ERROR(0x000500AA, "wrong Sqcc value in QCC marker");
  ------------------
  |  |  289|     19|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     19|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 11, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2072|    321|    }
_ZN4ojph5local9param_qcd7get_qccEj:
 2129|    216|    {
 2130|       |      // cast object to constant
 2131|    216|      const param_qcd* const_p = const_cast<const param_qcd*>(this);
 2132|       |      // call using the constant object, then cast to non-const
 2133|    216|      return const_cast<param_qcd*>(const_p->get_qcc(comp_idx));
 2134|    216|    }
_ZNK4ojph5local9param_qcd7get_qccEj:
 2138|  28.3M|    {
 2139|  28.3M|      assert(this->type == QCD_MAIN || this->top_qcd->type == QCD_MAIN);
 2140|  28.3M|      const param_qcd *p, *q;
 2141|  28.3M|      if (this->type == QCD_MAIN)
  ------------------
  |  Branch (2141:11): [True: 28.3M, False: 2.65k]
  ------------------
 2142|  28.3M|        q = p = this;
 2143|  2.65k|      else
 2144|  2.65k|        q = p = this->top_qcd;
 2145|  56.7M|      while (p && p->comp_idx != comp_idx)
  ------------------
  |  Branch (2145:14): [True: 28.3M, False: 28.3M]
  |  Branch (2145:19): [True: 28.3M, False: 5.60k]
  ------------------
 2146|  28.3M|        p = p->next;
 2147|  28.3M|      return p ? p : q;
  ------------------
  |  Branch (2147:14): [True: 5.60k, False: 28.3M]
  ------------------
 2148|  28.3M|    }
_ZN4ojph5local9param_qcd14add_qcc_objectEj:
 2152|    321|    {
 2153|    321|      assert(type == QCD_MAIN);
 2154|    321|      param_qcd *p = this;
 2155|    565|      while (p->next != NULL)
  ------------------
  |  Branch (2155:14): [True: 244, False: 321]
  ------------------
 2156|    244|        p = p->next;
 2157|    321|      if (avail)
  ------------------
  |  Branch (2157:11): [True: 0, False: 321]
  ------------------
 2158|      0|      {
 2159|      0|        p->next = avail;
 2160|      0|        avail = avail->next;
 2161|      0|        p->next->init(this, (ui16)comp_idx);
 2162|      0|      }
 2163|    321|      else
 2164|    321|        p->next = new param_qcd(this, (ui16)comp_idx);
 2165|    321|      return p->next;
 2166|    321|    }
_ZN4ojph5local7nlt_rec20prepare_for_decodingEv:
 2178|  3.14k|    {
 2179|  3.14k|      double d = 1.0 / (double)((1ull << 32) - 1);
 2180|  3.14k|      fd_min = (float)((double)d_min * d);
 2181|  3.14k|      fd_max = (float)((double)d_max * d);
 2182|  3.14k|      delta = (fd_max - fd_min) / (float)(num_points - 1);
 2183|  3.14k|      inv_delta = (float)(num_points - 1) / (fd_max - fd_min);
 2184|  3.14k|      multiplier = (float)(1ull << get_bit_depth());
 2185|  3.14k|      float divider = 1 / multiplier;
 2186|  3.14k|      if (bytes_per_point == 1) {
  ------------------
  |  Branch (2186:11): [True: 1.44k, False: 1.69k]
  ------------------
 2187|  1.44k|        ui8* sp = (ui8*)marker_points;
 2188|  1.44k|        float* dp = dec_points;
 2189|   105k|        for (ui32 i = 0; i < num_points; ++i)
  ------------------
  |  Branch (2189:26): [True: 104k, False: 1.44k]
  ------------------
 2190|   104k|          *dp++ = *sp++ * divider;
 2191|  1.44k|        dec_points[-1] = dec_points[0];
 2192|  1.44k|        dec_points[num_points] = dec_points[num_points - 1];
 2193|  1.44k|      }
 2194|  1.69k|      else if (bytes_per_point == 2) {
  ------------------
  |  Branch (2194:16): [True: 851, False: 847]
  ------------------
 2195|    851|        ui16* sp = (ui16*)marker_points;
 2196|    851|        float* dp = dec_points;
 2197|  23.4k|        for (ui32 i = 0; i < num_points; ++i)
  ------------------
  |  Branch (2197:26): [True: 22.5k, False: 851]
  ------------------
 2198|  22.5k|          *dp++ = *sp++ * divider;
 2199|    851|        dec_points[-1] = dec_points[0];
 2200|    851|        dec_points[num_points] = dec_points[num_points - 1];
 2201|    851|      }
 2202|    847|      else if (bytes_per_point == 4) {
  ------------------
  |  Branch (2202:16): [True: 847, False: 0]
  ------------------
 2203|    847|        ui32* sp = (ui32*)marker_points;
 2204|    847|        float* dp = dec_points;
 2205|  58.5k|        for (ui32 i = 0; i < num_points; ++i)
  ------------------
  |  Branch (2205:26): [True: 57.6k, False: 847]
  ------------------
 2206|  57.6k|          *dp++ = (float)*sp++ * divider;
 2207|    847|        dec_points[-1] = dec_points[0];
 2208|    847|        dec_points[num_points] = dec_points[num_points - 1];
 2209|    847|      }
 2210|      0|      else
 2211|       |        assert(0);
 2212|  3.14k|    }
_ZNK4ojph5local9param_nlt20find_unsupported_nltERKNS0_9param_sizERKNS0_9param_codE:
 2349|  7.06k|    {
 2350|  7.06k|      ui32 num_comps = siz.get_num_components();
 2351|  28.0k|      for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (2351:24): [True: 20.9k, False: 7.05k]
  ------------------
 2352|  20.9k|      {
 2353|  20.9k|        const nlt_rec* rec = get_nlt_rec(c);
 2354|  20.9k|        if (rec == NULL)
  ------------------
  |  Branch (2354:13): [True: 13.7k, False: 7.19k]
  ------------------
 2355|  13.7k|          continue;
 2356|  7.19k|        ui8 type = rec->get_type();
 2357|       |        // the LUT style nonlinearities are implemented for the irreversible
 2358|       |        // (9/7) wavelet only
 2359|  7.19k|        if ((type == nonlinearity::OJPH_NLT_LUT_STYLE_NLT ||
  ------------------
  |  Branch (2359:14): [True: 1.66k, False: 5.53k]
  ------------------
 2360|  5.53k|             type == nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_PLUS_LUT) &&
  ------------------
  |  Branch (2360:14): [True: 1.71k, False: 3.82k]
  ------------------
 2361|  3.37k|            cod.get_coc(c)->is_reversible())
  ------------------
  |  Branch (2361:13): [True: 17, False: 3.35k]
  ------------------
 2362|     17|          return (int)c;
 2363|  7.19k|      }
 2364|  7.05k|      return -1;
 2365|  7.06k|    }
_ZN4ojph5local9param_nlt4readEPNS_11infile_baseE:
 2720|  4.79k|    {
 2721|  4.79k|      ui16 buf2_len;
 2722|  4.79k|      ui16 buf2_comp;
 2723|  4.79k|      ui8  buf1_BDnlt;
 2724|  4.79k|      ui8  buf1_Tnlt;
 2725|  4.79k|      bool result = true;
 2726|       |
 2727|  4.79k|      result &= file->read(&buf2_len, sizeof(ui16)) == sizeof(ui16);
 2728|  4.79k|      result &= file->read(&buf2_comp, sizeof(ui16)) == sizeof(ui16);
 2729|  4.79k|      result &= file->read(&buf1_BDnlt, sizeof(ui8)) == sizeof(ui8);
 2730|  4.79k|      result &= file->read(&buf1_Tnlt, sizeof(ui8)) == sizeof(ui8);
 2731|       |
 2732|  4.79k|      if (buf1_Tnlt != nonlinearity::OJPH_NLT_NO_NLT &&
  ------------------
  |  Branch (2732:11): [True: 4.10k, False: 689]
  ------------------
 2733|  4.10k|        buf1_Tnlt != nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT &&
  ------------------
  |  Branch (2733:9): [True: 3.25k, False: 853]
  ------------------
 2734|  3.25k|        buf1_Tnlt != nonlinearity::OJPH_NLT_LUT_STYLE_NLT &&
  ------------------
  |  Branch (2734:9): [True: 2.83k, False: 421]
  ------------------
 2735|  2.83k|        buf1_Tnlt != nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_PLUS_LUT)
  ------------------
  |  Branch (2735:9): [True: 19, False: 2.81k]
  ------------------
 2736|     19|        OJPH_ERROR(0x00050141, "Unsupported nonlinearity type in an "
  ------------------
  |  |  289|     19|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     19|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 19, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2737|  4.79k|          "NLT marker segment, with a value of", buf1_Tnlt);
 2738|       |
 2739|  4.79k|      ui16 length = swap_bytes_if_le(buf2_len);
 2740|  4.79k|      if (buf1_Tnlt == nonlinearity::OJPH_NLT_NO_NLT ||
  ------------------
  |  Branch (2740:11): [True: 708, False: 4.08k]
  ------------------
 2741|  4.08k|        buf1_Tnlt == nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT)
  ------------------
  |  Branch (2741:9): [True: 853, False: 3.23k]
  ------------------
 2742|  1.54k|      {
 2743|  1.54k|        if (length != 6)
  ------------------
  |  Branch (2743:13): [True: 23, False: 1.51k]
  ------------------
 2744|     23|          OJPH_ERROR(0x00050142, "Somethins is wrong with this NLT "
  ------------------
  |  |  289|     23|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     23|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 23, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2745|  1.54k|            "marker segment -- it has an incorrect length of %d",
 2746|  1.54k|            length);
 2747|  1.54k|      }
 2748|       |
 2749|  4.79k|      ui16 comp = swap_bytes_if_le(buf2_comp);
 2750|  4.79k|      if (comp > 16383 && comp != special_comp_num::ALL_COMPS)
  ------------------
  |  Branch (2750:11): [True: 713, False: 4.08k]
  |  Branch (2750:27): [True: 31, False: 682]
  ------------------
 2751|     31|        OJPH_ERROR(0x00050143, "Something is wrong with this NLT "
  ------------------
  |  |  289|     31|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     31|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 31, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2752|  4.79k|          "marker segment -- it has an incorrect component index of %d",
 2753|  4.79k|          comp);
 2754|       |
 2755|  4.79k|      param_nlt* p = get_nlt_object(comp);
 2756|  4.79k|      if (p == NULL)
  ------------------
  |  Branch (2756:11): [True: 897, False: 3.89k]
  ------------------
 2757|    897|        p = add_object(comp);
 2758|  4.79k|      p->enabled = true;
 2759|  4.79k|      p->Cnlt = comp;
 2760|  4.79k|      p->rec.BDnlt = buf1_BDnlt;
 2761|  4.79k|      if ((buf1_BDnlt & 0x7F) + 1 > 38)
  ------------------
  |  Branch (2761:11): [True: 8, False: 4.78k]
  ------------------
 2762|      8|        OJPH_ERROR(0x00050144, "The NLT marker segment has an invalid bit "
  ------------------
  |  |  289|      8|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      8|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2763|  4.79k|          "depth of %d", (buf1_BDnlt & 0x7F) + 1);
 2764|  4.79k|      p->rec.Tnlt = buf1_Tnlt;
 2765|       |
 2766|  4.79k|      if (buf1_Tnlt == nonlinearity::OJPH_NLT_LUT_STYLE_NLT ||
  ------------------
  |  Branch (2766:11): [True: 495, False: 4.29k]
  ------------------
 2767|  4.29k|        buf1_Tnlt == nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_PLUS_LUT)
  ------------------
  |  Branch (2767:9): [True: 2.80k, False: 1.49k]
  ------------------
 2768|  3.21k|      {
 2769|  3.21k|        ui16 buf2_num_points;
 2770|  3.21k|        ui32 buf4_d_min, buf4_d_max;
 2771|  3.21k|        ui8 buf_pt_val;
 2772|       |
 2773|  3.21k|        result &= file->read(&buf2_num_points, sizeof(ui16)) == sizeof(ui16);
 2774|  3.21k|        result &= file->read(&buf4_d_min, sizeof(ui32)) == sizeof(ui32);
 2775|  3.21k|        result &= file->read(&buf4_d_max, sizeof(ui32)) == sizeof(ui32);
 2776|  3.21k|        result &= file->read(&buf_pt_val, sizeof(ui8)) == sizeof(ui8);
 2777|       |
 2778|  3.21k|        buf2_num_points = swap_bytes_if_le(buf2_num_points);
 2779|  3.21k|        buf4_d_min = swap_bytes_if_le(buf4_d_min);
 2780|  3.21k|        buf4_d_max = swap_bytes_if_le(buf4_d_max);
 2781|       |
 2782|  3.21k|        if (buf2_num_points < 1 || buf2_num_points > 8191)
  ------------------
  |  Branch (2782:13): [True: 5, False: 3.21k]
  |  Branch (2782:36): [True: 16, False: 3.19k]
  ------------------
 2783|     21|          OJPH_ERROR(0x00050145, "The NLT marker segment has an invalid "
  ------------------
  |  |  289|     21|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     21|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2784|  3.21k|            "number of points field", buf2_num_points);
 2785|  3.21k|        if (buf4_d_min >= buf4_d_max)
  ------------------
  |  Branch (2785:13): [True: 38, False: 3.18k]
  ------------------
 2786|     38|          OJPH_ERROR(0x00050146, "In an NLT marker segment, Dmin must smaller "
  ------------------
  |  |  289|     38|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     38|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 38, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2787|  3.21k|            "than Dmax; here we have %d and %d", buf4_d_min, buf4_d_max);
 2788|  3.21k|        if (buf_pt_val == 0 || buf_pt_val > 32)
  ------------------
  |  Branch (2788:13): [True: 66, False: 3.15k]
  |  Branch (2788:32): [True: 11, False: 3.14k]
  ------------------
 2789|     18|          OJPH_ERROR(0x00050147, "In an NLT marker segment, the value of "
  ------------------
  |  |  289|     18|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     18|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 18, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2790|  3.21k|            "pt_val must be larger than 0 and smaller or equal to 32; "
 2791|  3.21k|            "here, we have %d", buf_pt_val);
 2792|       |
 2793|  3.21k|        p->rec.num_points = buf2_num_points + 1;
 2794|  3.21k|        p->rec.d_min = buf4_d_min;
 2795|  3.21k|        p->rec.d_max = buf4_d_max;
 2796|  3.21k|        p->rec.pt_val = buf_pt_val;
 2797|  3.21k|        p->rec.bytes_per_point = p->rec.get_bpp(buf_pt_val);
 2798|       |
 2799|       |        // read the points
 2800|  3.21k|        ui32 len = p->rec.cal_store_size_for_decoding();
 2801|  3.21k|        if (p->rec.store_size < len)
  ------------------
  |  Branch (2801:13): [True: 468, False: 2.75k]
  ------------------
 2802|    468|        {
 2803|    468|          if (p->rec.points_store)
  ------------------
  |  Branch (2803:15): [True: 38, False: 430]
  ------------------
 2804|     38|            delete[] (ui8*)p->rec.points_store;
 2805|    468|          p->rec.store_size = 0;
 2806|    468|          p->rec.points_store = new (std::nothrow) ui8[len];
 2807|    468|          if (p->rec.points_store == NULL)
  ------------------
  |  Branch (2807:15): [True: 0, False: 468]
  ------------------
 2808|      0|            OJPH_ERROR(0x00050148, "Failed to allocated memory");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2809|    468|          p->rec.store_size = len;
 2810|    468|        }
 2811|  3.21k|        p->rec.assign_pointers_for_decoding();
 2812|       |
 2813|  3.21k|        if (p->rec.bytes_per_point == 1)
  ------------------
  |  Branch (2813:13): [True: 1.44k, False: 1.77k]
  ------------------
 2814|  1.44k|          result &=
 2815|  1.44k|            file->read(p->rec.marker_points, p->rec.num_points)
 2816|  1.44k|              == p->rec.num_points;
 2817|  1.77k|        else if (p->rec.bytes_per_point == 2)
  ------------------
  |  Branch (2817:18): [True: 851, False: 924]
  ------------------
 2818|    851|        {
 2819|    851|          ui16 buf2;
 2820|    851|          char* dp = (char*)p->rec.marker_points;
 2821|  23.4k|          for (ui32 i = 0; i < p->rec.num_points; ++i, dp += 2)
  ------------------
  |  Branch (2821:28): [True: 22.5k, False: 851]
  ------------------
 2822|  22.5k|          {
 2823|  22.5k|            result &= file->read(&buf2, sizeof(ui16)) == sizeof(ui16);
 2824|  22.5k|            buf2 = swap_bytes_if_le(buf2);
 2825|  22.5k|            memcpy(dp, &buf2, 2); // not to violate strict aliasing
 2826|  22.5k|          }
 2827|    851|        }
 2828|    924|        else
 2829|    924|        {
 2830|    924|          ui32 buf4;
 2831|    924|          char* dp = (char*)p->rec.marker_points;
 2832|  58.5k|          for (ui32 i = 0; i < p->rec.num_points; ++i, dp += 4)
  ------------------
  |  Branch (2832:28): [True: 57.6k, False: 924]
  ------------------
 2833|  57.6k|          {
 2834|  57.6k|            result &= file->read(&buf4, sizeof(ui32)) == sizeof(ui32);
 2835|  57.6k|            buf4 = swap_bytes_if_le(buf4);
 2836|  57.6k|            memcpy(dp, &buf4, 4); // not to violate strict aliasing
 2837|  57.6k|          }
 2838|    924|        }
 2839|  3.21k|        p->rec.prepare_for_decoding();
 2840|  3.21k|      }
 2841|       |
 2842|  4.79k|      return result;
 2843|  4.79k|    }
_ZNK4ojph5local9param_nlt11get_nlt_recEj:
 2847|  1.14M|    {
 2848|  1.14M|      assert(Cnlt == special_comp_num::ALL_COMPS);
 2849|  1.14M|      const param_nlt* p = get_nlt_object(comp_num);
 2850|  1.14M|      if (p && p->enabled)
  ------------------
  |  Branch (2850:11): [True: 110k, False: 1.03M]
  |  Branch (2850:16): [True: 110k, False: 0]
  ------------------
 2851|   110k|        return &p->rec;
 2852|  1.03M|      else if (this->enabled)
  ------------------
  |  Branch (2852:16): [True: 7.32k, False: 1.02M]
  ------------------
 2853|  7.32k|        return &this->rec;
 2854|  1.02M|      else
 2855|  1.02M|        return NULL;
 2856|  1.14M|    }
_ZN4ojph5local9param_nlt14get_nlt_objectEj:
 2860|  4.72k|    {
 2861|       |      // cast object to constant
 2862|  4.72k|      const param_nlt* const_p = const_cast<const param_nlt*>(this);
 2863|       |      // call using the constant object, then cast to non-const
 2864|  4.72k|      return const_cast<param_nlt*>(const_p->get_nlt_object(comp_num));
 2865|  4.72k|    }
_ZNK4ojph5local9param_nlt14get_nlt_objectEj:
 2869|  1.14M|    {
 2870|       |      // top level must be ALL_COMPS; cannot call this functions from
 2871|       |      // non-top nlt
 2872|  1.14M|      assert(Cnlt == special_comp_num::ALL_COMPS);
 2873|       |
 2874|  1.14M|      const param_nlt* p = this;
 2875|  2.32M|      while (p && p->Cnlt != comp_num)
  ------------------
  |  Branch (2875:14): [True: 1.29M, False: 1.03M]
  |  Branch (2875:19): [True: 1.17M, False: 114k]
  ------------------
 2876|  1.17M|        p = p->next;
 2877|  1.14M|      return p;
 2878|  1.14M|    }
_ZN4ojph5local9param_nlt10add_objectEj:
 2882|    897|    {
 2883|    897|      assert(comp_num != special_comp_num::ALL_COMPS);
 2884|    897|      assert(Cnlt == special_comp_num::ALL_COMPS);      // top level
 2885|    897|      param_nlt* p = this;
 2886|  1.64k|      while (p->next != NULL) {
  ------------------
  |  Branch (2886:14): [True: 745, False: 897]
  ------------------
 2887|    745|        assert(p->Cnlt != comp_num);
 2888|    745|        p = p->next;
 2889|    745|      }
 2890|    897|      if (avail)
  ------------------
  |  Branch (2890:11): [True: 0, False: 897]
  ------------------
 2891|      0|      {
 2892|      0|        p->next = avail;
 2893|      0|        avail = avail->next;
 2894|      0|        p->next->init();
 2895|      0|      }
 2896|    897|      else
 2897|    897|        p->next = new param_nlt;
 2898|    897|      p = p->next;
 2899|    897|      p->Cnlt = (ui16)comp_num;
 2900|    897|      return p;
 2901|    897|    }
_ZN4ojph5local9param_sot4readEPNS_11infile_baseEb:
 2985|   239k|    {
 2986|   239k|      if (resilient)
  ------------------
  |  Branch (2986:11): [True: 239k, False: 0]
  ------------------
 2987|   239k|      {
 2988|   239k|        if (file->read(&Lsot, 2) != 2)
  ------------------
  |  Branch (2988:13): [True: 623, False: 238k]
  ------------------
 2989|    623|        {
 2990|    623|          OJPH_INFO(0x00050091, "error reading SOT marker");
  ------------------
  |  |  285|    623|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    623|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 623, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2991|    623|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2992|    623|          return false;
 2993|    623|        }
 2994|   238k|        Lsot = swap_bytes_if_le(Lsot);
 2995|   238k|        if (Lsot != 10)
  ------------------
  |  Branch (2995:13): [True: 7.83k, False: 230k]
  ------------------
 2996|  7.83k|        {
 2997|  7.83k|          OJPH_INFO(0x00050092, "error in SOT length");
  ------------------
  |  |  285|  7.83k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  7.83k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7.83k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2998|  7.83k|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2999|  7.83k|          return false;
 3000|  7.83k|        }
 3001|   230k|        if (file->read(&Isot, 2) != 2)
  ------------------
  |  Branch (3001:13): [True: 66, False: 230k]
  ------------------
 3002|     66|        {
 3003|     66|          OJPH_INFO(0x00050093, "error reading tile index");
  ------------------
  |  |  285|     66|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     66|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 66, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3004|     66|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 3005|     66|          return false;
 3006|     66|        }
 3007|   230k|        Isot = swap_bytes_if_le(Isot);
 3008|   230k|        if (Isot == 0xFFFF)
  ------------------
  |  Branch (3008:13): [True: 368, False: 230k]
  ------------------
 3009|    368|        {
 3010|    368|          OJPH_INFO(0x00050094, "tile index in SOT marker cannot be 0xFFFF");
  ------------------
  |  |  285|    368|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    368|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 368, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3011|    368|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 3012|    368|          return false;
 3013|    368|        }
 3014|   230k|        if (file->read(&Psot, 4) != 4)
  ------------------
  |  Branch (3014:13): [True: 106, False: 230k]
  ------------------
 3015|    106|        {
 3016|    106|          OJPH_INFO(0x00050095, "error reading SOT marker");
  ------------------
  |  |  285|    106|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    106|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 106, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3017|    106|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 3018|    106|          return false;
 3019|    106|        }
 3020|   230k|        Psot = swap_bytes_if_le(Psot);
 3021|   230k|        if (file->read(&TPsot, 1) != 1)
  ------------------
  |  Branch (3021:13): [True: 20, False: 230k]
  ------------------
 3022|     20|        {
 3023|     20|          OJPH_INFO(0x00050096, "error reading SOT marker");
  ------------------
  |  |  285|     20|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     20|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3024|     20|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 3025|     20|          return false;
 3026|     20|        }
 3027|   230k|        if (file->read(&TNsot, 1) != 1)
  ------------------
  |  Branch (3027:13): [True: 16, False: 230k]
  ------------------
 3028|     16|        {
 3029|     16|          OJPH_INFO(0x00050097, "error reading SOT marker");
  ------------------
  |  |  285|     16|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3030|     16|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 3031|     16|          return false;
 3032|     16|        }
 3033|   230k|      }
 3034|      0|      else
 3035|      0|      {
 3036|      0|        if (file->read(&Lsot, 2) != 2)
  ------------------
  |  Branch (3036:13): [True: 0, False: 0]
  ------------------
 3037|      0|          OJPH_ERROR(0x00050091, "error reading SOT marker");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3038|      0|        Lsot = swap_bytes_if_le(Lsot);
 3039|      0|        if (Lsot != 10)
  ------------------
  |  Branch (3039:13): [True: 0, False: 0]
  ------------------
 3040|      0|          OJPH_ERROR(0x00050092, "error in SOT length");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3041|      0|        if (file->read(&Isot, 2) != 2)
  ------------------
  |  Branch (3041:13): [True: 0, False: 0]
  ------------------
 3042|      0|          OJPH_ERROR(0x00050093, "error reading SOT tile index");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3043|      0|        Isot = swap_bytes_if_le(Isot);
 3044|      0|        if (Isot == 0xFFFF)
  ------------------
  |  Branch (3044:13): [True: 0, False: 0]
  ------------------
 3045|      0|          OJPH_ERROR(0x00050094, "tile index in SOT marker cannot be 0xFFFF");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3046|      0|        if (file->read(&Psot, 4) != 4)
  ------------------
  |  Branch (3046:13): [True: 0, False: 0]
  ------------------
 3047|      0|          OJPH_ERROR(0x00050095, "error reading SOT marker");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3048|      0|        Psot = swap_bytes_if_le(Psot);
 3049|      0|        if (file->read(&TPsot, 1) != 1)
  ------------------
  |  Branch (3049:13): [True: 0, False: 0]
  ------------------
 3050|      0|          OJPH_ERROR(0x00050096, "error reading SOT marker");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3051|      0|        if (file->read(&TNsot, 1) != 1)
  ------------------
  |  Branch (3051:13): [True: 0, False: 0]
  ------------------
 3052|      0|          OJPH_ERROR(0x00050097, "error reading SOT marker");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3053|      0|      }
 3054|   230k|      return true;
 3055|   239k|    }
_ZNK4ojph5local9param_dfs7get_dfsEi:
 3134|  1.36M|    {
 3135|  1.36M|      const param_dfs* p = this;
 3136|  1.39M|      while (p && p->Sdfs != index)
  ------------------
  |  Branch (3136:14): [True: 1.39M, False: 4]
  |  Branch (3136:19): [True: 34.2k, False: 1.36M]
  ------------------
 3137|  34.2k|        p = p->next;
 3138|  1.36M|      return p;
 3139|  1.36M|    }
_ZNK4ojph5local9param_dfs12get_dwt_typeEj:
 3143|  2.28M|    {
 3144|  2.28M|      decomp_level = ojph_min(decomp_level, Ids);
  ------------------
  |  |   76|  2.28M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 1.44M, False: 844k]
  |  |  ------------------
  ------------------
 3145|  2.28M|      ui32 d = decomp_level - 1;          // decomp_level starts from 1
 3146|  2.28M|      ui32 idx = d >> 2;                  // complete bytes
 3147|  2.28M|      ui32 bits = d & 0x3;                // bit within the bytes
 3148|  2.28M|      ui32 val = (Ddfs[idx] >> (6 - 2 * bits)) & 0x3;
 3149|  2.28M|      return (dfs_dwt_type)val;
 3150|  2.28M|    }
_ZNK4ojph5local9param_dfs15get_subband_idxEjjj:
 3155|   593k|    {
 3156|   593k|      assert((resolution == 0 && subband == 0) ||
 3157|   593k|              (resolution > 0 && subband > 0 && subband < 4));
 3158|       |
 3159|   593k|      ui32 ns[4] = { 0, 3, 1, 1 };
 3160|       |
 3161|   593k|      ui32 idx = 0;
 3162|   593k|      if (resolution > 0)
  ------------------
  |  Branch (3162:11): [True: 505k, False: 88.2k]
  ------------------
 3163|   505k|      {
 3164|   505k|        idx = 0;
 3165|   505k|        ui32 i = 1;
 3166|  1.27M|        for (; i < resolution; ++i)
  ------------------
  |  Branch (3166:16): [True: 771k, False: 505k]
  ------------------
 3167|   771k|          idx += ns[get_dwt_type(num_decompositions - i + 1)];
 3168|   505k|        dfs_dwt_type t = get_dwt_type(num_decompositions - i + 1);
 3169|   505k|        idx += subband;
 3170|   505k|        if (t == VERT_DWT && subband == 2)
  ------------------
  |  Branch (3170:13): [True: 155k, False: 350k]
  |  Branch (3170:30): [True: 155k, False: 0]
  ------------------
 3171|   155k|          --idx;
 3172|   505k|      }
 3173|       |
 3174|   593k|      return idx;
 3175|   593k|    }
_ZNK4ojph5local9param_dfs16get_res_downsampEj:
 3179|  67.8k|    {
 3180|  67.8k|      point factor(1, 1);
 3181|  67.8k|      ui32 decomp_level = 1;
 3182|   281k|      while (skipped_resolutions > 0)
  ------------------
  |  Branch (3182:14): [True: 214k, False: 67.8k]
  ------------------
 3183|   214k|      {
 3184|   214k|        param_dfs::dfs_dwt_type type = get_dwt_type(decomp_level);
 3185|   214k|        if (type == BIDIR_DWT)
  ------------------
  |  Branch (3185:13): [True: 43.3k, False: 170k]
  ------------------
 3186|  43.3k|        { factor.x *= 2; factor.y *= 2; }
 3187|   170k|        else if (type == HORZ_DWT)
  ------------------
  |  Branch (3187:18): [True: 43.2k, False: 127k]
  ------------------
 3188|  43.2k|          factor.x *= 2;
 3189|   127k|        else if (type == VERT_DWT)
  ------------------
  |  Branch (3189:18): [True: 92.3k, False: 34.9k]
  ------------------
 3190|  92.3k|          factor.y *= 2;
 3191|       |
 3192|   214k|        ++decomp_level;
 3193|   214k|        --skipped_resolutions;
 3194|   214k|      }
 3195|  67.8k|      return factor;
 3196|  67.8k|    }
_ZN4ojph5local9param_dfs4readEPNS_11infile_baseE:
 3200|  1.31M|    {
 3201|  1.31M|      if (Ldfs != 0) { // this param_dfs is used
  ------------------
  |  Branch (3201:11): [True: 656k, False: 657k]
  ------------------
 3202|   656k|        param_dfs* p = this;
 3203|  9.56G|        while (p->next != NULL)
  ------------------
  |  Branch (3203:16): [True: 9.56G, False: 656k]
  ------------------
 3204|  9.56G|          p = p->next;
 3205|   656k|        if (avail)
  ------------------
  |  Branch (3205:13): [True: 0, False: 656k]
  ------------------
 3206|      0|        {
 3207|      0|          p->next = avail;
 3208|      0|          avail = avail->next;
 3209|      0|          p->next->init();
 3210|      0|        }
 3211|   656k|        else
 3212|   656k|          p->next = new param_dfs;
 3213|   656k|        p = p->next;
 3214|   656k|        return p->read(file);
 3215|   656k|      }
 3216|       |
 3217|   657k|      if (file->read(&Ldfs, 2) != 2)
  ------------------
  |  Branch (3217:11): [True: 9, False: 657k]
  ------------------
 3218|      9|        OJPH_ERROR(0x000500D1, "error reading DFS-Ldfs parameter");
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3219|   657k|      Ldfs = swap_bytes_if_le(Ldfs);
 3220|   657k|      if (file->read(&Sdfs, 2) != 2)
  ------------------
  |  Branch (3220:11): [True: 24, False: 656k]
  ------------------
 3221|     24|        OJPH_ERROR(0x000500D2, "error reading DFS-Sdfs parameter");
  ------------------
  |  |  289|     24|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     24|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 24, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3222|   657k|      Sdfs = swap_bytes_if_le(Sdfs);
 3223|   657k|      if (Sdfs > 15)
  ------------------
  |  Branch (3223:11): [True: 41, False: 656k]
  ------------------
 3224|     41|        OJPH_ERROR(0x000500D3, "The DFS-Sdfs parameter is %d, which is "
  ------------------
  |  |  289|     41|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     41|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 41, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3225|   657k|          "larger than the permissible 15", Sdfs);
 3226|   657k|      ui8 t, l_Ids = 0;
 3227|   657k|      if (file->read(&l_Ids, 1) != 1)
  ------------------
  |  Branch (3227:11): [True: 16, False: 656k]
  ------------------
 3228|     16|        OJPH_ERROR(0x000500D4, "error reading DFS-Ids parameter");
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3229|   657k|      if (l_Ids == 0)
  ------------------
  |  Branch (3229:11): [True: 5, False: 657k]
  ------------------
 3230|      5|        OJPH_ERROR(0x000500D8,
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3231|   657k|          "The value of the Ids member in the DFS marker segment cannot be 0");
 3232|   657k|      constexpr int max_Ddfs = sizeof(Ddfs) * 4;
 3233|   657k|      if (l_Ids > max_Ddfs)
  ------------------
  |  Branch (3233:11): [True: 2.68k, False: 654k]
  ------------------
 3234|  2.68k|        OJPH_INFO(0x000500D5, "The DFS-Ids parameter is %d; while this is "
  ------------------
  |  |  285|  2.68k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  2.68k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2.68k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3235|   657k|          "valid, the number is unnessarily large -- you do not need more "
 3236|   657k|          "than %d.  Please contact me regarding this issue.",
 3237|   657k|          l_Ids, max_Ddfs);
 3238|   657k|      Ids = l_Ids < max_Ddfs ? l_Ids : max_Ddfs;
  ------------------
  |  Branch (3238:13): [True: 654k, False: 2.83k]
  ------------------
 3239|  1.42M|      for (int i = 0; i < Ids; i += 4)
  ------------------
  |  Branch (3239:23): [True: 766k, False: 657k]
  ------------------
 3240|   766k|        if (file->read(&Ddfs[i / 4], 1) != 1)
  ------------------
  |  Branch (3240:13): [True: 24, False: 766k]
  ------------------
 3241|     24|          OJPH_ERROR(0x000500D6, "error reading DFS-Ddfs parameters");
  ------------------
  |  |  289|   657k|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     24|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 24, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3242|   674k|      for (int i = Ids; i < l_Ids; i += 4)
  ------------------
  |  Branch (3242:25): [True: 17.6k, False: 657k]
  ------------------
 3243|  17.6k|        if (file->read(&t, 1) != 1)
  ------------------
  |  Branch (3243:13): [True: 16, False: 17.6k]
  ------------------
 3244|     16|          OJPH_ERROR(0x000500D7, "error reading DFS-Ddfs parameters");
  ------------------
  |  |  289|   657k|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3245|   657k|      return true;
 3246|  1.31M|    }
_ZN4ojph5local9param_atk7get_atkEi:
 3258|  8.12k|    {
 3259|  8.12k|      assert(top_atk == NULL);
 3260|       |
 3261|  8.12k|      if (Latk == 0)
  ------------------
  |  Branch (3261:11): [True: 7.01k, False: 1.11k]
  ------------------
 3262|  7.01k|      {
 3263|       |        // This atk object is not used, initialize it to either 0 (irv97)
 3264|       |        // or 1 (rev53), and use it.  If index is not 0 nor 1, then index
 3265|       |        // must have been read from file previously, otherwise it is an
 3266|       |        // error.
 3267|  7.01k|        if (index == 0) { this->init_irv97(); return this; }
  ------------------
  |  Branch (3267:13): [True: 2.09k, False: 4.91k]
  ------------------
 3268|  4.91k|        else if (index == 1) { this->init_rev53(); return this; }
  ------------------
  |  Branch (3268:18): [True: 4.91k, False: 9]
  ------------------
 3269|  7.01k|      }
 3270|       |
 3271|  1.12k|      param_atk* p = this;
 3272|  3.20k|      while (p && p->get_index() != index)
  ------------------
  |  Branch (3272:14): [True: 2.67k, False: 531]
  |  Branch (3272:19): [True: 2.08k, False: 591]
  ------------------
 3273|  2.08k|        p = p->next;
 3274|       |
 3275|  1.12k|      if (p == NULL && (index == 0 || index == 1))
  ------------------
  |  Branch (3275:11): [True: 531, False: 591]
  |  Branch (3275:25): [True: 78, False: 453]
  |  Branch (3275:39): [True: 216, False: 237]
  ------------------
 3276|    294|      {
 3277|       |        // The index was not found, add an atk object only if the index is
 3278|       |        // either 0 or 1
 3279|    294|        p = add_object();
 3280|    294|        if (index == 0)
  ------------------
  |  Branch (3280:13): [True: 78, False: 216]
  ------------------
 3281|     78|          p->init_irv97();
 3282|    216|        else if (index == 1)
  ------------------
  |  Branch (3282:18): [True: 216, False: 0]
  ------------------
 3283|    216|          p->init_rev53();
 3284|    294|      }
 3285|       |
 3286|  1.12k|      return p;
 3287|  8.12k|    }
_ZN4ojph5local9param_atk16read_coefficientEPNS_11infile_baseERfRi:
 3291|  1.99k|    {
 3292|  1.99k|      int coeff_type = get_coeff_type();
 3293|  1.99k|      if (coeff_type == 0) { // 8bit
  ------------------
  |  Branch (3293:11): [True: 494, False: 1.49k]
  ------------------
 3294|    494|        ui8 v;
 3295|    494|        if (file->read(&v, 1) != 1) return false;
  ------------------
  |  Branch (3295:13): [True: 5, False: 489]
  ------------------
 3296|    489|        bytes -= 1;
 3297|    489|        K = v;
 3298|    489|      }
 3299|  1.49k|      else if (coeff_type == 1) { // 16bit
  ------------------
  |  Branch (3299:16): [True: 242, False: 1.25k]
  ------------------
 3300|    242|        ui16 v;
 3301|    242|        if (file->read(&v, 2) != 2) return false;
  ------------------
  |  Branch (3301:13): [True: 3, False: 239]
  ------------------
 3302|    239|        bytes -= 2;
 3303|    239|        K = swap_bytes_if_le(v);
 3304|    239|      }
 3305|  1.25k|      else if (coeff_type == 2) { // float
  ------------------
  |  Branch (3305:16): [True: 534, False: 723]
  ------------------
 3306|    534|        ui32 i;
 3307|    534|        if (file->read(&i, sizeof(ui32)) != sizeof(ui32)) return false;
  ------------------
  |  Branch (3307:13): [True: 5, False: 529]
  ------------------
 3308|    529|        bytes -= 4;
 3309|    529|        i = swap_bytes_if_le(i);
 3310|    529|        float f;
 3311|    529|        memcpy(&f, &i, sizeof(float));
 3312|    529|        K = f;
 3313|    529|      }
 3314|    723|      else if (coeff_type == 3) { // double
  ------------------
  |  Branch (3314:16): [True: 205, False: 518]
  ------------------
 3315|    205|        ui64 i;
 3316|    205|        if (file->read(&i, sizeof(ui64)) != sizeof(ui64)) return false;
  ------------------
  |  Branch (3316:13): [True: 7, False: 198]
  ------------------
 3317|    198|        bytes -= 8;
 3318|    198|        i = swap_bytes_if_le(i);
 3319|    198|        double d;
 3320|    198|        memcpy(&d, &i, sizeof(double));
 3321|    198|        K = (float)d;
 3322|    198|      }
 3323|    518|      else if (coeff_type == 4) { // 128 bit float
  ------------------
  |  Branch (3323:16): [True: 208, False: 310]
  ------------------
 3324|    208|        ui64 v, v1;
 3325|    208|        if (file->read(&v, 8) != 8) return false;
  ------------------
  |  Branch (3325:13): [True: 5, False: 203]
  ------------------
 3326|    203|        bytes -= 8;
 3327|    203|        if (file->read(&v1, 8) != 8) return false; // v1 not needed
  ------------------
  |  Branch (3327:13): [True: 1, False: 202]
  ------------------
 3328|    202|        bytes -= 8;
 3329|    202|        v = swap_bytes_if_le(v);
 3330|       |
 3331|       |        // convert the MSB of 128b float to 32b float
 3332|       |        // 32b float has 1 sign bit, 8 exponent (offset 127), 23 mantissa
 3333|       |        // 128b float has 1 sign bit, 15 exponent (offset 16383), 112 mantissa
 3334|    202|        si32 e = (si32)((v >> 48) & 0x7FFF);   // exponent
 3335|    202|        e -= 16383;
 3336|    202|        e += 127;
 3337|    202|        e = e & 0xFF;                          // removes MSBs if negative
 3338|    202|        e <<= 23;                              // move bits to their location
 3339|    202|        ui32 i = 0;
 3340|    202|        i |= ((ui32)(v >> 32) & 0x80000000); // copy sign bit
 3341|    202|        i |= (ui32)e;                        // copy exponent
 3342|    202|        i |= (ui32)((v >> 25) & 0x007FFFFF); // copy 23 mantissa
 3343|    202|        float f;
 3344|    202|        memcpy(&f, &i, sizeof(float));
 3345|    202|        K = f;
 3346|    202|      }
 3347|  1.96k|      return true;
 3348|  1.99k|    }
_ZN4ojph5local9param_atk16read_coefficientEPNS_11infile_baseERsRi:
 3353|    810|    {
 3354|    810|      int coeff_type = get_coeff_type();
 3355|    810|      if (coeff_type == 0) {
  ------------------
  |  Branch (3355:11): [True: 590, False: 220]
  ------------------
 3356|    590|        si8 v;
 3357|    590|        if (file->read(&v, 1) != 1) return false;
  ------------------
  |  Branch (3357:13): [True: 5, False: 585]
  ------------------
 3358|    585|        bytes -= 1;
 3359|    585|        K = v;
 3360|    585|      }
 3361|    220|      else if (coeff_type == 1) {
  ------------------
  |  Branch (3361:16): [True: 220, False: 0]
  ------------------
 3362|    220|        si16 v;
 3363|    220|        if (file->read(&v, 2) != 2) return false;
  ------------------
  |  Branch (3363:13): [True: 2, False: 218]
  ------------------
 3364|    218|        bytes -= 2;
 3365|    218|        K = (si16)swap_bytes_if_le((ui16)v);
 3366|    218|      }
 3367|      0|      else
 3368|      0|        return false;
 3369|    803|      return true;
 3370|    810|    }
_ZN4ojph5local9param_atk4readEPNS_11infile_baseE:
 3374|    801|    {
 3375|    801|      if (Latk != 0) // this param_atk is used
  ------------------
  |  Branch (3375:11): [True: 245, False: 556]
  ------------------
 3376|    245|        return add_object()->read(file);
 3377|       |
 3378|    556|      if (file->read(&Latk, 2) != 2)
  ------------------
  |  Branch (3378:11): [True: 6, False: 550]
  ------------------
 3379|      6|        OJPH_ERROR(0x000500E1, "error reading ATK-Latk parameter");
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3380|    556|      Latk = swap_bytes_if_le(Latk);
 3381|    556|      si32 bytes = Latk - 2;
 3382|    556|      ojph::ui16 temp_Satk;
 3383|    556|      if (file->read(&temp_Satk, 2) != 2)
  ------------------
  |  Branch (3383:11): [True: 4, False: 552]
  ------------------
 3384|      4|        OJPH_ERROR(0x000500E2, "error reading ATK-Satk parameter");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3385|    556|      bytes -= 2;
 3386|    556|      temp_Satk = swap_bytes_if_le(temp_Satk);
 3387|    556|      int tmp_idx = temp_Satk & 0xFF;
 3388|    556|      if ((top_atk && top_atk->get_atk(tmp_idx) != NULL)
  ------------------
  |  Branch (3388:12): [True: 238, False: 318]
  |  Branch (3388:23): [True: 11, False: 227]
  ------------------
 3389|    535|        || tmp_idx == 0 || tmp_idx == 1)
  ------------------
  |  Branch (3389:12): [True: 1, False: 534]
  |  Branch (3389:28): [True: 1, False: 533]
  ------------------
 3390|     13|        OJPH_ERROR(0x000500F3, "ATK-Satk parameter sets ATK marker index to "
  ------------------
  |  |  289|     13|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     13|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3391|    556|          "the illegal value of %d. ATK-Satk should be in (2-255) and, I "
 3392|    556|          "believe, must not be repeated; otherwise, it would be unclear "
 3393|    556|          "what marker segment must be employed when an index is repeated.",
 3394|    556|          tmp_idx);
 3395|    556|      Satk = temp_Satk;
 3396|    556|      if (is_m_init0() == false)  // only even-indexed is supported
  ------------------
  |  Branch (3396:11): [True: 7, False: 549]
  ------------------
 3397|      7|        OJPH_ERROR(0x000500E3, "ATK-Satk parameter sets m_init to 1, "
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3398|    556|          "requiring odd-indexed subsequence in first reconstruction step, "
 3399|    556|          "which is not supported yet.");
 3400|    556|      if (is_whole_sample() == false)  // ARB filter not supported
  ------------------
  |  Branch (3400:11): [True: 7, False: 549]
  ------------------
 3401|      7|        OJPH_ERROR(0x000500E4, "ATK-Satk parameter specified ARB filter, "
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3402|    556|          "which is not supported yet.");
 3403|    556|      if (is_reversible() && get_coeff_type() >= 2) // reversible & float
  ------------------
  |  Branch (3403:11): [True: 215, False: 341]
  |  Branch (3403:30): [True: 4, False: 211]
  ------------------
 3404|      4|        OJPH_ERROR(0x000500E5, "ATK-Satk parameter does not make sense. "
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3405|    556|          "It employs floats with reversible filtering.");
 3406|    556|      if (is_using_ws_extension() == false)  // only sym. ext is supported
  ------------------
  |  Branch (3406:11): [True: 1, False: 555]
  ------------------
 3407|      1|        OJPH_ERROR(0x000500E6, "ATK-Satk parameter requires constant "
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3408|    556|          "boundary extension, which is not supported yet.");
 3409|    556|      if (is_reversible() == false)
  ------------------
  |  Branch (3409:11): [True: 303, False: 253]
  ------------------
 3410|    303|        if (read_coefficient(file, Katk, bytes) == false)
  ------------------
  |  Branch (3410:13): [True: 14, False: 289]
  ------------------
 3411|     14|          OJPH_ERROR(0x000500E7, "error reading ATK-Katk parameter");
  ------------------
  |  |  289|     14|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     14|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3412|    556|      if (file->read(&Natk, 1) != 1)
  ------------------
  |  Branch (3412:11): [True: 12, False: 544]
  ------------------
 3413|     12|        OJPH_ERROR(0x000500E8, "error reading ATK-Natk parameter");
  ------------------
  |  |  289|     12|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     12|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3414|    556|      bytes -= 1;
 3415|    556|      if (Natk > max_steps) {
  ------------------
  |  Branch (3415:11): [True: 108, False: 448]
  ------------------
 3416|    108|        if (d != d_store) // was this allocated -- very unlikely
  ------------------
  |  Branch (3416:13): [True: 0, False: 108]
  ------------------
 3417|      0|          delete[] d;
 3418|    108|        d = new lifting_step[Natk];
 3419|    108|        max_steps = Natk;
 3420|    108|      }
 3421|       |
 3422|    556|      if (is_reversible())
  ------------------
  |  Branch (3422:11): [True: 209, False: 347]
  ------------------
 3423|    209|      {
 3424|  1.06k|        for (int s = 0; s < Natk; ++s)
  ------------------
  |  Branch (3424:25): [True: 851, False: 209]
  ------------------
 3425|    851|        {
 3426|    851|          if (file->read(&d[s].rev.Eatk, 1) != 1)
  ------------------
  |  Branch (3426:15): [True: 15, False: 836]
  ------------------
 3427|     15|            OJPH_ERROR(0x000500E9, "error reading ATK-Eatk parameter");
  ------------------
  |  |  289|     15|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     15|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3428|    851|          bytes -= 1;
 3429|    851|          if (file->read(&d[s].rev.Batk, 2) != 2)
  ------------------
  |  Branch (3429:15): [True: 8, False: 843]
  ------------------
 3430|      8|            OJPH_ERROR(0x000500EA, "error reading ATK-Batk parameter");
  ------------------
  |  |  289|      8|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      8|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3431|    851|          bytes -= 2;
 3432|    851|          d[s].rev.Batk = (si16)swap_bytes_if_le((ui16)d[s].rev.Batk);
 3433|    851|          ui8 LCatk;
 3434|    851|          if (file->read(&LCatk, 1) != 1)
  ------------------
  |  Branch (3434:15): [True: 8, False: 843]
  ------------------
 3435|      8|            OJPH_ERROR(0x000500EB, "error reading ATK-LCatk parameter");
  ------------------
  |  |  289|      8|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      8|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3436|    851|          bytes -= 1;
 3437|    851|          if (LCatk == 0)
  ------------------
  |  Branch (3437:15): [True: 3, False: 848]
  ------------------
 3438|      3|            OJPH_ERROR(0x000500EC, "Encountered a ATK-LCatk value of zero; "
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3439|    851|              "something is wrong.");
 3440|    851|          if (LCatk > 1)
  ------------------
  |  Branch (3440:15): [True: 7, False: 844]
  ------------------
 3441|      7|            OJPH_ERROR(0x000500ED, "ATK-LCatk value greater than 1; "
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3442|    851|              "that is, a multitap filter is not supported");
 3443|    851|          if (read_coefficient(file, d[s].rev.Aatk, bytes) == false)
  ------------------
  |  Branch (3443:15): [True: 7, False: 844]
  ------------------
 3444|      7|            OJPH_ERROR(0x000500EE, "Error reding ATK-Aatk parameter");
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3445|    851|        }
 3446|    209|      }
 3447|    347|      else
 3448|    347|      {
 3449|  2.08k|        for (int s = 0; s < Natk; ++s)
  ------------------
  |  Branch (3449:25): [True: 1.73k, False: 347]
  ------------------
 3450|  1.73k|        {
 3451|  1.73k|          ui8 LCatk;
 3452|  1.73k|          if (file->read(&LCatk, 1) != 1)
  ------------------
  |  Branch (3452:15): [True: 27, False: 1.71k]
  ------------------
 3453|     27|            OJPH_ERROR(0x000500EF, "error reading ATK-LCatk parameter");
  ------------------
  |  |  289|     27|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     27|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 27, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3454|  1.73k|          bytes -= 1;
 3455|  1.73k|          if (LCatk == 0)
  ------------------
  |  Branch (3455:15): [True: 5, False: 1.73k]
  ------------------
 3456|      5|            OJPH_ERROR(0x000500F0, "Encountered a ATK-LCatk value of zero; "
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3457|  1.73k|              "something is wrong.");
 3458|  1.73k|          if (LCatk > 1)
  ------------------
  |  Branch (3458:15): [True: 16, False: 1.72k]
  ------------------
 3459|     16|            OJPH_ERROR(0x000500F1, "ATK-LCatk value greater than 1; "
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3460|  1.73k|              "that is, a multitap filter is not supported.");
 3461|  1.73k|          if (read_coefficient(file, d[s].irv.Aatk, bytes) == false)
  ------------------
  |  Branch (3461:15): [True: 12, False: 1.72k]
  ------------------
 3462|     12|            OJPH_ERROR(0x000500F2, "Error reding ATK-Aatk parameter");
  ------------------
  |  |  289|     12|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     12|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3463|  1.73k|        }
 3464|    347|      }
 3465|    556|      if (bytes != 0)
  ------------------
  |  Branch (3465:11): [True: 30, False: 526]
  ------------------
 3466|     30|        OJPH_ERROR(0x000500F3, "The length of an ATK marker segment "
  ------------------
  |  |  289|     30|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     30|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 30, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3467|    556|          "(ATK-Latk) is not correct");
 3468|       |
 3469|    556|      return true;
 3470|    801|    }
_ZN4ojph5local9param_atk10init_irv97Ev:
 3474|  2.17k|    {
 3475|  2.17k|      Satk = 0x4a00;     // illegal because ATK = 0
 3476|  2.17k|      Katk = (float)1.230174104914001;
 3477|  2.17k|      Natk = 4;
 3478|       |      // next is (A-4) in T.801 second line
 3479|  2.17k|      Latk = (ui16)(5 + Natk + sizeof(float) * (1 + Natk));
 3480|  2.17k|      d[0].irv.Aatk = (float)0.443506852043971;
 3481|  2.17k|      d[1].irv.Aatk = (float)0.882911075530934;
 3482|  2.17k|      d[2].irv.Aatk = (float)-0.052980118572961;
 3483|  2.17k|      d[3].irv.Aatk = (float)-1.586134342059924;
 3484|  2.17k|    }
_ZN4ojph5local9param_atk10init_rev53Ev:
 3488|  5.12k|    {
 3489|  5.12k|      Satk = 0x5801;     // illegal because ATK = 1
 3490|  5.12k|      Natk = 2;
 3491|       |      // next is (A-4) in T.801 fourth line
 3492|  5.12k|      Latk = (ui16)(5 + 2 * Natk + sizeof(ui8) * (Natk + Natk));
 3493|  5.12k|      d[0].rev.Aatk = 1;
 3494|  5.12k|      d[0].rev.Batk = 2;
 3495|  5.12k|      d[0].rev.Eatk = 2;
 3496|  5.12k|      d[1].rev.Aatk = -1;
 3497|  5.12k|      d[1].rev.Batk = 1;
 3498|  5.12k|      d[1].rev.Eatk = 1;
 3499|  5.12k|    }
_ZN4ojph5local9param_atk10add_objectEv:
 3503|    539|    {
 3504|    539|      assert(top_atk == NULL);
 3505|    539|      param_atk *p = this;
 3506|  1.65k|      while (p->next != NULL)
  ------------------
  |  Branch (3506:14): [True: 1.11k, False: 539]
  ------------------
 3507|  1.11k|        p = p->next;
 3508|    539|      if (avail)
  ------------------
  |  Branch (3508:11): [True: 0, False: 539]
  ------------------
 3509|      0|      {
 3510|      0|        p->next = avail;
 3511|      0|        avail = avail->next;
 3512|      0|      }
 3513|    539|      else
 3514|    539|        p->next = new param_atk;
 3515|    539|      p = p->next;
 3516|    539|      p->init(this);
 3517|    539|      return p;
 3518|    539|    }

_ZN4ojph5local9param_sizC2Ev:
  177|  9.05k|      param_siz() { init(); }
_ZN4ojph5local9param_sizD2Ev:
  178|  9.05k|      ~param_siz() { destroy(); }
_ZN4ojph5local9param_siz4initEv:
  181|  9.05k|      {
  182|  9.05k|        Lsiz = Csiz = 0;
  183|  9.05k|        Xsiz = Ysiz = XOsiz = YOsiz = XTsiz = YTsiz = XTOsiz = YTOsiz = 0;
  184|  9.05k|        skipped_resolutions = 0;
  185|  9.05k|        memset(store, 0, sizeof(store));
  186|  9.05k|        ws_kern_support_needed = dfs_support_needed = false;
  187|  9.05k|        cod = NULL;
  188|       |        dfs = NULL;
  189|  9.05k|        Rsiz = RSIZ_HT_FLAG;
  190|  9.05k|        cptr = store;
  191|  9.05k|        old_Csiz = sizeof(store) / sizeof(siz_comp_info);
  192|  9.05k|      }
_ZN4ojph5local9param_siz7destroyEv:
  195|  9.05k|      { if (cptr != store) { delete[] cptr; cptr = NULL; } }
  ------------------
  |  Branch (195:13): [True: 226, False: 8.82k]
  ------------------
_ZN4ojph5local9param_siz18set_num_componentsEj:
  198|  8.81k|      {
  199|  8.81k|        Csiz = (ui16)num_comps;
  200|  8.81k|        if (Csiz > old_Csiz)
  ------------------
  |  Branch (200:13): [True: 226, False: 8.58k]
  ------------------
  201|    226|        {
  202|    226|          if (cptr != store)
  ------------------
  |  Branch (202:15): [True: 0, False: 226]
  ------------------
  203|      0|            delete[] cptr;
  204|    226|          cptr = new siz_comp_info[num_comps];
  205|    226|          old_Csiz = Csiz;
  206|    226|        }
  207|  8.81k|        memset(cptr, 0, sizeof(local::siz_comp_info) * num_comps);
  208|  8.81k|      }
_ZN4ojph5local9param_siz13set_tile_sizeENS_4sizeE:
  222|  8.87k|      void set_tile_size(size s) { XTsiz = s.w; YTsiz = s.h; }
_ZN4ojph5local9param_siz16set_image_offsetENS_5pointE:
  225|  8.88k|      { XOsiz = offset.x; YOsiz = offset.y; }
_ZN4ojph5local9param_siz15set_tile_offsetENS_5pointE:
  229|  8.86k|      { XTOsiz = offset.x; YTOsiz = offset.y; }
_ZN4ojph5local9param_siz14check_validityEv:
  236|  8.78k|      {
  237|  8.78k|        if (Xsiz == 0 || Ysiz == 0 || XTsiz == 0 || YTsiz == 0)
  ------------------
  |  Branch (237:13): [True: 1, False: 8.78k]
  |  Branch (237:26): [True: 1, False: 8.78k]
  |  Branch (237:39): [True: 2, False: 8.78k]
  |  Branch (237:53): [True: 4, False: 8.77k]
  ------------------
  238|      8|          OJPH_ERROR(0x00040001,
  ------------------
  |  |  289|      8|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      8|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  8.78k|            "Image extent and/or tile size cannot be zero");
  240|  8.78k|        if (XTOsiz > XOsiz || YTOsiz > YOsiz)
  ------------------
  |  Branch (240:13): [True: 33, False: 8.75k]
  |  Branch (240:31): [True: 29, False: 8.72k]
  ------------------
  241|     54|          OJPH_ERROR(0x00040002,
  ------------------
  |  |  289|     54|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     54|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 54, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|  8.78k|            "Tile offset has to be smaller than the image offset");
  243|  8.78k|        if (XTsiz + XTOsiz <= XOsiz || YTsiz + YTOsiz <= YOsiz)
  ------------------
  |  Branch (243:13): [True: 93, False: 8.69k]
  |  Branch (243:40): [True: 20, False: 8.67k]
  ------------------
  244|     51|          OJPH_ERROR(0x00040003,
  ------------------
  |  |  289|     51|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     51|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 51, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  8.78k|            "The top left tile must intersect with the image");
  246|  8.78k|        if (Xsiz <= XOsiz || Ysiz <= YOsiz)
  ------------------
  |  Branch (246:13): [True: 123, False: 8.66k]
  |  Branch (246:30): [True: 15, False: 8.64k]
  ------------------
  247|     25|          OJPH_ERROR(0x00040004,
  ------------------
  |  |  289|     25|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     25|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 25, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|  8.78k|            "The image extent must be larger than the image offset");
  249|  8.78k|      }
_ZNK4ojph5local9param_siz18get_num_componentsEv:
  251|  2.27M|      ui16 get_num_components() const { return Csiz; }
_ZNK4ojph5local9param_siz13get_bit_depthEj:
  253|  1.12M|      {
  254|       |        assert(comp_num < Csiz);
  255|  1.12M|        return (cptr[comp_num].SSiz & 0x7F) + 1u;
  256|  1.12M|      }
_ZNK4ojph5local9param_siz9is_signedEj:
  258|  1.12M|      {
  259|       |        assert(comp_num < Csiz);
  260|  1.12M|        return (cptr[comp_num].SSiz & 0x80) != 0;
  261|  1.12M|      }
_ZNK4ojph5local9param_siz16get_downsamplingEj:
  263|  3.44M|      {
  264|       |        assert(comp_num < Csiz);
  265|  3.44M|        return point(cptr[comp_num].XRsiz, cptr[comp_num].YRsiz);
  266|  3.44M|      }
_ZN4ojph5local9param_siz4linkEPKNS0_9param_codE:
  272|  7.10k|      { this->cod = cod; }
_ZN4ojph5local9param_siz4linkEPKNS0_9param_dfsE:
  275|    340|      { this->dfs = dfs; }
_ZN4ojph5local9param_siz23set_skipped_resolutionsEj:
  278|  1.73k|      { this->skipped_resolutions = skipped_resolutions; }
_ZNK4ojph5local9param_siz9get_widthEj:
  281|  8.39k|      {
  282|  8.39k|        assert(comp_num < get_num_components());
  283|  8.39k|        ui32 ds = (ui32)cptr[comp_num].XRsiz;
  284|  8.39k|        ui32 t = ojph_div_ceil(Xsiz, ds) - ojph_div_ceil(XOsiz, ds);
  ------------------
  |  |   70|  8.39k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
                      ui32 t = ojph_div_ceil(Xsiz, ds) - ojph_div_ceil(XOsiz, ds);
  ------------------
  |  |   70|  8.39k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  285|  8.39k|        return t;
  286|  8.39k|      }
_ZNK4ojph5local9param_siz10get_heightEj:
  289|  8.39k|      {
  290|  8.39k|        assert(comp_num < get_num_components());
  291|  8.39k|        ui32 ds = (ui32)cptr[comp_num].YRsiz;
  292|  8.39k|        ui32 t = ojph_div_ceil(Ysiz, ds) - ojph_div_ceil(YOsiz, ds);
  ------------------
  |  |   70|  8.39k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
                      ui32 t = ojph_div_ceil(Ysiz, ds) - ojph_div_ceil(YOsiz, ds);
  ------------------
  |  |   70|  8.39k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  293|  8.39k|        return t;
  294|  8.39k|      }
_ZNK4ojph5local9param_siz15get_recon_widthEj:
  299|  25.3k|      { return get_recon_size(comp_num).x; }
_ZNK4ojph5local9param_siz16get_recon_heightEj:
  301|  24.9k|      { return get_recon_size(comp_num).y; }
_ZN4ojph5local9cod_SPcodC2Ev:
  346|  29.2k|      cod_SPcod() {
  347|  29.2k|        num_decomp = 5;
  348|  29.2k|        block_width = 4;    // 64
  349|  29.2k|        block_height = 4;   // 64
  350|  29.2k|        block_style = 0x40; // HT mode
  351|  29.2k|        wavelet_trans = 0;  // reversible 5 / 3
  352|  29.2k|        memset(precinct_size, 0, sizeof(precinct_size));
  353|  29.2k|      }
_ZNK4ojph5local9cod_SPcod18get_log_block_dimsEv:
  363|  23.7M|      { return size(block_width + 2, block_height + 2); }
_ZNK4ojph5local9cod_SPcod21get_log_precinct_sizeEj:
  367|  29.2M|      {
  368|       |        assert(res_num <= num_decomp);
  369|  29.2M|        size ps(precinct_size[res_num] & 0xF, precinct_size[res_num] >> 4);
  370|  29.2M|        return ps;
  371|  29.2M|      }
_ZN4ojph5local9cod_SGcodC2Ev:
  377|  10.0k|      cod_SGcod() : prog_order(OJPH_PO_RPCL), num_layers(1), mc_trans(0) {}
_ZN4ojph5local9param_codC2EPS1_t:
  414|  10.0k|      { avail = NULL; init(top_cod, comp_idx); }
_ZN4ojph5local9param_codD2Ev:
  415|  10.0k|      ~param_cod() { destroy(); }
_ZN4ojph5local9param_cod7restartEv:
  419|  9.05k|      {
  420|  9.05k|        param_cod** p = &avail; // move next to the end of avail
  421|  9.05k|        while (*p != NULL)
  ------------------
  |  Branch (421:16): [True: 0, False: 9.05k]
  ------------------
  422|      0|          p = &((*p)->next);
  423|  9.05k|        *p = next;
  424|  9.05k|        this->init(top_cod, OJPH_COD_DEFAULT);
  425|  9.05k|      }
_ZNK4ojph5local9param_cod22get_num_decompositionsEv:
  505|  34.0M|      {
  506|  34.0M|        if (type == COD_MAIN)
  ------------------
  |  Branch (506:13): [True: 32.1M, False: 1.92M]
  ------------------
  507|  32.1M|          return SPcod.num_decomp;
  508|  1.92M|        else if (type == COC_MAIN)
  ------------------
  |  Branch (508:18): [True: 1.92M, False: 0]
  ------------------
  509|  1.92M|        {
  510|  1.92M|          if (is_dfs_defined())
  ------------------
  |  Branch (510:15): [True: 1.82M, False: 96.3k]
  ------------------
  511|  1.82M|            return top_cod->get_num_decompositions();
  512|  96.3k|          else
  513|  96.3k|            return SPcod.num_decomp;
  514|  1.92M|        }
  515|      0|        else {
  516|       |          assert(0);
  517|      0|          return 0; // just in case
  518|      0|        }
  519|  34.0M|      }
_ZNK4ojph5local9param_cod18get_log_block_dimsEv:
  527|  23.7M|      { return SPcod.get_log_block_dims(); }
_ZNK4ojph5local9param_cod16get_wavelet_kernEv:
  531|  6.77M|      { return SPcod.wavelet_trans; }
_ZNK4ojph5local9param_cod28is_employing_color_transformEv:
  538|  30.6M|      {
  539|  30.6M|        if (type == COD_MAIN || type == COD_TILE)
  ------------------
  |  Branch (539:13): [True: 30.6M, False: 0]
  |  Branch (539:33): [True: 0, False: 0]
  ------------------
  540|  30.6M|          return (SGCod.mc_trans == 1);
  541|      0|        else
  542|      0|          return top_cod->is_employing_color_transform();
  543|  30.6M|      }
_ZNK4ojph5local9param_cod17get_precinct_sizeEj:
  547|  40.8k|      {
  548|  40.8k|        size t = get_log_precinct_size(res_num);
  549|  40.8k|        return size(1 << t.w, 1 << t.h);
  550|  40.8k|      }
_ZNK4ojph5local9param_cod21get_log_precinct_sizeEj:
  554|  30.6M|      {
  555|  30.6M|        if (Scod & 1)
  ------------------
  |  Branch (555:13): [True: 29.2M, False: 1.40M]
  ------------------
  556|  29.2M|          return SPcod.get_log_precinct_size(res_num);
  557|  1.40M|        else
  558|  1.40M|          return size(15, 15);
  559|  30.6M|      }
_ZNK4ojph5local9param_cod19packets_may_use_sopEv:
  563|  9.47M|      {
  564|  9.47M|        if (type == COD_MAIN || type == COD_TILE)
  ------------------
  |  Branch (564:13): [True: 8.81M, False: 665k]
  |  Branch (564:33): [True: 0, False: 665k]
  ------------------
  565|  8.81M|          return (Scod & 2) == 2;
  566|   665k|        return false;
  567|  9.47M|      }
_ZNK4ojph5local9param_cod15packets_use_ephEv:
  571|  9.47M|      {
  572|  9.47M|        if (type == COD_MAIN || type == COD_TILE)
  ------------------
  |  Branch (572:13): [True: 8.81M, False: 665k]
  |  Branch (572:33): [True: 0, False: 665k]
  ------------------
  573|  8.81M|          return (Scod & 4) == 4;
  574|   665k|        return false;
  575|  9.47M|      }
_ZNK4ojph5local9param_cod28get_block_vertical_causalityEv:
  579|  5.64M|      { return (SPcod.block_style & local::param_cod::VERT_CAUSAL_MODE) != 0; }
_ZNK4ojph5local9param_cod10access_atkEv:
  609|  41.5M|      const param_atk* access_atk() const { return atk; }
_ZNK4ojph5local9param_cod14is_dfs_definedEv:
  614|  31.4M|      { return (SPcod.num_decomp & 0x80) != 0; }
_ZNK4ojph5local9param_cod13get_dfs_indexEv:
  618|  1.36M|      { return SPcod.num_decomp & 0xF; }
_ZNK4ojph5local9param_cod12get_comp_idxEv:
  622|  28.3M|      {
  623|       |        assert((type == COC_MAIN && comp_idx != OJPH_COD_DEFAULT) ||
  624|  28.3M|               (type == COD_MAIN && comp_idx == OJPH_COD_DEFAULT));
  625|  28.3M|        return comp_idx;
  626|  28.3M|      }
_ZN4ojph5local9param_cod4initEPS1_t:
  631|  19.1k|      {
  632|  19.1k|        type = top_cod ? COC_MAIN : COD_MAIN;
  ------------------
  |  Branch (632:16): [True: 1.03k, False: 18.1k]
  ------------------
  633|  19.1k|        Lcod = 0;
  634|  19.1k|        Scod = 0;
  635|  19.1k|        SPcod = cod_SPcod();  // SPcod is initialized to default values
  636|  19.1k|        next = NULL;
  637|  19.1k|        atk = NULL;
  638|       |        // For COC marker segment:
  639|       |        // Lcod will be initialized on writing the marker segment to disk
  640|       |        // Scod is initialized to 0
  641|       |        // SGcod does not exist in COC
  642|       |        // SPcoc is initialized to default values
  643|       |        // atk is initialized to NULL
  644|  19.1k|        this->top_cod = top_cod;
  645|  19.1k|        this->comp_idx = comp_idx;
  646|  19.1k|      }
_ZN4ojph5local9param_cod7destroyEv:
  649|  10.0k|      void destroy() {
  650|  10.0k|        if (avail)
  ------------------
  |  Branch (650:13): [True: 0, False: 10.0k]
  ------------------
  651|      0|          delete avail;
  652|  10.0k|        if (next) {
  ------------------
  |  Branch (652:13): [True: 1.03k, False: 9.05k]
  ------------------
  653|  1.03k|          delete next;
  654|       |          next = NULL;
  655|  1.03k|        }
  656|  10.0k|      }
_ZN4ojph5local9param_qcdC2EPS1_t:
  714|  9.37k|      { avail = NULL; init(top_qcd, comp_idx); }
_ZN4ojph5local9param_qcdD2Ev:
  715|  9.37k|      ~param_qcd() { destroy(); }
_ZN4ojph5local9param_qcd7restartEv:
  719|  9.05k|      {
  720|  9.05k|        param_qcd** p = &avail; // move next to the end of avail
  721|  9.05k|        while (*p != NULL)
  ------------------
  |  Branch (721:16): [True: 0, False: 9.05k]
  ------------------
  722|      0|          p = &((*p)->next);
  723|  9.05k|        *p = next;
  724|  9.05k|        this->init(top_qcd, OJPH_QCD_DEFAULT);
  725|  9.05k|      }
_ZNK4ojph5local9param_qcd12get_comp_idxEv:
  757|    508|      ui16 get_comp_idx() const { return comp_idx; }
_ZN4ojph5local9param_qcd4initEPS1_t:
  762|  18.4k|      {
  763|  18.4k|        is_init = false;
  764|  18.4k|        type = top_qcd ? QCC_MAIN : QCD_MAIN;
  ------------------
  |  Branch (764:16): [True: 321, False: 18.1k]
  ------------------
  765|  18.4k|        Lqcd = 0;
  766|  18.4k|        Sqcd = 0;
  767|  18.4k|        memset(&SPqcd, 0, sizeof(SPqcd));
  768|  18.4k|        num_subbands = 0;
  769|  18.4k|        base_delta = -1.0f;
  770|  18.4k|        qfactor = QFACTOR_UNSET;
  771|  18.4k|        num_weights = 0;
  772|  18.4k|        ctype = comp_type::OJPH_COMP_Y;
  773|  18.4k|        sampling = ojph::point(1, 1);
  774|  18.4k|        enabled = true;
  775|       |        next = NULL;
  776|  18.4k|        this->top_qcd = top_qcd;
  777|  18.4k|        this->comp_idx = comp_idx;
  778|  18.4k|      }
_ZN4ojph5local9param_qcd7destroyEv:
  781|  9.37k|      void destroy() {
  782|  9.37k|        if (avail)
  ------------------
  |  Branch (782:13): [True: 0, False: 9.37k]
  ------------------
  783|      0|          delete avail;
  784|  9.37k|        if (next)
  ------------------
  |  Branch (784:13): [True: 321, False: 9.05k]
  ------------------
  785|    321|        {
  786|    321|          delete next;
  787|       |          next = NULL;
  788|    321|        }
  789|  9.37k|      }
_ZNK4ojph5local9param_qcd12decode_SPqcdEh:
  801|   208M|      { return (ui8)(v >> 3); }
_ZN4ojph5local7nlt_rec7get_bppEj:
  855|  6.28k|      static ui8 get_bpp(ui32 t) { return (t <= 8) ? 1 : ((t <= 16) ? 2 : 4); }
  ------------------
  |  Branch (855:43): [True: 2.88k, False: 3.39k]
  |  Branch (855:59): [True: 1.70k, False: 1.69k]
  ------------------
_ZN4ojph5local7nlt_recC2Ev:
  856|  9.94k|      nlt_rec() { points_store = NULL; store_size = 0; init(); }
_ZN4ojph5local7nlt_rec4initEv:
  857|  28.9k|      void init() {
  858|  28.9k|        BDnlt = 0; Tnlt = nonlinearity::OJPH_NLT_UNDEFINED;
  859|  28.9k|        d_min = d_max = pt_val = num_points = 0; bytes_per_point = 0;
  860|  28.9k|        marker_points = NULL;
  861|       |        // decode
  862|  28.9k|        dec_points = NULL;
  863|  28.9k|        fd_min = fd_max = delta = inv_delta = multiplier = 0.0f;
  864|       |        // encode
  865|  28.9k|        approx_encoding_nlt = false;
  866|  28.9k|        enc_num_points = 0;
  867|  28.9k|        ft_min = ft_max = 0.0f;
  868|       |        //// approx
  869|  28.9k|        approx_enc_points = NULL;
  870|       |        //// precise
  871|  28.9k|        precise_max_steps = 0;
  872|  28.9k|        precise_enc_dec_indices = NULL;
  873|       |        precise_dec_lut = NULL;
  874|  28.9k|      }
_ZNK4ojph5local7nlt_rec8get_typeEv:
  875|   262k|      ui8 get_type() const { return Tnlt; }
_ZNK4ojph5local7nlt_rec13get_bit_depthEv:
  876|   118k|      ui8 get_bit_depth() const { return (ui8)((BDnlt & 0x7F) + 1u); }
_ZNK4ojph5local7nlt_rec7get_bppEv:
  877|  3.14k|      ui8 get_bpp() const { return get_bpp(pt_val); }
_ZNK4ojph5local7nlt_rec9is_signedEv:
  878|   113k|      bool is_signed() const { return (BDnlt & 0x80) != 0; }
_ZN4ojph5local7nlt_rec27cal_store_size_for_decodingEv:
  899|  3.14k|      { // add 2 extra points, one before the dec_points table and one after
  900|  3.14k|        return (ui32)(num_points + 2u) * (ui32)sizeof(float)
  901|  3.14k|          + (ui32)num_points * (ui32)get_bpp();
  902|  3.14k|      }
_ZN4ojph5local7nlt_rec28assign_pointers_for_decodingEv:
  904|  3.14k|      { // 2 extra points, one before the dec_points table and one after
  905|       |        dec_points = (float*)points_store + 1;  approx_enc_points = NULL;
  906|  3.14k|        marker_points = (ui8*)dec_points + (num_points + 1) * sizeof(float);
  907|  3.14k|      }
_ZN4ojph5local9param_nltC2Ev:
  970|  9.94k|      param_nlt() {
  971|       |        avail = NULL;
  972|  9.94k|        init();
  973|  9.94k|      }
_ZN4ojph5local9param_nltD2Ev:
  974|  9.94k|      ~param_nlt() { destroy(); }
_ZN4ojph5local9param_nlt7restartEv:
  978|  9.05k|      {
  979|  9.05k|        param_nlt** p = &avail; // move next to the end of avail
  980|  9.05k|        while (*p != NULL)
  ------------------
  |  Branch (980:16): [True: 0, False: 9.05k]
  ------------------
  981|      0|          p = &((*p)->next);
  982|  9.05k|        *p = next;
  983|  9.05k|        this->init();
  984|  9.05k|      }
_ZN4ojph5local9param_nlt4initEv:
 1020|  19.0k|      {
 1021|  19.0k|        Lnlt = 0;
 1022|  19.0k|        Cnlt = special_comp_num::ALL_COMPS; // default
 1023|  19.0k|        rec.init();
 1024|       |        enabled = false; next = NULL;
 1025|  19.0k|      }
_ZN4ojph5local9param_nlt7destroyEv:
 1029|  9.94k|      {
 1030|  9.94k|        if (rec.points_store) {
  ------------------
  |  Branch (1030:13): [True: 430, False: 9.51k]
  ------------------
 1031|    430|          delete[] (ui8*)rec.points_store;
 1032|    430|          rec.points_store = NULL;
 1033|    430|        }
 1034|  9.94k|        if (avail)
  ------------------
  |  Branch (1034:13): [True: 0, False: 9.94k]
  ------------------
 1035|      0|          delete avail;
 1036|  9.94k|        if (next) {
  ------------------
  |  Branch (1036:13): [True: 897, False: 9.05k]
  ------------------
 1037|    897|          delete next;
 1038|       |          next = NULL;
 1039|    897|        }
 1040|  9.94k|      }
_ZN4ojph5local9param_capC2Ev:
 1076|  9.05k|      {
 1077|  9.05k|        memset(this, 0, sizeof(param_cap));
 1078|  9.05k|        Lcap = 8;
 1079|  9.05k|        Pcap = 0x00020000; //for jph, Pcap^15 must be set, the 15th MSB
 1080|  9.05k|      }
_ZN4ojph5local9param_sot4initEjthh:
 1122|  1.09M|      {
 1123|  1.09M|        Lsot = 10;
 1124|  1.09M|        Psot = payload_length + 12; //total = payload + SOT marker
 1125|  1.09M|        Isot = tile_idx;
 1126|  1.09M|        TPsot = tile_part_index;
 1127|  1.09M|        TNsot = num_tile_parts;
 1128|  1.09M|      }
_ZNK4ojph5local9param_sot14get_tile_indexEv:
 1134|   453k|      ui16 get_tile_index() const { return Isot; }
_ZNK4ojph5local9param_sot18get_payload_lengthEv:
 1135|   445k|      ui32 get_payload_length() const { return Psot > 0 ? Psot - 12 : 0; }
  ------------------
  |  Branch (1135:48): [True: 32.4k, False: 412k]
  ------------------
_ZNK4ojph5local9param_sot19get_tile_part_indexEv:
 1136|   636k|      ui8  get_tile_part_index() const { return TPsot; }
_ZNK4ojph5local9param_sot18get_num_tile_partsEv:
 1137|   383k|      ui8  get_num_tile_parts() const { return TNsot; }
_ZN4ojph5local9param_tlmC2Ev:
 1163|  9.05k|      param_tlm() { pairs = NULL; num_pairs = 0; next_pair_index = 0; };
_ZN4ojph5local9param_dfsC2Ev:
 1199|   665k|      param_dfs() { avail = NULL; init(); }
_ZN4ojph5local9param_dfsD2Ev:
 1200|   665k|      ~param_dfs() { destroy(); }
_ZN4ojph5local9param_dfs7restartEv:
 1204|  9.05k|      {
 1205|  9.05k|        param_dfs** p = &avail; // move next to the end of avail
 1206|  9.05k|        while (*p != NULL)
  ------------------
  |  Branch (1206:16): [True: 0, False: 9.05k]
  ------------------
 1207|      0|          p = &((*p)->next);
 1208|  9.05k|        *p = next;
 1209|  9.05k|        this->init();
 1210|  9.05k|      }
_ZNK4ojph5local9param_dfs6existsEv:
 1213|  1.89M|      bool exists() const { return Ldfs != 0; }
_ZN4ojph5local9param_dfs4initEv:
 1227|   674k|      { Ldfs = Sdfs = Ids = 0; memset(Ddfs, 0, sizeof(Ddfs)); next = NULL; }
_ZN4ojph5local9param_dfs7destroyEv:
 1231|   665k|      {
 1232|   665k|        if (avail)
  ------------------
  |  Branch (1232:13): [True: 0, False: 665k]
  ------------------
 1233|      0|          delete avail;
 1234|   665k|        if (next) {
  ------------------
  |  Branch (1234:13): [True: 656k, False: 9.05k]
  ------------------
 1235|   656k|          delete next;
 1236|       |          next = NULL;
 1237|   656k|        }
 1238|   665k|      }
_ZN4ojph5local9param_atkC2Ev:
 1289|  9.59k|      {
 1290|  9.59k|        d = d_store;
 1291|  9.59k|        max_steps = sizeof(d_store) / sizeof(lifting_step);
 1292|       |        init(NULL);
 1293|  9.59k|      }
_ZN4ojph5local9param_atkD2Ev:
 1295|  9.59k|      {
 1296|  9.59k|        if (avail) {
  ------------------
  |  Branch (1296:13): [True: 0, False: 9.59k]
  ------------------
 1297|      0|          delete avail;
 1298|      0|          avail = NULL;
 1299|      0|        }
 1300|  9.59k|        if (next) {
  ------------------
  |  Branch (1300:13): [True: 539, False: 9.05k]
  ------------------
 1301|    539|          delete next;
 1302|    539|          next = NULL;
 1303|    539|        }
 1304|  9.59k|        if (d != NULL && d != d_store) {
  ------------------
  |  Branch (1304:13): [True: 9.59k, False: 0]
  |  Branch (1304:26): [True: 108, False: 9.48k]
  ------------------
 1305|    108|          delete[] d;
 1306|    108|          d = d_store;
 1307|    108|          max_steps = sizeof(d_store) / sizeof(lifting_step);
 1308|    108|        }
 1309|  9.59k|      }
_ZN4ojph5local9param_atk7restartEv:
 1313|  9.05k|      {
 1314|  9.05k|        assert(top_atk == NULL);
 1315|       |
 1316|  9.05k|        Latk = Satk = 0;
 1317|  9.05k|        Katk = 0.0f;
 1318|  9.05k|        Natk = 0;
 1319|  9.05k|        if (d == NULL || d == d_store) {
  ------------------
  |  Branch (1319:13): [True: 0, False: 9.05k]
  |  Branch (1319:26): [True: 9.05k, False: 0]
  ------------------
 1320|  9.05k|          d = d_store;
 1321|  9.05k|          max_steps = sizeof(d_store) / sizeof(lifting_step);
 1322|  9.05k|        }
 1323|  9.05k|        memset(d, 0, max_steps * sizeof(lifting_step));
 1324|       |
 1325|  9.05k|        param_atk** p = &avail; // move next to the end of avail
 1326|  9.05k|        while (*p != NULL)
  ------------------
  |  Branch (1326:16): [True: 0, False: 9.05k]
  ------------------
 1327|      0|          p = &((*p)->next);
 1328|  9.05k|        *p = next;
 1329|       |
 1330|       |        next = NULL;
 1331|  9.05k|      }
_ZNK4ojph5local9param_atk9get_indexEv:
 1335|  2.67k|      ui8 get_index() const { return (ui8)(Satk & 0xFF); }
_ZNK4ojph5local9param_atk14get_coeff_typeEv:
 1336|  3.01k|      int get_coeff_type() const { return (Satk >> 8) & 0x7; }
_ZNK4ojph5local9param_atk15is_whole_sampleEv:
 1337|    526|      bool is_whole_sample() const { return (Satk & 0x800) != 0; }
_ZNK4ojph5local9param_atk13is_reversibleEv:
 1338|  28.3M|      bool is_reversible() const { return (Satk & 0x1000) != 0; }
_ZNK4ojph5local9param_atk10is_m_init0Ev:
 1339|    533|      bool is_m_init0() const { return (Satk & 0x2000) == 0; }
_ZNK4ojph5local9param_atk21is_using_ws_extensionEv:
 1340|    515|      bool is_using_ws_extension() const { return (Satk & 0x4000) != 0; }
_ZNK4ojph5local9param_atk8get_stepEj:
 1343|  10.3M|      { assert(s < Natk); return d + s; }
_ZNK4ojph5local9param_atk13get_num_stepsEv:
 1344|  12.3M|      ui32 get_num_steps() const { return Natk; }
_ZNK4ojph5local9param_atk5get_KEv:
 1345|  2.32M|      float get_K() const { return Katk; }
_ZN4ojph5local9param_atk4initEPS1_:
 1350|  10.1k|      {
 1351|  10.1k|        Latk = Satk = 0;
 1352|  10.1k|        Katk = 0.0f;
 1353|  10.1k|        Natk = 0;
 1354|  10.1k|        if (d == NULL || d == d_store) {
  ------------------
  |  Branch (1354:13): [True: 0, False: 10.1k]
  |  Branch (1354:26): [True: 10.1k, False: 0]
  ------------------
 1355|  10.1k|          d = d_store;
 1356|  10.1k|          max_steps = sizeof(d_store) / sizeof(lifting_step);
 1357|  10.1k|        }
 1358|  10.1k|        memset(d, 0, max_steps * sizeof(lifting_step));
 1359|  10.1k|        next = NULL;
 1360|  10.1k|        this->top_atk = top_atk;
 1361|       |        avail = NULL;
 1362|  10.1k|      }

_ZN4ojph5local8precinct5parseEiPjPNS_21mem_elastic_allocatorERjPNS_11infile_baseEb:
  332|   364k|    {
  333|   364k|      assert(data_left > 0);
  334|   364k|      bit_read_buf bb;
  335|   364k|      bb_init(&bb, data_left, file);
  336|   364k|      if (may_use_sop)
  ------------------
  |  Branch (336:11): [True: 54.9k, False: 309k]
  ------------------
  337|  54.9k|        bb_skip_sop(&bb);
  338|       |
  339|   364k|      bool empty_packet = true;
  340|   905k|      for (int s = 0; s < 4; ++s)
  ------------------
  |  Branch (340:23): [True: 812k, False: 93.4k]
  ------------------
  341|   812k|      {
  342|   812k|        if (bands[s].empty)
  ------------------
  |  Branch (342:13): [True: 309k, False: 502k]
  ------------------
  343|   309k|          continue;
  344|       |
  345|   502k|        if (cb_idxs[s].siz.w == 0 || cb_idxs[s].siz.h == 0)
  ------------------
  |  Branch (345:13): [True: 5.10k, False: 497k]
  |  Branch (345:38): [True: 5.32k, False: 492k]
  ------------------
  346|  10.4k|          continue;
  347|       |
  348|   492k|        if (empty_packet) //one bit to check if the packet is empty
  ------------------
  |  Branch (348:13): [True: 360k, False: 131k]
  ------------------
  349|   360k|        {
  350|   360k|          ui32 bit;
  351|   360k|          bb_read_bit(&bb, bit);
  352|   360k|          if (bit == 0) //empty packet
  ------------------
  |  Branch (352:15): [True: 258k, False: 102k]
  ------------------
  353|   258k|          { bb_terminate(&bb, uses_eph); data_left = bb.bytes_left; return; }
  354|   102k|          empty_packet = false;
  355|   102k|        }
  356|       |
  357|   233k|        ui32 num_levels = 1 +
  358|   233k|          ojph_max(log2ceil(cb_idxs[s].siz.w), log2ceil(cb_idxs[s].siz.h));
  ------------------
  |  |   73|   233k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 4.21k, False: 229k]
  |  |  ------------------
  ------------------
  359|       |
  360|       |        //create quad trees for inclusion and missing msbs
  361|   233k|        tag_tree inc_tag, inc_tag_flags, mmsb_tag, mmsb_tag_flags;
  362|   233k|        inc_tag.init(scratch, lev_idx, num_levels, cb_idxs[s].siz, 0);
  363|   233k|        *inc_tag.get(0, 0, num_levels) = 0;
  364|   233k|        inc_tag_flags.init(scratch + tag_tree_size, lev_idx, num_levels,
  365|   233k|          cb_idxs[s].siz, 0);
  366|   233k|        *inc_tag_flags.get(0, 0, num_levels) = 0;
  367|   233k|        mmsb_tag.init(scratch + (tag_tree_size<<1), lev_idx, num_levels,
  368|   233k|          cb_idxs[s].siz, 0);
  369|   233k|        *mmsb_tag.get(0, 0, num_levels) = 0;
  370|   233k|        mmsb_tag_flags.init(scratch + (tag_tree_size<<1) + tag_tree_size,
  371|   233k|          lev_idx, num_levels, cb_idxs[s].siz, 0);
  372|   233k|        *mmsb_tag_flags.get(0, 0, num_levels) = 0;
  373|       |
  374|       |        //
  375|   233k|        ui32 band_width = bands[s].num_blocks.w;
  376|   233k|        ui32 width = cb_idxs[s].siz.w;
  377|   233k|        ui32 height = cb_idxs[s].siz.h;
  378|   502k|        for (ui32 y = 0; y < height; ++y)
  ------------------
  |  Branch (378:26): [True: 281k, False: 220k]
  ------------------
  379|   281k|        {
  380|   281k|          coded_cb_header *cp = bands[s].coded_cbs;
  381|   281k|          cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
  382|   856k|          for (ui32 x = 0; x < width; ++x, ++cp)
  ------------------
  |  Branch (382:28): [True: 587k, False: 268k]
  ------------------
  383|   587k|          {
  384|       |            //process inclusion
  385|   587k|            bool empty_cb = false;
  386|  1.41M|            for (ui32 cl = num_levels; cl > 0; --cl)
  ------------------
  |  Branch (386:40): [True: 1.30M, False: 112k]
  ------------------
  387|  1.30M|            {
  388|  1.30M|              ui32 cur_lev = cl - 1;
  389|  1.30M|              empty_cb = *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) == 1;
  390|  1.30M|              if (empty_cb)
  ------------------
  |  Branch (390:19): [True: 355k, False: 948k]
  ------------------
  391|   355k|                break;
  392|       |              //check received
  393|   948k|              if (*inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
  ------------------
  |  Branch (393:19): [True: 243k, False: 705k]
  ------------------
  394|   243k|              {
  395|   243k|                ui32 bit;
  396|   243k|                if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (396:21): [True: 203, False: 243k]
  ------------------
  397|    203|                { data_left = 0; throw "error reading from file p1"; }
  398|   243k|                empty_cb = (bit == 0);
  399|   243k|                *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)(1 - bit);
  400|   243k|                *inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
  401|   243k|              }
  402|   948k|              if (empty_cb)
  ------------------
  |  Branch (402:19): [True: 119k, False: 829k]
  ------------------
  403|   119k|                break;
  404|   948k|            }
  405|       |
  406|   587k|            if (empty_cb)
  ------------------
  |  Branch (406:17): [True: 474k, False: 112k]
  ------------------
  407|   474k|              continue;
  408|       |
  409|       |            //process missing msbs
  410|   112k|            ui32 mmsbs = 0;
  411|   245k|            for (ui32 levp1 = num_levels; levp1 > 0; --levp1)
  ------------------
  |  Branch (411:43): [True: 133k, False: 112k]
  ------------------
  412|   133k|            {
  413|   133k|              ui32 cur_lev = levp1 - 1;
  414|   133k|              mmsbs = *mmsb_tag.get(x>>levp1, y>>levp1, levp1);
  415|       |              //check received
  416|   133k|              if (*mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
  ------------------
  |  Branch (416:19): [True: 120k, False: 12.2k]
  ------------------
  417|   120k|              {
  418|   120k|                ui32 bit = 0;
  419|  28.5M|                while (bit == 0)
  ------------------
  |  Branch (419:24): [True: 28.3M, False: 120k]
  ------------------
  420|  28.3M|                {
  421|  28.3M|                  if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (421:23): [True: 225, False: 28.3M]
  ------------------
  422|    225|                  { data_left = 0; throw "error reading from file p2"; }
  423|  28.3M|                  mmsbs += 1 - bit;
  424|  28.3M|                }
  425|   120k|                *mmsb_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)mmsbs;
  426|   120k|                *mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
  427|   120k|              }
  428|   133k|            }
  429|       |
  430|   112k|            if (mmsbs > cp->Kmax)
  ------------------
  |  Branch (430:17): [True: 2.17k, False: 110k]
  ------------------
  431|  2.17k|              throw "error in parsing a tile header; "
  432|  2.17k|              "missing msbs are larger or equal to Kmax. The most likely "
  433|  2.17k|              "cause is a corruption in the bitstream.";
  434|   110k|            cp->missing_msbs = mmsbs;
  435|       |
  436|       |            //get number of passes
  437|   110k|            ui32 bit, num_passes = 1;
  438|   110k|            if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (438:17): [True: 291, False: 110k]
  ------------------
  439|    291|            { data_left = 0; throw "error reading from file p3"; }
  440|   110k|            if (bit)
  ------------------
  |  Branch (440:17): [True: 87.7k, False: 22.2k]
  ------------------
  441|  87.7k|            {
  442|  87.7k|              num_passes = 2;
  443|  87.7k|              if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (443:19): [True: 197, False: 87.5k]
  ------------------
  444|    197|              { data_left = 0; throw "error reading from file p4"; }
  445|  87.5k|              if (bit)
  ------------------
  |  Branch (445:19): [True: 65.9k, False: 21.6k]
  ------------------
  446|  65.9k|              {
  447|  65.9k|                if (bb_read_bits(&bb, 2, bit) == false)
  ------------------
  |  Branch (447:21): [True: 202, False: 65.7k]
  ------------------
  448|    202|                { data_left = 0; throw "error reading from file p5";  }
  449|  65.7k|                num_passes = 3 + bit;
  450|  65.7k|                if (bit == 3)
  ------------------
  |  Branch (450:21): [True: 47.4k, False: 18.3k]
  ------------------
  451|  47.4k|                {
  452|  47.4k|                  if (bb_read_bits(&bb, 5, bit) == false)
  ------------------
  |  Branch (452:23): [True: 283, False: 47.1k]
  ------------------
  453|    283|                  { data_left = 0; throw "error reading from file p6"; }
  454|  47.1k|                  num_passes = 6 + bit;
  455|  47.1k|                  if (bit == 31)
  ------------------
  |  Branch (455:23): [True: 10.7k, False: 36.3k]
  ------------------
  456|  10.7k|                  {
  457|  10.7k|                    if (bb_read_bits(&bb, 7, bit) == false)
  ------------------
  |  Branch (457:25): [True: 236, False: 10.5k]
  ------------------
  458|    236|                    { data_left = 0; throw "error reading from file p7"; }
  459|  10.5k|                    num_passes = 37 + bit;
  460|  10.5k|                  }
  461|  47.1k|                }
  462|  65.7k|              }
  463|  87.5k|            }
  464|   109k|            cp->num_passes = num_passes;
  465|       |
  466|       |            // Parse pass lengths
  467|       |            // When number of passes is one, one length.
  468|       |            // When number of passes is two or three, two lengths.
  469|       |            // When number of passes > 3, we have place holder passes;
  470|       |            // In this case, subtract multiples of 3 from the number of
  471|       |            // passes; for example, if we have 10 passes, we subtract 9,
  472|       |            // producing 1 pass.
  473|       |
  474|       |            // 1 => 1, 2 => 2, 3 => 3, 4 => 1, 5 => 2, 6 => 3
  475|   109k|            ui32 num_phld_passes = (num_passes - 1) / 3;
  476|   109k|            cp->missing_msbs += num_phld_passes;
  477|       |
  478|   109k|            num_phld_passes *= 3;
  479|   109k|            cp->num_passes = num_passes - num_phld_passes;
  480|   109k|            cp->pass_length[0] = cp->pass_length[1] = 0;
  481|       |
  482|   109k|            int Lblock = 3;
  483|   109k|            bit = 1;
  484|   195M|            while (bit)
  ------------------
  |  Branch (484:20): [True: 195M, False: 108k]
  ------------------
  485|   195M|            {
  486|       |              // add any extra bits here
  487|   195M|              if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (487:19): [True: 223, False: 195M]
  ------------------
  488|    223|              { data_left = 0; throw "error reading from file p8"; }
  489|   195M|              Lblock += bit;
  490|   195M|            }
  491|       |
  492|   108k|            int bits = Lblock + 31 -
  493|   108k|              (int)count_leading_zeros(num_phld_passes + 1);
  494|   108k|            if (bb_read_bits(&bb, bits, bit) == false)
  ------------------
  |  Branch (494:17): [True: 262, False: 108k]
  ------------------
  495|    262|            { data_left = 0; throw "error reading from file p9"; }
  496|   108k|            if (bit < 2)
  ------------------
  |  Branch (496:17): [True: 5.80k, False: 102k]
  ------------------
  497|  5.80k|              throw "The cleanup segment of an HT codeblock cannot contain "
  498|  5.80k|                "less than 2 bytes";
  499|   102k|            if (bit >= 65535)
  ------------------
  |  Branch (499:17): [True: 2.30k, False: 100k]
  ------------------
  500|  2.30k|              throw "The cleanup segment of an HT codeblock must contain "
  501|  2.30k|                "less than 65535 bytes";
  502|   100k|            cp->pass_length[0] = bit;
  503|       |
  504|   100k|            if (cp->num_passes > 1)
  ------------------
  |  Branch (504:17): [True: 64.8k, False: 35.6k]
  ------------------
  505|  64.8k|            {
  506|       |              //bits = Lblock + 31 - count_leading_zeros(cp->num_passes - 1);
  507|       |              // The following is simpler than the above, I think?
  508|  64.8k|              bits = Lblock + (cp->num_passes > 2 ? 1 : 0);
  ------------------
  |  Branch (508:32): [True: 31.4k, False: 33.3k]
  ------------------
  509|  64.8k|              if (bb_read_bits(&bb, bits, bit) == false)
  ------------------
  |  Branch (509:19): [True: 207, False: 64.6k]
  ------------------
  510|    207|              { data_left = 0; throw "error reading from file p10"; }
  511|  64.6k|              if (bit >= 2047)
  ------------------
  |  Branch (511:19): [True: 452, False: 64.1k]
  ------------------
  512|    452|                throw "The refinement segment (SigProp and MagRep passes) of "
  513|    452|                  "an HT codeblock must contain less than 2047 bytes";
  514|  64.1k|              cp->pass_length[1] = bit;
  515|  64.1k|            }
  516|   100k|          }
  517|   281k|        }
  518|   233k|      }
  519|  93.4k|      if (empty_packet)
  ------------------
  |  Branch (519:11): [True: 1.70k, False: 91.7k]
  ------------------
  520|  1.70k|      { // all subbands are empty
  521|  1.70k|        ui32 bit = 0;
  522|  1.70k|        bb_read_bit(&bb, bit);
  523|       |        //assert(bit == 0);
  524|  1.70k|      }
  525|  93.4k|      bb_terminate(&bb, uses_eph);
  526|       |      //read codeblock data
  527|   381k|      for (int s = 0; s < 4; ++s)
  ------------------
  |  Branch (527:23): [True: 288k, False: 93.4k]
  ------------------
  528|   288k|      {
  529|   288k|        if (bands[s].empty)
  ------------------
  |  Branch (529:13): [True: 91.5k, False: 196k]
  ------------------
  530|  91.5k|          continue;
  531|       |
  532|   196k|        ui32 band_width = bands[s].num_blocks.w;
  533|   196k|        ui32 width = cb_idxs[s].siz.w;
  534|   196k|        ui32 height = cb_idxs[s].siz.h;
  535|   449k|        for (ui32 y = 0; y < height; ++y)
  ------------------
  |  Branch (535:26): [True: 252k, False: 196k]
  ------------------
  536|   252k|        {
  537|   252k|          coded_cb_header *cp = bands[s].coded_cbs;
  538|   252k|          cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
  539|   626k|          for (ui32 x = 0; x < width; ++x, ++cp)
  ------------------
  |  Branch (539:28): [True: 373k, False: 252k]
  ------------------
  540|   373k|          {
  541|   373k|            ui32 num_bytes = cp->pass_length[0] + cp->pass_length[1];
  542|   373k|            if (data_left)
  ------------------
  |  Branch (542:17): [True: 356k, False: 17.1k]
  ------------------
  543|   356k|            {
  544|   356k|              if (num_bytes)
  ------------------
  |  Branch (544:19): [True: 83.1k, False: 273k]
  ------------------
  545|  83.1k|              {
  546|  83.1k|                if (skipped)
  ------------------
  |  Branch (546:21): [True: 4.20k, False: 78.9k]
  ------------------
  547|  4.20k|                { //no need to read
  548|  4.20k|                  si64 cur_loc = file->tell();
  549|  4.20k|                  ui32 t = ojph_min(num_bytes, bb.bytes_left);
  ------------------
  |  |   76|  4.20k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 3.59k, False: 604]
  |  |  ------------------
  ------------------
  550|  4.20k|                  file->seek(t, infile_base::OJPH_SEEK_CUR);
  551|  4.20k|                  ui32 bytes_read = (ui32)(file->tell() - cur_loc);
  552|  4.20k|                  cp->pass_length[0] = cp->pass_length[1] = 0;
  553|  4.20k|                  bb.bytes_left -= bytes_read;
  554|  4.20k|                  assert(bytes_read == t || bb.bytes_left == 0);
  555|  4.20k|                }
  556|  78.9k|                else
  557|  78.9k|                {
  558|  78.9k|                  if (!bb_read_chunk(&bb, num_bytes, cp->next_coded, elastic))
  ------------------
  |  Branch (558:23): [True: 10.3k, False: 68.5k]
  ------------------
  559|  10.3k|                  {
  560|       |                    //no need to decode a broken codeblock
  561|  10.3k|                    cp->pass_length[0] = cp->pass_length[1] = 0;
  562|  10.3k|                    data_left = 0;
  563|  10.3k|                  }
  564|  78.9k|                }
  565|  83.1k|              }
  566|   356k|            }
  567|  17.1k|            else
  568|  17.1k|              cp->pass_length[0] = cp->pass_length[1] = 0;
  569|   373k|          }
  570|   252k|        }
  571|   196k|      }
  572|  93.4k|      data_left = bb.bytes_left;
  573|  93.4k|    }
ojph_precinct.cpp:_ZN4ojph5localL8log2ceilEj:
   88|   665k|    {
   89|   665k|      ui32 t = 31 - count_leading_zeros(x);
   90|   665k|      return t + (x & (x - 1) ? 1 : 0);
  ------------------
  |  Branch (90:19): [True: 5.18k, False: 660k]
  ------------------
   91|   665k|    }
_ZN4ojph5local8tag_tree4initEPhPjjNS_4sizeEi:
   61|   887k|      {
   62|  2.74M|        for (ui32 i = 0; i <= num_levels; ++i) //on extra level
  ------------------
  |  Branch (62:26): [True: 1.85M, False: 887k]
  ------------------
   63|  1.85M|          levs[i] = buf + lev_idx[i];
   64|  13.2M|        for (ui32 i = num_levels + 1; i < 16; ++i)
  ------------------
  |  Branch (64:39): [True: 12.3M, False: 887k]
  ------------------
   65|  12.3M|          levs[i] = (ui8*)INT_MAX; //make it crash on error
   66|   887k|        width = s.w;
   67|   887k|        height = s.h;
   68|  1.85M|        for (ui32 i = 0; i < num_levels; ++i)
  ------------------
  |  Branch (68:26): [True: 968k, False: 887k]
  ------------------
   69|   968k|        {
   70|   968k|          ui32 size = 1u << ((num_levels - 1 - i) << 1);
   71|   968k|          memset(levs[i], init_val, size);
   72|   968k|        }
   73|   887k|        *levs[num_levels] = 0;
   74|   887k|        this->num_levels = num_levels;
   75|   887k|      }
_ZN4ojph5local8tag_tree3getEjjj:
   78|  4.13M|      {
   79|  4.13M|        return levs[lev] + (x + y * ((width + (1 << lev) - 1) >> lev));
   80|  4.13M|      }

_ZN4ojph5local8precinctC2Ev:
   60|  9.47M|      precinct() {
   61|  9.47M|        scratch = NULL; bands = NULL; coded = NULL;
   62|  9.47M|        may_use_sop = uses_eph = false;
   63|  9.47M|      }

_ZN4ojph5local10resolution9pre_allocEPNS0_10codestreamERKNS_4rectES6_jj:
   62|  6.82M|    {
   63|  6.82M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   64|  6.82M|      const param_cod* cdp = codestream->get_coc(comp_num);
   65|  6.82M|      ui32 num_decomps = cdp->get_num_decompositions();
   66|  6.82M|      ui32 t = num_decomps - codestream->get_skipped_res_for_recon();
   67|  6.82M|      bool skipped_res_for_recon = res_num > t;
   68|       |
   69|  6.82M|      const param_atk* atk = cdp->access_atk();
   70|  6.82M|      param_dfs::dfs_dwt_type ds = param_dfs::BIDIR_DWT;
   71|  6.82M|      if (cdp->is_dfs_defined()) {
  ------------------
  |  Branch (71:11): [True: 400k, False: 6.42M]
  ------------------
   72|   400k|        const param_dfs* dfs = codestream->access_dfs();
   73|   400k|        if (dfs == NULL) {
  ------------------
  |  Branch (73:13): [True: 5, False: 400k]
  ------------------
   74|      5|          OJPH_ERROR(0x00070001, "There is a problem with codestream "
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   75|      5|            "marker segments. COD/COC specifies the use of a DFS marker "
   76|      5|            "but there are no DFS markers within the main codestream "
   77|      5|            "headers");
   78|      5|        }
   79|   400k|        else {
   80|   400k|          ui16 dfs_idx = cdp->get_dfs_index();
   81|   400k|          dfs = dfs->get_dfs(dfs_idx);
   82|   400k|          if (dfs == NULL) {
  ------------------
  |  Branch (82:15): [True: 4, False: 400k]
  ------------------
   83|      4|            OJPH_ERROR(0x00070002, "There is a problem with codestream "
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|      4|              "marker segments. COD/COC specifies the use of a DFS marker "
   85|      4|              "with index %d, but there are no such marker within the "
   86|      4|              "main codestream headers", dfs_idx);
   87|      4|          }
   88|   400k|          ds = dfs->get_dwt_type(num_decomps - res_num + 1);
   89|   400k|        }
   90|   400k|      }
   91|       |
   92|  6.82M|      ui32 transform_flags = 0;
   93|  6.82M|      if (res_num > 0)
  ------------------
  |  Branch (93:11): [True: 5.62M, False: 1.20M]
  ------------------
   94|  5.62M|      {
   95|  5.62M|        if (ds == param_dfs::BIDIR_DWT)
  ------------------
  |  Branch (95:13): [True: 5.37M, False: 247k]
  ------------------
   96|  5.37M|          transform_flags = HORZ_TRX | VERT_TRX;
   97|   247k|        else if (ds == param_dfs::HORZ_DWT)
  ------------------
  |  Branch (97:18): [True: 52.7k, False: 194k]
  ------------------
   98|  52.7k|          transform_flags = HORZ_TRX;
   99|   194k|        else if (ds == param_dfs::VERT_DWT)
  ------------------
  |  Branch (99:18): [True: 120k, False: 73.5k]
  ------------------
  100|   120k|          transform_flags = VERT_TRX;
  101|  5.62M|      }
  102|       |
  103|       |      //allocate resolution/subbands
  104|  6.82M|      ui32 trx0 = res_rect.org.x;
  105|  6.82M|      ui32 try0 = res_rect.org.y;
  106|  6.82M|      ui32 trx1 = res_rect.org.x + res_rect.siz.w;
  107|  6.82M|      ui32 try1 = res_rect.org.y + res_rect.siz.h;
  108|  6.82M|      allocator->pre_alloc_obj<subband>(4);
  109|  6.82M|      if (res_num > 0)
  ------------------
  |  Branch (109:11): [True: 5.62M, False: 1.20M]
  ------------------
  110|  5.62M|      {
  111|  5.62M|        if (ds == param_dfs::BIDIR_DWT)
  ------------------
  |  Branch (111:13): [True: 5.37M, False: 247k]
  ------------------
  112|  5.37M|        {
  113|  26.8M|          for (ui32 i = 0; i < 4; ++i)
  ------------------
  |  Branch (113:28): [True: 21.5M, False: 5.37M]
  ------------------
  114|  21.5M|          {
  115|  21.5M|            ui32 tbx0 = (trx0 - (i & 1) + 1) >> 1;
  116|  21.5M|            ui32 tbx1 = (trx1 - (i & 1) + 1) >> 1;
  117|  21.5M|            ui32 tby0 = (try0 - (i >> 1) + 1) >> 1;
  118|  21.5M|            ui32 tby1 = (try1 - (i >> 1) + 1) >> 1;
  119|       |
  120|  21.5M|            rect re;
  121|  21.5M|            re.org.x = tbx0;
  122|  21.5M|            re.org.y = tby0;
  123|  21.5M|            re.siz.w = tbx1 - tbx0;
  124|  21.5M|            re.siz.h = tby1 - tby0;
  125|  21.5M|            if (i == 0) {
  ------------------
  |  Branch (125:17): [True: 5.37M, False: 16.1M]
  ------------------
  126|  5.37M|              allocator->pre_alloc_obj<resolution>(1);
  127|  5.37M|              resolution::pre_alloc(codestream, re,
  128|  5.37M|                skipped_res_for_recon ? recon_res_rect : re,
  ------------------
  |  Branch (128:17): [True: 971k, False: 4.40M]
  ------------------
  129|  5.37M|                comp_num, res_num - 1);
  130|  5.37M|            }
  131|  16.1M|            else
  132|  16.1M|              subband::pre_alloc(codestream, re, comp_num, res_num,
  133|  16.1M|                                 transform_flags);
  134|  21.5M|          }
  135|  5.37M|        }
  136|   247k|        else if (ds == param_dfs::VERT_DWT)
  ------------------
  |  Branch (136:18): [True: 120k, False: 126k]
  ------------------
  137|   120k|        {
  138|   120k|          ui32 tby0, tby1;
  139|   120k|          rect re = res_rect;
  140|   120k|          tby0 = (try0 + 1) >> 1;
  141|   120k|          tby1 = (try1 + 1) >> 1;
  142|   120k|          re.org.y = tby0;
  143|   120k|          re.siz.h = tby1 - tby0;
  144|   120k|          allocator->pre_alloc_obj<resolution>(1);
  145|   120k|          resolution::pre_alloc(codestream, re,
  146|   120k|            skipped_res_for_recon ? recon_res_rect : re,
  ------------------
  |  Branch (146:13): [True: 91.9k, False: 28.8k]
  ------------------
  147|   120k|            comp_num, res_num - 1);
  148|       |
  149|   120k|          tby0 = try0 >> 1;
  150|   120k|          tby1 = try1 >> 1;
  151|   120k|          re.org.y = tby0;
  152|   120k|          re.siz.h = tby1 - tby0;
  153|   120k|          subband::pre_alloc(codestream, re, comp_num, res_num,
  154|   120k|                             transform_flags);
  155|   120k|        }
  156|   126k|        else if (ds == param_dfs::HORZ_DWT)
  ------------------
  |  Branch (156:18): [True: 52.7k, False: 73.5k]
  ------------------
  157|  52.7k|        {
  158|  52.7k|          ui32 tbx0, tbx1;
  159|  52.7k|          rect re = res_rect;
  160|  52.7k|          tbx0 = (trx0 + 1) >> 1;
  161|  52.7k|          tbx1 = (trx1 + 1) >> 1;
  162|  52.7k|          re.org.x = tbx0;
  163|  52.7k|          re.siz.w = tbx1 - tbx0;
  164|  52.7k|          allocator->pre_alloc_obj<resolution>(1);
  165|  52.7k|          resolution::pre_alloc(codestream, re,
  166|  52.7k|            skipped_res_for_recon ? recon_res_rect : re,
  ------------------
  |  Branch (166:13): [True: 43.0k, False: 9.70k]
  ------------------
  167|  52.7k|            comp_num, res_num - 1);
  168|       |
  169|  52.7k|          tbx0 = trx0 >> 1;
  170|  52.7k|          tbx1 = trx1 >> 1;
  171|  52.7k|          re.org.x = tbx0;
  172|  52.7k|          re.siz.w = tbx1 - tbx0;
  173|  52.7k|          subband::pre_alloc(codestream, re, comp_num, res_num,
  174|  52.7k|                             transform_flags);
  175|  52.7k|        }
  176|  73.5k|        else
  177|  73.5k|        {
  178|  73.5k|          assert(ds == param_dfs::NO_DWT);
  179|  73.5k|          allocator->pre_alloc_obj<resolution>(1);
  180|  73.5k|          resolution::pre_alloc(codestream, res_rect,
  181|  73.5k|            skipped_res_for_recon ? recon_res_rect : res_rect,
  ------------------
  |  Branch (181:13): [True: 34.1k, False: 39.4k]
  ------------------
  182|  73.5k|            comp_num, res_num - 1);
  183|  73.5k|        }
  184|  5.62M|      }
  185|  1.20M|      else
  186|  1.20M|        subband::pre_alloc(codestream, res_rect, comp_num, res_num,
  187|  1.20M|                           transform_flags);
  188|       |
  189|       |      //prealloc precincts
  190|  6.82M|      size log_PP = cdp->get_log_precinct_size(res_num);
  191|  6.82M|      size num_precincts;
  192|  6.82M|      if (trx0 != trx1 && try0 != try1)
  ------------------
  |  Branch (192:11): [True: 4.76M, False: 2.06M]
  |  Branch (192:27): [True: 1.93M, False: 2.82M]
  ------------------
  193|  1.93M|      {
  194|  1.93M|        num_precincts.w = (trx1 + (1 << log_PP.w) - 1) >> log_PP.w;
  195|  1.93M|        num_precincts.w -= trx0 >> log_PP.w;
  196|  1.93M|        num_precincts.h = (try1 + (1 << log_PP.h) - 1) >> log_PP.h;
  197|  1.93M|        num_precincts.h -= try0 >> log_PP.h;
  198|  1.93M|        allocator->pre_alloc_obj<precinct>((size_t)num_precincts.area());
  199|  1.93M|      }
  200|       |
  201|       |      //allocate lines
  202|  6.82M|      if (skipped_res_for_recon == false)
  ------------------
  |  Branch (202:11): [True: 5.68M, False: 1.14M]
  ------------------
  203|  5.68M|      {
  204|  5.68M|        ui32 num_steps = atk->get_num_steps();
  205|  5.68M|        allocator->pre_alloc_obj<line_buf>(num_steps + 2);
  206|  5.68M|        allocator->pre_alloc_obj<lifting_buf>(num_steps + 2);
  207|       |
  208|  5.68M|        const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
  209|  5.68M|        ui32 precision = qp->propose_precision(cdp);
  210|  5.68M|        const param_atk* atk = cdp->access_atk();
  211|  5.68M|        bool reversible = atk->is_reversible();
  212|       |
  213|  5.68M|        ui32 width = res_rect.siz.w + 1;
  214|  5.68M|        if (reversible)
  ------------------
  |  Branch (214:13): [True: 5.08M, False: 597k]
  ------------------
  215|  5.08M|        {
  216|  5.08M|          if (precision <= 32) {
  ------------------
  |  Branch (216:15): [True: 4.02M, False: 1.05M]
  ------------------
  217|  12.0M|            for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (217:30): [True: 8.05M, False: 4.02M]
  ------------------
  218|  8.05M|              allocator->pre_alloc_data<si32>(width, 1);
  219|  4.02M|            allocator->pre_alloc_data<si32>(width, 1);
  220|  4.02M|            allocator->pre_alloc_data<si32>(width, 1);
  221|  4.02M|          }
  222|  1.05M|          else
  223|  1.05M|          {
  224|  3.17M|            for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (224:30): [True: 2.11M, False: 1.05M]
  ------------------
  225|  2.11M|              allocator->pre_alloc_data<si64>(width, 1);
  226|  1.05M|            allocator->pre_alloc_data<si64>(width, 1);
  227|  1.05M|            allocator->pre_alloc_data<si64>(width, 1);
  228|  1.05M|          }
  229|  5.08M|        }
  230|   597k|        else {
  231|  2.98M|          for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (231:28): [True: 2.38M, False: 597k]
  ------------------
  232|  2.38M|            allocator->pre_alloc_data<float>(width, 1);
  233|   597k|          allocator->pre_alloc_data<float>(width, 1);
  234|   597k|          allocator->pre_alloc_data<float>(width, 1);
  235|   597k|        }
  236|  5.68M|      }
  237|  6.82M|    }
_ZN4ojph5local10resolution14finalize_allocEPNS0_10codestreamERKNS_4rectES6_jjNS_5pointES7_PNS0_9tile_compEPS1_:
  247|  6.34M|    {
  248|  6.34M|      mem_fixed_allocator* allocator = codestream->get_allocator();
  249|  6.34M|      elastic = codestream->get_elastic_alloc();
  250|  6.34M|      const param_cod* cdp = codestream->get_coc(comp_num);
  251|  6.34M|      ui32 t, num_decomps = cdp->get_num_decompositions();
  252|  6.34M|      t = num_decomps - codestream->get_skipped_res_for_recon();
  253|  6.34M|      skipped_res_for_recon = res_num > t;
  254|  6.34M|      t = num_decomps - codestream->get_skipped_res_for_read();
  255|  6.34M|      skipped_res_for_read = res_num > t;
  256|       |
  257|  6.34M|      this->comp_downsamp = comp_downsamp;
  258|  6.34M|      this->parent_comp = parent_tile_comp;
  259|  6.34M|      this->parent_res = parent_res;
  260|  6.34M|      this->res_rect = res_rect;
  261|  6.34M|      this->comp_num = comp_num;
  262|  6.34M|      this->res_num = res_num;
  263|  6.34M|      this->num_bytes = 0;
  264|  6.34M|      this->atk = cdp->access_atk();
  265|  6.34M|      param_dfs::dfs_dwt_type ds = param_dfs::BIDIR_DWT;
  266|  6.34M|      if (cdp->is_dfs_defined()) {
  ------------------
  |  Branch (266:11): [True: 397k, False: 5.95M]
  ------------------
  267|   397k|        const param_dfs* dfs = codestream->access_dfs();
  268|   397k|        if (dfs == NULL) {
  ------------------
  |  Branch (268:13): [True: 0, False: 397k]
  ------------------
  269|      0|          OJPH_ERROR(0x00070011, "There is a problem with codestream "
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  270|      0|            "marker segments. COD/COC specifies the use of a DFS marker "
  271|      0|            "but there are no DFS markers within the main codestream "
  272|      0|            "headers");
  273|      0|        }
  274|   397k|        else {
  275|   397k|          ui16 dfs_idx = cdp->get_dfs_index();
  276|   397k|          dfs = dfs->get_dfs(dfs_idx);
  277|   397k|          if (dfs == NULL) {
  ------------------
  |  Branch (277:15): [True: 0, False: 397k]
  ------------------
  278|      0|            OJPH_ERROR(0x00070012, "There is a problem with codestream "
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|      0|              "marker segments. COD/COC specifies the use of a DFS marker "
  280|      0|              "with index %d, but there are no such marker within the "
  281|      0|              "main codestream headers", dfs_idx);
  282|      0|          }
  283|   397k|          ui32 num_decomps = cdp->get_num_decompositions();
  284|   397k|          ds = dfs->get_dwt_type(num_decomps - res_num + 1);
  285|   397k|        }
  286|   397k|      }
  287|       |
  288|  6.34M|      transform_flags = 0;
  289|  6.34M|      if (res_num > 0)
  ------------------
  |  Branch (289:11): [True: 5.22M, False: 1.12M]
  ------------------
  290|  5.22M|      {
  291|  5.22M|        if (ds == param_dfs::BIDIR_DWT)
  ------------------
  |  Branch (291:13): [True: 4.98M, False: 245k]
  ------------------
  292|  4.98M|          transform_flags = HORZ_TRX | VERT_TRX;
  293|   245k|        else if (ds == param_dfs::HORZ_DWT)
  ------------------
  |  Branch (293:18): [True: 52.5k, False: 192k]
  ------------------
  294|  52.5k|          transform_flags = HORZ_TRX;
  295|   192k|        else if (ds == param_dfs::VERT_DWT)
  ------------------
  |  Branch (295:18): [True: 120k, False: 72.0k]
  ------------------
  296|   120k|          transform_flags = VERT_TRX;
  297|  5.22M|      }
  298|       |
  299|       |      //allocate resolution/subbands
  300|  6.34M|      ui32 trx0 = res_rect.org.x;
  301|  6.34M|      ui32 try0 = res_rect.org.y;
  302|  6.34M|      ui32 trx1 = res_rect.org.x + res_rect.siz.w;
  303|  6.34M|      ui32 try1 = res_rect.org.y + res_rect.siz.h;
  304|  6.34M|      bands = allocator->post_alloc_obj<subband>(4);
  305|  31.7M|      for (int i = 0; i < 4; ++i)
  ------------------
  |  Branch (305:23): [True: 25.3M, False: 6.34M]
  ------------------
  306|  25.3M|        new (bands + i) subband;
  307|  6.34M|      if (res_num > 0)
  ------------------
  |  Branch (307:11): [True: 5.22M, False: 1.12M]
  ------------------
  308|  5.22M|      {
  309|  5.22M|        if (ds == param_dfs::BIDIR_DWT)
  ------------------
  |  Branch (309:13): [True: 4.98M, False: 245k]
  ------------------
  310|  4.98M|        {
  311|  24.9M|          for (ui32 i = 0; i < 4; ++i)
  ------------------
  |  Branch (311:28): [True: 19.9M, False: 4.98M]
  ------------------
  312|  19.9M|          {
  313|  19.9M|            ui32 tbx0 = (trx0 - (i & 1) + 1) >> 1;
  314|  19.9M|            ui32 tbx1 = (trx1 - (i & 1) + 1) >> 1;
  315|  19.9M|            ui32 tby0 = (try0 - (i >> 1) + 1) >> 1;
  316|  19.9M|            ui32 tby1 = (try1 - (i >> 1) + 1) >> 1;
  317|       |
  318|  19.9M|            rect re;
  319|  19.9M|            re.org.x = tbx0;
  320|  19.9M|            re.org.y = tby0;
  321|  19.9M|            re.siz.w = tbx1 - tbx0;
  322|  19.9M|            re.siz.h = tby1 - tby0;
  323|  19.9M|            if (i == 0) {
  ------------------
  |  Branch (323:17): [True: 4.98M, False: 14.9M]
  ------------------
  324|  4.98M|              point next_res_downsamp;
  325|  4.98M|              next_res_downsamp.x = res_downsamp.x * 2;
  326|  4.98M|              next_res_downsamp.y = res_downsamp.y * 2;
  327|       |
  328|  4.98M|              child_res = allocator->post_alloc_obj<resolution>(1);
  329|  4.98M|              child_res->finalize_alloc(codestream, re,
  330|  4.98M|                skipped_res_for_recon ? recon_res_rect : re, comp_num,
  ------------------
  |  Branch (330:17): [True: 921k, False: 4.05M]
  ------------------
  331|  4.98M|                res_num - 1, comp_downsamp, next_res_downsamp,
  332|  4.98M|                parent_tile_comp, this);
  333|  4.98M|            }
  334|  14.9M|            else
  335|  14.9M|              bands[i].finalize_alloc(codestream, re, this, res_num, i);
  336|  19.9M|          }
  337|  4.98M|        }
  338|   245k|        else if (ds == param_dfs::VERT_DWT)
  ------------------
  |  Branch (338:18): [True: 120k, False: 124k]
  ------------------
  339|   120k|        {
  340|   120k|          ui32 tby0, tby1;
  341|   120k|          rect re = res_rect;
  342|   120k|          tby0 = (try0 + 1) >> 1;
  343|   120k|          tby1 = (try1 + 1) >> 1;
  344|   120k|          re.org.y = tby0;
  345|   120k|          re.siz.h = tby1 - tby0;
  346|       |
  347|   120k|          point next_res_downsamp;
  348|   120k|          next_res_downsamp.x = res_downsamp.x;
  349|   120k|          next_res_downsamp.y = res_downsamp.y * 2;
  350|   120k|          child_res = allocator->post_alloc_obj<resolution>(1);
  351|   120k|          child_res->finalize_alloc(codestream, re,
  352|   120k|            skipped_res_for_recon ? recon_res_rect : re, comp_num,
  ------------------
  |  Branch (352:13): [True: 91.7k, False: 28.7k]
  ------------------
  353|   120k|            res_num - 1, comp_downsamp, next_res_downsamp,
  354|   120k|            parent_tile_comp, this);
  355|       |
  356|   120k|          tby0 = try0 >> 1;
  357|   120k|          tby1 = try1 >> 1;
  358|   120k|          re.org.y = tby0;
  359|   120k|          re.siz.h = tby1 - tby0;
  360|   120k|          bands[2].finalize_alloc(codestream, re, this, res_num, 2);
  361|   120k|        }
  362|   124k|        else if (ds == param_dfs::HORZ_DWT)
  ------------------
  |  Branch (362:18): [True: 52.5k, False: 72.0k]
  ------------------
  363|  52.5k|        {
  364|  52.5k|          ui32 tbx0, tbx1;
  365|  52.5k|          rect re = res_rect;
  366|  52.5k|          tbx0 = (trx0 + 1) >> 1;
  367|  52.5k|          tbx1 = (trx1 + 1) >> 1;
  368|  52.5k|          re.org.x = tbx0;
  369|  52.5k|          re.siz.w = tbx1 - tbx0;
  370|       |
  371|  52.5k|          point next_res_downsamp;
  372|  52.5k|          next_res_downsamp.x = res_downsamp.x * 2;
  373|  52.5k|          next_res_downsamp.y = res_downsamp.y;
  374|  52.5k|          child_res = allocator->post_alloc_obj<resolution>(1);
  375|  52.5k|          child_res->finalize_alloc(codestream, re,
  376|  52.5k|            skipped_res_for_recon ? recon_res_rect : re, comp_num,
  ------------------
  |  Branch (376:13): [True: 42.9k, False: 9.58k]
  ------------------
  377|  52.5k|            res_num - 1, comp_downsamp, next_res_downsamp,
  378|  52.5k|            parent_tile_comp, this);
  379|       |
  380|  52.5k|          tbx0 = trx0 >> 1;
  381|  52.5k|          tbx1 = trx1 >> 1;
  382|  52.5k|          re.org.x = tbx0;
  383|  52.5k|          re.siz.w = tbx1 - tbx0;
  384|  52.5k|          bands[1].finalize_alloc(codestream, re, this, res_num, 1);
  385|  52.5k|        }
  386|  72.0k|        else
  387|  72.0k|        {
  388|  72.0k|          assert(ds == param_dfs::NO_DWT);
  389|  72.0k|          child_res = allocator->post_alloc_obj<resolution>(1);
  390|  72.0k|          child_res->finalize_alloc(codestream, res_rect,
  391|  72.0k|            skipped_res_for_recon ? recon_res_rect : res_rect, comp_num,
  ------------------
  |  Branch (391:13): [True: 33.7k, False: 38.2k]
  ------------------
  392|  72.0k|            res_num - 1, comp_downsamp, res_downsamp, parent_tile_comp, this);
  393|  72.0k|        }
  394|  5.22M|      }
  395|  1.12M|      else {
  396|  1.12M|        child_res = NULL;
  397|  1.12M|        bands[0].finalize_alloc(codestream, res_rect, this, res_num, 0);
  398|  1.12M|      }
  399|       |
  400|       |      //finalize precincts
  401|  6.34M|      log_PP = cdp->get_log_precinct_size(res_num);
  402|  6.34M|      num_precincts = size();
  403|  6.34M|      precincts = NULL;
  404|  6.34M|      if (trx0 != trx1 && try0 != try1)
  ------------------
  |  Branch (404:11): [True: 4.75M, False: 1.59M]
  |  Branch (404:27): [True: 1.92M, False: 2.82M]
  ------------------
  405|  1.92M|      {
  406|  1.92M|        num_precincts.w = (trx1 + (1 << log_PP.w) - 1) >> log_PP.w;
  407|  1.92M|        num_precincts.w -= trx0 >> log_PP.w;
  408|  1.92M|        num_precincts.h = (try1 + (1 << log_PP.h) - 1) >> log_PP.h;
  409|  1.92M|        num_precincts.h -= try0 >> log_PP.h;
  410|  1.92M|        precincts =
  411|  1.92M|          allocator->post_alloc_obj<precinct>((size_t)num_precincts.area());
  412|  1.92M|        ui64 num = num_precincts.area();
  413|  11.4M|        for (ui64 i = 0; i < num; ++i)
  ------------------
  |  Branch (413:26): [True: 9.47M, False: 1.92M]
  ------------------
  414|  9.47M|          precincts[i] = precinct();
  415|  1.92M|      }
  416|       |      // precincts will be initialized in full shortly
  417|       |
  418|  6.34M|      ui32 x_lower_bound = (trx0 >> log_PP.w) << log_PP.w;
  419|  6.34M|      ui32 y_lower_bound = (try0 >> log_PP.h) << log_PP.h;
  420|       |
  421|  6.34M|      precinct* pp = precincts;
  422|  6.34M|      point tile_top_left = parent_tile_comp->get_tile()->get_tile_rect().org;
  423|  9.69M|      for (ui32 y = 0; y < num_precincts.h; ++y)
  ------------------
  |  Branch (423:24): [True: 3.34M, False: 6.34M]
  ------------------
  424|  3.34M|      {
  425|  3.34M|        ui32 ppy0 = y_lower_bound + (y << log_PP.h);
  426|  12.8M|        for (ui32 x = 0; x < num_precincts.w; ++x, ++pp)
  ------------------
  |  Branch (426:26): [True: 9.47M, False: 3.34M]
  ------------------
  427|  9.47M|        {
  428|  9.47M|          ui32 ppx0 = x_lower_bound + (x << log_PP.w);
  429|  9.47M|          point t(res_downsamp.x * ppx0, res_downsamp.y * ppy0);
  430|  9.47M|          t.x = t.x > tile_top_left.x ? t.x : tile_top_left.x;
  ------------------
  |  Branch (430:17): [True: 6.15M, False: 3.32M]
  ------------------
  431|  9.47M|          t.y = t.y > tile_top_left.y ? t.y : tile_top_left.y;
  ------------------
  |  Branch (431:17): [True: 4.74M, False: 4.72M]
  ------------------
  432|  9.47M|          pp->img_point = t;
  433|  9.47M|          pp->bands = bands;
  434|  9.47M|          pp->may_use_sop = cdp->packets_may_use_sop();
  435|  9.47M|          pp->uses_eph = cdp->packets_use_eph();
  436|  9.47M|          pp->scratch = codestream->get_precinct_scratch();
  437|  9.47M|          pp->coded = NULL;
  438|  9.47M|        }
  439|  3.34M|      }
  440|  31.7M|      for (int i = 0; i < 4; ++i)
  ------------------
  |  Branch (440:23): [True: 25.3M, False: 6.34M]
  ------------------
  441|  25.3M|        if (bands[i].exists())
  ------------------
  |  Branch (441:13): [True: 1.15M, False: 24.2M]
  ------------------
  442|  1.15M|          bands[i].get_cb_indices(num_precincts, precincts);
  443|       |
  444|       |      // determine how to divide scratch into multiple levels of
  445|       |      // tag trees
  446|  6.34M|      size log_cb = cdp->get_log_block_dims();
  447|  6.34M|      log_PP.w -= (transform_flags & HORZ_TRX) ? 1 : 0;
  ------------------
  |  Branch (447:19): [True: 5.03M, False: 1.31M]
  ------------------
  448|  6.34M|      log_PP.h -= (transform_flags & VERT_TRX) ? 1 : 0;
  ------------------
  |  Branch (448:19): [True: 5.10M, False: 1.24M]
  ------------------
  449|  6.34M|      size ratio;
  450|  6.34M|      ratio.w = log_PP.w - ojph_min(log_cb.w, log_PP.w);
  ------------------
  |  |   76|  6.34M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 537k, False: 5.81M]
  |  |  ------------------
  ------------------
  451|  6.34M|      ratio.h = log_PP.h - ojph_min(log_cb.h, log_PP.h);
  ------------------
  |  |   76|  6.34M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 1.09M, False: 5.25M]
  |  |  ------------------
  ------------------
  452|  6.34M|      max_num_levels = ojph_max(ratio.w, ratio.h);
  ------------------
  |  |   73|  6.34M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 248k, False: 6.10M]
  |  |  ------------------
  ------------------
  453|  6.34M|      ui32 val = 1u << (max_num_levels << 1);
  454|  6.34M|      tag_tree_size = (int)((val * 4 + 2) / 3);
  455|  6.34M|      ++max_num_levels;
  456|  6.34M|      level_index[0] = 0;
  457|  19.5M|      for (ui32 i = 1; i <= max_num_levels; ++i, val >>= 2)
  ------------------
  |  Branch (457:24): [True: 13.2M, False: 6.34M]
  ------------------
  458|  13.2M|        level_index[i] = level_index[i - 1] + val;
  459|  6.34M|      cur_precinct_loc = point(0, 0);
  460|       |
  461|       |      //allocate lines
  462|  6.34M|      if (skipped_res_for_recon == false)
  ------------------
  |  Branch (462:11): [True: 5.25M, False: 1.09M]
  ------------------
  463|  5.25M|      {
  464|  5.25M|        this->atk = cdp->access_atk();
  465|  5.25M|        this->reversible = atk->is_reversible();
  466|  5.25M|        this->num_steps = atk->get_num_steps();
  467|       |        // create line buffers and lifting_bufs
  468|  5.25M|        lines = allocator->post_alloc_obj<line_buf>(num_steps + 2);
  469|  5.25M|        ssp = allocator->post_alloc_obj<lifting_buf>(num_steps + 2);
  470|  5.25M|        sig = ssp + num_steps;
  471|  5.25M|        aug = ssp + num_steps + 1;
  472|       |
  473|       |        // initiate lifting_bufs
  474|  16.8M|        for (ui32 i = 0; i < num_steps; ++i) {
  ------------------
  |  Branch (474:26): [True: 11.6M, False: 5.25M]
  ------------------
  475|  11.6M|          new (ssp + i) lifting_buf;
  476|  11.6M|          ssp[i].line = lines + i;
  477|  11.6M|        };
  478|  5.25M|        new (sig) lifting_buf;
  479|  5.25M|        sig->line = lines + num_steps;
  480|  5.25M|        new (aug) lifting_buf;
  481|  5.25M|        aug->line = lines + num_steps + 1;
  482|       |
  483|  5.25M|        const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
  484|  5.25M|        ui32 precision = qp->propose_precision(cdp);
  485|       |
  486|       |        // initiate storage of line_buf
  487|  5.25M|        ui32 width = res_rect.siz.w + 1;
  488|  5.25M|        if (this->reversible)
  ------------------
  |  Branch (488:13): [True: 4.69M, False: 564k]
  ------------------
  489|  4.69M|        {
  490|  4.69M|          if (precision <= 32)
  ------------------
  |  Branch (490:15): [True: 4.02M, False: 667k]
  ------------------
  491|  4.02M|          {
  492|  12.0M|            for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (492:30): [True: 8.05M, False: 4.02M]
  ------------------
  493|  8.05M|              ssp[i].line->wrap(
  494|  8.05M|                allocator->post_alloc_data<si32>(width, 1), width, 1);
  495|  4.02M|            sig->line->wrap(
  496|  4.02M|              allocator->post_alloc_data<si32>(width, 1), width, 1);
  497|  4.02M|            aug->line->wrap(
  498|  4.02M|              allocator->post_alloc_data<si32>(width, 1), width, 1);
  499|  4.02M|          }
  500|   667k|          else
  501|   667k|          {
  502|  2.00M|            for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (502:30): [True: 1.33M, False: 667k]
  ------------------
  503|  1.33M|              ssp[i].line->wrap(
  504|  1.33M|                allocator->post_alloc_data<si64>(width, 1), width, 1);
  505|   667k|            sig->line->wrap(
  506|   667k|              allocator->post_alloc_data<si64>(width, 1), width, 1);
  507|   667k|            aug->line->wrap(
  508|   667k|              allocator->post_alloc_data<si64>(width, 1), width, 1);
  509|   667k|          }
  510|  4.69M|        }
  511|   564k|        else
  512|   564k|        {
  513|  2.81M|            for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (513:30): [True: 2.25M, False: 564k]
  ------------------
  514|  2.25M|              ssp[i].line->wrap(
  515|  2.25M|                allocator->post_alloc_data<float>(width, 1), width, 1);
  516|   564k|            sig->line->wrap(
  517|   564k|              allocator->post_alloc_data<float>(width, 1), width, 1);
  518|   564k|            aug->line->wrap(
  519|   564k|              allocator->post_alloc_data<float>(width, 1), width, 1);
  520|   564k|        }
  521|       |
  522|  5.25M|        cur_line = 0;
  523|  5.25M|        rows_to_produce = res_rect.siz.h;
  524|  5.25M|        vert_even = (res_rect.org.y & 1) == 0;
  525|  5.25M|        horz_even = (res_rect.org.x & 1) == 0;
  526|  5.25M|      }
  527|  6.34M|    }
_ZN4ojph5local10resolution9pull_lineEv:
  714|  9.28M|    {
  715|  9.28M|      if (res_num == 0)
  ------------------
  |  Branch (715:11): [True: 1.05M, False: 8.22M]
  ------------------
  716|  1.05M|      {
  717|  1.05M|        assert(child_res == NULL);
  718|  1.05M|        return bands[0].pull_line();
  719|  1.05M|      }
  720|       |
  721|  8.22M|      if (skipped_res_for_recon == true)
  ------------------
  |  Branch (721:11): [True: 829k, False: 7.39M]
  ------------------
  722|   829k|        return child_res->pull_line();
  723|       |
  724|  7.39M|      ui32 width = res_rect.siz.w;
  725|  7.39M|      if (width == 0)
  ------------------
  |  Branch (725:11): [True: 154k, False: 7.24M]
  ------------------
  726|   154k|        return NULL;
  727|       |
  728|  7.24M|      if (transform_flags & VERT_TRX)
  ------------------
  |  Branch (728:11): [True: 6.20M, False: 1.03M]
  ------------------
  729|  6.20M|      {
  730|  6.20M|        if (reversible)
  ------------------
  |  Branch (730:13): [True: 4.24M, False: 1.96M]
  ------------------
  731|  4.24M|        {
  732|  4.24M|          if (res_rect.siz.h > 1)
  ------------------
  |  Branch (732:15): [True: 3.13M, False: 1.10M]
  ------------------
  733|  3.13M|          {
  734|  3.13M|            if (sig->active) {
  ------------------
  |  Branch (734:17): [True: 1.55M, False: 1.57M]
  ------------------
  735|  1.55M|              sig->active = false;
  736|  1.55M|              return sig->line;
  737|  1.57M|            };
  738|  1.57M|            for (;;)
  739|  3.17M|            {
  740|       |              //horizontal transform
  741|  3.17M|              if (cur_line < res_rect.siz.h)
  ------------------
  |  Branch (741:19): [True: 3.13M, False: 43.5k]
  ------------------
  742|  3.13M|              {
  743|  3.13M|                if (vert_even) { // even
  ------------------
  |  Branch (743:21): [True: 1.56M, False: 1.56M]
  ------------------
  744|  1.56M|                  if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (744:23): [True: 1.50M, False: 61.0k]
  ------------------
  745|  1.50M|                    rev_horz_syn(atk, aug->line, child_res->pull_line(),
  746|  1.50M|                      bands[1].pull_line(), width, horz_even);
  747|  61.0k|                  else
  748|  61.0k|                    memcpy(aug->line->p, child_res->pull_line()->p,
  749|  61.0k|                      (size_t)width
  750|  61.0k|                      * (aug->line->flags & line_buf::LFT_SIZE_MASK));
  751|  1.56M|                  aug->active = true;
  752|  1.56M|                  vert_even = !vert_even;
  753|  1.56M|                  ++cur_line;
  754|  1.56M|                  continue;
  755|  1.56M|                }
  756|  1.56M|                else {
  757|  1.56M|                  if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (757:23): [True: 1.50M, False: 61.0k]
  ------------------
  758|  1.50M|                    rev_horz_syn(atk, sig->line, bands[2].pull_line(),
  759|  1.50M|                      bands[3].pull_line(), width, horz_even);
  760|  61.0k|                  else
  761|  61.0k|                    memcpy(sig->line->p, bands[2].pull_line()->p,
  762|  61.0k|                      (size_t)width
  763|  61.0k|                      * (sig->line->flags & line_buf::LFT_SIZE_MASK));
  764|  1.56M|                  sig->active = true;
  765|  1.56M|                  vert_even = !vert_even;
  766|  1.56M|                  ++cur_line;
  767|  1.56M|                }
  768|  3.13M|              }
  769|       |
  770|       |              //vertical transform
  771|  4.57M|              for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (771:32): [True: 2.96M, False: 1.60M]
  ------------------
  772|  2.96M|              {
  773|  2.96M|                if (aug->active && (sig->active || ssp[i].active))
  ------------------
  |  Branch (773:21): [True: 2.88M, False: 83.6k]
  |  Branch (773:37): [True: 2.85M, False: 29.0k]
  |  Branch (773:52): [True: 29.0k, False: 0]
  ------------------
  774|  2.88M|                {
  775|  2.88M|                  line_buf* dp = aug->line;
  776|  2.88M|                  line_buf* sp1 = sig->active ? sig->line : ssp[i].line;
  ------------------
  |  Branch (776:35): [True: 2.85M, False: 29.0k]
  ------------------
  777|  2.88M|                  line_buf* sp2 = ssp[i].active ? ssp[i].line : sig->line;
  ------------------
  |  Branch (777:35): [True: 2.85M, False: 29.0k]
  ------------------
  778|  2.88M|                  const lifting_step* s = atk->get_step(i);
  779|  2.88M|                  rev_vert_step(s, sp1, sp2, dp, width, true);
  780|  2.88M|                }
  781|  2.96M|                lifting_buf t = *aug; *aug = ssp[i]; ssp[i] = *sig; *sig = t;
  782|  2.96M|              }
  783|       |
  784|  1.60M|              if (aug->active) {
  ------------------
  |  Branch (784:19): [True: 1.56M, False: 40.2k]
  ------------------
  785|  1.56M|                aug->active = false;
  786|  1.56M|                return aug->line;
  787|  1.56M|              }
  788|  40.2k|              if (sig->active) {
  ------------------
  |  Branch (788:19): [True: 11.1k, False: 29.0k]
  ------------------
  789|  11.1k|                sig->active = false;
  790|  11.1k|                return sig->line;
  791|  29.0k|              };
  792|  29.0k|            }
  793|  1.57M|          }
  794|  1.10M|          else
  795|  1.10M|          {
  796|  1.10M|            if (vert_even) {
  ------------------
  |  Branch (796:17): [True: 659k, False: 449k]
  ------------------
  797|   659k|              if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (797:19): [True: 658k, False: 1.29k]
  ------------------
  798|   658k|                rev_horz_syn(atk, aug->line, child_res->pull_line(),
  799|   658k|                  bands[1].pull_line(), width, horz_even);
  800|  1.29k|              else
  801|  1.29k|                memcpy(aug->line->p, child_res->pull_line()->p,
  802|  1.29k|                  (size_t)width
  803|  1.29k|                  * (aug->line->flags & line_buf::LFT_SIZE_MASK));
  804|   659k|            }
  805|   449k|            else
  806|   449k|            {
  807|   449k|              if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (807:19): [True: 447k, False: 1.28k]
  ------------------
  808|   447k|                rev_horz_syn(atk, aug->line, bands[2].pull_line(),
  809|   447k|                  bands[3].pull_line(), width, horz_even);
  810|  1.28k|              else
  811|  1.28k|                memcpy(aug->line->p, bands[2].pull_line()->p,
  812|  1.28k|                  (size_t)width
  813|  1.28k|                  * (aug->line->flags & line_buf::LFT_SIZE_MASK));
  814|   449k|              if (aug->line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (814:19): [True: 431k, False: 17.1k]
  ------------------
  815|   431k|              {
  816|   431k|                si32* sp = aug->line->i32;
  817|  1.42M|                for (ui32 i = width; i > 0; --i)
  ------------------
  |  Branch (817:38): [True: 995k, False: 431k]
  ------------------
  818|   995k|                  *sp++ >>= 1;
  819|   431k|              }
  820|  17.1k|              else
  821|  17.1k|              {
  822|  17.1k|                assert(aug->line->flags & line_buf::LFT_64BIT);
  823|  17.1k|                si64* sp = aug->line->i64;
  824|   293k|                for (ui32 i = width; i > 0; --i)
  ------------------
  |  Branch (824:38): [True: 276k, False: 17.1k]
  ------------------
  825|   276k|                  *sp++ >>= 1;
  826|  17.1k|              }
  827|   449k|            }
  828|  1.10M|            return aug->line;
  829|  1.10M|          }
  830|  4.24M|        }
  831|  1.96M|        else
  832|  1.96M|        {
  833|  1.96M|          if (res_rect.siz.h > 1)
  ------------------
  |  Branch (833:15): [True: 1.92M, False: 44.2k]
  ------------------
  834|  1.92M|          {
  835|  1.92M|            if (sig->active) {
  ------------------
  |  Branch (835:17): [True: 954k, False: 967k]
  ------------------
  836|   954k|              sig->active = false;
  837|   954k|              return sig->line;
  838|   967k|            };
  839|   967k|            for (;;)
  840|  1.95M|            {
  841|       |              //horizontal transform
  842|  1.95M|              if (cur_line < res_rect.siz.h)
  ------------------
  |  Branch (842:19): [True: 1.92M, False: 32.0k]
  ------------------
  843|  1.92M|              {
  844|  1.92M|                if (vert_even) { // even
  ------------------
  |  Branch (844:21): [True: 962k, False: 960k]
  ------------------
  845|   962k|                  if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (845:23): [True: 961k, False: 294]
  ------------------
  846|   961k|                    irv_horz_syn(atk, aug->line, child_res->pull_line(),
  847|   961k|                      bands[1].pull_line(), width, horz_even);
  848|    294|                  else
  849|    294|                    memcpy(aug->line->f32, child_res->pull_line()->f32,
  850|    294|                      width * sizeof(float));
  851|   962k|                  aug->active = true;
  852|   962k|                  vert_even = !vert_even;
  853|   962k|                  ++cur_line;
  854|       |
  855|   962k|                  const float K = atk->get_K();
  856|   962k|                  irv_vert_times_K(K, aug->line, width);
  857|       |
  858|   962k|                  continue;
  859|   962k|                }
  860|   960k|                else {
  861|   960k|                  if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (861:23): [True: 960k, False: 299]
  ------------------
  862|   960k|                    irv_horz_syn(atk, sig->line, bands[2].pull_line(),
  863|   960k|                      bands[3].pull_line(), width, horz_even);
  864|    299|                  else
  865|    299|                    memcpy(sig->line->f32, bands[2].pull_line()->f32,
  866|    299|                      width * sizeof(float));
  867|   960k|                  sig->active = true;
  868|   960k|                  vert_even = !vert_even;
  869|   960k|                  ++cur_line;
  870|       |
  871|   960k|                  const float K_inv = 1.0f / atk->get_K();
  872|   960k|                  irv_vert_times_K(K_inv, sig->line, width);
  873|   960k|                }
  874|  1.92M|              }
  875|       |
  876|       |              //vertical transform
  877|  4.95M|              for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (877:32): [True: 3.96M, False: 992k]
  ------------------
  878|  3.96M|              {
  879|  3.96M|                if (aug->active && (sig->active || ssp[i].active))
  ------------------
  |  Branch (879:21): [True: 3.83M, False: 124k]
  |  Branch (879:37): [True: 3.81M, False: 24.8k]
  |  Branch (879:52): [True: 24.8k, False: 0]
  ------------------
  880|  3.83M|                {
  881|  3.83M|                  line_buf* dp = aug->line;
  882|  3.83M|                  line_buf* sp1 = sig->active ? sig->line : ssp[i].line;
  ------------------
  |  Branch (882:35): [True: 3.81M, False: 24.8k]
  ------------------
  883|  3.83M|                  line_buf* sp2 = ssp[i].active ? ssp[i].line : sig->line;
  ------------------
  |  Branch (883:35): [True: 3.81M, False: 24.9k]
  ------------------
  884|  3.83M|                  const lifting_step* s = atk->get_step(i);
  885|  3.83M|                  irv_vert_step(s, sp1, sp2, dp, width, true);
  886|  3.83M|                }
  887|  3.96M|                lifting_buf t = *aug; *aug = ssp[i]; ssp[i] = *sig; *sig = t;
  888|  3.96M|              }
  889|       |
  890|   992k|              if (aug->active) {
  ------------------
  |  Branch (890:19): [True: 962k, False: 30.3k]
  ------------------
  891|   962k|                aug->active = false;
  892|   962k|                return aug->line;
  893|   962k|              }
  894|  30.3k|              if (sig->active) {
  ------------------
  |  Branch (894:19): [True: 5.42k, False: 24.9k]
  ------------------
  895|  5.42k|                sig->active = false;
  896|  5.42k|                return sig->line;
  897|  24.9k|              };
  898|  24.9k|            }
  899|   967k|          }
  900|  44.2k|          else
  901|  44.2k|          {
  902|  44.2k|            if (vert_even) {
  ------------------
  |  Branch (902:17): [True: 39.6k, False: 4.59k]
  ------------------
  903|  39.6k|              if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (903:19): [True: 39.0k, False: 615]
  ------------------
  904|  39.0k|                irv_horz_syn(atk, aug->line, child_res->pull_line(),
  905|  39.0k|                  bands[1].pull_line(), width, horz_even);
  906|    615|              else
  907|    615|                memcpy(aug->line->f32, child_res->pull_line()->f32,
  908|    615|                  width * sizeof(float));
  909|  39.6k|            }
  910|  4.59k|            else
  911|  4.59k|            {
  912|  4.59k|              if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (912:19): [True: 3.96k, False: 627]
  ------------------
  913|  3.96k|                irv_horz_syn(atk, aug->line, bands[2].pull_line(),
  914|  3.96k|                  bands[3].pull_line(), width, horz_even);
  915|    627|             else
  916|    627|                memcpy(aug->line->f32, bands[2].pull_line()->f32,
  917|    627|                  width * sizeof(float));
  918|  4.59k|              float* sp = aug->line->f32;
  919|   439k|              for (ui32 i = width; i > 0; --i)
  ------------------
  |  Branch (919:36): [True: 435k, False: 4.59k]
  ------------------
  920|   435k|                *sp++ *= 0.5f;
  921|  4.59k|            }
  922|  44.2k|            return aug->line;
  923|  44.2k|          }
  924|  1.96M|        }
  925|  6.20M|      }
  926|  1.03M|      else
  927|  1.03M|      {
  928|  1.03M|        if (reversible)
  ------------------
  |  Branch (928:13): [True: 1.03M, False: 3.54k]
  ------------------
  929|  1.03M|        {
  930|  1.03M|          if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (930:15): [True: 105k, False: 924k]
  ------------------
  931|   105k|            rev_horz_syn(atk, aug->line, child_res->pull_line(),
  932|   105k|              bands[1].pull_line(), width, horz_even);
  933|   924k|          else
  934|   924k|            memcpy(aug->line->p, child_res->pull_line()->p,
  935|   924k|              (size_t)width * (aug->line->flags & line_buf::LFT_SIZE_MASK));
  936|  1.03M|          return aug->line;
  937|  1.03M|        }
  938|  3.54k|        else
  939|  3.54k|        {
  940|  3.54k|          if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (940:15): [True: 1.32k, False: 2.22k]
  ------------------
  941|  1.32k|            irv_horz_syn(atk, aug->line, child_res->pull_line(),
  942|  1.32k|              bands[1].pull_line(), width, horz_even);
  943|  2.22k|          else
  944|  2.22k|            memcpy(aug->line->f32, child_res->pull_line()->f32,
  945|  2.22k|              width * sizeof(float));
  946|  3.54k|          return aug->line;
  947|  3.54k|        }
  948|  1.03M|      }
  949|  7.24M|    }
_ZN4ojph5local10resolution21get_top_left_precinctERNS_5pointE:
  976|  2.53M|    {
  977|  2.53M|      ui32 idx = cur_precinct_loc.x + cur_precinct_loc.y * num_precincts.w;
  978|  2.53M|      if (idx < num_precincts.area())
  ------------------
  |  Branch (978:11): [True: 1.13M, False: 1.39M]
  ------------------
  979|  1.13M|      {
  980|  1.13M|        top_left = precincts[idx].img_point;
  981|  1.13M|        return true;
  982|  1.13M|      }
  983|  1.39M|      return false;
  984|  2.53M|    }
_ZN4ojph5local10resolution19parse_all_precinctsERjPNS_11infile_baseE:
 1002|  80.7k|    {
 1003|  80.7k|      precinct* p = precincts;
 1004|  80.7k|      ui32 idx = cur_precinct_loc.x + cur_precinct_loc.y * num_precincts.w;
 1005|   120k|      for (ui32 i = idx; i < num_precincts.area(); ++i)
  ------------------
  |  Branch (1005:26): [True: 40.4k, False: 80.4k]
  ------------------
 1006|  40.4k|      {
 1007|  40.4k|        if (data_left == 0)
  ------------------
  |  Branch (1007:13): [True: 266, False: 40.1k]
  ------------------
 1008|    266|          break;
 1009|  40.1k|        p[i].parse(tag_tree_size, level_index, elastic, data_left, file,
 1010|  40.1k|          skipped_res_for_read);
 1011|  40.1k|        if (++cur_precinct_loc.x >= num_precincts.w)
  ------------------
  |  Branch (1011:13): [True: 13.5k, False: 26.6k]
  ------------------
 1012|  13.5k|        {
 1013|  13.5k|          cur_precinct_loc.x = 0;
 1014|  13.5k|          ++cur_precinct_loc.y;
 1015|  13.5k|        }
 1016|  40.1k|      }
 1017|  80.7k|    }
_ZN4ojph5local10resolution18parse_one_precinctERjPNS_11infile_baseE:
 1021|   324k|    {
 1022|   324k|      ui32 idx = cur_precinct_loc.x + cur_precinct_loc.y * num_precincts.w;
 1023|   324k|      assert(idx < num_precincts.area());
 1024|       |
 1025|   324k|      if (data_left == 0)
  ------------------
  |  Branch (1025:11): [True: 0, False: 324k]
  ------------------
 1026|      0|        return;
 1027|   324k|      precinct* p = precincts + idx;
 1028|   324k|      p->parse(tag_tree_size, level_index, elastic, data_left, file,
 1029|   324k|        skipped_res_for_read);
 1030|   324k|      if (++cur_precinct_loc.x >= num_precincts.w)
  ------------------
  |  Branch (1030:11): [True: 98.9k, False: 225k]
  ------------------
 1031|  98.9k|      {
 1032|  98.9k|        cur_precinct_loc.x = 0;
 1033|  98.9k|        ++cur_precinct_loc.y;
 1034|  98.9k|      }
 1035|   324k|    }

_ZN4ojph5local10resolution15next_resolutionEv:
   91|  6.97M|      resolution *next_resolution() { return child_res; }
_ZN4ojph5local10resolution8get_rectEv:
   82|  1.15M|      rect get_rect() { return res_rect; }
_ZN4ojph5local10resolution12get_comp_numEv:
   83|  16.2M|      ui32 get_comp_num() { return comp_num; }
_ZN4ojph5local10resolution18has_horz_transformEv:
   84|  17.3M|      bool has_horz_transform() { return (transform_flags & HORZ_TRX) != 0; }
_ZN4ojph5local10resolution18has_vert_transformEv:
   85|  17.3M|      bool has_vert_transform() { return (transform_flags & VERT_TRX) != 0; }

_ZN4ojph5local7subband9pre_allocEPNS0_10codestreamERKNS_4rectEjjj:
   59|  17.5M|    {
   60|  17.5M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   61|       |
   62|  17.5M|      bool empty = ((band_rect.siz.w == 0) || (band_rect.siz.h == 0));
  ------------------
  |  Branch (62:21): [True: 12.2M, False: 5.20M]
  |  Branch (62:47): [True: 4.05M, False: 1.15M]
  ------------------
   63|  17.5M|      if (empty)
  ------------------
  |  Branch (63:11): [True: 16.3M, False: 1.15M]
  ------------------
   64|  16.3M|        return;
   65|       |
   66|  1.15M|      const param_cod* cdp = codestream->get_coc(comp_num);
   67|  1.15M|      size log_cb = cdp->get_log_block_dims();
   68|  1.15M|      size log_PP = cdp->get_log_precinct_size(res_num);
   69|       |
   70|  1.15M|      ui32 x_off = ((transform_flags & resolution::HORZ_TRX) ? 1 : 0);
  ------------------
  |  Branch (70:21): [True: 1.04M, False: 112k]
  ------------------
   71|  1.15M|      ui32 y_off = ((transform_flags & resolution::VERT_TRX) ? 1 : 0);
  ------------------
  |  Branch (71:21): [True: 1.04M, False: 109k]
  ------------------
   72|       |
   73|  1.15M|      ui32 xcb_prime = ojph_min(log_cb.w, log_PP.w - x_off);
  ------------------
  |  |   76|  1.15M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 46.8k, False: 1.10M]
  |  |  ------------------
  ------------------
   74|  1.15M|      ui32 ycb_prime = ojph_min(log_cb.h, log_PP.h - y_off);
  ------------------
  |  |   76|  1.15M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 128k, False: 1.02M]
  |  |  ------------------
  ------------------
   75|       |
   76|  1.15M|      size nominal(1 << xcb_prime, 1 << ycb_prime);
   77|       |
   78|  1.15M|      ui32 tbx0 = band_rect.org.x;
   79|  1.15M|      ui32 tby0 = band_rect.org.y;
   80|  1.15M|      ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
   81|  1.15M|      ui32 tby1 = band_rect.org.y + band_rect.siz.h;
   82|       |
   83|  1.15M|      size num_blocks;
   84|  1.15M|      num_blocks.w = (tbx1 + (1 << xcb_prime) - 1) >> xcb_prime;
   85|  1.15M|      num_blocks.w -= tbx0 >> xcb_prime;
   86|  1.15M|      num_blocks.h = (tby1 + (1 << ycb_prime) - 1) >> ycb_prime;
   87|  1.15M|      num_blocks.h -= tby0 >> ycb_prime;
   88|       |
   89|  1.15M|      allocator->pre_alloc_obj<codeblock>(num_blocks.w);
   90|       |      //allocate codeblock headers
   91|  1.15M|      allocator->pre_alloc_obj<coded_cb_header>((size_t)num_blocks.area());
   92|       |
   93|  1.15M|      const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
   94|  1.15M|      ui32 precision = qp->propose_precision(cdp);
   95|  1.15M|      const param_atk* atk = cdp->access_atk();
   96|  1.15M|      bool reversible = atk->is_reversible();
   97|       |
   98|  7.01M|      for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (98:24): [True: 5.85M, False: 1.15M]
  ------------------
   99|  5.85M|        codeblock::pre_alloc(codestream, nominal, precision);
  100|       |
  101|       |      //allocate lines
  102|  1.15M|      allocator->pre_alloc_obj<line_buf>(1);
  103|       |      //allocate line_buf
  104|  1.15M|      ui32 width = band_rect.siz.w + 1;
  105|  1.15M|      if (reversible)
  ------------------
  |  Branch (105:11): [True: 1.05M, False: 101k]
  ------------------
  106|  1.05M|      {
  107|  1.05M|        if (precision <= 32)
  ------------------
  |  Branch (107:13): [True: 884k, False: 170k]
  ------------------
  108|   884k|          allocator->pre_alloc_data<si32>(width, 1);
  109|   170k|        else
  110|   170k|          allocator->pre_alloc_data<si64>(width, 1);
  111|  1.05M|      }
  112|   101k|      else
  113|   101k|        allocator->pre_alloc_data<float>(width, 1);
  114|  1.15M|    }
_ZN4ojph5local7subband14finalize_allocEPNS0_10codestreamERKNS_4rectEPNS0_10resolutionEjj:
  121|  16.2M|    {
  122|  16.2M|      mem_fixed_allocator* allocator = codestream->get_allocator();
  123|  16.2M|      elastic = codestream->get_elastic_alloc();
  124|       |
  125|  16.2M|      this->res_num = res_num;
  126|  16.2M|      this->band_num = subband_num;
  127|  16.2M|      this->band_rect = band_rect;
  128|  16.2M|      this->parent = res;
  129|       |
  130|  16.2M|      ui32 comp_num = parent->get_comp_num();
  131|  16.2M|      const param_cod* cdp = codestream->get_coc(comp_num);
  132|  16.2M|      this->reversible = cdp->access_atk()->is_reversible();
  133|  16.2M|      size log_cb = cdp->get_log_block_dims();
  134|  16.2M|      log_PP = cdp->get_log_precinct_size(res_num);
  135|       |
  136|  16.2M|      ui32 x_off = ((parent->has_horz_transform()) ? 1 : 0);
  ------------------
  |  Branch (136:21): [True: 14.9M, False: 1.24M]
  ------------------
  137|  16.2M|      ui32 y_off = ((parent->has_vert_transform()) ? 1 : 0);
  ------------------
  |  Branch (137:21): [True: 15.0M, False: 1.17M]
  ------------------
  138|       |
  139|  16.2M|      xcb_prime = ojph_min(log_cb.w, log_PP.w - x_off);
  ------------------
  |  |   76|  16.2M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 893k, False: 15.3M]
  |  |  ------------------
  ------------------
  140|  16.2M|      ycb_prime = ojph_min(log_cb.h, log_PP.h - y_off);
  ------------------
  |  |   76|  16.2M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 2.25M, False: 13.9M]
  |  |  ------------------
  ------------------
  141|       |
  142|  16.2M|      size nominal(1 << xcb_prime, 1 << ycb_prime);
  143|       |
  144|  16.2M|      cur_cb_row = 0;
  145|  16.2M|      cur_line = 0;
  146|  16.2M|      cur_cb_height = 0;
  147|  16.2M|      const param_dfs* dfs = NULL;
  148|  16.2M|      if (cdp->is_dfs_defined()) {
  ------------------
  |  Branch (148:11): [True: 498k, False: 15.7M]
  ------------------
  149|   498k|        dfs = codestream->access_dfs();
  150|   498k|        if (dfs != NULL)
  ------------------
  |  Branch (150:13): [True: 498k, False: 0]
  ------------------
  151|   498k|          dfs = dfs->get_dfs(cdp->get_dfs_index());
  152|   498k|      }
  153|  16.2M|      const param_qcd* qcd = codestream->access_qcd()->get_qcc(comp_num);
  154|  16.2M|      ui32 num_decomps = cdp->get_num_decompositions();
  155|  16.2M|      this->K_max = qcd->get_Kmax(dfs, num_decomps, this->res_num, band_num);
  156|  16.2M|      if (!reversible)
  ------------------
  |  Branch (156:11): [True: 1.76M, False: 14.4M]
  ------------------
  157|  1.76M|      {
  158|  1.76M|        float d =
  159|  1.76M|          qcd->get_irrev_delta(dfs, num_decomps,
  160|  1.76M|            comp_num, res_num, subband_num);
  161|  1.76M|        d /= (float)(1u << (31 - this->K_max));
  162|  1.76M|        delta = d;
  163|  1.76M|        delta_inv = (1.0f/d);
  164|  1.76M|      }
  165|  16.2M|      ui32 precision = qcd->propose_precision(cdp);
  166|       |
  167|  16.2M|      this->empty = ((band_rect.siz.w == 0) || (band_rect.siz.h == 0));
  ------------------
  |  Branch (167:22): [True: 11.0M, False: 5.19M]
  |  Branch (167:48): [True: 4.04M, False: 1.15M]
  ------------------
  168|  16.2M|      if (this->empty)
  ------------------
  |  Branch (168:11): [True: 15.0M, False: 1.15M]
  ------------------
  169|  15.0M|        return;
  170|       |
  171|  1.15M|      ui32 tbx0 = band_rect.org.x;
  172|  1.15M|      ui32 tby0 = band_rect.org.y;
  173|  1.15M|      ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
  174|  1.15M|      ui32 tby1 = band_rect.org.y + band_rect.siz.h;
  175|       |
  176|  1.15M|      num_blocks = size();
  177|  1.15M|      num_blocks.w = (tbx1 + (1 << xcb_prime) - 1) >> xcb_prime;
  178|  1.15M|      num_blocks.w -= tbx0 >> xcb_prime;
  179|  1.15M|      num_blocks.h = (tby1 + (1 << ycb_prime) - 1) >> ycb_prime;
  180|  1.15M|      num_blocks.h -= tby0 >> ycb_prime;
  181|       |
  182|  1.15M|      blocks = allocator->post_alloc_obj<codeblock>(num_blocks.w);
  183|       |      //allocate codeblock headers
  184|  1.15M|      coded_cb_header *cp = coded_cbs =
  185|  1.15M|        allocator->post_alloc_obj<coded_cb_header>((size_t)num_blocks.area());
  186|  1.15M|      memset(coded_cbs, 0, sizeof(coded_cb_header) * (size_t)num_blocks.area());
  187|  18.2M|      for (int i = (int)num_blocks.area(); i > 0; --i, ++cp)
  ------------------
  |  Branch (187:44): [True: 17.0M, False: 1.15M]
  ------------------
  188|  17.0M|        cp->Kmax = K_max;
  189|       |
  190|  1.15M|      ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
  191|  1.15M|      ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
  192|       |
  193|  1.15M|      size cb_size;
  194|  1.15M|      cb_size.h = ojph_min(tby1, y_lower_bound + nominal.h) - tby0;
  ------------------
  |  |   76|  1.15M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 893k, False: 256k]
  |  |  ------------------
  ------------------
  195|  1.15M|      cur_cb_height = (si32)cb_size.h;
  196|  1.15M|      int line_offset = 0;
  197|  6.79M|      for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (197:24): [True: 5.64M, False: 1.15M]
  ------------------
  198|  5.64M|      {
  199|  5.64M|        ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
  ------------------
  |  |   73|  5.64M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 240k, False: 5.40M]
  |  |  ------------------
  ------------------
  200|  5.64M|        ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
  ------------------
  |  |   76|  5.64M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 764k, False: 4.87M]
  |  |  ------------------
  ------------------
  201|  5.64M|        cb_size.w = cbx1 - cbx0;
  202|  5.64M|        blocks[i].finalize_alloc(codestream, this, nominal, cb_size,
  203|  5.64M|                                 coded_cbs + i, K_max, line_offset,
  204|  5.64M|                                 precision, comp_num);
  205|  5.64M|        line_offset += cb_size.w;
  206|  5.64M|      }
  207|       |
  208|       |      //allocate lines
  209|  1.15M|      lines = allocator->post_alloc_obj<line_buf>(1);
  210|       |      //allocate line_buf
  211|  1.15M|      ui32 width = band_rect.siz.w + 1;
  212|  1.15M|      if (reversible)
  ------------------
  |  Branch (212:11): [True: 1.05M, False: 98.2k]
  ------------------
  213|  1.05M|      {
  214|  1.05M|        if (precision <= 32)
  ------------------
  |  Branch (214:13): [True: 882k, False: 169k]
  ------------------
  215|   882k|          lines->wrap(allocator->post_alloc_data<si32>(width, 1), width, 1);
  216|   169k|        else
  217|   169k|          lines->wrap(allocator->post_alloc_data<si64>(width, 1), width, 1);
  218|  1.05M|      }
  219|  98.2k|      else
  220|  98.2k|        lines->wrap(allocator->post_alloc_data<float>(width, 1), width, 1);
  221|  1.15M|    }
_ZN4ojph5local7subband14get_cb_indicesERKNS_4sizeEPNS0_8precinctE:
  226|  1.15M|    {
  227|  1.15M|      if (empty)
  ------------------
  |  Branch (227:11): [True: 0, False: 1.15M]
  ------------------
  228|      0|        return;
  229|       |
  230|  1.15M|      rect res_rect = parent->get_rect();
  231|  1.15M|      ui32 trx0 = res_rect.org.x;
  232|  1.15M|      ui32 try0 = res_rect.org.y;
  233|  1.15M|      ui32 trx1 = res_rect.org.x + res_rect.siz.w;
  234|  1.15M|      ui32 try1 = res_rect.org.y + res_rect.siz.h;
  235|       |
  236|  1.15M|      ui32 pc_lft = (res_rect.org.x >> log_PP.w) << log_PP.w;
  237|  1.15M|      ui32 pc_top = (res_rect.org.y >> log_PP.h) << log_PP.h;
  238|       |
  239|  1.15M|      ui32 pcx0, pcx1, pcy0, pcy1;
  240|  1.15M|      ui32 x_shift = parent->has_horz_transform() ? 1 : 0;
  ------------------
  |  Branch (240:22): [True: 1.03M, False: 112k]
  ------------------
  241|  1.15M|      ui32 y_shift = parent->has_vert_transform() ? 1 : 0;
  ------------------
  |  Branch (241:22): [True: 1.04M, False: 109k]
  ------------------
  242|  1.15M|      ui32 yb, xb, coly = 0, colx = 0;
  243|  4.09M|      for (ui32 y = 0; y < num_precincts.h; ++y)
  ------------------
  |  Branch (243:24): [True: 2.94M, False: 1.15M]
  ------------------
  244|  2.94M|      {
  245|  2.94M|        pcy0 = ojph_max(try0, pc_top + (y << log_PP.h));
  ------------------
  |  |   73|  2.94M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 769k, False: 2.17M]
  |  |  ------------------
  ------------------
  246|  2.94M|        pcy1 = ojph_min(try1, pc_top + ((y + 1) << log_PP.h));
  ------------------
  |  |   76|  2.94M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 999k, False: 1.94M]
  |  |  ------------------
  ------------------
  247|  2.94M|        pcy0 = (pcy0 - (band_num >> 1) + (1 << y_shift) - 1) >> y_shift;
  248|  2.94M|        pcy1 = (pcy1 - (band_num >> 1) + (1 << y_shift) - 1) >> y_shift;
  249|       |
  250|  2.94M|        precinct *p = precincts + y * num_precincts.w;
  251|  2.94M|        yb = ((pcy1 + (1<<ycb_prime) - 1) >> ycb_prime);
  252|  2.94M|        yb -= (pcy0 >> ycb_prime);
  253|  2.94M|        colx = 0;
  254|       |
  255|  19.3M|        for (ui32 x = 0; x < num_precincts.w; ++x, ++p)
  ------------------
  |  Branch (255:26): [True: 16.4M, False: 2.94M]
  ------------------
  256|  16.4M|        {
  257|  16.4M|          pcx0 = ojph_max(trx0, pc_lft + (x << log_PP.w));
  ------------------
  |  |   73|  16.4M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 788k, False: 15.6M]
  |  |  ------------------
  ------------------
  258|  16.4M|          pcx1 = ojph_min(trx1, pc_lft + ((x + 1) << log_PP.w));
  ------------------
  |  |   76|  16.4M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 2.54M, False: 13.8M]
  |  |  ------------------
  ------------------
  259|  16.4M|          pcx0 = (pcx0 - (band_num & 1) + (1 << x_shift) - 1) >> x_shift;
  260|  16.4M|          pcx1 = (pcx1 - (band_num & 1) + (1 << x_shift) - 1) >> x_shift;
  261|       |
  262|  16.4M|          rect *bp = p->cb_idxs + band_num;
  263|  16.4M|          xb = ((pcx1 + (1<<xcb_prime) - 1) >> xcb_prime);
  264|  16.4M|          xb -= (pcx0 >> xcb_prime);
  265|       |
  266|  16.4M|          bp->org.x = colx;
  267|  16.4M|          bp->org.y = coly;
  268|  16.4M|          bp->siz.w = xb;
  269|  16.4M|          bp->siz.h = yb;
  270|       |
  271|  16.4M|          colx += xb;
  272|  16.4M|        }
  273|  2.94M|        coly += yb;
  274|  2.94M|      }
  275|       |      assert(colx == num_blocks.w && coly == num_blocks.h);
  276|  1.15M|    }
_ZN4ojph5local7subband9pull_lineEv:
  337|  10.2M|    {
  338|  10.2M|      if (empty)
  ------------------
  |  Branch (338:11): [True: 4.61M, False: 5.61M]
  ------------------
  339|  4.61M|        return lines;
  340|       |
  341|       |      //pull from codeblocks
  342|  5.61M|      if (--cur_line <= 0)
  ------------------
  |  Branch (342:11): [True: 2.42M, False: 3.19M]
  ------------------
  343|  2.42M|      {
  344|  2.42M|        if (cur_cb_row < num_blocks.h)
  ------------------
  |  Branch (344:13): [True: 2.41M, False: 6.21k]
  ------------------
  345|  2.41M|        {
  346|  2.41M|          ui32 tbx0 = band_rect.org.x;
  347|  2.41M|          ui32 tby0 = band_rect.org.y;
  348|  2.41M|          ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
  349|  2.41M|          ui32 tby1 = band_rect.org.y + band_rect.siz.h;
  350|  2.41M|          size nominal(1 << xcb_prime, 1 << ycb_prime);
  351|       |
  352|  2.41M|          ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
  353|  2.41M|          ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
  354|  2.41M|          ui32 cby0 = ojph_max(tby0, y_lower_bound + cur_cb_row * nominal.h);
  ------------------
  |  |   73|  2.41M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 487k, False: 1.92M]
  |  |  ------------------
  ------------------
  355|  2.41M|          ui32 cby1 = ojph_min(tby1, y_lower_bound+(cur_cb_row+1)*nominal.h);
  ------------------
  |  |   76|  2.41M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 638k, False: 1.77M]
  |  |  ------------------
  ------------------
  356|       |
  357|  2.41M|          size cb_size;
  358|  2.41M|          cb_size.h = cby1 - cby0;
  359|  2.41M|          cur_line = cur_cb_height = (int)cb_size.h;
  360|  15.0M|          for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (360:28): [True: 12.6M, False: 2.41M]
  ------------------
  361|  12.6M|          {
  362|  12.6M|            ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
  ------------------
  |  |   73|  12.6M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 375k, False: 12.2M]
  |  |  ------------------
  ------------------
  363|  12.6M|            ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
  ------------------
  |  |   76|  12.6M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 1.73M, False: 10.9M]
  |  |  ------------------
  ------------------
  364|  12.6M|            cb_size.w = cbx1 - cbx0;
  365|  12.6M|            blocks[i].recreate(cb_size,
  366|  12.6M|                               coded_cbs + i + cur_cb_row * num_blocks.w);
  367|  12.6M|            blocks[i].decode();
  368|  12.6M|          }
  369|  2.41M|          ++cur_cb_row;
  370|  2.41M|        }
  371|  2.42M|      }
  372|       |
  373|  5.61M|      assert(cur_line >= 0);
  374|       |
  375|       |      //pull from codeblocks
  376|  44.9M|      for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (376:24): [True: 39.3M, False: 5.61M]
  ------------------
  377|  39.3M|        blocks[i].pull_line(lines + 0);
  378|       |
  379|  5.61M|      return lines;
  380|  10.2M|    }

_ZN4ojph5local7subbandC2Ev:
   66|  25.3M|      subband() { 
   67|  25.3M|        res_num = band_num = 0;
   68|  25.3M|        reversible = false;
   69|  25.3M|        empty = true;             // <---- true
   70|  25.3M|        lines = NULL;
   71|  25.3M|        parent = NULL;
   72|  25.3M|        blocks = NULL;
   73|  25.3M|        xcb_prime = ycb_prime = 0;
   74|  25.3M|        cur_cb_row = 0;
   75|  25.3M|        cur_line = 0;
   76|  25.3M|        cur_cb_height = 0;
   77|  25.3M|        delta = delta_inv = 0.0f;
   78|  25.3M|        K_max = 0;
   79|  25.3M|        coded_cbs = NULL;
   80|       |        elastic = NULL;
   81|  25.3M|      }
_ZN4ojph5local7subband6existsEv:
   94|  25.3M|      bool exists() { return !empty; }
_ZN4ojph5local7subband9get_deltaEv:
   93|  5.64M|      float get_delta() { return delta; }

_ZN4ojph5local4tile9pre_allocEPNS0_10codestreamERKNS_4rectES6_Rj:
   59|  1.17M|    {
   60|  1.17M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   61|       |
   62|       |      //allocate tiles_comp
   63|  1.17M|      const param_siz *szp = codestream->get_siz();
   64|  1.17M|      ui32 num_comps = szp->get_num_components();
   65|  1.17M|      allocator->pre_alloc_obj<tile_comp>(num_comps);
   66|  1.17M|      allocator->pre_alloc_obj<rect>(num_comps); //for comp_rects
   67|  1.17M|      allocator->pre_alloc_obj<rect>(num_comps); //for recon_comp_rects
   68|  1.17M|      allocator->pre_alloc_obj<ui32>(num_comps); //for line_offsets
   69|  1.17M|      allocator->pre_alloc_obj<ui32>(num_comps); //for num_bits
   70|  1.17M|      allocator->pre_alloc_obj<bool>(num_comps); //for is_signed
   71|  1.17M|      allocator->pre_alloc_obj<bool>(num_comps); //for reversible
   72|  1.17M|      allocator->pre_alloc_obj<const nlt_rec*>(num_comps);
   73|  1.17M|      allocator->pre_alloc_obj<ui32>(num_comps); //for cur_line
   74|       |
   75|  1.17M|      {
   76|  1.17M|        ui32 tilepart_div = codestream->get_tilepart_div();
   77|  1.17M|        ui32 t = tilepart_div & OJPH_TILEPART_MASK;
   78|  1.17M|        if (t == OJPH_TILEPART_NO_DIVISIONS)
  ------------------
  |  Branch (78:13): [True: 1.17M, False: 0]
  ------------------
   79|  1.17M|          num_tileparts = 1; //for num_rc_bytes
   80|      0|        else if (t == OJPH_TILEPART_COMPONENTS)
  ------------------
  |  Branch (80:18): [True: 0, False: 0]
  ------------------
   81|      0|          num_tileparts = num_comps;
   82|      0|        else if (t == OJPH_TILEPART_RESOLUTIONS)
  ------------------
  |  Branch (82:18): [True: 0, False: 0]
  ------------------
   83|      0|        {
   84|      0|          ui32 max_decs = 0;
   85|      0|          for (ui32 c = 0; c < num_comps; ++c) {
  ------------------
  |  Branch (85:28): [True: 0, False: 0]
  ------------------
   86|      0|            ui32 s = codestream->get_coc(c)->get_num_decompositions();
   87|      0|            max_decs = ojph_max(max_decs, s);
  ------------------
  |  |   73|      0|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   88|      0|          }
   89|      0|          num_tileparts = 1 + max_decs;
   90|      0|        }
   91|      0|        else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
  ------------------
  |  Branch (91:18): [True: 0, False: 0]
  ------------------
   92|      0|        {
   93|      0|          num_tileparts = 0;
   94|      0|          for (ui32 c = 0; c < num_comps; ++c) {
  ------------------
  |  Branch (94:28): [True: 0, False: 0]
  ------------------
   95|      0|            ui32 s = codestream->get_coc(c)->get_num_decompositions();
   96|      0|            num_tileparts += s + 1;
   97|      0|          }
   98|      0|        }
   99|  1.17M|        if (num_tileparts > 255)
  ------------------
  |  Branch (99:13): [True: 0, False: 1.17M]
  ------------------
  100|      0|          OJPH_ERROR(0x000300D1, "Trying to create %d tileparts; a tile "
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|  1.17M|            "cannot have more than 255 tile parts.", num_tileparts);
  102|  1.17M|      }
  103|       |
  104|  1.17M|      ui32 tx0 = tile_rect.org.x;
  105|  1.17M|      ui32 ty0 = tile_rect.org.y;
  106|  1.17M|      ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
  107|  1.17M|      ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
  108|  1.17M|      ui32 recon_tx0 = recon_tile_rect.org.x;
  109|  1.17M|      ui32 recon_ty0 = recon_tile_rect.org.y;
  110|  1.17M|      ui32 recon_tx1 = recon_tile_rect.org.x + recon_tile_rect.siz.w;
  111|  1.17M|      ui32 recon_ty1 = recon_tile_rect.org.y + recon_tile_rect.siz.h;
  112|       |
  113|  1.17M|      ui32 width = 0;
  114|  1.17M|      rect colour_comp_rect[3];
  115|  2.37M|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (115:24): [True: 1.20M, False: 1.17M]
  ------------------
  116|  1.20M|      {
  117|  1.20M|        point downsamp = szp->get_downsampling(i);
  118|       |
  119|  1.20M|        ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
  ------------------
  |  |   70|  1.20M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  120|  1.20M|        ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
  ------------------
  |  |   70|  1.20M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  121|  1.20M|        ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
  ------------------
  |  |   70|  1.20M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  122|  1.20M|        ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
  ------------------
  |  |   70|  1.20M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  123|  1.20M|        ui32 recon_tcx0 = ojph_div_ceil(recon_tx0, downsamp.x);
  ------------------
  |  |   70|  1.20M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  124|  1.20M|        ui32 recon_tcy0 = ojph_div_ceil(recon_ty0, downsamp.y);
  ------------------
  |  |   70|  1.20M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  125|  1.20M|        ui32 recon_tcx1 = ojph_div_ceil(recon_tx1, downsamp.x);
  ------------------
  |  |   70|  1.20M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  126|  1.20M|        ui32 recon_tcy1 = ojph_div_ceil(recon_ty1, downsamp.y);
  ------------------
  |  |   70|  1.20M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  127|       |
  128|  1.20M|        rect comp_rect;
  129|  1.20M|        comp_rect.org.x = tcx0;
  130|  1.20M|        comp_rect.org.y = tcy0;
  131|  1.20M|        comp_rect.siz.w = tcx1 - tcx0;
  132|  1.20M|        comp_rect.siz.h = tcy1 - tcy0;
  133|       |
  134|  1.20M|        if (i < 3)
  ------------------
  |  Branch (134:13): [True: 1.19M, False: 4.41k]
  ------------------
  135|  1.19M|          colour_comp_rect[i] = comp_rect;
  136|       |
  137|  1.20M|        rect recon_comp_rect;
  138|  1.20M|        recon_comp_rect.org.x = recon_tcx0;
  139|  1.20M|        recon_comp_rect.org.y = recon_tcy0;
  140|  1.20M|        recon_comp_rect.siz.w = recon_tcx1 - recon_tcx0;
  141|  1.20M|        recon_comp_rect.siz.h = recon_tcy1 - recon_tcy0;
  142|       |
  143|  1.20M|        tile_comp::pre_alloc(codestream, i, comp_rect, recon_comp_rect);
  144|  1.20M|        width = ojph_max(width, recon_comp_rect.siz.w);
  ------------------
  |  |   73|  1.20M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 6.77k, False: 1.19M]
  |  |  ------------------
  ------------------
  145|  1.20M|      }
  146|       |
  147|       |      //allocate lines
  148|  1.17M|      const param_cod* cdp = codestream->get_cod();
  149|  1.17M|      if (cdp->is_employing_color_transform())
  ------------------
  |  Branch (149:11): [True: 6.17k, False: 1.16M]
  ------------------
  150|  6.17k|      {
  151|  6.17k|        bool reversible[3];
  152|  24.6k|        for (ui32 i = 0; i < 3; ++i)
  ------------------
  |  Branch (152:26): [True: 18.5k, False: 6.17k]
  ------------------
  153|  18.5k|          reversible[i] = codestream->get_coc(i)->is_reversible();
  154|  6.17k|        if (reversible[0] != reversible[1] || reversible[1] != reversible[2])
  ------------------
  |  Branch (154:13): [True: 52, False: 6.11k]
  |  Branch (154:47): [True: 1, False: 6.11k]
  ------------------
  155|     53|          OJPH_ERROR(0x000300A2, "When the colour transform is employed, "
  ------------------
  |  |  289|    318|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     53|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 53, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (289:52): [True: 40, False: 13]
  |  |  |  Branch (289:52): [True: 14, False: 39]
  |  |  |  Branch (289:52): [True: 10, False: 43]
  |  |  ------------------
  ------------------
  156|  6.17k|            "all colour components must undergo either reversible or "
  157|  6.17k|            "irreversible wavelet transform; if not, then it is not clear "
  158|  6.17k|            "what colour transform should be used (reversible or "
  159|  6.17k|            "irreversible).  Here we found that the first three colour "
  160|  6.17k|            "components uses %s, %s, and %s transforms, respectively.",
  161|  6.17k|            reversible[0] ? "reversible" : "irreversible",
  162|  6.17k|            reversible[1] ? "reversible" : "irreversible",
  163|  6.17k|            reversible[2] ? "reversible" : "irreversible");
  164|       |
  165|  6.17k|        if (colour_comp_rect[0] != colour_comp_rect[1] ||
  ------------------
  |  Branch (165:13): [True: 241, False: 5.92k]
  ------------------
  166|  5.92k|          colour_comp_rect[1] != colour_comp_rect[2])
  ------------------
  |  Branch (166:11): [True: 61, False: 5.86k]
  ------------------
  167|    249|          OJPH_ERROR(0x000300A3, "When the colour transform is employed, "
  ------------------
  |  |  289|    249|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    249|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 249, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|  6.17k|            "the first three colour components must have the same rectangle; "
  169|  6.17k|            "i.e., the same origin on the canvas and the same width and "
  170|  6.17k|            "height. The first three components have the following "
  171|  6.17k|            "origin-size (x,y)-(w,h) values. Component 0 (%d,%d)-(%d,%d), "
  172|  6.17k|            "Component 1 (%d,%d)-(%d,%d), Component 2 (%d,%d)-(%d,%d)",
  173|  6.17k|            colour_comp_rect[0].org.x, colour_comp_rect[0].org.y,
  174|  6.17k|            colour_comp_rect[0].siz.w, colour_comp_rect[0].siz.h,
  175|  6.17k|            colour_comp_rect[1].org.x, colour_comp_rect[1].org.y,
  176|  6.17k|            colour_comp_rect[1].siz.w, colour_comp_rect[1].siz.h,
  177|  6.17k|            colour_comp_rect[2].org.x, colour_comp_rect[2].org.y,
  178|  6.17k|            colour_comp_rect[2].siz.w, colour_comp_rect[2].siz.h);
  179|       |
  180|  6.17k|        allocator->pre_alloc_obj<line_buf>(3);
  181|  6.17k|        if (reversible[0])
  ------------------
  |  Branch (181:13): [True: 914, False: 5.25k]
  ------------------
  182|  3.65k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (182:27): [True: 2.74k, False: 914]
  ------------------
  183|  2.74k|            allocator->pre_alloc_data<si32>(width, 0);
  184|  5.25k|        else
  185|  20.1k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (185:27): [True: 14.8k, False: 5.25k]
  ------------------
  186|  14.8k|            allocator->pre_alloc_data<float>(width, 0);
  187|  6.17k|      }
  188|  1.17M|    }
_ZN4ojph5local4tile14finalize_allocEPNS0_10codestreamERKNS_4rectEjRjS7_:
  194|  1.09M|    {
  195|  1.09M|      constexpr ui8 type3 =
  196|  1.09M|        param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
  197|       |
  198|       |      //this->parent = codestream;
  199|  1.09M|      mem_fixed_allocator* allocator = codestream->get_allocator();
  200|       |
  201|  1.09M|      sot.init(0, (ui16)tile_idx, 0, 1);
  202|  1.09M|      prog_order = codestream->access_cod().get_progression_order();
  203|       |
  204|       |      //allocate tiles_comp
  205|  1.09M|      const param_siz *szp = codestream->get_siz();
  206|  1.09M|      const param_nlt *nlp = codestream->get_nlt();
  207|       |
  208|  1.09M|      this->num_bytes = 0;
  209|  1.09M|      num_comps = szp->get_num_components();
  210|  1.09M|      skipped_res_for_read = codestream->get_skipped_res_for_read();
  211|  1.09M|      comps = allocator->post_alloc_obj<tile_comp>(num_comps);
  212|  1.09M|      comp_rects = allocator->post_alloc_obj<rect>(num_comps);
  213|  1.09M|      recon_comp_rects = allocator->post_alloc_obj<rect>(num_comps);
  214|  1.09M|      line_offsets = allocator->post_alloc_obj<ui32>(num_comps);
  215|  1.09M|      num_bits = allocator->post_alloc_obj<ui32>(num_comps);
  216|  1.09M|      is_signed = allocator->post_alloc_obj<bool>(num_comps);
  217|  1.09M|      reversible = allocator->post_alloc_obj<bool>(num_comps);
  218|  1.09M|      nlt_ptr = allocator->post_alloc_obj<const nlt_rec*>(num_comps);
  219|  1.09M|      cur_line = allocator->post_alloc_obj<ui32>(num_comps);
  220|       |
  221|  1.09M|      profile = codestream->get_profile();
  222|  1.09M|      tilepart_div = codestream->get_tilepart_div();
  223|  1.09M|      need_tlm = codestream->is_tlm_needed();
  224|  1.09M|      {
  225|  1.09M|        ui32 tilepart_div = codestream->get_tilepart_div();
  226|  1.09M|        ui32 t = tilepart_div & OJPH_TILEPART_MASK;
  227|  1.09M|        if (t == OJPH_TILEPART_NO_DIVISIONS)
  ------------------
  |  Branch (227:13): [True: 1.09M, False: 0]
  ------------------
  228|  1.09M|          num_tileparts = 1; //for num_rc_bytes
  229|      0|        else if (t == OJPH_TILEPART_COMPONENTS)
  ------------------
  |  Branch (229:18): [True: 0, False: 0]
  ------------------
  230|      0|          num_tileparts = num_comps;
  231|      0|        else if (t == OJPH_TILEPART_RESOLUTIONS)
  ------------------
  |  Branch (231:18): [True: 0, False: 0]
  ------------------
  232|      0|        {
  233|      0|          ui32 max_decs = 0;
  234|      0|          for (ui32 c = 0; c < num_comps; ++c) {
  ------------------
  |  Branch (234:28): [True: 0, False: 0]
  ------------------
  235|      0|            ui32 s = codestream->get_coc(c)->get_num_decompositions();
  236|      0|            max_decs = ojph_max(max_decs, s);
  ------------------
  |  |   73|      0|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  237|      0|          }
  238|      0|          num_tileparts = 1 + max_decs;
  239|      0|        }
  240|      0|        else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
  ------------------
  |  Branch (240:18): [True: 0, False: 0]
  ------------------
  241|      0|        {
  242|      0|          num_tileparts = 0;
  243|      0|          for (ui32 c = 0; c < num_comps; ++c) {
  ------------------
  |  Branch (243:28): [True: 0, False: 0]
  ------------------
  244|      0|            ui32 s = codestream->get_coc(c)->get_num_decompositions();
  245|      0|            num_tileparts += s + 1;
  246|      0|          }
  247|      0|        }
  248|  1.09M|        if (num_tileparts > 255)
  ------------------
  |  Branch (248:13): [True: 0, False: 1.09M]
  ------------------
  249|      0|          OJPH_ERROR(0x000300D1, "Trying to create %d tileparts; a tile "
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  250|  1.09M|          "cannot have more than 255 tile parts.", num_tileparts);
  251|  1.09M|      }
  252|       |
  253|  1.09M|      this->resilient = codestream->is_resilient();
  254|  1.09M|      this->tile_rect = tile_rect;
  255|       |
  256|  1.09M|      ui32 tx0 = tile_rect.org.x;
  257|  1.09M|      ui32 ty0 = tile_rect.org.y;
  258|  1.09M|      ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
  259|  1.09M|      ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
  260|       |
  261|  1.09M|      ui32 width = 0;
  262|  2.21M|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (262:24): [True: 1.12M, False: 1.09M]
  ------------------
  263|  1.12M|      {
  264|  1.12M|        point downsamp = szp->get_downsampling(i);
  265|  1.12M|        point recon_downsamp = szp->get_recon_downsampling(i);
  266|       |
  267|  1.12M|        ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
  ------------------
  |  |   70|  1.12M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  268|  1.12M|        ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
  ------------------
  |  |   70|  1.12M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  269|  1.12M|        ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
  ------------------
  |  |   70|  1.12M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  270|  1.12M|        ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
  ------------------
  |  |   70|  1.12M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  271|  1.12M|        ui32 recon_tcx0 = ojph_div_ceil(tx0, recon_downsamp.x);
  ------------------
  |  |   70|  1.12M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  272|  1.12M|        ui32 recon_tcy0 = ojph_div_ceil(ty0, recon_downsamp.y);
  ------------------
  |  |   70|  1.12M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  273|  1.12M|        ui32 recon_tcx1 = ojph_div_ceil(tx1, recon_downsamp.x);
  ------------------
  |  |   70|  1.12M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  274|  1.12M|        ui32 recon_tcy1 = ojph_div_ceil(ty1, recon_downsamp.y);
  ------------------
  |  |   70|  1.12M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  275|       |
  276|  1.12M|        line_offsets[i] =
  277|  1.12M|          recon_tcx0 - ojph_div_ceil(tx0 - offset, recon_downsamp.x);
  ------------------
  |  |   70|  1.12M|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  278|  1.12M|        comp_rects[i].org.x = tcx0;
  279|  1.12M|        comp_rects[i].org.y = tcy0;
  280|  1.12M|        comp_rects[i].siz.w = tcx1 - tcx0;
  281|  1.12M|        comp_rects[i].siz.h = tcy1 - tcy0;
  282|  1.12M|        recon_comp_rects[i].org.x = recon_tcx0;
  283|  1.12M|        recon_comp_rects[i].org.y = recon_tcy0;
  284|  1.12M|        recon_comp_rects[i].siz.w = recon_tcx1 - recon_tcx0;
  285|  1.12M|        recon_comp_rects[i].siz.h = recon_tcy1 - recon_tcy0;
  286|       |
  287|  1.12M|        comps[i].finalize_alloc(codestream, this, i, comp_rects[i],
  288|  1.12M|          recon_comp_rects[i]);
  289|  1.12M|        width = ojph_max(width, recon_comp_rects[i].siz.w);
  ------------------
  |  |   73|  1.12M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 6.65k, False: 1.11M]
  |  |  ------------------
  ------------------
  290|       |
  291|  1.12M|        num_bits[i] = szp->get_bit_depth(i);
  292|  1.12M|        is_signed[i] = szp->is_signed(i);
  293|  1.12M|        nlt_ptr[i] = nlp->get_nlt_rec(i);
  294|       |
  295|  1.12M|        if (nlt_ptr[i])
  ------------------
  |  Branch (295:13): [True: 110k, False: 1.01M]
  ------------------
  296|   110k|        {
  297|   110k|          ui8 bd = nlt_ptr[i]->get_bit_depth();
  298|   110k|          ui8 nlt_type = nlt_ptr[i]->get_type();
  299|   110k|          bool is = nlt_ptr[i]->is_signed();
  300|   110k|          if (nlt_type == type3 && (bd != num_bits[i] || is != is_signed[i]))
  ------------------
  |  Branch (300:15): [True: 77.4k, False: 33.0k]
  |  Branch (300:37): [True: 9, False: 77.4k]
  |  Branch (300:58): [True: 1, False: 77.4k]
  ------------------
  301|     10|            OJPH_ERROR(0x000300A1, "Mismatch between Ssiz (bit_depth = %d, "
  ------------------
  |  |  289|     40|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     10|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (289:52): [True: 5, False: 5]
  |  |  |  Branch (289:52): [True: 7, False: 3]
  |  |  ------------------
  ------------------
  302|   110k|              "is_signed = %s) from SIZ marker segment, and BDnlt "
  303|   110k|              "(bit_depth = %d, is_signed = %s) from NLT marker segment, "
  304|   110k|              "for component %d", num_bits[i],
  305|   110k|              is_signed[i] ? "True" : "False", bd, is ? "True" : "False", i);
  306|   110k|        }
  307|  1.12M|        cur_line[i] = 0;
  308|  1.12M|        reversible[i] = codestream->get_coc(i)->is_reversible();
  309|  1.12M|      }
  310|       |
  311|  1.09M|      offset += tile_rect.siz.w;
  312|       |
  313|       |      //allocate lines
  314|  1.09M|      const param_cod* cdp = codestream->get_cod();
  315|  1.09M|      this->employ_color_transform = cdp->is_employing_color_transform();
  316|  1.09M|      if (this->employ_color_transform)
  ------------------
  |  Branch (316:11): [True: 5.86k, False: 1.08M]
  ------------------
  317|  5.86k|      {
  318|  5.86k|        num_lines = 3;
  319|  5.86k|        lines = allocator->post_alloc_obj<line_buf>(num_lines);
  320|  5.86k|        if (reversible[0])
  ------------------
  |  Branch (320:13): [True: 908, False: 4.95k]
  ------------------
  321|  3.63k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (321:27): [True: 2.72k, False: 908]
  ------------------
  322|  2.72k|            lines[i].wrap(
  323|  2.72k|              allocator->post_alloc_data<si32>(width, 0), width, 0);
  324|  4.95k|        else
  325|  19.8k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (325:27): [True: 14.8k, False: 4.95k]
  ------------------
  326|  14.8k|            lines[i].wrap(
  327|  14.8k|              allocator->post_alloc_data<float>(width, 0), width, 0);
  328|  5.86k|      }
  329|  1.08M|      else
  330|  1.08M|      {
  331|       |        lines = NULL;
  332|  1.08M|        num_lines = 0;
  333|  1.08M|      }
  334|  1.09M|      next_tile_part = 0;
  335|  1.09M|    }
_ZN4ojph5local4tile4pullEPNS_8line_bufEj:
  458|  5.13M|    {
  459|  5.13M|      constexpr ui8 type2 =
  460|  5.13M|        param_nlt::nonlinearity::OJPH_NLT_LUT_STYLE_NLT;
  461|  5.13M|      constexpr ui8 type3 =
  462|  5.13M|        param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
  463|  5.13M|      constexpr ui8 type4 =
  464|  5.13M|        param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_PLUS_LUT;
  465|       |
  466|  5.13M|      assert(comp_num < num_comps);
  467|  5.13M|      if (cur_line[comp_num] >= recon_comp_rects[comp_num].siz.h)
  ------------------
  |  Branch (467:11): [True: 694k, False: 4.43M]
  ------------------
  468|   694k|        return false;
  469|       |
  470|  4.43M|      cur_line[comp_num]++;
  471|       |
  472|  4.43M|      ui32 comp_width = recon_comp_rects[comp_num].siz.w;
  473|  4.43M|      if (comp_width == 0)
  ------------------
  |  Branch (473:11): [True: 257k, False: 4.18M]
  ------------------
  474|   257k|        return true; // nothing to pull, but not an error
  475|       |
  476|  4.18M|      if (!employ_color_transform || num_comps == 1)
  ------------------
  |  Branch (476:11): [True: 4.14M, False: 40.1k]
  |  Branch (476:38): [True: 0, False: 40.1k]
  ------------------
  477|  4.14M|      {
  478|  4.14M|        line_buf *src_line = comps[comp_num].pull_line();
  479|  4.14M|        if (reversible[comp_num])
  ------------------
  |  Branch (479:13): [True: 2.56M, False: 1.58M]
  ------------------
  480|  2.56M|        {
  481|  2.56M|          si64 shift = (si64)1 << (num_bits[comp_num] - 1);
  482|  2.56M|          if (nlt_ptr[comp_num] == NULL) {
  ------------------
  |  Branch (482:15): [True: 2.50M, False: 60.6k]
  ------------------
  483|  2.50M|            shift = is_signed[comp_num] ? 0 : shift;
  ------------------
  |  Branch (483:21): [True: 219k, False: 2.28M]
  ------------------
  484|  2.50M|            rev_convert(src_line, 0, tgt_line,
  485|  2.50M|              line_offsets[comp_num], shift, comp_width);
  486|  2.50M|          }
  487|  60.6k|          else if (is_signed[comp_num] &&
  ------------------
  |  Branch (487:20): [True: 55.6k, False: 4.98k]
  ------------------
  488|  55.6k|            nlt_ptr[comp_num]->get_type() == type3)
  ------------------
  |  Branch (488:13): [True: 43.3k, False: 12.3k]
  ------------------
  489|  43.3k|            rev_convert_nlt_type3(src_line, 0, tgt_line,
  490|  43.3k|              line_offsets[comp_num], shift + 1, comp_width);
  491|  17.3k|          else if (nlt_ptr[comp_num]->get_type() == type2 ||
  ------------------
  |  Branch (491:20): [True: 0, False: 17.3k]
  ------------------
  492|  17.3k|            nlt_ptr[comp_num]->get_type() == type4)
  ------------------
  |  Branch (492:13): [True: 0, False: 17.3k]
  ------------------
  493|      0|            rev_decode_nlt(src_line, 0, tgt_line,
  494|      0|              line_offsets[comp_num], num_bits[comp_num],
  495|      0|              is_signed[comp_num], comp_width, nlt_ptr[comp_num]);
  496|  2.56M|        }
  497|  1.58M|        else
  498|  1.58M|        {
  499|  1.58M|          if (nlt_ptr[comp_num] == NULL)
  ------------------
  |  Branch (499:15): [True: 1.55M, False: 23.0k]
  ------------------
  500|  1.55M|            irv_convert_to_integer(src_line, tgt_line,
  501|  1.55M|              line_offsets[comp_num], num_bits[comp_num],
  502|  1.55M|              is_signed[comp_num], comp_width);
  503|  23.0k|          else if (nlt_ptr[comp_num]->get_type() == type3)
  ------------------
  |  Branch (503:20): [True: 19.8k, False: 3.19k]
  ------------------
  504|  19.8k|            irv_convert_to_integer_nlt_type3(src_line, tgt_line,
  505|  19.8k|              line_offsets[comp_num], num_bits[comp_num],
  506|  19.8k|              is_signed[comp_num], comp_width);
  507|  3.19k|          else if (nlt_ptr[comp_num]->get_type() == type2 ||
  ------------------
  |  Branch (507:20): [True: 1.41k, False: 1.78k]
  ------------------
  508|  1.78k|            nlt_ptr[comp_num]->get_type() == type4)
  ------------------
  |  Branch (508:13): [True: 1.15k, False: 621]
  ------------------
  509|  2.56k|            irv_convert_to_integer_nlt(src_line, tgt_line,
  510|  2.56k|              line_offsets[comp_num], num_bits[comp_num],
  511|  2.56k|              is_signed[comp_num], comp_width, nlt_ptr[comp_num]);
  512|  1.58M|        }
  513|  4.14M|      }
  514|  40.1k|      else
  515|  40.1k|      {
  516|  40.1k|        assert(num_comps >= 3);
  517|  40.1k|        if (comp_num == 0)
  ------------------
  |  Branch (517:13): [True: 12.3k, False: 27.7k]
  ------------------
  518|  12.3k|        {
  519|  12.3k|          if (reversible[comp_num])
  ------------------
  |  Branch (519:15): [True: 8.25k, False: 4.07k]
  ------------------
  520|  8.25k|            rct_backward(comps[0].pull_line(), comps[1].pull_line(),
  521|  8.25k|              comps[2].pull_line(), lines + 0, lines + 1,
  522|  8.25k|              lines + 2, comp_width);
  523|  4.07k|          else
  524|  4.07k|            ict_backward(comps[0].pull_line()->f32, comps[1].pull_line()->f32,
  525|  4.07k|              comps[2].pull_line()->f32, lines[0].f32, lines[1].f32,
  526|  4.07k|              lines[2].f32, comp_width);
  527|  12.3k|        }
  528|  40.1k|        if (reversible[comp_num])
  ------------------
  |  Branch (528:13): [True: 18.9k, False: 21.2k]
  ------------------
  529|  18.9k|        {
  530|  18.9k|          si64 shift = (si64)1 << (num_bits[comp_num] - 1);
  531|  18.9k|          line_buf* src_line;
  532|  18.9k|          if (comp_num < 3)
  ------------------
  |  Branch (532:15): [True: 18.5k, False: 352]
  ------------------
  533|  18.5k|            src_line = lines + comp_num;
  534|    352|          else
  535|    352|            src_line = comps[comp_num].pull_line();
  536|  18.9k|          if (nlt_ptr[comp_num] == NULL) {
  ------------------
  |  Branch (536:15): [True: 11.6k, False: 7.23k]
  ------------------
  537|  11.6k|            shift = is_signed[comp_num] ? 0 : shift;
  ------------------
  |  Branch (537:21): [True: 1.80k, False: 9.85k]
  ------------------
  538|  11.6k|            rev_convert(src_line, 0, tgt_line,
  539|  11.6k|              line_offsets[comp_num], shift, comp_width);
  540|  11.6k|          }
  541|  7.23k|          else if (is_signed[comp_num] &&
  ------------------
  |  Branch (541:20): [True: 3.33k, False: 3.90k]
  ------------------
  542|  3.33k|            nlt_ptr[comp_num]->get_type() == type3)
  ------------------
  |  Branch (542:13): [True: 221, False: 3.11k]
  ------------------
  543|    221|            rev_convert_nlt_type3(src_line, 0, tgt_line,
  544|    221|              line_offsets[comp_num], shift + 1, comp_width);
  545|  7.01k|          else if (nlt_ptr[comp_num]->get_type() == type2 ||
  ------------------
  |  Branch (545:20): [True: 0, False: 7.01k]
  ------------------
  546|  7.01k|            nlt_ptr[comp_num]->get_type() == type4)
  ------------------
  |  Branch (546:13): [True: 0, False: 7.01k]
  ------------------
  547|      0|            rev_decode_nlt(src_line, 0, tgt_line,
  548|      0|              line_offsets[comp_num], num_bits[comp_num],
  549|      0|              is_signed[comp_num], comp_width, nlt_ptr[comp_num]);
  550|  18.9k|        }
  551|  21.2k|        else
  552|  21.2k|        {
  553|  21.2k|          line_buf* lbp;
  554|  21.2k|          if (comp_num < 3)
  ------------------
  |  Branch (554:15): [True: 12.2k, False: 9.01k]
  ------------------
  555|  12.2k|            lbp = lines + comp_num;
  556|  9.01k|          else
  557|  9.01k|            lbp = comps[comp_num].pull_line();
  558|  21.2k|          if (nlt_ptr[comp_num] == NULL)
  ------------------
  |  Branch (558:15): [True: 18.8k, False: 2.40k]
  ------------------
  559|  18.8k|            irv_convert_to_integer(lbp, tgt_line,
  560|  18.8k|              line_offsets[comp_num], num_bits[comp_num],
  561|  18.8k|              is_signed[comp_num], comp_width);
  562|  2.40k|          else if (nlt_ptr[comp_num]->get_type() == type3)
  ------------------
  |  Branch (562:20): [True: 1.28k, False: 1.12k]
  ------------------
  563|  1.28k|            irv_convert_to_integer_nlt_type3(lbp, tgt_line,
  564|  1.28k|              line_offsets[comp_num], num_bits[comp_num],
  565|  1.28k|              is_signed[comp_num], comp_width);
  566|  1.12k|          else if (nlt_ptr[comp_num]->get_type() == type2 ||
  ------------------
  |  Branch (566:20): [True: 578, False: 545]
  ------------------
  567|    545|            nlt_ptr[comp_num]->get_type() == type4)
  ------------------
  |  Branch (567:13): [True: 265, False: 280]
  ------------------
  568|    843|            irv_convert_to_integer_nlt(lbp, tgt_line,
  569|    843|              line_offsets[comp_num], num_bits[comp_num], is_signed[comp_num],
  570|    843|              comp_width, nlt_ptr[comp_num]);
  571|  21.2k|        }
  572|  40.1k|      }
  573|       |
  574|  4.18M|      return true;
  575|  4.43M|    }
_ZN4ojph5local4tile17parse_tile_headerERKNS0_9param_sotEPNS_11infile_baseERKm:
  837|   222k|    {
  838|   222k|      if (sot.get_tile_part_index() != next_tile_part)
  ------------------
  |  Branch (838:11): [True: 220k, False: 1.84k]
  ------------------
  839|   220k|      {
  840|   220k|        if (resilient)
  ------------------
  |  Branch (840:13): [True: 220k, False: 0]
  ------------------
  841|   220k|          OJPH_INFO(0x00030091, "wrong tile part index")
  ------------------
  |  |  285|   220k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|   220k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 220k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  842|      0|        else
  843|      0|          OJPH_ERROR(0x00030091, "wrong tile part index")
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  844|   220k|      }
  845|   222k|      ++next_tile_part;
  846|       |
  847|       |      //tile_end_location used on failure
  848|   222k|      ui64 tile_end_location = tile_start_location + sot.get_payload_length();
  849|       |
  850|   222k|      ui32 data_left = sot.get_payload_length(); //bytes left to parse
  851|   222k|      data_left -= (ui32)((ui64)file->tell() - tile_start_location);
  852|       |
  853|   222k|      if (data_left == 0)
  ------------------
  |  Branch (853:11): [True: 319, False: 222k]
  ------------------
  854|    319|        return;
  855|       |
  856|   222k|      ui32 max_decompositions = 0;
  857|   458k|      for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (857:24): [True: 236k, False: 222k]
  ------------------
  858|   236k|        max_decompositions = ojph_max(max_decompositions,
  ------------------
  |  |   73|   458k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 4.91k, False: 231k]
  |  |  ------------------
  ------------------
  859|   222k|          comps[c].get_num_decompositions());
  860|       |
  861|   222k|      try
  862|   222k|      {
  863|       |        //sequence the reading of precincts according to progression order
  864|   222k|        if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
  ------------------
  |  Branch (864:13): [True: 11.1k, False: 211k]
  |  Branch (864:43): [True: 1.04k, False: 210k]
  ------------------
  865|  12.2k|        {
  866|  12.2k|          max_decompositions -= skipped_res_for_read;
  867|  73.6k|          for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (867:28): [True: 61.4k, False: 12.2k]
  ------------------
  868|   188k|            for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (868:30): [True: 126k, False: 61.4k]
  ------------------
  869|   126k|              if (data_left > 0)
  ------------------
  |  Branch (869:19): [True: 121k, False: 5.88k]
  ------------------
  870|   121k|                comps[c].parse_precincts(r, data_left, file);
  871|  12.2k|        }
  872|   210k|        else if (prog_order == OJPH_PO_RPCL)
  ------------------
  |  Branch (872:18): [True: 4.62k, False: 205k]
  ------------------
  873|  4.62k|        {
  874|  4.62k|          max_decompositions -= skipped_res_for_read;
  875|  21.7k|          for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (875:28): [True: 17.1k, False: 4.62k]
  ------------------
  876|  17.1k|          {
  877|  64.4k|            while (true)
  ------------------
  |  Branch (877:20): [True: 60.1k, Folded]
  ------------------
  878|  60.1k|            {
  879|  60.1k|              bool found = false;
  880|  60.1k|              ui32 comp_num = 0;
  881|  60.1k|              point smallest(INT_MAX, INT_MAX), cur;
  882|   163k|              for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (882:32): [True: 103k, False: 60.1k]
  ------------------
  883|   103k|              {
  884|   103k|                if (!comps[c].get_top_left_precinct(r, cur))
  ------------------
  |  Branch (884:21): [True: 27.8k, False: 75.5k]
  ------------------
  885|  27.8k|                  continue;
  886|  75.5k|                else
  887|  75.5k|                  found = true;
  888|       |
  889|  75.5k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (889:21): [True: 48.2k, False: 27.2k]
  ------------------
  890|  48.2k|                { smallest = cur; comp_num = c; }
  891|  27.2k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (891:26): [True: 15.6k, False: 11.6k]
  |  Branch (891:49): [True: 2.61k, False: 13.0k]
  ------------------
  892|  2.61k|                { smallest = cur; comp_num = c; }
  893|  75.5k|              }
  894|  60.1k|              if (found == true && data_left > 0)
  ------------------
  |  Branch (894:19): [True: 47.9k, False: 12.1k]
  |  Branch (894:36): [True: 47.2k, False: 724]
  ------------------
  895|  47.2k|                comps[comp_num].parse_one_precinct(r, data_left, file);
  896|  12.9k|              else
  897|  12.9k|                break;
  898|  60.1k|            }
  899|  17.1k|          }
  900|  4.62k|        }
  901|   205k|        else if (prog_order == OJPH_PO_PCRL)
  ------------------
  |  Branch (901:18): [True: 3.44k, False: 201k]
  ------------------
  902|  3.44k|        {
  903|  87.8k|          while (true)
  ------------------
  |  Branch (903:18): [True: 85.5k, Folded]
  ------------------
  904|  85.5k|          {
  905|  85.5k|            bool found = false;
  906|  85.5k|            ui32 comp_num = 0;
  907|  85.5k|            ui32 res_num = 0;
  908|  85.5k|            point smallest(INT_MAX, INT_MAX), cur;
  909|   173k|            for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (909:30): [True: 88.3k, False: 85.5k]
  ------------------
  910|  88.3k|            {
  911|   287k|              for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
  ------------------
  |  Branch (911:32): [True: 198k, False: 88.3k]
  ------------------
  912|   198k|              {
  913|   198k|                if (!comps[c].get_top_left_precinct(r, cur))
  ------------------
  |  Branch (913:21): [True: 30.4k, False: 168k]
  ------------------
  914|  30.4k|                  continue;
  915|   168k|                else
  916|   168k|                  found = true;
  917|       |
  918|   168k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (918:21): [True: 105k, False: 62.3k]
  ------------------
  919|   105k|                { smallest = cur; comp_num = c; res_num = r; }
  920|  62.3k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (920:26): [True: 54.6k, False: 7.71k]
  |  Branch (920:49): [True: 13.4k, False: 41.1k]
  ------------------
  921|  13.4k|                { smallest = cur; comp_num = c; res_num = r; }
  922|  48.8k|                else if (cur.y == smallest.y && cur.x == smallest.x &&
  ------------------
  |  Branch (922:26): [True: 41.1k, False: 7.71k]
  |  Branch (922:49): [True: 36.4k, False: 4.65k]
  ------------------
  923|  36.4k|                         c < comp_num)
  ------------------
  |  Branch (923:26): [True: 0, False: 36.4k]
  ------------------
  924|      0|                { smallest = cur; comp_num = c; res_num = r; }
  925|  48.8k|                else if (cur.y == smallest.y && cur.x == smallest.x &&
  ------------------
  |  Branch (925:26): [True: 41.1k, False: 7.71k]
  |  Branch (925:49): [True: 36.4k, False: 4.65k]
  ------------------
  926|  36.4k|                         c == comp_num && r < res_num)
  ------------------
  |  Branch (926:26): [True: 31.5k, False: 4.93k]
  |  Branch (926:43): [True: 0, False: 31.5k]
  ------------------
  927|      0|                { smallest = cur; comp_num = c; res_num = r; }
  928|   168k|              }
  929|  88.3k|            }
  930|  85.5k|            if (found == true && data_left > 0)
  ------------------
  |  Branch (930:17): [True: 84.9k, False: 679]
  |  Branch (930:34): [True: 84.4k, False: 465]
  ------------------
  931|  84.4k|              comps[comp_num].parse_one_precinct(res_num, data_left, file);
  932|  1.14k|            else
  933|  1.14k|              break;
  934|  85.5k|          }
  935|  3.44k|        }
  936|   201k|        else if (prog_order == OJPH_PO_CPRL)
  ------------------
  |  Branch (936:18): [True: 200k, False: 1.36k]
  ------------------
  937|   200k|        {
  938|   403k|          for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (938:28): [True: 203k, False: 200k]
  ------------------
  939|   203k|          {
  940|   396k|            while (true)
  ------------------
  |  Branch (940:20): [True: 371k, Folded]
  ------------------
  941|   371k|            {
  942|   371k|              bool found = false;
  943|   371k|              ui32 res_num = 0;
  944|   371k|              point smallest(INT_MAX, INT_MAX), cur;
  945|  2.60M|              for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (945:32): [True: 2.23M, False: 371k]
  ------------------
  946|  2.23M|              {
  947|  2.23M|                if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
  ------------------
  |  Branch (947:21): [True: 1.33M, False: 895k]
  ------------------
  948|  1.33M|                  continue;
  949|   895k|                else
  950|   895k|                  found = true;
  951|       |
  952|   895k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (952:21): [True: 386k, False: 509k]
  ------------------
  953|   386k|                { smallest = cur; res_num = r; }
  954|   509k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (954:26): [True: 478k, False: 30.7k]
  |  Branch (954:49): [True: 163k, False: 315k]
  ------------------
  955|   163k|                { smallest = cur; res_num = r; }
  956|   895k|              }
  957|   371k|              if (found == true && data_left > 0)
  ------------------
  |  Branch (957:19): [True: 193k, False: 177k]
  |  Branch (957:36): [True: 192k, False: 976]
  ------------------
  958|   192k|                comps[c].parse_one_precinct(res_num, data_left, file);
  959|   178k|              else
  960|   178k|                break;
  961|   371k|            }
  962|   203k|          }
  963|   200k|        }
  964|  1.36k|        else
  965|   201k|          assert(0);
  966|       |
  967|   222k|      }
  968|   222k|      catch (const char *error)
  969|   222k|      {
  970|  36.2k|        if (resilient)
  ------------------
  |  Branch (970:13): [True: 36.2k, False: 0]
  ------------------
  971|  36.2k|          OJPH_INFO(0x00030092, "%s", error)
  ------------------
  |  |  285|  36.2k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  36.2k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 36.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|      0|        else
  973|      0|          OJPH_ERROR(0x00030092, "%s", error)
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  974|  36.2k|      }
  975|       |      // The decode path is meant to throw const char* only, but a nested
  976|       |      // OJPH_ERROR throws std::runtime_error and the allocators can throw
  977|       |      // std::bad_alloc.  These two handlers make sure such throws are also
  978|       |      // subject to the resilience setting, instead of unwinding past
  979|       |      // parse_tile_header.  In the non-resilient case the throw is passed on
  980|       |      // unchanged, because it has already been reported at its origin.
  981|   222k|      catch (const std::exception& error)
  982|   222k|      {
  983|      0|        if (resilient)
  ------------------
  |  Branch (983:13): [True: 0, False: 0]
  ------------------
  984|      0|          OJPH_INFO(0x00030093, "%s", error.what())
  ------------------
  |  |  285|      0|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  985|      0|        else
  986|      0|          throw;
  987|      0|      }
  988|   222k|      catch (...)
  989|   222k|      {
  990|      0|        if (resilient)
  ------------------
  |  Branch (990:13): [True: 0, False: 0]
  ------------------
  991|      0|          OJPH_INFO(0x00030094, "unknown error while parsing a tile header")
  ------------------
  |  |  285|      0|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  992|      0|        else
  993|      0|          throw;
  994|      0|      }
  995|   222k|      file->seek((si64)tile_end_location, infile_base::OJPH_SEEK_SET);
  996|   222k|    }

_ZN4ojph5local4tile13get_tile_rectEv:
   75|  6.34M|      rect get_tile_rect() { return tile_rect; }

_ZN4ojph5local9tile_comp9pre_allocEPNS0_10codestreamEjRKNS_4rectES6_:
   57|  1.20M|    {
   58|  1.20M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   59|       |
   60|       |      //allocate a resolution
   61|  1.20M|      ui32 num_decomps;
   62|  1.20M|      num_decomps = codestream->get_coc(comp_num)->get_num_decompositions();
   63|  1.20M|      allocator->pre_alloc_obj<resolution>(1);
   64|       |
   65|  1.20M|      resolution::pre_alloc(codestream, comp_rect, recon_comp_rect, comp_num, 
   66|  1.20M|                            num_decomps);
   67|  1.20M|    }
_ZN4ojph5local9tile_comp14finalize_allocEPNS0_10codestreamEPNS0_4tileEjRKNS_4rectES8_:
   73|  1.12M|    {
   74|  1.12M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   75|       |
   76|       |      //allocate a resolution
   77|  1.12M|      num_decomps = codestream->get_coc(comp_num)->get_num_decompositions();
   78|       |
   79|  1.12M|      comp_downsamp = codestream->get_siz()->get_downsampling(comp_num);
   80|  1.12M|      this->comp_rect = comp_rect;
   81|  1.12M|      this->parent_tile = parent;
   82|       |
   83|  1.12M|      this->comp_num = comp_num;
   84|  1.12M|      this->num_bytes = 0;
   85|  1.12M|      res = allocator->post_alloc_obj<resolution>(1);
   86|  1.12M|      res->finalize_alloc(codestream, comp_rect, recon_comp_rect, comp_num,
   87|  1.12M|                          num_decomps, comp_downsamp, comp_downsamp, this, 
   88|       |                          NULL);
   89|  1.12M|    }
_ZN4ojph5local9tile_comp9pull_lineEv:
  105|  4.18M|    {
  106|  4.18M|      return res->pull_line();
  107|  4.18M|    }
_ZN4ojph5local9tile_comp21get_top_left_precinctEjRNS_5pointE:
  133|  2.53M|    {
  134|  2.53M|      int resolution_num = (int)num_decomps - (int)res_num;
  135|  2.53M|      resolution *r = res;
  136|  8.77M|       while (resolution_num > 0 && r != NULL)
  ------------------
  |  Branch (136:15): [True: 6.23M, False: 2.53M]
  |  Branch (136:37): [True: 6.23M, False: 0]
  ------------------
  137|  6.23M|      {
  138|  6.23M|        r = r->next_resolution();
  139|  6.23M|        --resolution_num;
  140|  6.23M|      }
  141|  2.53M|      if (r) //resolution does not exist if r is NULL
  ------------------
  |  Branch (141:11): [True: 2.53M, False: 0]
  ------------------
  142|  2.53M|        return r->get_top_left_precinct(top_left);
  143|      0|      else
  144|      0|        return false;
  145|  2.53M|    }
_ZN4ojph5local9tile_comp15parse_precinctsEjRjPNS_11infile_baseE:
  164|   121k|    {
  165|   121k|      assert(res_num <= num_decomps);
  166|   121k|      res_num = num_decomps - res_num; //how many levels to go down
  167|   121k|      resolution *r = res;
  168|   689k|      while (res_num > 0 && r != NULL)
  ------------------
  |  Branch (168:14): [True: 609k, False: 80.7k]
  |  Branch (168:29): [True: 568k, False: 40.3k]
  ------------------
  169|   568k|      {
  170|   568k|        r = r->next_resolution();
  171|   568k|        --res_num;
  172|   568k|      }
  173|   121k|      if (r) //resolution does not exist if r is NULL
  ------------------
  |  Branch (173:11): [True: 80.7k, False: 40.3k]
  ------------------
  174|  80.7k|        r->parse_all_precincts(data_left, file);
  175|   121k|    }
_ZN4ojph5local9tile_comp18parse_one_precinctEjRjPNS_11infile_baseE:
  181|   324k|    {
  182|   324k|      assert(res_num <= num_decomps);
  183|   324k|      res_num = num_decomps - res_num;
  184|   324k|      resolution *r = res;
  185|   489k|      while (res_num > 0 && r != NULL)
  ------------------
  |  Branch (185:14): [True: 165k, False: 324k]
  |  Branch (185:29): [True: 165k, False: 0]
  ------------------
  186|   165k|      {
  187|   165k|        r = r->next_resolution();
  188|   165k|        --res_num;
  189|   165k|      }
  190|   324k|      if (r) //resolution does not exist if r is NULL
  ------------------
  |  Branch (190:11): [True: 324k, False: 0]
  ------------------
  191|   324k|        r->parse_one_precinct(data_left, file);
  192|   324k|    }

_ZN4ojph5local9tile_comp22get_num_decompositionsEv:
   73|   755k|      ui32 get_num_decompositions() { return num_decomps; }
_ZN4ojph5local9tile_comp8get_tileEv:
   74|  6.34M|      tile* get_tile() { return parent_tile; }

ojph_block_common.cpp:_ZN4ojph5localL15vlc_init_tablesEv:
  125|      2|    {
  126|      2|      const bool debug = false; //useful for checking 
  127|       |
  128|       |      //Data in the table is arranged in this format (taken from the standard)
  129|       |      // c_q is the context for a quad
  130|       |      // rho is the significance pattern for a quad
  131|       |      // u_off indicate if u value is 0 (u_off is 0), or communicated
  132|       |      // e_k, e_1 EMB patterns
  133|       |      // cwd VLC codeword
  134|       |      // cwd VLC codeword length
  135|      2|      struct vlc_src_table { int c_q, rho, u_off, e_k, e_1, cwd, cwd_len; };
  136|       |      // initial quad rows
  137|      2|      vlc_src_table tbl0[] = {
  138|      2|    #include "table0.h"
  ------------------
  |  |    1|      2|{0, 0x1, 0x0, 0x0, 0x0, 0x06, 4},
  |  |    2|      2|{0, 0x1, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |    3|      2|{0, 0x2, 0x0, 0x0, 0x0, 0x00, 3},
  |  |    4|      2|{0, 0x2, 0x1, 0x2, 0x2, 0x7F, 7},
  |  |    5|      2|{0, 0x3, 0x0, 0x0, 0x0, 0x11, 5},
  |  |    6|      2|{0, 0x3, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |    7|      2|{0, 0x3, 0x1, 0x3, 0x1, 0x1F, 7},
  |  |    8|      2|{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3},
  |  |    9|      2|{0, 0x4, 0x1, 0x4, 0x4, 0x13, 6},
  |  |   10|      2|{0, 0x5, 0x0, 0x0, 0x0, 0x0E, 5},
  |  |   11|      2|{0, 0x5, 0x1, 0x4, 0x4, 0x23, 6},
  |  |   12|      2|{0, 0x5, 0x1, 0x5, 0x1, 0x0F, 7},
  |  |   13|      2|{0, 0x6, 0x0, 0x0, 0x0, 0x03, 6},
  |  |   14|      2|{0, 0x6, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |   15|      2|{0, 0x7, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   16|      2|{0, 0x7, 0x1, 0x2, 0x2, 0x4F, 7},
  |  |   17|      2|{0, 0x7, 0x1, 0x2, 0x0, 0x0D, 6},
  |  |   18|      2|{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3},
  |  |   19|      2|{0, 0x8, 0x1, 0x8, 0x8, 0x3D, 6},
  |  |   20|      2|{0, 0x9, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |   21|      2|{0, 0x9, 0x1, 0x0, 0x0, 0x2D, 6},
  |  |   22|      2|{0, 0xA, 0x0, 0x0, 0x0, 0x01, 5},
  |  |   23|      2|{0, 0xA, 0x1, 0x8, 0x8, 0x35, 6},
  |  |   24|      2|{0, 0xA, 0x1, 0xA, 0x2, 0x77, 7},
  |  |   25|      2|{0, 0xB, 0x0, 0x0, 0x0, 0x37, 7},
  |  |   26|      2|{0, 0xB, 0x1, 0x1, 0x1, 0x57, 7},
  |  |   27|      2|{0, 0xB, 0x1, 0x1, 0x0, 0x09, 6},
  |  |   28|      2|{0, 0xC, 0x0, 0x0, 0x0, 0x1E, 5},
  |  |   29|      2|{0, 0xC, 0x1, 0xC, 0xC, 0x17, 7},
  |  |   30|      2|{0, 0xC, 0x1, 0xC, 0x4, 0x15, 6},
  |  |   31|      2|{0, 0xC, 0x1, 0xC, 0x8, 0x25, 6},
  |  |   32|      2|{0, 0xD, 0x0, 0x0, 0x0, 0x67, 7},
  |  |   33|      2|{0, 0xD, 0x1, 0x1, 0x1, 0x27, 7},
  |  |   34|      2|{0, 0xD, 0x1, 0x5, 0x4, 0x47, 7},
  |  |   35|      2|{0, 0xD, 0x1, 0xD, 0x8, 0x07, 7},
  |  |   36|      2|{0, 0xE, 0x0, 0x0, 0x0, 0x7B, 7},
  |  |   37|      2|{0, 0xE, 0x1, 0x2, 0x2, 0x4B, 7},
  |  |   38|      2|{0, 0xE, 0x1, 0xA, 0x8, 0x05, 6},
  |  |   39|      2|{0, 0xE, 0x1, 0xE, 0x4, 0x3B, 7},
  |  |   40|      2|{0, 0xF, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |   41|      2|{0, 0xF, 0x1, 0x9, 0x9, 0x1B, 7},
  |  |   42|      2|{0, 0xF, 0x1, 0xB, 0xA, 0x6B, 7},
  |  |   43|      2|{0, 0xF, 0x1, 0xF, 0xC, 0x2B, 7},
  |  |   44|      2|{0, 0xF, 0x1, 0xF, 0x8, 0x39, 6},
  |  |   45|      2|{0, 0xF, 0x1, 0xE, 0x6, 0x73, 7},
  |  |   46|      2|{0, 0xF, 0x1, 0xE, 0x2, 0x19, 6},
  |  |   47|      2|{0, 0xF, 0x1, 0xF, 0x5, 0x0B, 7},
  |  |   48|      2|{0, 0xF, 0x1, 0xF, 0x4, 0x29, 6},
  |  |   49|      2|{0, 0xF, 0x1, 0xF, 0x1, 0x33, 7},
  |  |   50|      2|{1, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |   51|      2|{1, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
  |  |   52|      2|{1, 0x1, 0x1, 0x1, 0x1, 0x1F, 7},
  |  |   53|      2|{1, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
  |  |   54|      2|{1, 0x2, 0x1, 0x2, 0x2, 0x3B, 6},
  |  |   55|      2|{1, 0x3, 0x0, 0x0, 0x0, 0x1B, 6},
  |  |   56|      2|{1, 0x3, 0x1, 0x0, 0x0, 0x3D, 6},
  |  |   57|      2|{1, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |   58|      2|{1, 0x4, 0x1, 0x4, 0x4, 0x2B, 6},
  |  |   59|      2|{1, 0x5, 0x0, 0x0, 0x0, 0x0B, 6},
  |  |   60|      2|{1, 0x5, 0x1, 0x4, 0x4, 0x33, 6},
  |  |   61|      2|{1, 0x5, 0x1, 0x5, 0x1, 0x7F, 7},
  |  |   62|      2|{1, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |   63|      2|{1, 0x6, 0x1, 0x0, 0x0, 0x23, 6},
  |  |   64|      2|{1, 0x7, 0x0, 0x0, 0x0, 0x3F, 7},
  |  |   65|      2|{1, 0x7, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |   66|      2|{1, 0x7, 0x1, 0x2, 0x0, 0x03, 6},
  |  |   67|      2|{1, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
  |  |   68|      2|{1, 0x8, 0x1, 0x8, 0x8, 0x1D, 6},
  |  |   69|      2|{1, 0x9, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |   70|      2|{1, 0x9, 0x1, 0x0, 0x0, 0x0D, 6},
  |  |   71|      2|{1, 0xA, 0x0, 0x0, 0x0, 0x35, 6},
  |  |   72|      2|{1, 0xA, 0x1, 0x8, 0x8, 0x15, 6},
  |  |   73|      2|{1, 0xA, 0x1, 0xA, 0x2, 0x6F, 7},
  |  |   74|      2|{1, 0xB, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   75|      2|{1, 0xB, 0x1, 0x1, 0x1, 0x4F, 7},
  |  |   76|      2|{1, 0xB, 0x1, 0x1, 0x0, 0x11, 6},
  |  |   77|      2|{1, 0xC, 0x0, 0x0, 0x0, 0x01, 5},
  |  |   78|      2|{1, 0xC, 0x1, 0x8, 0x8, 0x25, 6},
  |  |   79|      2|{1, 0xC, 0x1, 0xC, 0x4, 0x05, 6},
  |  |   80|      2|{1, 0xD, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   81|      2|{1, 0xD, 0x1, 0x1, 0x1, 0x17, 7},
  |  |   82|      2|{1, 0xD, 0x1, 0x5, 0x4, 0x39, 6},
  |  |   83|      2|{1, 0xD, 0x1, 0xD, 0x8, 0x77, 7},
  |  |   84|      2|{1, 0xE, 0x0, 0x0, 0x0, 0x37, 7},
  |  |   85|      2|{1, 0xE, 0x1, 0x2, 0x2, 0x57, 7},
  |  |   86|      2|{1, 0xE, 0x1, 0xA, 0x8, 0x19, 6},
  |  |   87|      2|{1, 0xE, 0x1, 0xE, 0x4, 0x67, 7},
  |  |   88|      2|{1, 0xF, 0x0, 0x0, 0x0, 0x07, 7},
  |  |   89|      2|{1, 0xF, 0x1, 0xB, 0x8, 0x29, 6},
  |  |   90|      2|{1, 0xF, 0x1, 0x8, 0x8, 0x27, 7},
  |  |   91|      2|{1, 0xF, 0x1, 0xA, 0x2, 0x09, 6},
  |  |   92|      2|{1, 0xF, 0x1, 0xE, 0x4, 0x31, 6},
  |  |   93|      2|{1, 0xF, 0x1, 0xF, 0x1, 0x47, 7},
  |  |   94|      2|{2, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |   95|      2|{2, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
  |  |   96|      2|{2, 0x1, 0x1, 0x1, 0x1, 0x1B, 6},
  |  |   97|      2|{2, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
  |  |   98|      2|{2, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |   99|      2|{2, 0x3, 0x0, 0x0, 0x0, 0x2B, 6},
  |  |  100|      2|{2, 0x3, 0x1, 0x1, 0x1, 0x33, 6},
  |  |  101|      2|{2, 0x3, 0x1, 0x3, 0x2, 0x7F, 7},
  |  |  102|      2|{2, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |  103|      2|{2, 0x4, 0x1, 0x4, 0x4, 0x0B, 6},
  |  |  104|      2|{2, 0x5, 0x0, 0x0, 0x0, 0x01, 5},
  |  |  105|      2|{2, 0x5, 0x1, 0x5, 0x5, 0x2F, 7},
  |  |  106|      2|{2, 0x5, 0x1, 0x5, 0x1, 0x13, 6},
  |  |  107|      2|{2, 0x5, 0x1, 0x5, 0x4, 0x23, 6},
  |  |  108|      2|{2, 0x6, 0x0, 0x0, 0x0, 0x03, 6},
  |  |  109|      2|{2, 0x6, 0x1, 0x0, 0x0, 0x5F, 7},
  |  |  110|      2|{2, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
  |  |  111|      2|{2, 0x7, 0x1, 0x2, 0x2, 0x6F, 7},
  |  |  112|      2|{2, 0x7, 0x1, 0x3, 0x1, 0x11, 6},
  |  |  113|      2|{2, 0x7, 0x1, 0x7, 0x4, 0x37, 7},
  |  |  114|      2|{2, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  115|      2|{2, 0x8, 0x1, 0x8, 0x8, 0x4F, 7},
  |  |  116|      2|{2, 0x9, 0x0, 0x0, 0x0, 0x3D, 6},
  |  |  117|      2|{2, 0x9, 0x1, 0x0, 0x0, 0x1D, 6},
  |  |  118|      2|{2, 0xA, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  119|      2|{2, 0xA, 0x1, 0x0, 0x0, 0x0D, 6},
  |  |  120|      2|{2, 0xB, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |  121|      2|{2, 0xB, 0x1, 0x2, 0x2, 0x77, 7},
  |  |  122|      2|{2, 0xB, 0x1, 0x2, 0x0, 0x35, 6},
  |  |  123|      2|{2, 0xC, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  124|      2|{2, 0xC, 0x1, 0x4, 0x4, 0x25, 6},
  |  |  125|      2|{2, 0xC, 0x1, 0xC, 0x8, 0x57, 7},
  |  |  126|      2|{2, 0xD, 0x0, 0x0, 0x0, 0x17, 7},
  |  |  127|      2|{2, 0xD, 0x1, 0x8, 0x8, 0x05, 6},
  |  |  128|      2|{2, 0xD, 0x1, 0xC, 0x4, 0x39, 6},
  |  |  129|      2|{2, 0xD, 0x1, 0xD, 0x1, 0x67, 7},
  |  |  130|      2|{2, 0xE, 0x0, 0x0, 0x0, 0x27, 7},
  |  |  131|      2|{2, 0xE, 0x1, 0x2, 0x2, 0x7B, 7},
  |  |  132|      2|{2, 0xE, 0x1, 0x2, 0x0, 0x19, 6},
  |  |  133|      2|{2, 0xF, 0x0, 0x0, 0x0, 0x47, 7},
  |  |  134|      2|{2, 0xF, 0x1, 0xF, 0x1, 0x29, 6},
  |  |  135|      2|{2, 0xF, 0x1, 0x1, 0x1, 0x09, 6},
  |  |  136|      2|{2, 0xF, 0x1, 0x3, 0x2, 0x07, 7},
  |  |  137|      2|{2, 0xF, 0x1, 0x7, 0x4, 0x31, 6},
  |  |  138|      2|{2, 0xF, 0x1, 0xF, 0x8, 0x3B, 7},
  |  |  139|      2|{3, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  140|      2|{3, 0x1, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  141|      2|{3, 0x1, 0x1, 0x1, 0x1, 0x3D, 6},
  |  |  142|      2|{3, 0x2, 0x0, 0x0, 0x0, 0x0C, 5},
  |  |  143|      2|{3, 0x2, 0x1, 0x2, 0x2, 0x4F, 7},
  |  |  144|      2|{3, 0x3, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  145|      2|{3, 0x3, 0x1, 0x1, 0x1, 0x05, 6},
  |  |  146|      2|{3, 0x3, 0x1, 0x3, 0x2, 0x7F, 7},
  |  |  147|      2|{3, 0x4, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  148|      2|{3, 0x4, 0x1, 0x4, 0x4, 0x2D, 6},
  |  |  149|      2|{3, 0x5, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  150|      2|{3, 0x5, 0x1, 0x5, 0x5, 0x1A, 5},
  |  |  151|      2|{3, 0x5, 0x1, 0x5, 0x1, 0x0D, 6},
  |  |  152|      2|{3, 0x5, 0x1, 0x5, 0x4, 0x35, 6},
  |  |  153|      2|{3, 0x6, 0x0, 0x0, 0x0, 0x3F, 7},
  |  |  154|      2|{3, 0x6, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |  155|      2|{3, 0x6, 0x1, 0x6, 0x2, 0x1F, 7},
  |  |  156|      2|{3, 0x7, 0x0, 0x0, 0x0, 0x6F, 7},
  |  |  157|      2|{3, 0x7, 0x1, 0x6, 0x6, 0x2F, 7},
  |  |  158|      2|{3, 0x7, 0x1, 0x6, 0x4, 0x15, 6},
  |  |  159|      2|{3, 0x7, 0x1, 0x7, 0x3, 0x77, 7},
  |  |  160|      2|{3, 0x7, 0x1, 0x7, 0x1, 0x25, 6},
  |  |  161|      2|{3, 0x7, 0x1, 0x7, 0x2, 0x0F, 7},
  |  |  162|      2|{3, 0x8, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  163|      2|{3, 0x8, 0x1, 0x8, 0x8, 0x07, 7},
  |  |  164|      2|{3, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  165|      2|{3, 0x9, 0x1, 0x1, 0x1, 0x37, 7},
  |  |  166|      2|{3, 0x9, 0x1, 0x9, 0x8, 0x57, 7},
  |  |  167|      2|{3, 0xA, 0x0, 0x0, 0x0, 0x19, 6},
  |  |  168|      2|{3, 0xA, 0x1, 0x8, 0x8, 0x29, 6},
  |  |  169|      2|{3, 0xA, 0x1, 0xA, 0x2, 0x17, 7},
  |  |  170|      2|{3, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  171|      2|{3, 0xB, 0x1, 0xB, 0x1, 0x27, 7},
  |  |  172|      2|{3, 0xB, 0x1, 0x1, 0x1, 0x47, 7},
  |  |  173|      2|{3, 0xB, 0x1, 0x3, 0x2, 0x09, 6},
  |  |  174|      2|{3, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
  |  |  175|      2|{3, 0xC, 0x0, 0x0, 0x0, 0x31, 6},
  |  |  176|      2|{3, 0xC, 0x1, 0x4, 0x4, 0x11, 6},
  |  |  177|      2|{3, 0xC, 0x1, 0xC, 0x8, 0x3B, 7},
  |  |  178|      2|{3, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  179|      2|{3, 0xD, 0x1, 0x9, 0x9, 0x1B, 7},
  |  |  180|      2|{3, 0xD, 0x1, 0xD, 0x5, 0x2B, 7},
  |  |  181|      2|{3, 0xD, 0x1, 0xD, 0x1, 0x21, 6},
  |  |  182|      2|{3, 0xD, 0x1, 0xD, 0xC, 0x6B, 7},
  |  |  183|      2|{3, 0xD, 0x1, 0xD, 0x4, 0x01, 6},
  |  |  184|      2|{3, 0xD, 0x1, 0xD, 0x8, 0x4B, 7},
  |  |  185|      2|{3, 0xE, 0x0, 0x0, 0x0, 0x0B, 7},
  |  |  186|      2|{3, 0xE, 0x1, 0xE, 0x4, 0x73, 7},
  |  |  187|      2|{3, 0xE, 0x1, 0x4, 0x4, 0x13, 7},
  |  |  188|      2|{3, 0xE, 0x1, 0xC, 0x8, 0x3E, 6},
  |  |  189|      2|{3, 0xE, 0x1, 0xE, 0x2, 0x33, 7},
  |  |  190|      2|{3, 0xF, 0x0, 0x0, 0x0, 0x53, 7},
  |  |  191|      2|{3, 0xF, 0x1, 0xA, 0xA, 0x0E, 6},
  |  |  192|      2|{3, 0xF, 0x1, 0xB, 0x9, 0x63, 7},
  |  |  193|      2|{3, 0xF, 0x1, 0xF, 0xC, 0x03, 7},
  |  |  194|      2|{3, 0xF, 0x1, 0xF, 0x8, 0x12, 5},
  |  |  195|      2|{3, 0xF, 0x1, 0xE, 0x6, 0x23, 7},
  |  |  196|      2|{3, 0xF, 0x1, 0xF, 0x5, 0x1E, 6},
  |  |  197|      2|{3, 0xF, 0x1, 0xF, 0x4, 0x02, 5},
  |  |  198|      2|{3, 0xF, 0x1, 0xF, 0x3, 0x43, 7},
  |  |  199|      2|{3, 0xF, 0x1, 0xF, 0x1, 0x1C, 5},
  |  |  200|      2|{3, 0xF, 0x1, 0xF, 0x2, 0x2E, 6},
  |  |  201|      2|{4, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |  202|      2|{4, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
  |  |  203|      2|{4, 0x1, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |  204|      2|{4, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
  |  |  205|      2|{4, 0x2, 0x1, 0x2, 0x2, 0x1B, 6},
  |  |  206|      2|{4, 0x3, 0x0, 0x0, 0x0, 0x2B, 6},
  |  |  207|      2|{4, 0x3, 0x1, 0x2, 0x2, 0x3D, 6},
  |  |  208|      2|{4, 0x3, 0x1, 0x3, 0x1, 0x7F, 7},
  |  |  209|      2|{4, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |  210|      2|{4, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |  211|      2|{4, 0x5, 0x0, 0x0, 0x0, 0x0B, 6},
  |  |  212|      2|{4, 0x5, 0x1, 0x0, 0x0, 0x33, 6},
  |  |  213|      2|{4, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |  214|      2|{4, 0x6, 0x1, 0x0, 0x0, 0x23, 6},
  |  |  215|      2|{4, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
  |  |  216|      2|{4, 0x7, 0x1, 0x4, 0x4, 0x6F, 7},
  |  |  217|      2|{4, 0x7, 0x1, 0x4, 0x0, 0x03, 6},
  |  |  218|      2|{4, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  219|      2|{4, 0x8, 0x1, 0x8, 0x8, 0x1D, 6},
  |  |  220|      2|{4, 0x9, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  221|      2|{4, 0x9, 0x1, 0x0, 0x0, 0x77, 7},
  |  |  222|      2|{4, 0xA, 0x0, 0x0, 0x0, 0x01, 5},
  |  |  223|      2|{4, 0xA, 0x1, 0xA, 0xA, 0x2F, 7},
  |  |  224|      2|{4, 0xA, 0x1, 0xA, 0x2, 0x2D, 6},
  |  |  225|      2|{4, 0xA, 0x1, 0xA, 0x8, 0x0D, 6},
  |  |  226|      2|{4, 0xB, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  227|      2|{4, 0xB, 0x1, 0xB, 0x2, 0x0F, 7},
  |  |  228|      2|{4, 0xB, 0x1, 0x0, 0x0, 0x35, 6},
  |  |  229|      2|{4, 0xC, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  230|      2|{4, 0xC, 0x1, 0x8, 0x8, 0x25, 6},
  |  |  231|      2|{4, 0xC, 0x1, 0xC, 0x4, 0x37, 7},
  |  |  232|      2|{4, 0xD, 0x0, 0x0, 0x0, 0x57, 7},
  |  |  233|      2|{4, 0xD, 0x1, 0x1, 0x1, 0x07, 7},
  |  |  234|      2|{4, 0xD, 0x1, 0x1, 0x0, 0x05, 6},
  |  |  235|      2|{4, 0xE, 0x0, 0x0, 0x0, 0x17, 7},
  |  |  236|      2|{4, 0xE, 0x1, 0x4, 0x4, 0x39, 6},
  |  |  237|      2|{4, 0xE, 0x1, 0xC, 0x8, 0x19, 6},
  |  |  238|      2|{4, 0xE, 0x1, 0xE, 0x2, 0x67, 7},
  |  |  239|      2|{4, 0xF, 0x0, 0x0, 0x0, 0x27, 7},
  |  |  240|      2|{4, 0xF, 0x1, 0x9, 0x9, 0x47, 7},
  |  |  241|      2|{4, 0xF, 0x1, 0x9, 0x1, 0x29, 6},
  |  |  242|      2|{4, 0xF, 0x1, 0x7, 0x6, 0x7B, 7},
  |  |  243|      2|{4, 0xF, 0x1, 0x7, 0x2, 0x09, 6},
  |  |  244|      2|{4, 0xF, 0x1, 0xB, 0x8, 0x31, 6},
  |  |  245|      2|{4, 0xF, 0x1, 0xF, 0x4, 0x3B, 7},
  |  |  246|      2|{5, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  247|      2|{5, 0x1, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  248|      2|{5, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |  249|      2|{5, 0x2, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  250|      2|{5, 0x2, 0x1, 0x2, 0x2, 0x1D, 6},
  |  |  251|      2|{5, 0x3, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  252|      2|{5, 0x3, 0x1, 0x3, 0x3, 0x5F, 7},
  |  |  253|      2|{5, 0x3, 0x1, 0x3, 0x2, 0x39, 6},
  |  |  254|      2|{5, 0x3, 0x1, 0x3, 0x1, 0x3F, 7},
  |  |  255|      2|{5, 0x4, 0x0, 0x0, 0x0, 0x12, 5},
  |  |  256|      2|{5, 0x4, 0x1, 0x4, 0x4, 0x1F, 7},
  |  |  257|      2|{5, 0x5, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |  258|      2|{5, 0x5, 0x1, 0x4, 0x4, 0x35, 6},
  |  |  259|      2|{5, 0x5, 0x1, 0x5, 0x1, 0x6F, 7},
  |  |  260|      2|{5, 0x6, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  261|      2|{5, 0x6, 0x1, 0x2, 0x2, 0x25, 6},
  |  |  262|      2|{5, 0x6, 0x1, 0x6, 0x4, 0x2F, 7},
  |  |  263|      2|{5, 0x7, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  264|      2|{5, 0x7, 0x1, 0x6, 0x6, 0x57, 7},
  |  |  265|      2|{5, 0x7, 0x1, 0x6, 0x4, 0x05, 6},
  |  |  266|      2|{5, 0x7, 0x1, 0x7, 0x3, 0x0F, 7},
  |  |  267|      2|{5, 0x7, 0x1, 0x7, 0x2, 0x77, 7},
  |  |  268|      2|{5, 0x7, 0x1, 0x7, 0x1, 0x37, 7},
  |  |  269|      2|{5, 0x8, 0x0, 0x0, 0x0, 0x02, 5},
  |  |  270|      2|{5, 0x8, 0x1, 0x8, 0x8, 0x19, 6},
  |  |  271|      2|{5, 0x9, 0x0, 0x0, 0x0, 0x26, 6},
  |  |  272|      2|{5, 0x9, 0x1, 0x8, 0x8, 0x17, 7},
  |  |  273|      2|{5, 0x9, 0x1, 0x9, 0x1, 0x67, 7},
  |  |  274|      2|{5, 0xA, 0x0, 0x0, 0x0, 0x1C, 5},
  |  |  275|      2|{5, 0xA, 0x1, 0xA, 0xA, 0x29, 6},
  |  |  276|      2|{5, 0xA, 0x1, 0xA, 0x2, 0x09, 6},
  |  |  277|      2|{5, 0xA, 0x1, 0xA, 0x8, 0x31, 6},
  |  |  278|      2|{5, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
  |  |  279|      2|{5, 0xB, 0x1, 0x9, 0x9, 0x07, 7},
  |  |  280|      2|{5, 0xB, 0x1, 0x9, 0x8, 0x11, 6},
  |  |  281|      2|{5, 0xB, 0x1, 0xB, 0x3, 0x47, 7},
  |  |  282|      2|{5, 0xB, 0x1, 0xB, 0x2, 0x21, 6},
  |  |  283|      2|{5, 0xB, 0x1, 0xB, 0x1, 0x7B, 7},
  |  |  284|      2|{5, 0xC, 0x0, 0x0, 0x0, 0x01, 6},
  |  |  285|      2|{5, 0xC, 0x1, 0x8, 0x8, 0x3E, 6},
  |  |  286|      2|{5, 0xC, 0x1, 0xC, 0x4, 0x3B, 7},
  |  |  287|      2|{5, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  288|      2|{5, 0xD, 0x1, 0x9, 0x9, 0x6B, 7},
  |  |  289|      2|{5, 0xD, 0x1, 0x9, 0x8, 0x1E, 6},
  |  |  290|      2|{5, 0xD, 0x1, 0xD, 0x5, 0x1B, 7},
  |  |  291|      2|{5, 0xD, 0x1, 0xD, 0x4, 0x2E, 6},
  |  |  292|      2|{5, 0xD, 0x1, 0xD, 0x1, 0x2B, 7},
  |  |  293|      2|{5, 0xE, 0x0, 0x0, 0x0, 0x4B, 7},
  |  |  294|      2|{5, 0xE, 0x1, 0x6, 0x6, 0x0B, 7},
  |  |  295|      2|{5, 0xE, 0x1, 0xE, 0xA, 0x33, 7},
  |  |  296|      2|{5, 0xE, 0x1, 0xE, 0x2, 0x0E, 6},
  |  |  297|      2|{5, 0xE, 0x1, 0xE, 0xC, 0x73, 7},
  |  |  298|      2|{5, 0xE, 0x1, 0xE, 0x8, 0x36, 6},
  |  |  299|      2|{5, 0xE, 0x1, 0xE, 0x4, 0x53, 7},
  |  |  300|      2|{5, 0xF, 0x0, 0x0, 0x0, 0x13, 7},
  |  |  301|      2|{5, 0xF, 0x1, 0x7, 0x7, 0x43, 7},
  |  |  302|      2|{5, 0xF, 0x1, 0x7, 0x6, 0x16, 6},
  |  |  303|      2|{5, 0xF, 0x1, 0x7, 0x5, 0x63, 7},
  |  |  304|      2|{5, 0xF, 0x1, 0xF, 0xC, 0x23, 7},
  |  |  305|      2|{5, 0xF, 0x1, 0xF, 0x4, 0x0C, 5},
  |  |  306|      2|{5, 0xF, 0x1, 0xD, 0x9, 0x03, 7},
  |  |  307|      2|{5, 0xF, 0x1, 0xF, 0xA, 0x3D, 7},
  |  |  308|      2|{5, 0xF, 0x1, 0xF, 0x8, 0x14, 5},
  |  |  309|      2|{5, 0xF, 0x1, 0xF, 0x3, 0x7D, 7},
  |  |  310|      2|{5, 0xF, 0x1, 0xF, 0x2, 0x04, 5},
  |  |  311|      2|{5, 0xF, 0x1, 0xF, 0x1, 0x06, 6},
  |  |  312|      2|{6, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  313|      2|{6, 0x1, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  314|      2|{6, 0x1, 0x1, 0x1, 0x1, 0x03, 6},
  |  |  315|      2|{6, 0x2, 0x0, 0x0, 0x0, 0x0C, 5},
  |  |  316|      2|{6, 0x2, 0x1, 0x2, 0x2, 0x0D, 6},
  |  |  317|      2|{6, 0x3, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  318|      2|{6, 0x3, 0x1, 0x3, 0x3, 0x3D, 6},
  |  |  319|      2|{6, 0x3, 0x1, 0x3, 0x1, 0x1D, 6},
  |  |  320|      2|{6, 0x3, 0x1, 0x3, 0x2, 0x2D, 6},
  |  |  321|      2|{6, 0x4, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  322|      2|{6, 0x4, 0x1, 0x4, 0x4, 0x3F, 7},
  |  |  323|      2|{6, 0x5, 0x0, 0x0, 0x0, 0x35, 6},
  |  |  324|      2|{6, 0x5, 0x1, 0x1, 0x1, 0x15, 6},
  |  |  325|      2|{6, 0x5, 0x1, 0x5, 0x4, 0x7F, 7},
  |  |  326|      2|{6, 0x6, 0x0, 0x0, 0x0, 0x25, 6},
  |  |  327|      2|{6, 0x6, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |  328|      2|{6, 0x6, 0x1, 0x6, 0x4, 0x1F, 7},
  |  |  329|      2|{6, 0x7, 0x0, 0x0, 0x0, 0x6F, 7},
  |  |  330|      2|{6, 0x7, 0x1, 0x6, 0x6, 0x4F, 7},
  |  |  331|      2|{6, 0x7, 0x1, 0x6, 0x4, 0x05, 6},
  |  |  332|      2|{6, 0x7, 0x1, 0x7, 0x3, 0x2F, 7},
  |  |  333|      2|{6, 0x7, 0x1, 0x7, 0x1, 0x36, 6},
  |  |  334|      2|{6, 0x7, 0x1, 0x7, 0x2, 0x77, 7},
  |  |  335|      2|{6, 0x8, 0x0, 0x0, 0x0, 0x12, 5},
  |  |  336|      2|{6, 0x8, 0x1, 0x8, 0x8, 0x0F, 7},
  |  |  337|      2|{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  338|      2|{6, 0x9, 0x1, 0x1, 0x1, 0x37, 7},
  |  |  339|      2|{6, 0x9, 0x1, 0x9, 0x8, 0x57, 7},
  |  |  340|      2|{6, 0xA, 0x0, 0x0, 0x0, 0x19, 6},
  |  |  341|      2|{6, 0xA, 0x1, 0x2, 0x2, 0x29, 6},
  |  |  342|      2|{6, 0xA, 0x1, 0xA, 0x8, 0x17, 7},
  |  |  343|      2|{6, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  344|      2|{6, 0xB, 0x1, 0x9, 0x9, 0x47, 7},
  |  |  345|      2|{6, 0xB, 0x1, 0x9, 0x1, 0x09, 6},
  |  |  346|      2|{6, 0xB, 0x1, 0xB, 0xA, 0x27, 7},
  |  |  347|      2|{6, 0xB, 0x1, 0xB, 0x2, 0x31, 6},
  |  |  348|      2|{6, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
  |  |  349|      2|{6, 0xC, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  350|      2|{6, 0xC, 0x1, 0xC, 0xC, 0x07, 7},
  |  |  351|      2|{6, 0xC, 0x1, 0xC, 0x8, 0x21, 6},
  |  |  352|      2|{6, 0xC, 0x1, 0xC, 0x4, 0x3B, 7},
  |  |  353|      2|{6, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  354|      2|{6, 0xD, 0x1, 0x5, 0x5, 0x33, 7},
  |  |  355|      2|{6, 0xD, 0x1, 0x5, 0x4, 0x01, 6},
  |  |  356|      2|{6, 0xD, 0x1, 0xC, 0x8, 0x1B, 7},
  |  |  357|      2|{6, 0xD, 0x1, 0xD, 0x1, 0x6B, 7},
  |  |  358|      2|{6, 0xE, 0x0, 0x0, 0x0, 0x2B, 7},
  |  |  359|      2|{6, 0xE, 0x1, 0xE, 0x2, 0x4B, 7},
  |  |  360|      2|{6, 0xE, 0x1, 0x2, 0x2, 0x0B, 7},
  |  |  361|      2|{6, 0xE, 0x1, 0xE, 0xC, 0x73, 7},
  |  |  362|      2|{6, 0xE, 0x1, 0xE, 0x8, 0x3E, 6},
  |  |  363|      2|{6, 0xE, 0x1, 0xE, 0x4, 0x53, 7},
  |  |  364|      2|{6, 0xF, 0x0, 0x0, 0x0, 0x13, 7},
  |  |  365|      2|{6, 0xF, 0x1, 0x6, 0x6, 0x1E, 6},
  |  |  366|      2|{6, 0xF, 0x1, 0xE, 0xA, 0x2E, 6},
  |  |  367|      2|{6, 0xF, 0x1, 0xF, 0x3, 0x0E, 6},
  |  |  368|      2|{6, 0xF, 0x1, 0xF, 0x2, 0x02, 5},
  |  |  369|      2|{6, 0xF, 0x1, 0xB, 0x9, 0x63, 7},
  |  |  370|      2|{6, 0xF, 0x1, 0xF, 0xC, 0x16, 6},
  |  |  371|      2|{6, 0xF, 0x1, 0xF, 0x8, 0x06, 6},
  |  |  372|      2|{6, 0xF, 0x1, 0xF, 0x5, 0x23, 7},
  |  |  373|      2|{6, 0xF, 0x1, 0xF, 0x1, 0x1C, 5},
  |  |  374|      2|{6, 0xF, 0x1, 0xF, 0x4, 0x26, 6},
  |  |  375|      2|{7, 0x0, 0x0, 0x0, 0x0, 0x12, 5},
  |  |  376|      2|{7, 0x1, 0x0, 0x0, 0x0, 0x05, 6},
  |  |  377|      2|{7, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |  378|      2|{7, 0x2, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  379|      2|{7, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  380|      2|{7, 0x3, 0x0, 0x0, 0x0, 0x5F, 7},
  |  |  381|      2|{7, 0x3, 0x1, 0x3, 0x3, 0x1F, 7},
  |  |  382|      2|{7, 0x3, 0x1, 0x3, 0x2, 0x6F, 7},
  |  |  383|      2|{7, 0x3, 0x1, 0x3, 0x1, 0x2F, 7},
  |  |  384|      2|{7, 0x4, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  385|      2|{7, 0x4, 0x1, 0x4, 0x4, 0x0F, 7},
  |  |  386|      2|{7, 0x5, 0x0, 0x0, 0x0, 0x57, 7},
  |  |  387|      2|{7, 0x5, 0x1, 0x1, 0x1, 0x19, 6},
  |  |  388|      2|{7, 0x5, 0x1, 0x5, 0x4, 0x77, 7},
  |  |  389|      2|{7, 0x6, 0x0, 0x0, 0x0, 0x37, 7},
  |  |  390|      2|{7, 0x6, 0x1, 0x0, 0x0, 0x29, 6},
  |  |  391|      2|{7, 0x7, 0x0, 0x0, 0x0, 0x17, 7},
  |  |  392|      2|{7, 0x7, 0x1, 0x6, 0x6, 0x67, 7},
  |  |  393|      2|{7, 0x7, 0x1, 0x7, 0x3, 0x27, 7},
  |  |  394|      2|{7, 0x7, 0x1, 0x7, 0x2, 0x47, 7},
  |  |  395|      2|{7, 0x7, 0x1, 0x7, 0x5, 0x1B, 7},
  |  |  396|      2|{7, 0x7, 0x1, 0x7, 0x1, 0x09, 6},
  |  |  397|      2|{7, 0x7, 0x1, 0x7, 0x4, 0x07, 7},
  |  |  398|      2|{7, 0x8, 0x0, 0x0, 0x0, 0x7B, 7},
  |  |  399|      2|{7, 0x8, 0x1, 0x8, 0x8, 0x3B, 7},
  |  |  400|      2|{7, 0x9, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  401|      2|{7, 0x9, 0x1, 0x0, 0x0, 0x31, 6},
  |  |  402|      2|{7, 0xA, 0x0, 0x0, 0x0, 0x53, 7},
  |  |  403|      2|{7, 0xA, 0x1, 0x2, 0x2, 0x11, 6},
  |  |  404|      2|{7, 0xA, 0x1, 0xA, 0x8, 0x6B, 7},
  |  |  405|      2|{7, 0xB, 0x0, 0x0, 0x0, 0x2B, 7},
  |  |  406|      2|{7, 0xB, 0x1, 0x9, 0x9, 0x4B, 7},
  |  |  407|      2|{7, 0xB, 0x1, 0xB, 0x3, 0x0B, 7},
  |  |  408|      2|{7, 0xB, 0x1, 0xB, 0x1, 0x73, 7},
  |  |  409|      2|{7, 0xB, 0x1, 0xB, 0xA, 0x33, 7},
  |  |  410|      2|{7, 0xB, 0x1, 0xB, 0x2, 0x21, 6},
  |  |  411|      2|{7, 0xB, 0x1, 0xB, 0x8, 0x13, 7},
  |  |  412|      2|{7, 0xC, 0x0, 0x0, 0x0, 0x63, 7},
  |  |  413|      2|{7, 0xC, 0x1, 0x8, 0x8, 0x23, 7},
  |  |  414|      2|{7, 0xC, 0x1, 0xC, 0x4, 0x43, 7},
  |  |  415|      2|{7, 0xD, 0x0, 0x0, 0x0, 0x03, 7},
  |  |  416|      2|{7, 0xD, 0x1, 0x9, 0x9, 0x7D, 7},
  |  |  417|      2|{7, 0xD, 0x1, 0xD, 0x5, 0x5D, 7},
  |  |  418|      2|{7, 0xD, 0x1, 0xD, 0x1, 0x01, 6},
  |  |  419|      2|{7, 0xD, 0x1, 0xD, 0xC, 0x3D, 7},
  |  |  420|      2|{7, 0xD, 0x1, 0xD, 0x4, 0x3E, 6},
  |  |  421|      2|{7, 0xD, 0x1, 0xD, 0x8, 0x1D, 7},
  |  |  422|      2|{7, 0xE, 0x0, 0x0, 0x0, 0x6D, 7},
  |  |  423|      2|{7, 0xE, 0x1, 0x6, 0x6, 0x2D, 7},
  |  |  424|      2|{7, 0xE, 0x1, 0xE, 0xA, 0x0D, 7},
  |  |  425|      2|{7, 0xE, 0x1, 0xE, 0x2, 0x1E, 6},
  |  |  426|      2|{7, 0xE, 0x1, 0xE, 0xC, 0x4D, 7},
  |  |  427|      2|{7, 0xE, 0x1, 0xE, 0x8, 0x0E, 6},
  |  |  428|      2|{7, 0xE, 0x1, 0xE, 0x4, 0x75, 7},
  |  |  429|      2|{7, 0xF, 0x0, 0x0, 0x0, 0x15, 7},
  |  |  430|      2|{7, 0xF, 0x1, 0xF, 0xF, 0x06, 5},
  |  |  431|      2|{7, 0xF, 0x1, 0xF, 0xD, 0x35, 7},
  |  |  432|      2|{7, 0xF, 0x1, 0xF, 0x7, 0x55, 7},
  |  |  433|      2|{7, 0xF, 0x1, 0xF, 0x5, 0x1A, 5},
  |  |  434|      2|{7, 0xF, 0x1, 0xF, 0xB, 0x25, 7},
  |  |  435|      2|{7, 0xF, 0x1, 0xF, 0x3, 0x0A, 5},
  |  |  436|      2|{7, 0xF, 0x1, 0xF, 0x9, 0x2E, 6},
  |  |  437|      2|{7, 0xF, 0x1, 0xF, 0x1, 0x00, 4},
  |  |  438|      2|{7, 0xF, 0x1, 0xF, 0xE, 0x65, 7},
  |  |  439|      2|{7, 0xF, 0x1, 0xF, 0x6, 0x36, 6},
  |  |  440|      2|{7, 0xF, 0x1, 0xF, 0xA, 0x02, 5},
  |  |  441|      2|{7, 0xF, 0x1, 0xF, 0x2, 0x0C, 4},
  |  |  442|      2|{7, 0xF, 0x1, 0xF, 0xC, 0x16, 6},
  |  |  443|      2|{7, 0xF, 0x1, 0xF, 0x8, 0x04, 4},
  |  |  444|      2|{7, 0xF, 0x1, 0xF, 0x4, 0x08, 4}
  ------------------
  139|      2|      };
  140|       |      // number of entries in the table
  141|      2|      size_t tbl0_size = sizeof(tbl0) / sizeof(vlc_src_table); 
  142|       |
  143|       |      // nono-initial quad rows
  144|      2|      vlc_src_table tbl1[] = {
  145|      2|    #include "table1.h"
  ------------------
  |  |    1|      2|{0, 0x1, 0x0, 0x0, 0x0, 0x00, 3},
  |  |    2|      2|{0, 0x1, 0x1, 0x1, 0x1, 0x27, 6},
  |  |    3|      2|{0, 0x2, 0x0, 0x0, 0x0, 0x06, 3},
  |  |    4|      2|{0, 0x2, 0x1, 0x2, 0x2, 0x17, 6},
  |  |    5|      2|{0, 0x3, 0x0, 0x0, 0x0, 0x0D, 5},
  |  |    6|      2|{0, 0x3, 0x1, 0x0, 0x0, 0x3B, 6},
  |  |    7|      2|{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3},
  |  |    8|      2|{0, 0x4, 0x1, 0x4, 0x4, 0x07, 6},
  |  |    9|      2|{0, 0x5, 0x0, 0x0, 0x0, 0x15, 5},
  |  |   10|      2|{0, 0x5, 0x1, 0x0, 0x0, 0x2B, 6},
  |  |   11|      2|{0, 0x6, 0x0, 0x0, 0x0, 0x01, 5},
  |  |   12|      2|{0, 0x6, 0x1, 0x0, 0x0, 0x7F, 7},
  |  |   13|      2|{0, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
  |  |   14|      2|{0, 0x7, 0x1, 0x0, 0x0, 0x1B, 6},
  |  |   15|      2|{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3},
  |  |   16|      2|{0, 0x8, 0x1, 0x8, 0x8, 0x05, 5},
  |  |   17|      2|{0, 0x9, 0x0, 0x0, 0x0, 0x19, 5},
  |  |   18|      2|{0, 0x9, 0x1, 0x0, 0x0, 0x13, 6},
  |  |   19|      2|{0, 0xA, 0x0, 0x0, 0x0, 0x09, 5},
  |  |   20|      2|{0, 0xA, 0x1, 0x8, 0x8, 0x0B, 6},
  |  |   21|      2|{0, 0xA, 0x1, 0xA, 0x2, 0x3F, 7},
  |  |   22|      2|{0, 0xB, 0x0, 0x0, 0x0, 0x5F, 7},
  |  |   23|      2|{0, 0xB, 0x1, 0x0, 0x0, 0x33, 6},
  |  |   24|      2|{0, 0xC, 0x0, 0x0, 0x0, 0x11, 5},
  |  |   25|      2|{0, 0xC, 0x1, 0x8, 0x8, 0x23, 6},
  |  |   26|      2|{0, 0xC, 0x1, 0xC, 0x4, 0x6F, 7},
  |  |   27|      2|{0, 0xD, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   28|      2|{0, 0xD, 0x1, 0x0, 0x0, 0x03, 6},
  |  |   29|      2|{0, 0xE, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   30|      2|{0, 0xE, 0x1, 0x4, 0x4, 0x4F, 7},
  |  |   31|      2|{0, 0xE, 0x1, 0x4, 0x0, 0x3D, 6},
  |  |   32|      2|{0, 0xF, 0x0, 0x0, 0x0, 0x77, 7},
  |  |   33|      2|{0, 0xF, 0x1, 0x1, 0x1, 0x37, 7},
  |  |   34|      2|{0, 0xF, 0x1, 0x1, 0x0, 0x1D, 6},
  |  |   35|      2|{1, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
  |  |   36|      2|{1, 0x1, 0x0, 0x0, 0x0, 0x05, 4},
  |  |   37|      2|{1, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |   38|      2|{1, 0x2, 0x0, 0x0, 0x0, 0x09, 4},
  |  |   39|      2|{1, 0x2, 0x1, 0x2, 0x2, 0x1F, 7},
  |  |   40|      2|{1, 0x3, 0x0, 0x0, 0x0, 0x1D, 5},
  |  |   41|      2|{1, 0x3, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |   42|      2|{1, 0x3, 0x1, 0x3, 0x2, 0x5F, 7},
  |  |   43|      2|{1, 0x4, 0x0, 0x0, 0x0, 0x0D, 5},
  |  |   44|      2|{1, 0x4, 0x1, 0x4, 0x4, 0x37, 7},
  |  |   45|      2|{1, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
  |  |   46|      2|{1, 0x5, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |   47|      2|{1, 0x6, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   48|      2|{1, 0x6, 0x1, 0x0, 0x0, 0x4F, 7},
  |  |   49|      2|{1, 0x7, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   50|      2|{1, 0x7, 0x1, 0x0, 0x0, 0x77, 7},
  |  |   51|      2|{1, 0x8, 0x0, 0x0, 0x0, 0x01, 4},
  |  |   52|      2|{1, 0x8, 0x1, 0x8, 0x8, 0x17, 7},
  |  |   53|      2|{1, 0x9, 0x0, 0x0, 0x0, 0x0B, 6},
  |  |   54|      2|{1, 0x9, 0x1, 0x0, 0x0, 0x57, 7},
  |  |   55|      2|{1, 0xA, 0x0, 0x0, 0x0, 0x33, 6},
  |  |   56|      2|{1, 0xA, 0x1, 0x0, 0x0, 0x67, 7},
  |  |   57|      2|{1, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
  |  |   58|      2|{1, 0xB, 0x1, 0x0, 0x0, 0x2B, 7},
  |  |   59|      2|{1, 0xC, 0x0, 0x0, 0x0, 0x13, 6},
  |  |   60|      2|{1, 0xC, 0x1, 0x0, 0x0, 0x47, 7},
  |  |   61|      2|{1, 0xD, 0x0, 0x0, 0x0, 0x07, 7},
  |  |   62|      2|{1, 0xD, 0x1, 0x0, 0x0, 0x7B, 7},
  |  |   63|      2|{1, 0xE, 0x0, 0x0, 0x0, 0x3B, 7},
  |  |   64|      2|{1, 0xE, 0x1, 0x0, 0x0, 0x5B, 7},
  |  |   65|      2|{1, 0xF, 0x0, 0x0, 0x0, 0x1B, 7},
  |  |   66|      2|{1, 0xF, 0x1, 0x4, 0x4, 0x6B, 7},
  |  |   67|      2|{1, 0xF, 0x1, 0x4, 0x0, 0x23, 6},
  |  |   68|      2|{2, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
  |  |   69|      2|{2, 0x1, 0x0, 0x0, 0x0, 0x09, 4},
  |  |   70|      2|{2, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |   71|      2|{2, 0x2, 0x0, 0x0, 0x0, 0x01, 4},
  |  |   72|      2|{2, 0x2, 0x1, 0x2, 0x2, 0x23, 6},
  |  |   73|      2|{2, 0x3, 0x0, 0x0, 0x0, 0x3D, 6},
  |  |   74|      2|{2, 0x3, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |   75|      2|{2, 0x3, 0x1, 0x3, 0x1, 0x1F, 7},
  |  |   76|      2|{2, 0x4, 0x0, 0x0, 0x0, 0x15, 5},
  |  |   77|      2|{2, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |   78|      2|{2, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
  |  |   79|      2|{2, 0x5, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |   80|      2|{2, 0x6, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   81|      2|{2, 0x6, 0x1, 0x0, 0x0, 0x4F, 7},
  |  |   82|      2|{2, 0x7, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   83|      2|{2, 0x7, 0x1, 0x0, 0x0, 0x17, 7},
  |  |   84|      2|{2, 0x8, 0x0, 0x0, 0x0, 0x05, 5},
  |  |   85|      2|{2, 0x8, 0x1, 0x8, 0x8, 0x77, 7},
  |  |   86|      2|{2, 0x9, 0x0, 0x0, 0x0, 0x37, 7},
  |  |   87|      2|{2, 0x9, 0x1, 0x0, 0x0, 0x57, 7},
  |  |   88|      2|{2, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |   89|      2|{2, 0xA, 0x1, 0xA, 0xA, 0x7B, 7},
  |  |   90|      2|{2, 0xA, 0x1, 0xA, 0x2, 0x2D, 6},
  |  |   91|      2|{2, 0xA, 0x1, 0xA, 0x8, 0x67, 7},
  |  |   92|      2|{2, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
  |  |   93|      2|{2, 0xB, 0x1, 0xB, 0x2, 0x47, 7},
  |  |   94|      2|{2, 0xB, 0x1, 0x0, 0x0, 0x07, 7},
  |  |   95|      2|{2, 0xC, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |   96|      2|{2, 0xC, 0x1, 0x0, 0x0, 0x3B, 7},
  |  |   97|      2|{2, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |   98|      2|{2, 0xD, 0x1, 0x0, 0x0, 0x1B, 7},
  |  |   99|      2|{2, 0xE, 0x0, 0x0, 0x0, 0x6B, 7},
  |  |  100|      2|{2, 0xE, 0x1, 0x4, 0x4, 0x2B, 7},
  |  |  101|      2|{2, 0xE, 0x1, 0x4, 0x0, 0x4B, 7},
  |  |  102|      2|{2, 0xF, 0x0, 0x0, 0x0, 0x0B, 7},
  |  |  103|      2|{2, 0xF, 0x1, 0x4, 0x4, 0x73, 7},
  |  |  104|      2|{2, 0xF, 0x1, 0x5, 0x1, 0x33, 7},
  |  |  105|      2|{2, 0xF, 0x1, 0x7, 0x2, 0x53, 7},
  |  |  106|      2|{2, 0xF, 0x1, 0xF, 0x8, 0x13, 7},
  |  |  107|      2|{3, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |  108|      2|{3, 0x1, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |  109|      2|{3, 0x1, 0x1, 0x1, 0x1, 0x0B, 6},
  |  |  110|      2|{3, 0x2, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  111|      2|{3, 0x2, 0x1, 0x2, 0x2, 0x23, 6},
  |  |  112|      2|{3, 0x3, 0x0, 0x0, 0x0, 0x0E, 5},
  |  |  113|      2|{3, 0x3, 0x1, 0x3, 0x3, 0x7F, 7},
  |  |  114|      2|{3, 0x3, 0x1, 0x3, 0x2, 0x33, 6},
  |  |  115|      2|{3, 0x3, 0x1, 0x3, 0x1, 0x13, 6},
  |  |  116|      2|{3, 0x4, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  117|      2|{3, 0x4, 0x1, 0x4, 0x4, 0x3F, 7},
  |  |  118|      2|{3, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
  |  |  119|      2|{3, 0x5, 0x1, 0x1, 0x1, 0x3D, 6},
  |  |  120|      2|{3, 0x5, 0x1, 0x5, 0x4, 0x1F, 7},
  |  |  121|      2|{3, 0x6, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  122|      2|{3, 0x6, 0x1, 0x0, 0x0, 0x5F, 7},
  |  |  123|      2|{3, 0x7, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  124|      2|{3, 0x7, 0x1, 0x4, 0x4, 0x2F, 7},
  |  |  125|      2|{3, 0x7, 0x1, 0x5, 0x1, 0x1E, 6},
  |  |  126|      2|{3, 0x7, 0x1, 0x7, 0x2, 0x6F, 7},
  |  |  127|      2|{3, 0x8, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  128|      2|{3, 0x8, 0x1, 0x8, 0x8, 0x4F, 7},
  |  |  129|      2|{3, 0x9, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |  130|      2|{3, 0x9, 0x1, 0x0, 0x0, 0x35, 6},
  |  |  131|      2|{3, 0xA, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  132|      2|{3, 0xA, 0x1, 0x2, 0x2, 0x25, 6},
  |  |  133|      2|{3, 0xA, 0x1, 0xA, 0x8, 0x0F, 7},
  |  |  134|      2|{3, 0xB, 0x0, 0x0, 0x0, 0x05, 6},
  |  |  135|      2|{3, 0xB, 0x1, 0x8, 0x8, 0x39, 6},
  |  |  136|      2|{3, 0xB, 0x1, 0xB, 0x3, 0x17, 7},
  |  |  137|      2|{3, 0xB, 0x1, 0xB, 0x2, 0x19, 6},
  |  |  138|      2|{3, 0xB, 0x1, 0xB, 0x1, 0x77, 7},
  |  |  139|      2|{3, 0xC, 0x0, 0x0, 0x0, 0x29, 6},
  |  |  140|      2|{3, 0xC, 0x1, 0x0, 0x0, 0x09, 6},
  |  |  141|      2|{3, 0xD, 0x0, 0x0, 0x0, 0x37, 7},
  |  |  142|      2|{3, 0xD, 0x1, 0x4, 0x4, 0x57, 7},
  |  |  143|      2|{3, 0xD, 0x1, 0x4, 0x0, 0x31, 6},
  |  |  144|      2|{3, 0xE, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  145|      2|{3, 0xE, 0x1, 0x4, 0x4, 0x27, 7},
  |  |  146|      2|{3, 0xE, 0x1, 0xC, 0x8, 0x47, 7},
  |  |  147|      2|{3, 0xE, 0x1, 0xE, 0x2, 0x6B, 7},
  |  |  148|      2|{3, 0xF, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  149|      2|{3, 0xF, 0x1, 0x6, 0x6, 0x07, 7},
  |  |  150|      2|{3, 0xF, 0x1, 0x7, 0x3, 0x7B, 7},
  |  |  151|      2|{3, 0xF, 0x1, 0xF, 0xA, 0x3B, 7},
  |  |  152|      2|{3, 0xF, 0x1, 0xF, 0x2, 0x21, 6},
  |  |  153|      2|{3, 0xF, 0x1, 0xF, 0x8, 0x01, 6},
  |  |  154|      2|{3, 0xF, 0x1, 0xA, 0x8, 0x5B, 7},
  |  |  155|      2|{3, 0xF, 0x1, 0xF, 0x5, 0x1B, 7},
  |  |  156|      2|{3, 0xF, 0x1, 0xF, 0x1, 0x3E, 6},
  |  |  157|      2|{3, 0xF, 0x1, 0xF, 0x4, 0x2B, 7},
  |  |  158|      2|{4, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
  |  |  159|      2|{4, 0x1, 0x0, 0x0, 0x0, 0x0D, 5},
  |  |  160|      2|{4, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |  161|      2|{4, 0x2, 0x0, 0x0, 0x0, 0x15, 5},
  |  |  162|      2|{4, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  163|      2|{4, 0x3, 0x0, 0x0, 0x0, 0x5F, 7},
  |  |  164|      2|{4, 0x3, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |  165|      2|{4, 0x4, 0x0, 0x0, 0x0, 0x09, 4},
  |  |  166|      2|{4, 0x4, 0x1, 0x4, 0x4, 0x23, 6},
  |  |  167|      2|{4, 0x5, 0x0, 0x0, 0x0, 0x33, 6},
  |  |  168|      2|{4, 0x5, 0x1, 0x0, 0x0, 0x1F, 7},
  |  |  169|      2|{4, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |  170|      2|{4, 0x6, 0x1, 0x0, 0x0, 0x2F, 7},
  |  |  171|      2|{4, 0x7, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  172|      2|{4, 0x7, 0x1, 0x0, 0x0, 0x57, 7},
  |  |  173|      2|{4, 0x8, 0x0, 0x0, 0x0, 0x01, 4},
  |  |  174|      2|{4, 0x8, 0x1, 0x8, 0x8, 0x0F, 7},
  |  |  175|      2|{4, 0x9, 0x0, 0x0, 0x0, 0x77, 7},
  |  |  176|      2|{4, 0x9, 0x1, 0x0, 0x0, 0x37, 7},
  |  |  177|      2|{4, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  178|      2|{4, 0xA, 0x1, 0x0, 0x0, 0x17, 7},
  |  |  179|      2|{4, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  180|      2|{4, 0xB, 0x1, 0x0, 0x0, 0x6B, 7},
  |  |  181|      2|{4, 0xC, 0x0, 0x0, 0x0, 0x05, 5},
  |  |  182|      2|{4, 0xC, 0x1, 0xC, 0xC, 0x27, 7},
  |  |  183|      2|{4, 0xC, 0x1, 0xC, 0x8, 0x47, 7},
  |  |  184|      2|{4, 0xC, 0x1, 0xC, 0x4, 0x07, 7},
  |  |  185|      2|{4, 0xD, 0x0, 0x0, 0x0, 0x7B, 7},
  |  |  186|      2|{4, 0xD, 0x1, 0x0, 0x0, 0x3B, 7},
  |  |  187|      2|{4, 0xE, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  188|      2|{4, 0xE, 0x1, 0x2, 0x2, 0x1B, 7},
  |  |  189|      2|{4, 0xE, 0x1, 0x2, 0x0, 0x03, 6},
  |  |  190|      2|{4, 0xF, 0x0, 0x0, 0x0, 0x2B, 7},
  |  |  191|      2|{4, 0xF, 0x1, 0x1, 0x1, 0x4B, 7},
  |  |  192|      2|{4, 0xF, 0x1, 0x3, 0x2, 0x0B, 7},
  |  |  193|      2|{4, 0xF, 0x1, 0x3, 0x0, 0x3D, 6},
  |  |  194|      2|{5, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |  195|      2|{5, 0x1, 0x0, 0x0, 0x0, 0x1E, 5},
  |  |  196|      2|{5, 0x1, 0x1, 0x1, 0x1, 0x3B, 6},
  |  |  197|      2|{5, 0x2, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  198|      2|{5, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  199|      2|{5, 0x3, 0x0, 0x0, 0x0, 0x1B, 6},
  |  |  200|      2|{5, 0x3, 0x1, 0x0, 0x0, 0x0B, 6},
  |  |  201|      2|{5, 0x4, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  202|      2|{5, 0x4, 0x1, 0x4, 0x4, 0x2B, 6},
  |  |  203|      2|{5, 0x5, 0x0, 0x0, 0x0, 0x0E, 5},
  |  |  204|      2|{5, 0x5, 0x1, 0x4, 0x4, 0x33, 6},
  |  |  205|      2|{5, 0x5, 0x1, 0x5, 0x1, 0x7F, 7},
  |  |  206|      2|{5, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |  207|      2|{5, 0x6, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |  208|      2|{5, 0x7, 0x0, 0x0, 0x0, 0x23, 6},
  |  |  209|      2|{5, 0x7, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |  210|      2|{5, 0x7, 0x1, 0x2, 0x0, 0x15, 6},
  |  |  211|      2|{5, 0x8, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  212|      2|{5, 0x8, 0x1, 0x8, 0x8, 0x03, 6},
  |  |  213|      2|{5, 0x9, 0x0, 0x0, 0x0, 0x3D, 6},
  |  |  214|      2|{5, 0x9, 0x1, 0x0, 0x0, 0x1F, 7},
  |  |  215|      2|{5, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  216|      2|{5, 0xA, 0x1, 0x0, 0x0, 0x2D, 6},
  |  |  217|      2|{5, 0xB, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |  218|      2|{5, 0xB, 0x1, 0x1, 0x1, 0x4F, 7},
  |  |  219|      2|{5, 0xB, 0x1, 0x1, 0x0, 0x35, 6},
  |  |  220|      2|{5, 0xC, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  221|      2|{5, 0xC, 0x1, 0x4, 0x4, 0x25, 6},
  |  |  222|      2|{5, 0xC, 0x1, 0xC, 0x8, 0x2F, 7},
  |  |  223|      2|{5, 0xD, 0x0, 0x0, 0x0, 0x05, 6},
  |  |  224|      2|{5, 0xD, 0x1, 0x1, 0x1, 0x77, 7},
  |  |  225|      2|{5, 0xD, 0x1, 0x5, 0x4, 0x39, 6},
  |  |  226|      2|{5, 0xD, 0x1, 0xD, 0x8, 0x0F, 7},
  |  |  227|      2|{5, 0xE, 0x0, 0x0, 0x0, 0x19, 6},
  |  |  228|      2|{5, 0xE, 0x1, 0x2, 0x2, 0x57, 7},
  |  |  229|      2|{5, 0xE, 0x1, 0xA, 0x8, 0x01, 6},
  |  |  230|      2|{5, 0xE, 0x1, 0xE, 0x4, 0x37, 7},
  |  |  231|      2|{5, 0xF, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  232|      2|{5, 0xF, 0x1, 0x9, 0x9, 0x17, 7},
  |  |  233|      2|{5, 0xF, 0x1, 0xD, 0x5, 0x67, 7},
  |  |  234|      2|{5, 0xF, 0x1, 0xF, 0x3, 0x07, 7},
  |  |  235|      2|{5, 0xF, 0x1, 0xF, 0x1, 0x29, 6},
  |  |  236|      2|{5, 0xF, 0x1, 0x7, 0x6, 0x27, 7},
  |  |  237|      2|{5, 0xF, 0x1, 0xF, 0xC, 0x09, 6},
  |  |  238|      2|{5, 0xF, 0x1, 0xF, 0x4, 0x31, 6},
  |  |  239|      2|{5, 0xF, 0x1, 0xF, 0xA, 0x47, 7},
  |  |  240|      2|{5, 0xF, 0x1, 0xF, 0x8, 0x11, 6},
  |  |  241|      2|{5, 0xF, 0x1, 0xF, 0x2, 0x21, 6},
  |  |  242|      2|{6, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  243|      2|{6, 0x1, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  244|      2|{6, 0x1, 0x1, 0x1, 0x1, 0x03, 6},
  |  |  245|      2|{6, 0x2, 0x0, 0x0, 0x0, 0x0C, 4},
  |  |  246|      2|{6, 0x2, 0x1, 0x2, 0x2, 0x3D, 6},
  |  |  247|      2|{6, 0x3, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  248|      2|{6, 0x3, 0x1, 0x2, 0x2, 0x0D, 6},
  |  |  249|      2|{6, 0x3, 0x1, 0x3, 0x1, 0x7F, 7},
  |  |  250|      2|{6, 0x4, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  251|      2|{6, 0x4, 0x1, 0x4, 0x4, 0x2D, 6},
  |  |  252|      2|{6, 0x5, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  253|      2|{6, 0x5, 0x1, 0x4, 0x4, 0x35, 6},
  |  |  254|      2|{6, 0x5, 0x1, 0x5, 0x1, 0x2F, 7},
  |  |  255|      2|{6, 0x6, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  256|      2|{6, 0x6, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  257|      2|{6, 0x6, 0x1, 0x6, 0x4, 0x5F, 7},
  |  |  258|      2|{6, 0x7, 0x0, 0x0, 0x0, 0x25, 6},
  |  |  259|      2|{6, 0x7, 0x1, 0x2, 0x2, 0x29, 6},
  |  |  260|      2|{6, 0x7, 0x1, 0x3, 0x1, 0x1F, 7},
  |  |  261|      2|{6, 0x7, 0x1, 0x7, 0x4, 0x6F, 7},
  |  |  262|      2|{6, 0x8, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  263|      2|{6, 0x8, 0x1, 0x8, 0x8, 0x05, 6},
  |  |  264|      2|{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  265|      2|{6, 0x9, 0x1, 0x0, 0x0, 0x19, 6},
  |  |  266|      2|{6, 0xA, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  267|      2|{6, 0xA, 0x1, 0xA, 0xA, 0x0F, 7},
  |  |  268|      2|{6, 0xA, 0x1, 0xA, 0x2, 0x09, 6},
  |  |  269|      2|{6, 0xA, 0x1, 0xA, 0x8, 0x4F, 7},
  |  |  270|      2|{6, 0xB, 0x0, 0x0, 0x0, 0x0E, 6},
  |  |  271|      2|{6, 0xB, 0x1, 0xB, 0x2, 0x77, 7},
  |  |  272|      2|{6, 0xB, 0x1, 0x2, 0x2, 0x37, 7},
  |  |  273|      2|{6, 0xB, 0x1, 0xA, 0x8, 0x57, 7},
  |  |  274|      2|{6, 0xB, 0x1, 0xB, 0x1, 0x47, 7},
  |  |  275|      2|{6, 0xC, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  276|      2|{6, 0xC, 0x1, 0xC, 0xC, 0x17, 7},
  |  |  277|      2|{6, 0xC, 0x1, 0xC, 0x8, 0x67, 7},
  |  |  278|      2|{6, 0xC, 0x1, 0xC, 0x4, 0x27, 7},
  |  |  279|      2|{6, 0xD, 0x0, 0x0, 0x0, 0x31, 6},
  |  |  280|      2|{6, 0xD, 0x1, 0xD, 0x4, 0x07, 7},
  |  |  281|      2|{6, 0xD, 0x1, 0x4, 0x4, 0x7B, 7},
  |  |  282|      2|{6, 0xD, 0x1, 0xC, 0x8, 0x3B, 7},
  |  |  283|      2|{6, 0xD, 0x1, 0xD, 0x1, 0x2B, 7},
  |  |  284|      2|{6, 0xE, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  285|      2|{6, 0xE, 0x1, 0xE, 0x4, 0x5B, 7},
  |  |  286|      2|{6, 0xE, 0x1, 0x4, 0x4, 0x1B, 7},
  |  |  287|      2|{6, 0xE, 0x1, 0xE, 0xA, 0x6B, 7},
  |  |  288|      2|{6, 0xE, 0x1, 0xE, 0x8, 0x21, 6},
  |  |  289|      2|{6, 0xE, 0x1, 0xE, 0x2, 0x33, 7},
  |  |  290|      2|{6, 0xF, 0x0, 0x0, 0x0, 0x01, 6},
  |  |  291|      2|{6, 0xF, 0x1, 0x3, 0x3, 0x4B, 7},
  |  |  292|      2|{6, 0xF, 0x1, 0x7, 0x6, 0x0B, 7},
  |  |  293|      2|{6, 0xF, 0x1, 0xF, 0xA, 0x73, 7},
  |  |  294|      2|{6, 0xF, 0x1, 0xF, 0x2, 0x3E, 6},
  |  |  295|      2|{6, 0xF, 0x1, 0xB, 0x9, 0x53, 7},
  |  |  296|      2|{6, 0xF, 0x1, 0xF, 0xC, 0x63, 7},
  |  |  297|      2|{6, 0xF, 0x1, 0xF, 0x8, 0x1E, 6},
  |  |  298|      2|{6, 0xF, 0x1, 0xF, 0x5, 0x13, 7},
  |  |  299|      2|{6, 0xF, 0x1, 0xF, 0x4, 0x2E, 6},
  |  |  300|      2|{6, 0xF, 0x1, 0xF, 0x1, 0x23, 7},
  |  |  301|      2|{7, 0x0, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  302|      2|{7, 0x1, 0x0, 0x0, 0x0, 0x33, 6},
  |  |  303|      2|{7, 0x1, 0x1, 0x1, 0x1, 0x13, 6},
  |  |  304|      2|{7, 0x2, 0x0, 0x0, 0x0, 0x23, 6},
  |  |  305|      2|{7, 0x2, 0x1, 0x2, 0x2, 0x7F, 7},
  |  |  306|      2|{7, 0x3, 0x0, 0x0, 0x0, 0x03, 6},
  |  |  307|      2|{7, 0x3, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |  308|      2|{7, 0x3, 0x1, 0x3, 0x2, 0x6F, 7},
  |  |  309|      2|{7, 0x4, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  310|      2|{7, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |  311|      2|{7, 0x5, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  312|      2|{7, 0x5, 0x1, 0x1, 0x1, 0x3D, 6},
  |  |  313|      2|{7, 0x5, 0x1, 0x5, 0x4, 0x1F, 7},
  |  |  314|      2|{7, 0x6, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  315|      2|{7, 0x6, 0x1, 0x0, 0x0, 0x77, 7},
  |  |  316|      2|{7, 0x7, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  317|      2|{7, 0x7, 0x1, 0x7, 0x4, 0x2F, 7},
  |  |  318|      2|{7, 0x7, 0x1, 0x4, 0x4, 0x4F, 7},
  |  |  319|      2|{7, 0x7, 0x1, 0x7, 0x3, 0x0F, 7},
  |  |  320|      2|{7, 0x7, 0x1, 0x7, 0x1, 0x0D, 6},
  |  |  321|      2|{7, 0x7, 0x1, 0x7, 0x2, 0x57, 7},
  |  |  322|      2|{7, 0x8, 0x0, 0x0, 0x0, 0x35, 6},
  |  |  323|      2|{7, 0x8, 0x1, 0x8, 0x8, 0x37, 7},
  |  |  324|      2|{7, 0x9, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  325|      2|{7, 0x9, 0x1, 0x0, 0x0, 0x27, 7},
  |  |  326|      2|{7, 0xA, 0x0, 0x0, 0x0, 0x25, 6},
  |  |  327|      2|{7, 0xA, 0x1, 0x0, 0x0, 0x29, 6},
  |  |  328|      2|{7, 0xB, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  329|      2|{7, 0xB, 0x1, 0xB, 0x1, 0x17, 7},
  |  |  330|      2|{7, 0xB, 0x1, 0x1, 0x1, 0x67, 7},
  |  |  331|      2|{7, 0xB, 0x1, 0x3, 0x2, 0x05, 6},
  |  |  332|      2|{7, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
  |  |  333|      2|{7, 0xC, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  334|      2|{7, 0xC, 0x1, 0x0, 0x0, 0x19, 6},
  |  |  335|      2|{7, 0xD, 0x0, 0x0, 0x0, 0x0C, 5},
  |  |  336|      2|{7, 0xD, 0x1, 0xD, 0x1, 0x47, 7},
  |  |  337|      2|{7, 0xD, 0x1, 0x1, 0x1, 0x07, 7},
  |  |  338|      2|{7, 0xD, 0x1, 0x5, 0x4, 0x09, 6},
  |  |  339|      2|{7, 0xD, 0x1, 0xD, 0x8, 0x1B, 7},
  |  |  340|      2|{7, 0xE, 0x0, 0x0, 0x0, 0x31, 6},
  |  |  341|      2|{7, 0xE, 0x1, 0xE, 0x2, 0x3B, 7},
  |  |  342|      2|{7, 0xE, 0x1, 0x2, 0x2, 0x5B, 7},
  |  |  343|      2|{7, 0xE, 0x1, 0xA, 0x8, 0x3E, 6},
  |  |  344|      2|{7, 0xE, 0x1, 0xE, 0x4, 0x0B, 7},
  |  |  345|      2|{7, 0xF, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  346|      2|{7, 0xF, 0x1, 0xF, 0xF, 0x6B, 7},
  |  |  347|      2|{7, 0xF, 0x1, 0xF, 0x7, 0x2B, 7},
  |  |  348|      2|{7, 0xF, 0x1, 0xF, 0xB, 0x4B, 7},
  |  |  349|      2|{7, 0xF, 0x1, 0xF, 0x3, 0x11, 6},
  |  |  350|      2|{7, 0xF, 0x1, 0x7, 0x6, 0x21, 6},
  |  |  351|      2|{7, 0xF, 0x1, 0xF, 0xA, 0x01, 6},
  |  |  352|      2|{7, 0xF, 0x1, 0xF, 0x2, 0x0A, 5},
  |  |  353|      2|{7, 0xF, 0x1, 0xB, 0x9, 0x1E, 6},
  |  |  354|      2|{7, 0xF, 0x1, 0xF, 0xC, 0x0E, 6},
  |  |  355|      2|{7, 0xF, 0x1, 0xF, 0x8, 0x12, 5},
  |  |  356|      2|{7, 0xF, 0x1, 0xF, 0x5, 0x2E, 6},
  |  |  357|      2|{7, 0xF, 0x1, 0xF, 0x1, 0x02, 5},
  |  |  358|      2|{7, 0xF, 0x1, 0xF, 0x4, 0x1C, 5}
  ------------------
  146|      2|      };
  147|       |      // number of entries in the table
  148|      2|      size_t tbl1_size = sizeof(tbl1) / sizeof(vlc_src_table);
  149|       |
  150|      2|      if (debug) memset(vlc_tbl0, 0, sizeof(vlc_tbl0)); //unnecessary
  ------------------
  |  Branch (150:11): [Folded, False: 2]
  ------------------
  151|       |
  152|       |      // this is to convert table entries into values for decoder look up
  153|       |      // There can be at most 1024 possibilities, not all of them are valid.
  154|       |      // 
  155|  2.05k|      for (int i = 0; i < 1024; ++i)
  ------------------
  |  Branch (155:23): [True: 2.04k, False: 2]
  ------------------
  156|  2.04k|      {
  157|  2.04k|        int cwd = i & 0x7F; // from i extract codeword
  158|  2.04k|        int c_q = i >> 7;   // from i extract context
  159|       |        // See if this case exist in the table, if so then set the entry in
  160|       |        // vlc_tbl0
  161|   911k|        for (size_t j = 0; j < tbl0_size; ++j) 
  ------------------
  |  Branch (161:28): [True: 909k, False: 2.04k]
  ------------------
  162|   909k|          if (tbl0[j].c_q == c_q) // this is an and operation
  ------------------
  |  Branch (162:15): [True: 113k, False: 795k]
  ------------------
  163|   113k|            if (tbl0[j].cwd == (cwd & ((1 << tbl0[j].cwd_len) - 1)))
  ------------------
  |  Branch (163:17): [True: 2.04k, False: 111k]
  ------------------
  164|  2.04k|            {
  165|  2.04k|              if (debug) assert(vlc_tbl0[i] == 0);
  ------------------
  |  Branch (165:19): [Folded, False: 2.04k]
  ------------------
  166|       |              // Put this entry into the table
  167|  2.04k|              vlc_tbl0[i] = (ui16)((tbl0[j].rho << 4) | (tbl0[j].u_off << 3)
  168|  2.04k|                | (tbl0[j].e_k << 12) | (tbl0[j].e_1 << 8) | tbl0[j].cwd_len);
  169|  2.04k|            }
  170|  2.04k|      }
  171|       |
  172|      2|      if (debug) memset(vlc_tbl1, 0, sizeof(vlc_tbl1)); //unnecessary
  ------------------
  |  Branch (172:11): [Folded, False: 2]
  ------------------
  173|       |
  174|       |      // this the same as above but for non-initial rows
  175|  2.05k|      for (int i = 0; i < 1024; ++i)
  ------------------
  |  Branch (175:23): [True: 2.04k, False: 2]
  ------------------
  176|  2.04k|      {
  177|  2.04k|        int cwd = i & 0x7F; //7 bits
  178|  2.04k|        int c_q = i >> 7;
  179|   735k|        for (size_t j = 0; j < tbl1_size; ++j)
  ------------------
  |  Branch (179:28): [True: 733k, False: 2.04k]
  ------------------
  180|   733k|          if (tbl1[j].c_q == c_q) // this is an and operation
  ------------------
  |  Branch (180:15): [True: 91.6k, False: 641k]
  ------------------
  181|  91.6k|            if (tbl1[j].cwd == (cwd & ((1 << tbl1[j].cwd_len) - 1)))
  ------------------
  |  Branch (181:17): [True: 2.04k, False: 89.6k]
  ------------------
  182|  2.04k|            {
  183|  2.04k|              if (debug) assert(vlc_tbl1[i] == 0);
  ------------------
  |  Branch (183:19): [Folded, False: 2.04k]
  ------------------
  184|  2.04k|              vlc_tbl1[i] = (ui16)((tbl1[j].rho << 4) | (tbl1[j].u_off << 3)
  185|  2.04k|                | (tbl1[j].e_k << 12) | (tbl1[j].e_1 << 8) | tbl1[j].cwd_len);
  186|  2.04k|            }
  187|  2.04k|      }
  188|       |
  189|      2|      return true;
  190|      2|    }
ojph_block_common.cpp:_ZN4ojph5localL16uvlc_init_tablesEv:
  197|      2|    {
  198|       |      // table stores possible decoding three bits from vlc
  199|       |      // there are 8 entries for xx1, x10, 100, 000, where x means do not
  200|       |      // care table value is made up of
  201|       |      // 2 bits in the LSB for prefix length 
  202|       |      // 3 bits for suffix length
  203|       |      // 3 bits in the MSB for prefix value (u_pfx in Table 3 of ITU T.814)
  204|      2|      static const ui8 dec[8] = { // the index is the prefix codeword
  205|      2|        3 | (5 << 2) | (5 << 5), //000 == 000, prefix codeword "000"
  206|      2|        1 | (0 << 2) | (1 << 5), //001 == xx1, prefix codeword "1"
  207|      2|        2 | (0 << 2) | (2 << 5), //010 == x10, prefix codeword "01"
  208|      2|        1 | (0 << 2) | (1 << 5), //011 == xx1, prefix codeword "1"
  209|      2|        3 | (1 << 2) | (3 << 5), //100 == 100, prefix codeword "001"
  210|      2|        1 | (0 << 2) | (1 << 5), //101 == xx1, prefix codeword "1"
  211|      2|        2 | (0 << 2) | (2 << 5), //110 == x10, prefix codeword "01"
  212|      2|        1 | (0 << 2) | (1 << 5)  //111 == xx1, prefix codeword "1"
  213|      2|      };
  214|       |
  215|    642|      for (ui32 i = 0; i < 256 + 64; ++i)
  ------------------
  |  Branch (215:24): [True: 640, False: 2]
  ------------------
  216|    640|      { 
  217|    640|        ui32 mode = i >> 6;
  218|    640|        ui32 vlc = i & 0x3F;
  219|       |
  220|    640|        if (mode == 0) {      // both u_off are 0
  ------------------
  |  Branch (220:13): [True: 128, False: 512]
  ------------------
  221|    128|          uvlc_tbl0[i] = 0;
  222|    128|          uvlc_bias[i] = 0;
  223|    128|        }
  224|    512|        else if (mode <= 2) // u_off are either 01 or 10
  ------------------
  |  Branch (224:18): [True: 256, False: 256]
  ------------------
  225|    256|        {
  226|    256|          ui32 d = dec[vlc & 0x7];   //look at the least significant 3 bits
  227|       |
  228|    256|          ui32 total_prefix = d & 0x3;
  229|    256|          ui32 total_suffix = (d >> 2) & 0x7;
  230|    256|          ui32 u0_suffix_len = (mode == 1) ? total_suffix : 0;
  ------------------
  |  Branch (230:32): [True: 128, False: 128]
  ------------------
  231|    256|          ui32 u0 = (mode == 1) ? (d >> 5) : 0;
  ------------------
  |  Branch (231:21): [True: 128, False: 128]
  ------------------
  232|    256|          ui32 u1 = (mode == 1) ? 0 : (d >> 5);
  ------------------
  |  Branch (232:21): [True: 128, False: 128]
  ------------------
  233|       |
  234|    256|          uvlc_tbl0[i] = (ui16)(total_prefix | 
  235|    256|                               (total_suffix << 3) |
  236|    256|                               (u0_suffix_len << 7) |
  237|    256|                               (u0 << 10) |
  238|    256|                               (u1 << 13));
  239|       |          
  240|    256|        }
  241|    256|        else if (mode == 3) // both u_off are 1, and MEL event is 0
  ------------------
  |  Branch (241:18): [True: 128, False: 128]
  ------------------
  242|    128|        {
  243|    128|          ui32 d0 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  244|    128|          vlc >>= d0 & 0x3;          // Consume bits
  245|    128|          ui32 d1 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  246|       |
  247|    128|          ui32 total_prefix, u0_suffix_len, total_suffix, u0, u1;
  248|    128|          if ((d0 & 0x3) == 3)
  ------------------
  |  Branch (248:15): [True: 32, False: 96]
  ------------------
  249|     32|          {
  250|     32|            total_prefix = (d0 & 0x3) + 1;
  251|     32|            u0_suffix_len = (d0 >> 2) & 0x7;
  252|     32|            total_suffix = u0_suffix_len;
  253|     32|            u0 = d0 >> 5;
  254|     32|            u1 = (vlc & 1) + 1;
  255|     32|            uvlc_bias[i] = 4; // 0b00 for u0 and 0b01 for u1
  256|     32|          }
  257|     96|          else
  258|     96|          {
  259|     96|            total_prefix = (d0 & 0x3) + (d1 & 0x3);
  260|     96|            u0_suffix_len = (d0 >> 2) & 0x7;
  261|     96|            total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
  262|     96|            u0 = d0 >> 5;
  263|     96|            u1 = d1 >> 5;
  264|     96|            uvlc_bias[i] = 0;
  265|     96|          }
  266|       |
  267|    128|          uvlc_tbl0[i] = (ui16)(total_prefix | 
  268|    128|                               (total_suffix << 3) |
  269|    128|                               (u0_suffix_len << 7) |
  270|    128|                               (u0 << 10) |
  271|    128|                               (u1 << 13));
  272|    128|        }
  273|    128|        else if (mode == 4) // both u_off are 1, and MEL event is 1
  ------------------
  |  Branch (273:18): [True: 128, False: 0]
  ------------------
  274|    128|        {
  275|    128|          ui32 d0 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  276|    128|          vlc >>= d0 & 0x3;          // Consume bits
  277|    128|          ui32 d1 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  278|       |
  279|    128|          ui32 total_prefix = (d0 & 0x3) + (d1 & 0x3);
  280|    128|          ui32 u0_suffix_len = (d0 >> 2) & 0x7;
  281|    128|          ui32 total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
  282|    128|          ui32 u0 = (d0 >> 5) + 2;
  283|    128|          ui32 u1 = (d1 >> 5) + 2;
  284|       |
  285|    128|          uvlc_tbl0[i] = (ui16)(total_prefix | 
  286|    128|                               (total_suffix << 3) |
  287|    128|                               (u0_suffix_len << 7) |
  288|    128|                               (u0 << 10) |
  289|    128|                               (u1 << 13));
  290|    128|          uvlc_bias[i] = 10; // 0b10 for u0 and 0b10 for u1
  291|    128|        }
  292|    640|      }
  293|       |
  294|    514|      for (ui32 i = 0; i < 256; ++i)
  ------------------
  |  Branch (294:24): [True: 512, False: 2]
  ------------------
  295|    512|      {
  296|    512|        ui32 mode = i >> 6;
  297|    512|        ui32 vlc = i & 0x3F;
  298|       |
  299|    512|        if (mode == 0)       // both u_off are 0
  ------------------
  |  Branch (299:13): [True: 128, False: 384]
  ------------------
  300|    128|          uvlc_tbl1[i] = 0;
  301|    384|        else if (mode <= 2)  // u_off are either 01 or 10
  ------------------
  |  Branch (301:18): [True: 256, False: 128]
  ------------------
  302|    256|        {
  303|    256|          ui32 d = dec[vlc & 0x7];   // look at the 3 LSB bits
  304|       |
  305|    256|          ui32 total_prefix = d & 0x3;
  306|    256|          ui32 total_suffix = (d >> 2) & 0x7;
  307|    256|          ui32 u0_suffix_len = (mode == 1) ? total_suffix : 0;
  ------------------
  |  Branch (307:32): [True: 128, False: 128]
  ------------------
  308|    256|          ui32 u0 = (mode == 1) ? (d >> 5) : 0;
  ------------------
  |  Branch (308:21): [True: 128, False: 128]
  ------------------
  309|    256|          ui32 u1 = (mode == 1) ? 0 : (d >> 5);
  ------------------
  |  Branch (309:21): [True: 128, False: 128]
  ------------------
  310|       |
  311|    256|          uvlc_tbl1[i] = (ui16)(total_prefix | 
  312|    256|                               (total_suffix << 3) |
  313|    256|                               (u0_suffix_len << 7) |
  314|    256|                               (u0 << 10) |
  315|    256|                               (u1 << 13));
  316|    256|        }
  317|    128|        else if (mode == 3) // both u_off are 1
  ------------------
  |  Branch (317:18): [True: 128, False: 0]
  ------------------
  318|    128|        {
  319|    128|          ui32 d0 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  320|    128|          vlc >>= d0 & 0x3;          // Consume bits
  321|    128|          ui32 d1 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  322|       |
  323|    128|          ui32 total_prefix = (d0 & 0x3) + (d1 & 0x3);
  324|    128|          ui32 u0_suffix_len = (d0 >> 2) & 0x7;
  325|    128|          ui32 total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
  326|    128|          ui32 u0 = d0 >> 5;
  327|    128|          ui32 u1 = d1 >> 5;
  328|       |
  329|    128|          uvlc_tbl1[i] = (ui16)(total_prefix | 
  330|    128|                               (total_suffix << 3) |
  331|    128|                               (u0_suffix_len << 7) |
  332|    128|                               (u0 << 10) |
  333|    128|                               (u1 << 13));
  334|    128|        }
  335|    512|      }
  336|      2|      return true;
  337|      2|    }
ojph_block_common.cpp:_ZN4ojph5localL20uvlc_init_wide_tableEv:
  347|      2|    {
  348|      2|      static const ui8 dec[8] = {
  349|      2|        3 | (5 << 2) | (5 << 5), //000
  350|      2|        1 | (0 << 2) | (1 << 5), //xx1
  351|      2|        2 | (0 << 2) | (2 << 5), //x10
  352|      2|        1 | (0 << 2) | (1 << 5), //xx1
  353|      2|        3 | (1 << 2) | (3 << 5), //100
  354|      2|        1 | (0 << 2) | (1 << 5), //xx1
  355|      2|        2 | (0 << 2) | (2 << 5), //x10
  356|      2|        1 | (0 << 2) | (1 << 5)  //xx1
  357|      2|      };
  358|       |
  359|  8.19k|      for (ui32 idx = 0; idx < 4096; ++idx)
  ------------------
  |  Branch (359:26): [True: 8.19k, False: 2]
  ------------------
  360|  8.19k|      {
  361|  8.19k|        ui32 mode = idx >> 10;       // 2 bits
  362|  8.19k|        ui32 vlc = idx & 0x3FF;      // 10 bits
  363|       |
  364|  8.19k|        if (mode == 0) {
  ------------------
  |  Branch (364:13): [True: 2.04k, False: 6.14k]
  ------------------
  365|  2.04k|          uvlc_tbl1_wide[idx] = 0;
  366|  2.04k|          continue;
  367|  2.04k|        }
  368|       |
  369|  6.14k|        if (mode <= 2) // single UVLC (one u_off set)
  ------------------
  |  Branch (369:13): [True: 4.09k, False: 2.04k]
  ------------------
  370|  4.09k|        {
  371|  4.09k|          ui32 d = dec[vlc & 0x7];
  372|  4.09k|          ui32 prefix_len = d & 0x3;
  373|  4.09k|          ui32 suffix_len = (d >> 2) & 0x7;
  374|  4.09k|          ui32 u_pfx = d >> 5;
  375|  4.09k|          ui32 suffix_val = (vlc >> prefix_len) & ((1u << suffix_len) - 1);
  376|  4.09k|          ui32 u_val = u_pfx + suffix_val;
  377|  4.09k|          ui32 total = prefix_len + suffix_len;
  378|  4.09k|          ui32 u_q0 = (mode == 1) ? u_val : 0;
  ------------------
  |  Branch (378:23): [True: 2.04k, False: 2.04k]
  ------------------
  379|  4.09k|          ui32 u_q1 = (mode == 2) ? u_val : 0;
  ------------------
  |  Branch (379:23): [True: 2.04k, False: 2.04k]
  ------------------
  380|  4.09k|          uvlc_tbl1_wide[idx] = total | (u_q0 << 5) | (u_q1 << 13);
  381|  4.09k|          continue;
  382|  4.09k|        }
  383|       |
  384|       |        // mode == 3: both u_off set
  385|       |        // Bitstream layout: [prefix0][prefix1][suffix0][suffix1]
  386|  2.04k|        ui32 d0 = dec[vlc & 0x7];
  387|  2.04k|        ui32 p0_len = d0 & 0x3;
  388|  2.04k|        ui32 s0_len = (d0 >> 2) & 0x7;
  389|  2.04k|        ui32 u0_pfx = d0 >> 5;
  390|       |
  391|  2.04k|        ui32 vlc1 = vlc >> p0_len;  // consume prefix0
  392|  2.04k|        ui32 d1 = dec[vlc1 & 0x7];
  393|  2.04k|        ui32 p1_len = d1 & 0x3;
  394|  2.04k|        ui32 s1_len = (d1 >> 2) & 0x7;
  395|  2.04k|        ui32 u1_pfx = d1 >> 5;
  396|       |
  397|  2.04k|        ui32 total_prefix = p0_len + p1_len;
  398|  2.04k|        ui32 total_suffix = s0_len + s1_len;
  399|  2.04k|        ui32 total = total_prefix + total_suffix;
  400|       |
  401|  2.04k|        if (total > 10) {
  ------------------
  |  Branch (401:13): [True: 96, False: 1.95k]
  ------------------
  402|     96|          uvlc_tbl1_wide[idx] = 0x1F; // fallback sentinel
  403|     96|          continue;
  404|     96|        }
  405|       |
  406|       |        // suffixes follow both prefixes in the bitstream
  407|  1.95k|        ui32 suffix_bits = vlc >> total_prefix;
  408|  1.95k|        ui32 s0_val = suffix_bits & ((1u << s0_len) - 1);
  409|  1.95k|        ui32 s1_val = (suffix_bits >> s0_len) & ((1u << s1_len) - 1);
  410|       |
  411|  1.95k|        ui32 u_q0 = u0_pfx + s0_val;
  412|  1.95k|        ui32 u_q1 = u1_pfx + s1_val;
  413|  1.95k|        uvlc_tbl1_wide[idx] = total | (u_q0 << 5) | (u_q1 << 13);
  414|  1.95k|      }
  415|      2|      return true;
  416|      2|    }

_ZN4ojph5local10dec_mel_stC2Ev:
   64|  45.6k|      dec_mel_st() : data(NULL), tmp(0), bits(0), size(0), unstuff(false),
   65|  45.6k|        k(0), num_runs(0), runs(0)
   66|  45.6k|      {}
_ZN4ojph5local10rev_structC2Ev:
  276|  24.1k|      rev_struct() : data(NULL), tmp(0), bits(0), size(0), unstuff(false)
  277|  24.1k|      {}

_ZN4ojph5local23ojph_decode_codeblock64EPhPmjjjjjjjb:
  771|  26.2k|    {
  772|       |      // static bool insufficient_precision = false;
  773|       |      // static bool modify_code = false;
  774|       |      // static bool truncate_spp_mrp = false;
  775|       |
  776|  26.2k|      if (num_passes > 1 && lengths2 == 0)
  ------------------
  |  Branch (776:11): [True: 18.7k, False: 7.45k]
  |  Branch (776:29): [True: 3.40k, False: 15.3k]
  ------------------
  777|  3.40k|      {
  778|  3.40k|        OJPH_WARN(0x00010001, "A malformed codeblock that has more than "
  ------------------
  |  |  287|  3.40k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  3.40k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3.40k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  779|  3.40k|                              "one coding pass, but zero length for "
  780|  3.40k|                              "2nd and potential 3rd pass.");
  781|  3.40k|        num_passes = 1;
  782|  3.40k|      }
  783|       |
  784|  26.2k|      if (num_passes > 3)
  ------------------
  |  Branch (784:11): [True: 0, False: 26.2k]
  ------------------
  785|      0|      {
  786|      0|        OJPH_WARN(0x00010002, "We do not support more than 3 coding passes; "
  ------------------
  |  |  287|      0|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  787|      0|                              "This codeblocks has %d passes.",
  788|      0|                              num_passes);
  789|      0|        return false;
  790|      0|      }
  791|       |
  792|       |      // if (missing_msbs > 30) // p < 0
  793|       |      // {
  794|       |      //   if (insufficient_precision == false) 
  795|       |      //   {
  796|       |      //     insufficient_precision = true;
  797|       |      //     OJPH_WARN(0x00010003, "32 bits are not enough to decode this "
  798|       |      //                           "codeblock. This message will not be "
  799|       |      //                           "displayed again.");
  800|       |      //   }
  801|       |      //   return false;
  802|       |      // }       
  803|       |      // else if (missing_msbs == 30) // p == 0
  804|       |      // { // not enough precision to decode and set the bin center to 1
  805|       |      //   if (modify_code == false) {
  806|       |      //     modify_code = true;
  807|       |      //     OJPH_WARN(0x00010004, "Not enough precision to decode the cleanup "
  808|       |      //                           "pass. The code can be modified to support "
  809|       |      //                           "this case. This message will not be "
  810|       |      //                           "displayed again.");
  811|       |      //   }
  812|       |      //    return false;         // 32 bits are not enough to decode this
  813|       |      //  }
  814|       |      // else if (missing_msbs == 29) // if p is 1, then num_passes must be 1
  815|       |      // {
  816|       |      //   if (num_passes > 1) {
  817|       |      //     num_passes = 1;
  818|       |      //     if (truncate_spp_mrp == false) {
  819|       |      //       truncate_spp_mrp = true;
  820|       |      //       OJPH_WARN(0x00010005, "Not enough precision to decode the SgnProp "
  821|       |      //                             "nor MagRef passes; both will be skipped. "
  822|       |      //                             "This message will not be displayed "
  823|       |      //                             "again.");
  824|       |      //     }
  825|       |      //   }
  826|       |      // }
  827|  26.2k|      ui32 p = 62 - missing_msbs; // The least significant bitplane for CUP
  828|       |      // There is a way to handle the case of p == 0, but a different path
  829|       |      // is required
  830|       |
  831|  26.2k|      if (lengths1 < 2)
  ------------------
  |  Branch (831:11): [True: 0, False: 26.2k]
  ------------------
  832|      0|      {
  833|      0|        OJPH_WARN(0x00010006, "Wrong codeblock length.");
  ------------------
  |  |  287|      0|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  834|      0|        return false;
  835|      0|      }
  836|       |
  837|       |      // read scup and fix the bytes there
  838|  26.2k|      int lcup, scup;
  839|  26.2k|      lcup = (int)lengths1;  // length of CUP
  840|       |      //scup is the length of MEL + VLC
  841|  26.2k|      scup = (((int)coded_data[lcup-1]) << 4) + (coded_data[lcup-2] & 0xF);
  842|  26.2k|      if (scup < 2 || scup > lcup || scup > 4079) //something is wrong
  ------------------
  |  Branch (842:11): [True: 1.78k, False: 24.4k]
  |  Branch (842:23): [True: 6.59k, False: 17.8k]
  |  Branch (842:38): [True: 966, False: 16.8k]
  ------------------
  843|  9.34k|        return false;
  844|       |
  845|       |      // The temporary storage scratch holds two types of data in an 
  846|       |      // interleaved fashion. The interleaving allows us to use one
  847|       |      // memory pointer.
  848|       |      // We have one entry for a decoded VLC code, and one entry for UVLC.
  849|       |      // Entries are 16 bits each, corresponding to one quad, 
  850|       |      // but since we want to use XMM registers of the SSE family 
  851|       |      // of SIMD; we allocated 16 bytes or more per quad row; that is,
  852|       |      // the width is no smaller than 16 bytes (or 8 entries), and the
  853|       |      // height is 512 quads
  854|       |      // Each VLC entry contains, in the following order, starting 
  855|       |      // from MSB
  856|       |      // e_k (4bits), e_1 (4bits), rho (4bits), useless for step 2 (4bits)
  857|       |      // Each entry in UVLC contains u_q
  858|       |      // One extra row to handle the case of SPP propagating downwards
  859|       |      // when codeblock width is 4
  860|  16.8k|      ui16 scratch[8 * 513] = {0};       // 8 kB
  861|       |
  862|       |      // We need an extra two entries (one inf and one u_q) beyond
  863|       |      // the last column. 
  864|       |      // If the block width is 4 (2 quads), then we use sstr of 8 
  865|       |      // (enough for 4 quads). If width is 8 (4 quads) we use 
  866|       |      // sstr is 16 (enough for 8 quads). For a width of 16 (8 
  867|       |      // quads), we use 24 (enough for 12 quads).
  868|  16.8k|      ui32 sstr = ((width + 2u) + 7u) & ~7u; // multiples of 8
  869|       |
  870|  16.8k|      ui32 mmsbp2 = missing_msbs + 2;
  871|       |
  872|       |      // The cleanup pass is decoded in two steps; in step one,
  873|       |      // the VLC and MEL segments are decoded, generating a record that 
  874|       |      // has 2 bytes per quad. The 2 bytes contain, u, rho, e^1 & e^k.
  875|       |      // This information should be sufficient for the next step.
  876|       |      // In step 2, we decode the MagSgn segment.
  877|       |
  878|       |      // step 1 decoding VLC and MEL segments
  879|  16.8k|      {
  880|       |        // init structures
  881|  16.8k|        dec_mel_st mel;
  882|  16.8k|        mel_init(&mel, coded_data, lcup, scup);
  883|  16.8k|        rev_struct vlc;
  884|  16.8k|        rev_init8(&vlc, coded_data, lcup, scup);
  885|       |
  886|  16.8k|        int run = mel_get_run(&mel); // decode runs of events from MEL bitstrm
  887|       |                                     // data represented as runs of 0 events
  888|       |                                     // See mel_decode description
  889|       |
  890|  16.8k|        ui64 vlc_val;
  891|  16.8k|        ui32 c_q = 0;
  892|  16.8k|        ui16 *sp = scratch;
  893|       |        //initial quad row
  894|  83.9k|        for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (894:26): [True: 67.1k, False: 16.8k]
  ------------------
  895|  67.1k|        {
  896|       |          // decode VLC
  897|       |          /////////////
  898|       |
  899|       |          // first quad
  900|  67.1k|          vlc_val = rev_fetch64(&vlc);
  901|       |
  902|       |          //decode VLC using the context c_q and the head of VLC bitstream
  903|  67.1k|          ui16 t0 = vlc_tbl0[ c_q + (vlc_val & 0x7F) ];
  904|       |
  905|       |          // if context is zero, use one MEL event
  906|  67.1k|          if (c_q == 0) //zero context
  ------------------
  |  Branch (906:15): [True: 34.4k, False: 32.6k]
  ------------------
  907|  34.4k|          {
  908|  34.4k|            run -= 2; //subtract 2, since events number if multiplied by 2
  909|       |
  910|       |            // Is the run terminated in 1? if so, use decoded VLC code, 
  911|       |            // otherwise, discard decoded data, since we will decoded again 
  912|       |            // using a different context
  913|  34.4k|            t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (913:18): [True: 18.6k, False: 15.8k]
  ------------------
  914|       |
  915|       |            // is run -1 or -2? this means a run has been consumed
  916|  34.4k|            if (run < 0) 
  ------------------
  |  Branch (916:17): [True: 29.1k, False: 5.28k]
  ------------------
  917|  29.1k|              run = mel_get_run(&mel);  // get another run
  918|  34.4k|          }
  919|       |          //run -= (c_q == 0) ? 2 : 0;
  920|       |          //t0 = (c_q != 0 || run == -1) ? t0 : 0;
  921|       |          //if (run < 0)
  922|       |          //  run = mel_get_run(&mel);  // get another run
  923|  67.1k|          sp[0] = t0;
  924|  67.1k|          x += 2;
  925|       |
  926|       |          // prepare context for the next quad; eqn. 1 in ITU T.814
  927|  67.1k|          c_q = ((t0 & 0x10U) << 3) | ((t0 & 0xE0U) << 2);
  928|       |
  929|       |          //remove data from vlc stream (0 bits are removed if vlc is not used)
  930|  67.1k|          vlc_val = rev_advance64(&vlc, t0 & 0x7);
  931|       |
  932|       |          //second quad
  933|  67.1k|          ui16 t1 = 0;
  934|       |
  935|       |          //decode VLC using the context c_q and the head of VLC bitstream
  936|  67.1k|          t1 = vlc_tbl0[c_q + (vlc_val & 0x7F)]; 
  937|       |
  938|       |          // if context is zero, use one MEL event
  939|  67.1k|          if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (939:15): [True: 24.9k, False: 42.1k]
  |  Branch (939:27): [True: 21.8k, False: 3.10k]
  ------------------
  940|  21.8k|          {
  941|  21.8k|            run -= 2; //subtract 2, since events number if multiplied by 2
  942|       |
  943|       |            // if event is 0, discard decoded t1
  944|  21.8k|            t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (944:18): [True: 9.72k, False: 12.1k]
  ------------------
  945|       |
  946|  21.8k|            if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (946:17): [True: 14.7k, False: 7.10k]
  ------------------
  947|  14.7k|              run = mel_get_run(&mel); // if yes, then get another run
  948|  21.8k|          }
  949|  67.1k|          t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (949:16): [True: 55.9k, False: 11.1k]
  ------------------
  950|       |          //run -= (c_q == 0 && x < width) ? 2 : 0;
  951|       |          //t1 = (c_q != 0 || run == -1) ? t1 : 0;
  952|       |          //if (run < 0)
  953|       |          //  run = mel_get_run(&mel);  // get another run
  954|  67.1k|          sp[2] = t1;
  955|  67.1k|          x += 2;
  956|       |
  957|       |          //prepare context for the next quad, eqn. 1 in ITU T.814
  958|  67.1k|          c_q = ((t1 & 0x10U) << 3) | ((t1 & 0xE0U) << 2);
  959|       |
  960|       |          //remove data from vlc stream, if qinf is not used, cwdlen is 0
  961|  67.1k|          vlc_val = rev_advance64(&vlc, t1 & 0x7);
  962|       |          
  963|       |          // decode u
  964|       |          /////////////
  965|       |          // uvlc_mode is made up of u_offset bits from the quad pair
  966|  67.1k|          ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
  967|  67.1k|          if (uvlc_mode == 0xc0)// if both u_offset are set, get an event from
  ------------------
  |  Branch (967:15): [True: 21.0k, False: 46.0k]
  ------------------
  968|  21.0k|          {                     // the MEL run of events
  969|  21.0k|            run -= 2; //subtract 2, since events number if multiplied by 2
  970|       |
  971|  21.0k|            uvlc_mode += (run == -1) ? 0x40 : 0; // increment uvlc_mode by
  ------------------
  |  Branch (971:26): [True: 8.20k, False: 12.8k]
  ------------------
  972|       |                                                 // is 0x40
  973|       |
  974|  21.0k|            if (run < 0)//if run is consumed (run is -1 or -2), get another run
  ------------------
  |  Branch (974:17): [True: 15.8k, False: 5.15k]
  ------------------
  975|  15.8k|              run = mel_get_run(&mel);
  976|  21.0k|          }
  977|       |          //run -= (uvlc_mode == 0xc0) ? 2 : 0;
  978|       |          //uvlc_mode += (uvlc_mode == 0xc0 && run == -1) ? 0x40 : 0;
  979|       |          //if (run < 0)
  980|       |          //  run = mel_get_run(&mel);  // get another run
  981|       |
  982|       |          //decode uvlc_mode to get u for both quads
  983|  67.1k|          ui32 idx = uvlc_mode + (ui32)(vlc_val & 0x3F);
  984|  67.1k|          ui32 uvlc_entry = uvlc_tbl0[idx];
  985|  67.1k|          ui16 u_bias = uvlc_bias[idx];          
  986|       |          //remove total prefix length
  987|  67.1k|          vlc_val = rev_advance64(&vlc, uvlc_entry & 0x7); 
  988|  67.1k|          uvlc_entry >>= 3; 
  989|       |          //extract suffixes for quad 0 and 1
  990|  67.1k|          ui32 len = uvlc_entry & 0xF;             // suffix length for 2 quads
  991|  67.1k|          ui32 tmp = (ui32)(vlc_val&((1<<len)-1)); // suffix value for 2 quads
  992|  67.1k|          vlc_val = rev_advance64(&vlc, len);
  993|  67.1k|          uvlc_entry >>= 4;
  994|       |          // quad 0 length
  995|  67.1k|          len = uvlc_entry & 0x7; // quad 0 suffix length
  996|  67.1k|          uvlc_entry >>= 3;
  997|  67.1k|          ui16 u_q0 = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
  998|  67.1k|          ui16 u_q1 = (ui16)((uvlc_entry >> 3) + (tmp >> len));
  999|       |
 1000|       |          // decode u_q extensions, which is needed only when u_q > 32
 1001|  67.1k|          ui16 u_ext; bool cond0, cond1;
 1002|  67.1k|          cond0 = u_q0 - (u_bias & 0x3) > 32;
 1003|  67.1k|          u_ext = (ui16)(cond0 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1003:26): [True: 332, False: 66.7k]
  ------------------
 1004|  67.1k|          vlc_val = rev_advance64(&vlc, cond0 ? 4 : 0);
  ------------------
  |  Branch (1004:41): [True: 332, False: 66.7k]
  ------------------
 1005|  67.1k|          u_q0 = (ui16)(u_q0 + (u_ext << 2));
 1006|  67.1k|          sp[1] = (ui16)(u_q0 + 1); // kappa = 1
 1007|  67.1k|          cond1 = u_q1 - (u_bias >> 2) > 32;
 1008|  67.1k|          u_ext = (ui16)(cond1 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1008:26): [True: 273, False: 66.8k]
  ------------------
 1009|  67.1k|          vlc_val = rev_advance64(&vlc, cond1 ? 4 : 0);
  ------------------
  |  Branch (1009:41): [True: 273, False: 66.8k]
  ------------------
 1010|  67.1k|          u_q1 = (ui16)(u_q1 + (u_ext << 2));
 1011|  67.1k|          sp[3] = (ui16)(u_q1 + 1); // kappa = 1
 1012|  67.1k|        }
 1013|  16.8k|        sp[0] = sp[1] = 0;
 1014|       |
 1015|       |        //non initial quad rows
 1016|   178k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1016:26): [True: 161k, False: 16.8k]
  ------------------
 1017|   161k|        {
 1018|   161k|          c_q = 0;                                // context
 1019|   161k|          ui16 *sp = scratch + (y >> 1) * sstr;   // this row of quads
 1020|       |
 1021|   446k|          for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1021:28): [True: 284k, False: 161k]
  ------------------
 1022|   284k|          {
 1023|       |            // decode VLC
 1024|       |            /////////////
 1025|       |
 1026|       |            // sigma_q (n, ne, nf)
 1027|   284k|            c_q |= ((sp[0 - (si32)sstr] & 0xA0U) << 2);
 1028|   284k|            c_q |= ((sp[2 - (si32)sstr] & 0x20U) << 4);
 1029|       |
 1030|       |            // first quad
 1031|   284k|            vlc_val = rev_fetch64(&vlc);
 1032|       |
 1033|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1034|   284k|            ui16 t0 = vlc_tbl1[ c_q + (vlc_val & 0x7F) ];
 1035|       |
 1036|       |            // if context is zero, use one MEL event
 1037|   284k|            if (c_q == 0) //zero context
  ------------------
  |  Branch (1037:17): [True: 242k, False: 42.8k]
  ------------------
 1038|   242k|            {
 1039|   242k|              run -= 2; //subtract 2, since events number is multiplied by 2
 1040|       |
 1041|       |              // Is the run terminated in 1? if so, use decoded VLC code, 
 1042|       |              // otherwise, discard decoded data, since we will decoded again 
 1043|       |              // using a different context
 1044|   242k|              t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1044:20): [True: 73.4k, False: 168k]
  ------------------
 1045|       |
 1046|       |              // is run -1 or -2? this means a run has been consumed
 1047|   242k|              if (run < 0) 
  ------------------
  |  Branch (1047:19): [True: 132k, False: 109k]
  ------------------
 1048|   132k|                run = mel_get_run(&mel);  // get another run
 1049|   242k|            }
 1050|       |            //run -= (c_q == 0) ? 2 : 0;
 1051|       |            //t0 = (c_q != 0 || run == -1) ? t0 : 0;
 1052|       |            //if (run < 0)
 1053|       |            //  run = mel_get_run(&mel);  // get another run
 1054|   284k|            sp[0] = t0;
 1055|   284k|            x += 2;
 1056|       |
 1057|       |            // prepare context for the next quad; eqn. 2 in ITU T.814
 1058|       |            // sigma_q (w, sw)
 1059|   284k|            c_q = ((t0 & 0x40U) << 2) | ((t0 & 0x80U) << 1);
 1060|       |            // sigma_q (nw)
 1061|   284k|            c_q |= sp[0 - (si32)sstr] & 0x80;
 1062|       |            // sigma_q (n, ne, nf)
 1063|   284k|            c_q |= ((sp[2 - (si32)sstr] & 0xA0U) << 2);
 1064|   284k|            c_q |= ((sp[4 - (si32)sstr] & 0x20U) << 4);
 1065|       |
 1066|       |            //remove data from vlc stream (0 bits are removed if vlc is unused)
 1067|   284k|            vlc_val = rev_advance64(&vlc, t0 & 0x7);
 1068|       |
 1069|       |            //second quad
 1070|   284k|            ui16 t1 = 0;
 1071|       |
 1072|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1073|   284k|            t1 = vlc_tbl1[ c_q + (vlc_val & 0x7F)]; 
 1074|       |
 1075|       |            // if context is zero, use one MEL event
 1076|   284k|            if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1076:17): [True: 237k, False: 47.7k]
  |  Branch (1076:29): [True: 132k, False: 104k]
  ------------------
 1077|   132k|            {
 1078|   132k|              run -= 2; //subtract 2, since events number if multiplied by 2
 1079|       |
 1080|       |              // if event is 0, discard decoded t1
 1081|   132k|              t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1081:20): [True: 28.0k, False: 104k]
  ------------------
 1082|       |
 1083|   132k|              if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1083:19): [True: 52.2k, False: 80.2k]
  ------------------
 1084|  52.2k|                run = mel_get_run(&mel); // if yes, then get another run
 1085|   132k|            }
 1086|   284k|            t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1086:18): [True: 163k, False: 121k]
  ------------------
 1087|       |            //run -= (c_q == 0 && x < width) ? 2 : 0;
 1088|       |            //t1 = (c_q != 0 || run == -1) ? t1 : 0;
 1089|       |            //if (run < 0)
 1090|       |            //  run = mel_get_run(&mel);  // get another run
 1091|   284k|            sp[2] = t1;
 1092|   284k|            x += 2;
 1093|       |
 1094|       |            // partial c_q, will be completed when we process the next quad
 1095|       |            // sigma_q (w, sw)
 1096|   284k|            c_q = ((t1 & 0x40U) << 2) | ((t1 & 0x80U) << 1);
 1097|       |            // sigma_q (nw)
 1098|   284k|            c_q |= sp[2 - (si32)sstr] & 0x80;
 1099|       |
 1100|       |            //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1101|   284k|            vlc_val = rev_advance64(&vlc, t1 & 0x7);
 1102|       |          
 1103|       |            // decode u
 1104|       |            /////////////
 1105|       |            // uvlc_mode is made up of u_offset bits from the quad pair
 1106|   284k|            ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1107|   284k|            ui32 uvlc_entry = uvlc_tbl1[uvlc_mode + (vlc_val & 0x3F)];
 1108|       |            //remove total prefix length
 1109|   284k|            vlc_val = rev_advance64(&vlc, uvlc_entry & 0x7);
 1110|   284k|            uvlc_entry >>= 3;
 1111|       |            //extract suffixes for quad 0 and 1
 1112|   284k|            ui32 len = uvlc_entry & 0xF;             //suffix length for 2 quads
 1113|   284k|            ui32 tmp = (ui32)(vlc_val&((1<<len)-1)); //suffix value for 2 quads
 1114|   284k|            vlc_val = rev_advance64(&vlc, len);
 1115|   284k|            uvlc_entry >>= 4;
 1116|       |            // quad 0 length
 1117|   284k|            len = uvlc_entry & 0x7; // quad 0 suffix length
 1118|   284k|            uvlc_entry >>= 3;
 1119|   284k|            ui16 u_q0 = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
 1120|   284k|            ui16 u_q1 = (ui16)((uvlc_entry >> 3) + (tmp >> len)); // u_q
 1121|       |
 1122|       |            // decode u_q extensions, which is needed only when u_q > 32
 1123|   284k|            ui16 u_ext; bool cond0, cond1;
 1124|   284k|            cond0 = u_q0 > 32;
 1125|   284k|            u_ext = (ui16)(cond0 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1125:28): [True: 245, False: 284k]
  ------------------
 1126|   284k|            vlc_val = rev_advance64(&vlc, cond0 ? 4 : 0);
  ------------------
  |  Branch (1126:43): [True: 245, False: 284k]
  ------------------
 1127|   284k|            u_q0 = (ui16)(u_q0 + (u_ext << 2));
 1128|   284k|            sp[1] = u_q0;
 1129|   284k|            cond1 = u_q1 > 32;
 1130|   284k|            u_ext = (ui16)(cond1 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1130:28): [True: 174, False: 284k]
  ------------------
 1131|   284k|            vlc_val = rev_advance64(&vlc, cond1 ? 4 : 0);
  ------------------
  |  Branch (1131:43): [True: 174, False: 284k]
  ------------------
 1132|   284k|            u_q1 = (ui16)(u_q1 + (u_ext << 2));
 1133|   284k|            sp[3] = u_q1;
 1134|   284k|          }
 1135|   161k|          sp[0] = sp[1] = 0;
 1136|   161k|        }
 1137|  16.8k|      }
 1138|       |
 1139|       |      // step2 we decode magsgn
 1140|  16.8k|      {
 1141|       |        // We allocate a scratch row for storing v_n values.
 1142|       |        // We have 512 quads horizontally.
 1143|       |        // We need an extra entry to handle the case of vp[1]
 1144|       |        // when vp is at the last column.
 1145|       |        // Here, we allocate 4 instead of 1 to make the buffer size
 1146|       |        // a multipled of 16 bytes.
 1147|  16.8k|        const int v_n_size = 512 + 4;
 1148|  16.8k|        ui64 v_n_scratch[v_n_size] = {0};  // 4+ kB
 1149|       |
 1150|  16.8k|        frwd_struct64 magsgn;
 1151|  16.8k|        frwd_init8<0xFF>(&magsgn, coded_data, lcup - scup);
 1152|       |
 1153|  16.8k|        const ui16 *sp = scratch;
 1154|  16.8k|        ui64 *vp = v_n_scratch;
 1155|  16.8k|        ui64 *dp = decoded_data;
 1156|       |
 1157|  16.8k|        ui64 prev_v_n = 0;
 1158|   111k|        for (ui32 x = 0; x < width; sp += 2, ++vp)
  ------------------
  |  Branch (1158:26): [True: 105k, False: 5.97k]
  ------------------
 1159|   105k|        {
 1160|   105k|          ui32 inf = sp[0];
 1161|   105k|          ui32 U_q = sp[1];
 1162|   105k|          if (U_q > mmsbp2)
  ------------------
  |  Branch (1162:15): [True: 2.33k, False: 103k]
  ------------------
 1163|  2.33k|            return false;
 1164|       |
 1165|   103k|          ui64 v_n;
 1166|   103k|          ui64 val = 0;
 1167|   103k|          ui32 bit = 0;
 1168|   103k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1168:15): [True: 34.4k, False: 68.6k]
  ------------------
 1169|  34.4k|          {
 1170|       |            //get 32 bits of magsgn data
 1171|  34.4k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1172|  34.4k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1173|  34.4k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1174|       |
 1175|  34.4k|            val = ms_val << 63;                           // get sign bit
 1176|  34.4k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1177|  34.4k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1178|  34.4k|            v_n |= 1;                                     // add center of bin    
 1179|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1180|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1181|  34.4k|            val |= (v_n + 2) << (p - 1);
 1182|  34.4k|          }
 1183|   103k|          dp[0] = val;
 1184|       |
 1185|   103k|          v_n = 0;
 1186|   103k|          val = 0;
 1187|   103k|          bit = 1;
 1188|   103k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1188:15): [True: 49.3k, False: 53.7k]
  ------------------
 1189|  49.3k|          {
 1190|       |            //get 32 bits of magsgn data
 1191|  49.3k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1192|  49.3k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1193|  49.3k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1194|       |
 1195|  49.3k|            val = ms_val << 63;                           // get sign bit
 1196|  49.3k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1197|  49.3k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1198|  49.3k|            v_n |= 1;                                     // add center of bin    
 1199|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1200|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1201|  49.3k|            val |= (v_n + 2) << (p - 1);
 1202|  49.3k|          }
 1203|   103k|          dp[stride] = val;
 1204|   103k|          vp[0] = prev_v_n | v_n;
 1205|   103k|          prev_v_n = 0;
 1206|   103k|          ++dp;
 1207|   103k|          if (++x >= width)
  ------------------
  |  Branch (1207:15): [True: 8.55k, False: 94.5k]
  ------------------
 1208|  8.55k|          { ++vp; break; }
 1209|       |
 1210|  94.5k|          val = 0;
 1211|  94.5k|          bit = 2;
 1212|  94.5k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1212:15): [True: 33.4k, False: 61.1k]
  ------------------
 1213|  33.4k|          {
 1214|       |            //get 32 bits of magsgn data
 1215|  33.4k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1216|  33.4k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1217|  33.4k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1218|       |
 1219|  33.4k|            val = ms_val << 63;                           // get sign bit
 1220|  33.4k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1221|  33.4k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1222|  33.4k|            v_n |= 1;                                     // add center of bin    
 1223|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1224|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1225|  33.4k|            val |= (v_n + 2) << (p - 1);
 1226|  33.4k|          }
 1227|  94.5k|          dp[0] = val;
 1228|       |
 1229|  94.5k|          v_n = 0;
 1230|  94.5k|          val = 0;
 1231|  94.5k|          bit = 3;
 1232|  94.5k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1232:15): [True: 34.6k, False: 59.9k]
  ------------------
 1233|  34.6k|          {
 1234|       |            //get 32 bits of magsgn data
 1235|  34.6k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1236|  34.6k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1237|  34.6k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1238|       |
 1239|  34.6k|            val = ms_val << 63;                           // get sign bit
 1240|  34.6k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1241|  34.6k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1242|  34.6k|            v_n |= 1;                                     // add center of bin    
 1243|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1244|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1245|  34.6k|            val |= (v_n + 2) << (p - 1);
 1246|  34.6k|          }
 1247|  94.5k|          dp[stride] = val;
 1248|  94.5k|          prev_v_n = v_n;
 1249|  94.5k|          ++dp;
 1250|  94.5k|          ++x;
 1251|  94.5k|        }
 1252|  14.5k|        vp[0] = prev_v_n;
 1253|       |
 1254|   111k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1254:26): [True: 99.0k, False: 12.4k]
  ------------------
 1255|  99.0k|        {
 1256|  99.0k|          const ui16 *sp = scratch + (y >> 1) * sstr;
 1257|  99.0k|          ui64 *vp = v_n_scratch;
 1258|  99.0k|          ui64 *dp = decoded_data + y * stride;
 1259|       |
 1260|  99.0k|          prev_v_n = 0;
 1261|   356k|          for (ui32 x = 0; x < width; sp += 2, ++vp)
  ------------------
  |  Branch (1261:28): [True: 323k, False: 33.8k]
  ------------------
 1262|   323k|          {
 1263|   323k|            ui32 inf = sp[0];
 1264|   323k|            ui32 u_q = sp[1];
 1265|       |
 1266|   323k|            ui32 gamma = inf & 0xF0; gamma &= gamma - 0x10; //is gamma_q 1?
 1267|   323k|            ui32 emax = 63 - count_leading_zeros(2 | vp[0] | vp[1]); // emax-1
 1268|   323k|            ui32 kappa = gamma ? emax : 1;
  ------------------
  |  Branch (1268:26): [True: 18.1k, False: 304k]
  ------------------
 1269|       |
 1270|   323k|            ui32 U_q = u_q + kappa;
 1271|   323k|            if (U_q > mmsbp2)
  ------------------
  |  Branch (1271:17): [True: 2.03k, False: 321k]
  ------------------
 1272|  2.03k|              return false;
 1273|       |
 1274|   321k|            ui64 v_n;
 1275|   321k|            ui64 val = 0;
 1276|   321k|            ui32 bit = 0;
 1277|   321k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1277:17): [True: 70.8k, False: 250k]
  ------------------
 1278|  70.8k|            {
 1279|       |              //get 32 bits of magsgn data
 1280|  70.8k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1281|  70.8k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1282|  70.8k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1283|       |
 1284|  70.8k|              val = ms_val << 63;                         // get sign bit
 1285|  70.8k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1286|  70.8k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1287|  70.8k|              v_n |= 1;                                   // add center of bin    
 1288|       |              //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1289|       |              //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1290|  70.8k|              val |= (v_n + 2) << (p - 1);
 1291|  70.8k|            }
 1292|   321k|            dp[0] = val;
 1293|       |
 1294|   321k|            v_n = 0;
 1295|   321k|            val = 0;
 1296|   321k|            bit = 1;
 1297|   321k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1297:17): [True: 14.5k, False: 306k]
  ------------------
 1298|  14.5k|            {
 1299|       |              //get 32 bits of magsgn data
 1300|  14.5k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1301|  14.5k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1302|  14.5k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1303|       |
 1304|  14.5k|              val = ms_val << 63;                         // get sign bit
 1305|  14.5k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1306|  14.5k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1307|  14.5k|              v_n |= 1;                                   // add center of bin    
 1308|       |              //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1309|       |              //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1310|  14.5k|              val |= (v_n + 2) << (p - 1);
 1311|  14.5k|            }
 1312|   321k|            dp[stride] = val;
 1313|   321k|            vp[0] = prev_v_n | v_n;
 1314|   321k|            prev_v_n = 0;
 1315|   321k|            ++dp;
 1316|   321k|            if (++x >= width)
  ------------------
  |  Branch (1316:17): [True: 63.1k, False: 257k]
  ------------------
 1317|  63.1k|            { ++vp; break; }
 1318|       |
 1319|   257k|            val = 0;
 1320|   257k|            bit = 2;
 1321|   257k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1321:17): [True: 12.3k, False: 245k]
  ------------------
 1322|  12.3k|            {
 1323|       |              //get 32 bits of magsgn data
 1324|  12.3k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1325|  12.3k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1326|  12.3k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1327|       |
 1328|  12.3k|              val = ms_val << 63;                         // get sign bit
 1329|  12.3k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1330|  12.3k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1331|  12.3k|              v_n |= 1;                                   // add center of bin    
 1332|       |              //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1333|       |              //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1334|  12.3k|              val |= (v_n + 2) << (p - 1);
 1335|  12.3k|            }
 1336|   257k|            dp[0] = val;
 1337|       |
 1338|   257k|            v_n = 0;
 1339|   257k|            val = 0;
 1340|   257k|            bit = 3;
 1341|   257k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1341:17): [True: 12.3k, False: 245k]
  ------------------
 1342|  12.3k|            {
 1343|       |              //get 32 bits of magsgn data
 1344|  12.3k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1345|  12.3k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1346|  12.3k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1347|       |
 1348|  12.3k|              val = ms_val << 63;                         // get sign bit
 1349|  12.3k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1350|  12.3k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1351|  12.3k|              v_n |= 1;                                   // add center of bin    
 1352|       |              //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1353|       |              //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1354|  12.3k|              val |= (v_n + 2) << (p - 1);
 1355|  12.3k|            }
 1356|   257k|            dp[stride] = val;
 1357|   257k|            prev_v_n = v_n;
 1358|   257k|            ++dp;
 1359|   257k|            ++x;
 1360|   257k|          }
 1361|  97.0k|          vp[0] = prev_v_n;
 1362|  97.0k|        }
 1363|  14.5k|      }
 1364|       |
 1365|  12.4k|      if (num_passes > 1)
  ------------------
  |  Branch (1365:11): [True: 10.4k, False: 2.07k]
  ------------------
 1366|  10.4k|      {
 1367|       |        // We use scratch again, we can divide it into multiple regions
 1368|       |        // sigma holds all the significant samples, and it cannot
 1369|       |        // be modified after it is set.  it will be used during the
 1370|       |        // Magnitude Refinement Pass
 1371|  10.4k|        ui16* const sigma = scratch;
 1372|       |
 1373|  10.4k|        ui32 mstr = (width + 3u) >> 2;   // divide by 4, since each
 1374|       |                                         // ui16 contains 4 columns
 1375|  10.4k|        mstr = ((mstr + 2u) + 7u) & ~7u; // multiples of 8
 1376|       |
 1377|       |        // We re-arrange quad significance, where each 4 consecutive
 1378|       |        // bits represent one quad, into column significance, where,
 1379|       |        // each 4 consequtive bits represent one column of 4 rows
 1380|  10.4k|        {
 1381|  10.4k|          ui32 y;
 1382|  58.0k|          for (y = 0; y < height; y += 4)
  ------------------
  |  Branch (1382:23): [True: 47.6k, False: 10.4k]
  ------------------
 1383|  47.6k|          {
 1384|  47.6k|            ui16* sp = scratch + (y >> 1) * sstr;
 1385|  47.6k|            ui16* dp = sigma + (y >> 2) * mstr;
 1386|   161k|            for (ui32 x = 0; x < width; x += 4, sp += 4, ++dp) {
  ------------------
  |  Branch (1386:30): [True: 113k, False: 47.6k]
  ------------------
 1387|   113k|              ui32 t0 = 0, t1 = 0;
 1388|   113k|              t0  = ((sp[0     ] & 0x30u) >> 4)  | ((sp[0     ] & 0xC0u) >> 2);
 1389|   113k|              t0 |= ((sp[2     ] & 0x30u) << 4)  | ((sp[2     ] & 0xC0u) << 6);
 1390|   113k|              t1  = ((sp[0+sstr] & 0x30u) >> 2)  | ((sp[0+sstr] & 0xC0u)     );
 1391|   113k|              t1 |= ((sp[2+sstr] & 0x30u) << 6)  | ((sp[2+sstr] & 0xC0u) << 8);
 1392|   113k|              dp[0] = (ui16)(t0 | t1);
 1393|   113k|            }
 1394|  47.6k|            dp[0] = 0; // set an extra entry on the right with 0
 1395|  47.6k|          }
 1396|  10.4k|          {
 1397|       |            // reset one row after the codeblock
 1398|  10.4k|            ui16* dp = sigma + (y >> 2) * mstr;
 1399|  51.7k|            for (ui32 x = 0; x < width; x += 4, ++dp)
  ------------------
  |  Branch (1399:30): [True: 41.3k, False: 10.4k]
  ------------------
 1400|  41.3k|              dp[0] = 0;
 1401|  10.4k|            dp[0] = 0; // set an extra entry on the right with 0
 1402|  10.4k|          }
 1403|  10.4k|        }
 1404|       |
 1405|       |        // We perform Significance Propagation Pass here
 1406|  10.4k|        {
 1407|       |          // This stores significance information of the previous
 1408|       |          // 4 rows.  Significance information in this array includes
 1409|       |          // all signicant samples in bitplane p - 1; that is,
 1410|       |          // significant samples for bitplane p (discovered during the
 1411|       |          // cleanup pass and stored in sigma) and samples that have recently
 1412|       |          // became significant (during the SPP) in bitplane p-1.
 1413|       |          // We store enough for the widest row, containing 1024 columns,
 1414|       |          // which is equivalent to 256 of ui16, since each stores 4 columns.
 1415|       |          // We add an extra 8 entries, just in case we need more
 1416|  10.4k|          ui16 prev_row_sig[256 + 8] = {0}; // 528 Bytes
 1417|       |
 1418|  10.4k|          frwd_struct64 sigprop;
 1419|  10.4k|          frwd_init<0>(&sigprop, coded_data + lengths1, (int)lengths2);
 1420|       |
 1421|  58.0k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1421:28): [True: 47.6k, False: 10.4k]
  ------------------
 1422|  47.6k|          {
 1423|  47.6k|            ui32 pattern = 0xFFFFu; // a pattern needed samples
 1424|  47.6k|            if (height - y < 4) {
  ------------------
  |  Branch (1424:17): [True: 5.58k, False: 42.0k]
  ------------------
 1425|  5.58k|              pattern = 0x7777u;
 1426|  5.58k|              if (height - y < 3) {
  ------------------
  |  Branch (1426:19): [True: 3.70k, False: 1.88k]
  ------------------
 1427|  3.70k|                pattern = 0x3333u;
 1428|  3.70k|                if (height - y < 2)
  ------------------
  |  Branch (1428:21): [True: 1.44k, False: 2.26k]
  ------------------
 1429|  1.44k|                  pattern = 0x1111u;
 1430|  3.70k|              }
 1431|  5.58k|            }
 1432|       |
 1433|       |            // prev holds sign. info. for the previous quad, together
 1434|       |            // with the rows on top of it and below it.
 1435|  47.6k|            ui32 prev = 0;
 1436|  47.6k|            ui16 *prev_sig = prev_row_sig;
 1437|  47.6k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1438|  47.6k|            ui64 *dpp = decoded_data + y * stride;
 1439|   161k|            for (ui32 x = 0; x < width; x += 4, ++cur_sig, ++prev_sig)
  ------------------
  |  Branch (1439:30): [True: 113k, False: 47.6k]
  ------------------
 1440|   113k|            {
 1441|       |              // only rows and columns inside the stripe are included
 1442|   113k|              si32 s = (si32)x + 4 - (si32)width;
 1443|   113k|              s = ojph_max(s, 0);
  ------------------
  |  |   73|   113k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 31.6k, False: 82.1k]
  |  |  ------------------
  ------------------
 1444|   113k|              pattern = pattern >> (s * 4);
 1445|       |
 1446|       |              // We first find locations that need to be tested (potential
 1447|       |              // SPP members); these location will end up in mbr
 1448|       |              // In each iteration, we produce 16 bits because cwd can have
 1449|       |              // up to 16 bits of significance information, followed by the
 1450|       |              // corresponding 16 bits of sign information; therefore, it is
 1451|       |              // sufficient to fetch 32 bit data per loop.
 1452|       |
 1453|       |              // Althougth we are interested in 16 bits only, we load 32 bits.
 1454|       |              // For the 16 bits we are producing, we need the next 4 bits --
 1455|       |              // We need data for at least 5 columns out of 8.
 1456|       |              // Therefore loading 32 bits is easier than loading 16 bits
 1457|       |              // twice.
 1458|   113k|              ui32 ps = load_le_ui16x2(prev_sig);
 1459|   113k|              ui32 ns = load_le_ui16x2(cur_sig + mstr);
 1460|   113k|              ui32 u = (ps & 0x88888888) >> 3; // the row on top
 1461|   113k|              if (!stripe_causal)
  ------------------
  |  Branch (1461:19): [True: 105k, False: 8.23k]
  ------------------
 1462|   105k|                u |= (ns & 0x11111111) << 3;   // the row below
 1463|       |
 1464|   113k|              ui32 cs = load_le_ui16x2(cur_sig);
 1465|       |              // vertical integration
 1466|   113k|              ui32 mbr =  cs;                // this sig. info.
 1467|   113k|              mbr |= (cs & 0x77777777) << 1; //above neighbors
 1468|   113k|              mbr |= (cs & 0xEEEEEEEE) >> 1; //below neighbors
 1469|   113k|              mbr |= u;
 1470|       |              // horizontal integration
 1471|   113k|              ui32 t = mbr;
 1472|   113k|              mbr |= t << 4;      // neighbors on the left
 1473|   113k|              mbr |= t >> 4;      // neighbors on the right
 1474|   113k|              mbr |= prev >> 12;  // significance of previous group
 1475|       |
 1476|       |              // remove outside samples, and already significant samples
 1477|   113k|              mbr &= pattern;
 1478|   113k|              mbr &= ~cs;
 1479|       |
 1480|       |              // find samples that become significant during the SPP
 1481|   113k|              ui32 new_sig = mbr;
 1482|   113k|              if (new_sig)
  ------------------
  |  Branch (1482:19): [True: 72.6k, False: 41.1k]
  ------------------
 1483|  72.6k|              {
 1484|  72.6k|                ui64 cwd = frwd_fetch<0>(&sigprop);
 1485|       |
 1486|  72.6k|                ui32 cnt = 0;
 1487|  72.6k|                ui32 col_mask = 0xFu;
 1488|  72.6k|                ui32 inv_sig = ~cs & pattern;
 1489|   363k|                for (int i = 0; i < 16; i += 4, col_mask <<= 4)
  ------------------
  |  Branch (1489:33): [True: 290k, False: 72.6k]
  ------------------
 1490|   290k|                {
 1491|   290k|                  if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1491:23): [True: 88.1k, False: 202k]
  ------------------
 1492|  88.1k|                    continue;
 1493|       |
 1494|       |                  //scan one column
 1495|   202k|                  ui32 sample_mask = 0x1111u & col_mask;
 1496|   202k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1496:23): [True: 130k, False: 72.2k]
  ------------------
 1497|   130k|                  {
 1498|   130k|                    new_sig &= ~sample_mask;
 1499|   130k|                    if (cwd & 1)
  ------------------
  |  Branch (1499:25): [True: 41.9k, False: 88.4k]
  ------------------
 1500|  41.9k|                    {
 1501|  41.9k|                      ui32 t = 0x33u << i;
 1502|  41.9k|                      new_sig |= t & inv_sig;
 1503|  41.9k|                    }
 1504|   130k|                    cwd >>= 1; ++cnt;
 1505|   130k|                  }
 1506|       |
 1507|   202k|                  sample_mask <<= 1;
 1508|   202k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1508:23): [True: 138k, False: 63.8k]
  ------------------
 1509|   138k|                  {
 1510|   138k|                    new_sig &= ~sample_mask;
 1511|   138k|                    if (cwd & 1)
  ------------------
  |  Branch (1511:25): [True: 41.8k, False: 96.8k]
  ------------------
 1512|  41.8k|                    {
 1513|  41.8k|                      ui32 t = 0x76u << i;
 1514|  41.8k|                      new_sig |= t & inv_sig;
 1515|  41.8k|                    }
 1516|   138k|                    cwd >>= 1; ++cnt;
 1517|   138k|                  }
 1518|       |
 1519|   202k|                  sample_mask <<= 1;
 1520|   202k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1520:23): [True: 103k, False: 99.4k]
  ------------------
 1521|   103k|                  {
 1522|   103k|                    new_sig &= ~sample_mask;
 1523|   103k|                    if (cwd & 1)
  ------------------
  |  Branch (1523:25): [True: 38.5k, False: 64.6k]
  ------------------
 1524|  38.5k|                    {
 1525|  38.5k|                      ui32 t = 0xECu << i;
 1526|  38.5k|                      new_sig |= t & inv_sig;
 1527|  38.5k|                    }
 1528|   103k|                    cwd >>= 1; ++cnt;
 1529|   103k|                  }
 1530|       |
 1531|   202k|                  sample_mask <<= 1;
 1532|   202k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1532:23): [True: 115k, False: 86.7k]
  ------------------
 1533|   115k|                  {
 1534|   115k|                    new_sig &= ~sample_mask;
 1535|   115k|                    if (cwd & 1)
  ------------------
  |  Branch (1535:25): [True: 43.1k, False: 72.7k]
  ------------------
 1536|  43.1k|                    {
 1537|  43.1k|                      ui32 t = 0xC8u << i;
 1538|  43.1k|                      new_sig |= t & inv_sig;
 1539|  43.1k|                    }
 1540|   115k|                    cwd >>= 1; ++cnt;
 1541|   115k|                  }
 1542|   202k|                }
 1543|       |
 1544|  72.6k|                if (new_sig)
  ------------------
  |  Branch (1544:21): [True: 33.6k, False: 39.0k]
  ------------------
 1545|  33.6k|                {
 1546|       |                  // new_sig has newly-discovered sig. samples during SPP
 1547|       |                  // find the signs and update decoded_data
 1548|  33.6k|                  ui64 *dp = dpp + x;
 1549|  33.6k|                  ui64 val = 3u << (p - 2);
 1550|  33.6k|                  col_mask = 0xFu;
 1551|   168k|                  for (int i = 0; i < 4; ++i, ++dp, col_mask <<= 4)
  ------------------
  |  Branch (1551:35): [True: 134k, False: 33.6k]
  ------------------
 1552|   134k|                  {
 1553|   134k|                    if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1553:25): [True: 58.3k, False: 76.4k]
  ------------------
 1554|  58.3k|                      continue;
 1555|       |
 1556|       |                    //scan 4 signs
 1557|  76.4k|                    ui32 sample_mask = 0x1111u & col_mask;
 1558|  76.4k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1558:25): [True: 41.9k, False: 34.5k]
  ------------------
 1559|  41.9k|                    {
 1560|  41.9k|                      assert(dp[0] == 0);
 1561|  41.9k|                      dp[0] = (cwd << 63) | val;
 1562|  41.9k|                      cwd >>= 1; ++cnt;
 1563|  41.9k|                    }
 1564|       |
 1565|  76.4k|                    sample_mask += sample_mask;
 1566|  76.4k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1566:25): [True: 41.8k, False: 34.5k]
  ------------------
 1567|  41.8k|                    {
 1568|  41.8k|                      assert(dp[stride] == 0);
 1569|  41.8k|                      dp[stride] = (cwd << 63) | val;
 1570|  41.8k|                      cwd >>= 1; ++cnt;
 1571|  41.8k|                    }
 1572|       |
 1573|  76.4k|                    sample_mask += sample_mask;
 1574|  76.4k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1574:25): [True: 38.5k, False: 37.8k]
  ------------------
 1575|  38.5k|                    {
 1576|  38.5k|                      assert(dp[2 * stride] == 0);
 1577|  38.5k|                      dp[2 * stride] = (cwd << 63) | val;
 1578|  38.5k|                      cwd >>= 1; ++cnt;
 1579|  38.5k|                    }
 1580|       |
 1581|  76.4k|                    sample_mask += sample_mask;
 1582|  76.4k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1582:25): [True: 43.1k, False: 33.3k]
  ------------------
 1583|  43.1k|                    {
 1584|  43.1k|                      assert(dp[3 * stride] == 0);
 1585|  43.1k|                      dp[3 * stride] = (cwd << 63) | val;
 1586|  43.1k|                      cwd >>= 1; ++cnt;
 1587|  43.1k|                    }
 1588|  76.4k|                  }
 1589|  33.6k|                }
 1590|  72.6k|                frwd_advance(&sigprop, cnt);
 1591|  72.6k|              }
 1592|       |
 1593|   113k|              new_sig |= cs;
 1594|   113k|              *prev_sig = (ui16)(new_sig);
 1595|       |
 1596|       |              // vertical integration for the new sig. info.
 1597|   113k|              t = new_sig;
 1598|   113k|              new_sig |= (t & 0x7777) << 1; //above neighbors
 1599|   113k|              new_sig |= (t & 0xEEEE) >> 1; //below neighbors
 1600|       |              // add sig. info. from the row on top and below
 1601|   113k|              prev = new_sig | u;
 1602|       |              // we need only the bits in 0xF000
 1603|   113k|              prev &= 0xF000;
 1604|   113k|            }
 1605|  47.6k|          }
 1606|  10.4k|        }
 1607|       |
 1608|       |        // We perform Magnitude Refinement Pass here
 1609|  10.4k|        if (num_passes > 2)
  ------------------
  |  Branch (1609:13): [True: 7.26k, False: 3.15k]
  ------------------
 1610|  7.26k|        {
 1611|  7.26k|          rev_struct magref;
 1612|  7.26k|          rev_init_mrp(&magref, coded_data, (int)lengths1, (int)lengths2);
 1613|       |
 1614|  32.0k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1614:28): [True: 24.7k, False: 7.26k]
  ------------------
 1615|  24.7k|          {
 1616|  24.7k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1617|  24.7k|            ui64 *dpp = decoded_data + y * stride;
 1618|  24.7k|            ui64 half = 1ULL << (p - 2);
 1619|  66.5k|            for (ui32 i = 0; i < width; i += 8, cur_sig += 2)
  ------------------
  |  Branch (1619:30): [True: 41.8k, False: 24.7k]
  ------------------
 1620|  41.8k|            {
 1621|       |              //Process one entry from sigma array at a time
 1622|       |              // Each nibble (4 bits) in the sigma array represents 4 rows,
 1623|       |              // and the 32 bits contain 8 columns
 1624|  41.8k|              ui32 cwd = rev_fetch_mrp(&magref); // get 32 bit data
 1625|  41.8k|              ui32 sig = load_le_ui16x2(cur_sig); // 32 bits processed now
 1626|  41.8k|              ui32 col_mask = 0xFu;  // a mask for a column in sig
 1627|  41.8k|              if (sig) // if any of the 32 bits are set
  ------------------
  |  Branch (1627:19): [True: 28.3k, False: 13.4k]
  ------------------
 1628|  28.3k|              {
 1629|   255k|                for (int j = 0; j < 8; ++j) //one column at a time
  ------------------
  |  Branch (1629:33): [True: 227k, False: 28.3k]
  ------------------
 1630|   227k|                {
 1631|   227k|                  if (sig & col_mask) // lowest nibble
  ------------------
  |  Branch (1631:23): [True: 103k, False: 124k]
  ------------------
 1632|   103k|                  {
 1633|   103k|                    ui64 *dp = dpp + i + j; // next column in decoded samples
 1634|   103k|                    ui32 sample_mask = 0x11111111u & col_mask; //LSB
 1635|       |
 1636|   515k|                    for (int k = 0; k < 4; ++k) {
  ------------------
  |  Branch (1636:37): [True: 412k, False: 103k]
  ------------------
 1637|   412k|                      if (sig & sample_mask) //if LSB is set
  ------------------
  |  Branch (1637:27): [True: 180k, False: 231k]
  ------------------
 1638|   180k|                      {
 1639|   180k|                        assert(dp[0] != 0); // decoded value cannot be zero
 1640|   180k|                        assert((dp[0] & half) == 0); // no half
 1641|   180k|                        ui64 sym = cwd & 1;          // get it value
 1642|   180k|                        sym = (1 - sym) << (p - 1); // previous center of bin
 1643|   180k|                        sym |= half;            // put half the center of bin
 1644|   180k|                        dp[0] ^= sym;    // remove old bin center and put new
 1645|   180k|                        cwd >>= 1;       // consume word
 1646|   180k|                      }
 1647|   412k|                      sample_mask += sample_mask; //next row
 1648|   412k|                      dp += stride; // next samples row
 1649|   412k|                    }
 1650|   103k|                  }
 1651|   227k|                  col_mask <<= 4; //next column
 1652|   227k|                }
 1653|  28.3k|              }
 1654|       |              // consume data according to the number of bits set
 1655|  41.8k|              rev_advance_mrp(&magref, population_count(sig));
 1656|  41.8k|            }
 1657|  24.7k|          }
 1658|  7.26k|        }
 1659|  10.4k|      }
 1660|  12.4k|      return true;
 1661|  14.5k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL8mel_initEPNS0_10dec_mel_stEPhii:
  222|  16.8k|    {
  223|  16.8k|      melp->data = bbuf + lcup - scup; // move the pointer to the start of MEL
  224|  16.8k|      melp->bits = 0;                  // 0 bits in tmp
  225|  16.8k|      melp->tmp = 0;                   //
  226|  16.8k|      melp->unstuff = false;           // no unstuffing
  227|  16.8k|      melp->size = scup - 1;           // size is the length of MEL+VLC-1
  228|  16.8k|      melp->k = 0;                     // 0 for state 
  229|  16.8k|      melp->num_runs = 0;              // num_runs is 0
  230|  16.8k|      melp->runs = 0;                  //
  231|       |
  232|       |      //This code is borrowed; original is for a different architecture
  233|       |      //These few lines take care of the case where data is not at a multiple
  234|       |      // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the MEL segment
  235|  16.8k|      int num = 4 - (int)(intptr_t(melp->data) & 0x3);
  236|  61.9k|      for (int i = 0; i < num; ++i) { // this code is similar to mel_read
  ------------------
  |  Branch (236:23): [True: 45.0k, False: 16.8k]
  ------------------
  237|  45.0k|        assert(melp->unstuff == false || melp->data[0] <= 0x8F);
  238|  45.0k|        ui64 d = (melp->size > 0) ? *melp->data : 0xFF;//if buffer is consumed
  ------------------
  |  Branch (238:18): [True: 40.3k, False: 4.68k]
  ------------------
  239|       |                                                       //set data to 0xFF
  240|  45.0k|        if (melp->size == 1) d |= 0xF; //if this is MEL+VLC-1, set LSBs to 0xF
  ------------------
  |  Branch (240:13): [True: 7.82k, False: 37.2k]
  ------------------
  241|       |                                       // see the standard
  242|  45.0k|        melp->data += melp->size-- > 0; //increment if the end is not reached
  243|  45.0k|        int d_bits = 8 - melp->unstuff; //if unstuffing is needed, reduce by 1
  244|  45.0k|        melp->tmp = (melp->tmp << d_bits) | d; //store bits in tmp
  245|  45.0k|        melp->bits += d_bits;  //increment tmp by number of bits
  246|  45.0k|        melp->unstuff = ((d & 0xFF) == 0xFF); //true of next byte needs 
  247|       |                                              //unstuffing
  248|  45.0k|      }
  249|  16.8k|      melp->tmp <<= (64 - melp->bits); //push all the way up so the first bit
  250|       |                                       // is the MSB
  251|  16.8k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL9rev_init8EPNS0_10rev_structEPhii:
  344|  16.8k|    {
  345|       |      //first byte has only the upper 4 bits
  346|  16.8k|      vlcp->data = data + lcup - 2;
  347|       |
  348|       |      //size can not be larger than this, in fact it should be smaller
  349|  16.8k|      vlcp->size = scup - 2;
  350|       |
  351|  16.8k|      ui8 val = *vlcp->data--; // read one byte (this is a half byte)
  352|       |
  353|       |      // the first byte is treated different to other bytes, because only
  354|       |      // the MSB nibble is part of the VLC code.
  355|  16.8k|      val = (ui8)(val >> 4);
  356|  16.8k|      ui8 t = ((val & 0x7) == 0x7) ? 1 : 0; // unstuffing is needed
  ------------------
  |  Branch (356:15): [True: 4.14k, False: 12.7k]
  ------------------
  357|  16.8k|      val = (ui8)(val & (0xFU >> t)); // protect against erroneous 1 in MSB
  358|  16.8k|      vlcp->tmp = val;
  359|  16.8k|      vlcp->bits = 4 - t;
  360|  16.8k|      vlcp->unstuff = val > 0x8; //this is useful for the next byte
  361|  16.8k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL11mel_get_runEPNS0_10dec_mel_stE:
  261|   261k|    {
  262|   261k|      if (melp->num_runs == 0)  //if no runs, decode more bit from MEL segment
  ------------------
  |  Branch (262:11): [True: 45.7k, False: 215k]
  ------------------
  263|  45.7k|        mel_decode(melp);
  264|       |
  265|   261k|      int t = melp->runs & 0x7F; //retrieve one run
  266|   261k|      melp->runs >>= 7;  // remove the retrieved run
  267|   261k|      melp->num_runs--;
  268|   261k|      return t; // return run
  269|   261k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10mel_decodeEPNS0_10dec_mel_stE:
  171|  45.7k|    {
  172|  45.7k|      static const int mel_exp[13] = { //MEL exponents
  173|  45.7k|        0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5
  174|  45.7k|      };
  175|       |
  176|  45.7k|      if (melp->bits < 6) // if there are less than 6 bits in tmp
  ------------------
  |  Branch (176:11): [True: 8.29k, False: 37.4k]
  ------------------
  177|  8.29k|        mel_read(melp);   // then read from the MEL bitstream
  178|       |                          // 6 bits is the largest decodable MEL cwd
  179|       |
  180|       |      //repeat so long that there is enough decodable bits in tmp,
  181|       |      // and the runs store is not full (num_runs < 8)
  182|   365k|      while (melp->bits >= 6 && melp->num_runs < 8)
  ------------------
  |  Branch (182:14): [True: 354k, False: 11.6k]
  |  Branch (182:33): [True: 320k, False: 34.1k]
  ------------------
  183|   320k|      {
  184|   320k|        int eval = mel_exp[melp->k]; // number of bits associated with state
  185|   320k|        int run = 0;
  186|   320k|        if (melp->tmp & (1ull<<63)) //The next bit to decode (stored in MSB)
  ------------------
  |  Branch (186:13): [True: 147k, False: 172k]
  ------------------
  187|   147k|        { //one is found
  188|   147k|          run = 1 << eval;  
  189|   147k|          run--; // consecutive runs of 0 events - 1
  190|   147k|          melp->k = melp->k + 1 < 12 ? melp->k + 1 : 12;//increment, max is 12
  ------------------
  |  Branch (190:21): [True: 134k, False: 12.8k]
  ------------------
  191|   147k|          melp->tmp <<= 1; // consume one bit from tmp
  192|   147k|          melp->bits -= 1;
  193|   147k|          run = run << 1; // a stretch of zeros not terminating in one
  194|   147k|        }
  195|   172k|        else
  196|   172k|        { //0 is found
  197|   172k|          run = (int)(melp->tmp >> (63 - eval)) & ((1 << eval) - 1);
  198|   172k|          melp->k = melp->k - 1 > 0 ? melp->k - 1 : 0; //decrement, min is 0
  ------------------
  |  Branch (198:21): [True: 33.7k, False: 138k]
  ------------------
  199|   172k|          melp->tmp <<= eval + 1; //consume eval + 1 bits (max is 6)
  200|   172k|          melp->bits -= eval + 1;
  201|   172k|          run = (run << 1) + 1; // a stretch of zeros terminating with one
  202|   172k|        }
  203|   320k|        eval = melp->num_runs * 7;           // 7 bits per run
  204|   320k|        melp->runs &= ~((ui64)0x3F << eval); // 6 bits are sufficient
  205|   320k|        melp->runs |= ((ui64)run) << eval;   // store the value in runs
  206|   320k|        melp->num_runs++;                    // increment count  
  207|   320k|      }
  208|  45.7k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL8mel_readEPNS0_10dec_mel_stE:
   94|  8.29k|    {
   95|  8.29k|      if (melp->bits > 32)  //there are enough bits in the tmp variable
  ------------------
  |  Branch (95:11): [True: 0, False: 8.29k]
  ------------------
   96|      0|        return;             // return without reading new data
   97|       |
   98|  8.29k|      ui32 val = 0xFFFFFFFF;       // feed in 0xFF if buffer is exhausted
   99|  8.29k|      if (melp->size > 4) {        // if there is data in the MEL segment
  ------------------
  |  Branch (99:11): [True: 2.39k, False: 5.89k]
  ------------------
  100|  2.39k|        val = load_le_ui32(melp->data); // read 32 bits from MEL data
  101|  2.39k|        melp->data += 4;           // advance pointer
  102|  2.39k|        melp->size -= 4;           // reduce counter
  103|  2.39k|      }
  104|  5.89k|      else if (melp->size > 0)
  ------------------
  |  Branch (104:16): [True: 2.83k, False: 3.05k]
  ------------------
  105|  2.83k|      { // 4 or less
  106|  2.83k|        int i = 0;
  107|  5.45k|        while (melp->size > 1) {   
  ------------------
  |  Branch (107:16): [True: 2.62k, False: 2.83k]
  ------------------
  108|  2.62k|          ui32 v = *melp->data++;    // read one byte at a time
  109|  2.62k|          ui32 m = ~(0xFFu << i);    // mask of location
  110|  2.62k|          val = (val & m) | (v << i);// put one byte in its correct location
  111|  2.62k|          --melp->size;
  112|  2.62k|          i += 8;
  113|  2.62k|        }
  114|       |        // size equal to 1
  115|  2.83k|        ui32 v = *melp->data++;    // the one before the last is different 
  116|  2.83k|        v |= 0xF;                  // MEL and VLC segments can overlap
  117|  2.83k|        ui32 m = ~(0xFFu << i);
  118|  2.83k|        val = (val & m) | (v << i);
  119|  2.83k|        --melp->size;
  120|  2.83k|      }
  121|       |      
  122|       |      // next we unstuff them before adding them to the buffer
  123|  8.29k|      int bits = 32 - melp->unstuff; // number of bits in val, subtract 1 if
  124|       |                                     // the previously read byte requires 
  125|       |                                     // unstuffing
  126|       |
  127|       |      // data is unstuffed and accumulated in t
  128|       |      // bits has the number of bits in t
  129|  8.29k|      ui32 t = val & 0xFF; 
  130|  8.29k|      bool unstuff = ((val & 0xFF) == 0xFF); // true if we need unstuffing
  131|  8.29k|      bits -= unstuff; // there is one less bit in t if unstuffing is needed
  132|  8.29k|      t = t << (8 - unstuff); // move up to make room for the next byte
  133|       |
  134|       |      //this is a repeat of the above
  135|  8.29k|      t |= (val>>8) & 0xFF;
  136|  8.29k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  137|  8.29k|      bits -= unstuff;
  138|  8.29k|      t = t << (8 - unstuff);
  139|       |
  140|  8.29k|      t |= (val>>16) & 0xFF;
  141|  8.29k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  142|  8.29k|      bits -= unstuff;
  143|  8.29k|      t = t << (8 - unstuff);
  144|       |
  145|  8.29k|      t |= (val>>24) & 0xFF;
  146|  8.29k|      melp->unstuff = (((val >> 24) & 0xFF) == 0xFF);
  147|       |
  148|       |      // move t to tmp, and push the result all the way up, so we read from
  149|       |      // the MSB
  150|  8.29k|      melp->tmp |= ((ui64)t) << (64 - bits - melp->bits);
  151|  8.29k|      melp->bits += bits; //increment the number of bits in tmp
  152|  8.29k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL11rev_fetch64EPNS0_10rev_structE:
  372|   352k|    {
  373|   616k|      while (vlcp->bits <= 56)
  ------------------
  |  Branch (373:14): [True: 263k, False: 352k]
  ------------------
  374|   263k|        rev_read8(vlcp); // read 8 bits, but unstuffing might reduce this
  375|   352k|      return vlcp->tmp;  // return unstuff decoded bits
  376|   352k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL9rev_read8EPNS0_10rev_structE:
  306|   263k|    {
  307|       |      // process 1 bytes
  308|   263k|      ui8 val = 0; // insert 0s at the end -- the standard says that the
  309|       |                   // bitstream must contain all needed bits. Therefore
  310|       |                   // if the whole bitstream is consumed and bits are still
  311|       |                   // needed, then this is an error condition, but we are
  312|       |                   // lenient -- it is also possible that we are decoding
  313|       |                   // more bits than what we are actually need.
  314|   263k|      if (vlcp->size > 0)  // if there are more than 3 bytes left in VLC
  ------------------
  |  Branch (314:11): [True: 82.1k, False: 181k]
  ------------------
  315|  82.1k|      {
  316|  82.1k|        val = *vlcp->data; // then read 8 bits
  317|  82.1k|        --vlcp->data;      // increment data pointer
  318|  82.1k|        --vlcp->size;      // decrement number of bytes in the buffer
  319|  82.1k|      }
  320|       |
  321|       |      // accumulate in tmp, and increment bits, check if unstuffing is needed
  322|   263k|      ui8 t = (vlcp->unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0;
  ------------------
  |  Branch (322:16): [True: 24.4k, False: 239k]
  |  Branch (322:33): [True: 3.32k, False: 21.1k]
  ------------------
  323|   263k|      val = (ui8)(val & (0xFFU >> t)); // protect against erroneous 1 in MSB
  324|   263k|      vlcp->tmp |= (ui64)val << vlcp->bits;
  325|   263k|      vlcp->bits += 8 - t;
  326|   263k|      vlcp->unstuff = val > 0x8F;
  327|   263k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL13rev_advance64EPNS0_10rev_structEj:
  386|  2.11M|    {
  387|       |      assert(num_bits <= vlcp->bits); // vlcp->tmp must have more than num_bits
  388|  2.11M|      vlcp->tmp >>= num_bits;         // remove bits
  389|  2.11M|      vlcp->bits -= num_bits;         // decrement the number of bits
  390|  2.11M|      return vlcp->tmp;
  391|  2.11M|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL12frwd_advanceEPNS0_13frwd_struct64Ej:
  707|   334k|    {
  708|       |      assert(num_bits <= msp->bits);
  709|   334k|      msp->tmp >>= num_bits;  // consume num_bits
  710|   334k|      msp->bits -= num_bits;
  711|   334k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12rev_init_mrpEPNS0_10rev_structEPhii:
  470|  7.26k|    {
  471|  7.26k|      mrp->data = data + lcup + len2 - 1;
  472|  7.26k|      mrp->size = len2;
  473|  7.26k|      mrp->unstuff = true;
  474|  7.26k|      mrp->bits = 0;
  475|  7.26k|      mrp->tmp = 0;
  476|       |
  477|       |      //This code is designed for an architecture that read address should
  478|       |      // align to the read size (address multiple of 4 if read size is 4)
  479|       |      //These few lines take care of the case where data is not at a multiple
  480|       |      // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the MRP stream
  481|  7.26k|      int num = 1 + (int)(intptr_t(mrp->data) & 0x3);
  482|  27.1k|      for (int i = 0; i < num; ++i) {
  ------------------
  |  Branch (482:23): [True: 19.9k, False: 7.26k]
  ------------------
  483|  19.9k|        ui64 d;
  484|       |        //read a byte, 0 if no more data
  485|  19.9k|        d = (mrp->size-- > 0) ? *mrp->data-- : 0; 
  ------------------
  |  Branch (485:13): [True: 18.7k, False: 1.17k]
  ------------------
  486|       |        //check if unstuffing is needed
  487|  19.9k|        ui32 d_bits = 8 - ((mrp->unstuff && ((d & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (487:29): [True: 10.6k, False: 9.21k]
  |  Branch (487:45): [True: 2.26k, False: 8.41k]
  ------------------
  488|  19.9k|        mrp->tmp |= d << mrp->bits; // move data to vlcp->tmp
  489|  19.9k|        mrp->bits += d_bits;
  490|  19.9k|        mrp->unstuff = d > 0x8F; // for next byte
  491|  19.9k|      }
  492|  7.26k|      rev_read_mrp(mrp);
  493|  7.26k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12rev_read_mrpEPNS0_10rev_structE:
  406|  12.3k|    {
  407|       |      //process 4 bytes at a time
  408|  12.3k|      if (mrp->bits > 32)
  ------------------
  |  Branch (408:11): [True: 0, False: 12.3k]
  ------------------
  409|      0|        return;
  410|  12.3k|      ui32 val = 0;
  411|  12.3k|      if (mrp->size > 3) // If there are 3 byte or more
  ------------------
  |  Branch (411:11): [True: 7.53k, False: 4.79k]
  ------------------
  412|  7.53k|      { // (mrp->data - 3) move pointer back to read 32 bits at once
  413|  7.53k|        val = load_le_ui32(mrp->data - 3); // read 32 bits
  414|  7.53k|        mrp->data -= 4;                // move back pointer
  415|  7.53k|        mrp->size -= 4;                // reduce count
  416|  7.53k|      }
  417|  4.79k|      else if (mrp->size > 0)
  ------------------
  |  Branch (417:16): [True: 1.72k, False: 3.06k]
  ------------------
  418|  1.72k|      {
  419|  1.72k|        int i = 24;
  420|  5.18k|        while (mrp->size > 0) {   
  ------------------
  |  Branch (420:16): [True: 3.46k, False: 1.72k]
  ------------------
  421|  3.46k|          ui32 v = *mrp->data--; // read one byte at a time
  422|  3.46k|          val |= (v << i);       // put byte in its correct location
  423|  3.46k|          --mrp->size;
  424|  3.46k|          i -= 8;
  425|  3.46k|        }
  426|  1.72k|      }
  427|       |
  428|       |      //accumulate in tmp, and keep count in bits
  429|  12.3k|      ui32 bits, tmp = val >> 24;
  430|       |
  431|       |      //test if the last byte > 0x8F (unstuff must be true) and this is 0x7F
  432|  12.3k|      bits = 8 - ((mrp->unstuff && (((val >> 24) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (432:20): [True: 5.57k, False: 6.75k]
  |  Branch (432:36): [True: 2.69k, False: 2.88k]
  ------------------
  433|  12.3k|      bool unstuff = (val >> 24) > 0x8F;
  434|       |
  435|       |      //process the next byte
  436|  12.3k|      tmp |= ((val >> 16) & 0xFF) << bits;
  437|  12.3k|      bits += 8 - ((unstuff && (((val >> 16) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (437:21): [True: 4.69k, False: 7.63k]
  |  Branch (437:32): [True: 2.61k, False: 2.08k]
  ------------------
  438|  12.3k|      unstuff = ((val >> 16) & 0xFF) > 0x8F;
  439|       |
  440|  12.3k|      tmp |= ((val >> 8) & 0xFF) << bits;
  441|  12.3k|      bits += 8 - ((unstuff && (((val >> 8) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (441:21): [True: 4.88k, False: 7.44k]
  |  Branch (441:32): [True: 2.72k, False: 2.15k]
  ------------------
  442|  12.3k|      unstuff = ((val >> 8) & 0xFF) > 0x8F;
  443|       |
  444|  12.3k|      tmp |= (val & 0xFF) << bits;
  445|  12.3k|      bits += 8 - ((unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (445:21): [True: 4.27k, False: 8.05k]
  |  Branch (445:32): [True: 2.43k, False: 1.84k]
  ------------------
  446|  12.3k|      unstuff = (val & 0xFF) > 0x8F;
  447|       |
  448|  12.3k|      mrp->tmp |= (ui64)tmp << mrp->bits; // move data to mrp pointer
  449|  12.3k|      mrp->bits += bits;
  450|  12.3k|      mrp->unstuff = unstuff;             // next byte
  451|  12.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL13rev_fetch_mrpEPNS0_10rev_structE:
  504|  41.8k|    {
  505|  41.8k|      if (mrp->bits < 32) // if there are less than 32 bits in mrp->tmp
  ------------------
  |  Branch (505:11): [True: 4.71k, False: 37.1k]
  ------------------
  506|  4.71k|      {
  507|  4.71k|        rev_read_mrp(mrp);    // read 30-32 bits from mrp
  508|  4.71k|        if (mrp->bits < 32)   // if there is a space of 32 bits
  ------------------
  |  Branch (508:13): [True: 344, False: 4.37k]
  ------------------
  509|    344|          rev_read_mrp(mrp);  // read more
  510|  4.71k|      }
  511|  41.8k|      return (ui32)mrp->tmp;  // return the head of mrp->tmp
  512|  41.8k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL15rev_advance_mrpEPNS0_10rev_structEj:
  522|  41.8k|    {
  523|       |      assert(num_bits <= mrp->bits); // we must not consume more than mrp->bits
  524|  41.8k|      mrp->tmp >>= num_bits;  // discard the lowest num_bits bits
  525|  41.8k|      mrp->bits -= num_bits;
  526|  41.8k|      return (ui32)mrp->tmp;  // return data after consumption
  527|  41.8k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_init8ILh255EEEvPNS0_13frwd_struct64EPKhi:
  690|  16.8k|    {
  691|  16.8k|      msp->data = data;
  692|  16.8k|      msp->tmp = 0;
  693|  16.8k|      msp->bits = 0;
  694|  16.8k|      msp->unstuff = 0;
  695|  16.8k|      msp->size = size;
  696|  16.8k|      frwd_read8<X>(msp); // read 8 bits
  697|  16.8k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_read8ILh255EEEvPNS0_13frwd_struct64E:
  626|   211k|    {
  627|   211k|      ui8 val = X;
  628|   211k|      if (msp->size > 0) {
  ------------------
  |  Branch (628:11): [True: 89.9k, False: 121k]
  ------------------
  629|  89.9k|        val = *msp->data;  // read 8 bits
  630|  89.9k|        ++msp->data;      // increment pointer
  631|  89.9k|        --msp->size;      // reduce size
  632|  89.9k|      }
  633|       |
  634|       |      // unstuff and accumulate
  635|   211k|      ui8 t = msp->unstuff ? 1 : 0;
  ------------------
  |  Branch (635:15): [True: 67.2k, False: 144k]
  ------------------
  636|   211k|      val = (ui8)(val & (0xFFU >> t));
  637|   211k|      msp->unstuff = (val == 0xFF);
  638|   211k|      msp->tmp |= ((ui64)val) << msp->bits;  // move data to msp->tmp
  639|   211k|      msp->bits += 8 - t;
  640|   211k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12frwd_fetch64ILh255EEEmPNS0_13frwd_struct64E:
  743|   261k|    {
  744|   456k|      while (msp->bits <= 56)
  ------------------
  |  Branch (744:14): [True: 194k, False: 261k]
  ------------------
  745|   194k|        frwd_read8<X>(msp);
  746|   261k|      return msp->tmp;
  747|   261k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL9frwd_initILi0EEEvPNS0_13frwd_struct64EPKhi:
  654|  10.4k|    {
  655|  10.4k|      msp->data = data;
  656|  10.4k|      msp->tmp = 0;
  657|  10.4k|      msp->bits = 0;
  658|  10.4k|      msp->unstuff = 0;
  659|  10.4k|      msp->size = size;
  660|       |
  661|       |      //This code is designed for an architecture that read address should
  662|       |      // align to the read size (address multiple of 4 if read size is 4)
  663|       |      //These few lines take care of the case where data is not at a multiple
  664|       |      // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the bitstream
  665|  10.4k|      int num = 4 - (int)(intptr_t(msp->data) & 0x3);
  666|  36.3k|      for (int i = 0; i < num; ++i)
  ------------------
  |  Branch (666:23): [True: 25.9k, False: 10.4k]
  ------------------
  667|  25.9k|      {
  668|  25.9k|        ui64 d;
  669|       |        //read a byte if the buffer is not exhausted, otherwise set it to X
  670|  25.9k|        d = msp->size-- > 0 ? *msp->data++ : X;
  ------------------
  |  Branch (670:13): [True: 23.7k, False: 2.22k]
  ------------------
  671|  25.9k|        msp->tmp |= (d << msp->bits);      // store data in msp->tmp
  672|  25.9k|        msp->bits += 8 - msp->unstuff;     // number of bits added to msp->tmp
  673|  25.9k|        msp->unstuff = ((d & 0xFF) == 0xFF); // unstuffing for next byte
  674|  25.9k|      }
  675|  10.4k|      frwd_read<X>(msp); // read 32 bits more
  676|  10.4k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL9frwd_readILi0EEEvPNS0_13frwd_struct64E:
  562|  29.5k|    {
  563|  29.5k|      assert(msp->bits <= 32); // assert that there is a space for 32 bits
  564|       |
  565|  29.5k|      ui32 val = 0;
  566|  29.5k|      if (msp->size > 3) {
  ------------------
  |  Branch (566:11): [True: 16.3k, False: 13.1k]
  ------------------
  567|  16.3k|        val = load_le_ui32(msp->data); // read 32 bits
  568|  16.3k|        msp->data += 4;           // increment pointer
  569|  16.3k|        msp->size -= 4;           // reduce size
  570|  16.3k|      }
  571|  13.1k|      else if (msp->size > 0)
  ------------------
  |  Branch (571:16): [True: 3.98k, False: 9.14k]
  ------------------
  572|  3.98k|      {
  573|  3.98k|        int i = 0;
  574|  3.98k|        val = X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (574:15): [Folded, False: 3.98k]
  ------------------
  575|  12.1k|        while (msp->size > 0) {   
  ------------------
  |  Branch (575:16): [True: 8.14k, False: 3.98k]
  ------------------
  576|  8.14k|          ui32 v = *msp->data++;    // read one byte at a time
  577|  8.14k|          ui32 m = ~(0xFFu << i);    // mask of location
  578|  8.14k|          val = (val & m) | (v << i);// put one byte in its correct location
  579|  8.14k|          --msp->size;
  580|  8.14k|          i += 8;          
  581|  8.14k|        }
  582|  3.98k|      }
  583|  9.14k|      else
  584|  9.14k|        val = X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (584:15): [Folded, False: 9.14k]
  ------------------
  585|       |
  586|       |      // we accumulate in t and keep a count of the number of bits in bits
  587|  29.5k|      ui32 bits = 8 - msp->unstuff;        
  588|  29.5k|      ui32 t = val & 0xFF;
  589|  29.5k|      bool unstuff = ((val & 0xFF) == 0xFF);  // Do we need unstuffing next?
  590|       |
  591|  29.5k|      t |= ((val >> 8) & 0xFF) << bits;
  592|  29.5k|      bits += 8 - unstuff;
  593|  29.5k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  594|       |
  595|  29.5k|      t |= ((val >> 16) & 0xFF) << bits;
  596|  29.5k|      bits += 8 - unstuff;
  597|  29.5k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  598|       |
  599|  29.5k|      t |= ((val >> 24) & 0xFF) << bits;
  600|  29.5k|      bits += 8 - unstuff;
  601|  29.5k|      msp->unstuff = (((val >> 24) & 0xFF) == 0xFF); // for next byte
  602|       |
  603|  29.5k|      msp->tmp |= ((ui64)t) << msp->bits;  // move data to msp->tmp
  604|  29.5k|      msp->bits += bits;
  605|  29.5k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_fetchILi0EEEjPNS0_13frwd_struct64E:
  723|  72.6k|    {
  724|  72.6k|      if (msp->bits < 32)
  ------------------
  |  Branch (724:11): [True: 18.4k, False: 54.2k]
  ------------------
  725|  18.4k|      {
  726|  18.4k|        frwd_read<X>(msp);
  727|  18.4k|        if (msp->bits < 32) //need to test
  ------------------
  |  Branch (727:13): [True: 632, False: 17.8k]
  ------------------
  728|    632|          frwd_read<X>(msp);
  729|  18.4k|      }
  730|  72.6k|      return (ui32)msp->tmp;
  731|  72.6k|    }

_ZN4ojph5local26ojph_decode_codeblock_avx2EPhPjjjjjjjjb:
 1824|  42.3k|    {
 1825|  42.3k|      static bool insufficient_precision = false;
 1826|  42.3k|      static bool modify_code = false;
 1827|  42.3k|      static bool truncate_spp_mrp = false;
 1828|       |
 1829|  42.3k|      if (num_passes > 1 && lengths2 == 0)
  ------------------
  |  Branch (1829:11): [True: 30.0k, False: 12.2k]
  |  Branch (1829:29): [True: 6.21k, False: 23.8k]
  ------------------
 1830|  6.21k|      {
 1831|  6.21k|        OJPH_WARN(0x00010001, "A malformed codeblock that has more than "
  ------------------
  |  |  287|  6.21k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  6.21k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1832|  6.21k|                              "one coding pass, but zero length for "
 1833|  6.21k|                              "2nd and potential 3rd pass.");
 1834|  6.21k|        num_passes = 1;
 1835|  6.21k|      }
 1836|       |
 1837|  42.3k|      if (num_passes > 3)
  ------------------
  |  Branch (1837:11): [True: 0, False: 42.3k]
  ------------------
 1838|      0|      {
 1839|      0|        OJPH_WARN(0x00010002, "We do not support more than 3 coding passes; "
  ------------------
  |  |  287|      0|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1840|      0|                              "This codeblocks has %d passes.",
 1841|      0|                              num_passes);
 1842|      0|        return false;
 1843|      0|      }
 1844|       |
 1845|  42.3k|      if (missing_msbs > 30) // p < 0
  ------------------
  |  Branch (1845:11): [True: 301, False: 42.0k]
  ------------------
 1846|    301|      {
 1847|    301|        if (insufficient_precision == false)
  ------------------
  |  Branch (1847:13): [True: 1, False: 300]
  ------------------
 1848|      1|        {
 1849|      1|          insufficient_precision = true;
 1850|      1|          OJPH_WARN(0x00010003, "32 bits are not enough to decode this "
  ------------------
  |  |  287|      1|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1851|      1|                                "codeblock. This message will not be "
 1852|      1|                                "displayed again.");
 1853|      1|        }
 1854|    301|        return false;
 1855|    301|      }
 1856|  42.0k|      else if (missing_msbs == 30) // p == 0
  ------------------
  |  Branch (1856:16): [True: 202, False: 41.8k]
  ------------------
 1857|    202|      { // not enough precision to decode and set the bin center to 1
 1858|    202|        if (modify_code == false) {
  ------------------
  |  Branch (1858:13): [True: 1, False: 201]
  ------------------
 1859|      1|          modify_code = true;
 1860|      1|          OJPH_WARN(0x00010004, "Not enough precision to decode the cleanup "
  ------------------
  |  |  287|      1|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1861|      1|                                "pass. The code can be modified to support "
 1862|      1|                                "this case. This message will not be "
 1863|      1|                                "displayed again.");
 1864|      1|        }
 1865|    202|         return false;         // 32 bits are not enough to decode this
 1866|    202|       }
 1867|  41.8k|      else if (missing_msbs == 29) // if p is 1, then num_passes must be 1
  ------------------
  |  Branch (1867:16): [True: 1.08k, False: 40.7k]
  ------------------
 1868|  1.08k|      {
 1869|  1.08k|        if (num_passes > 1) {
  ------------------
  |  Branch (1869:13): [True: 392, False: 696]
  ------------------
 1870|    392|          num_passes = 1;
 1871|    392|          if (truncate_spp_mrp == false) {
  ------------------
  |  Branch (1871:15): [True: 1, False: 391]
  ------------------
 1872|      1|            truncate_spp_mrp = true;
 1873|      1|            OJPH_WARN(0x00010005, "Not enough precision to decode the SgnProp "
  ------------------
  |  |  287|      1|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1874|      1|                                  "nor MagRef passes; both will be skipped. "
 1875|      1|                                  "This message will not be displayed "
 1876|      1|                                  "again.");
 1877|      1|          }
 1878|    392|        }
 1879|  1.08k|      }
 1880|  41.8k|      ui32 p = 30 - missing_msbs; // The least significant bitplane for CUP
 1881|       |      // There is a way to handle the case of p == 0, but a different path
 1882|       |      // is required
 1883|       |
 1884|  41.8k|      if (lengths1 < 2)
  ------------------
  |  Branch (1884:11): [True: 0, False: 41.8k]
  ------------------
 1885|      0|      {
 1886|      0|        OJPH_WARN(0x00010006, "Wrong codeblock length.");
  ------------------
  |  |  287|      0|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1887|      0|        return false;
 1888|      0|      }
 1889|       |
 1890|       |      // read scup and fix the bytes there
 1891|  41.8k|      int lcup, scup;
 1892|  41.8k|      lcup = (int)lengths1;  // length of CUP
 1893|       |      //scup is the length of MEL + VLC
 1894|  41.8k|      scup = (((int)coded_data[lcup-1]) << 4) + (coded_data[lcup-2] & 0xF);
 1895|  41.8k|      if (scup < 2 || scup > lcup || scup > 4079) //something is wrong
  ------------------
  |  Branch (1895:11): [True: 1.93k, False: 39.8k]
  |  Branch (1895:23): [True: 10.8k, False: 29.0k]
  |  Branch (1895:38): [True: 215, False: 28.7k]
  ------------------
 1896|  13.0k|        return false;
 1897|       |
 1898|       |      // The temporary storage scratch holds two types of data in an
 1899|       |      // interleaved fashion. The interleaving allows us to use one
 1900|       |      // memory pointer.
 1901|       |      // We have one entry for a decoded VLC code, and one entry for UVLC.
 1902|       |      // Entries are 16 bits each, corresponding to one quad,
 1903|       |      // but since we want to use XMM registers of the SSE family
 1904|       |      // of SIMD; we allocated 16 bytes or more per quad row; that is,
 1905|       |      // the width is no smaller than 16 bytes (or 8 entries), and the
 1906|       |      // height is 512 quads
 1907|       |      // Each VLC entry contains, in the following order, starting
 1908|       |      // from MSB
 1909|       |      // e_k (4bits), e_1 (4bits), rho (4bits), useless for step 2 (4bits)
 1910|       |      // Each entry in UVLC contains u_q
 1911|       |      // One extra row to handle the case of SPP propagating downwards
 1912|       |      // when codeblock width is 4
 1913|       |      // We need an extra two entries (one inf and one u_q) beyond
 1914|       |      // the last column.
 1915|       |      // If the block width is 4 (2 quads), then we use sstr of 8
 1916|       |      // (enough for 4 quads). If width is 8 (4 quads) we use
 1917|       |      // sstr is 16 (enough for 8 quads). For a width of 16 (8
 1918|       |      // quads), we use 24 (enough for 12 quads).
 1919|  28.7k|      ui32 sstr = ((width + 2u) + 7u) & ~7u; // multiples of 8
 1920|       |
 1921|       |#ifdef __MINGW64__
 1922|       |      ui16 scratch[8 * 513] = {0};
 1923|       |#else
 1924|  28.7k|      ui16 scratch[8 * 513];
 1925|  28.7k|      ui32 quad_rows = (height + 1u) >> 1;
 1926|  28.7k|      size_t scratch_zero = (size_t)(quad_rows + 1) * sstr;
 1927|  28.7k|      if (scratch_zero > 8 * 513) scratch_zero = 8 * 513;
  ------------------
  |  Branch (1927:11): [True: 0, False: 28.7k]
  ------------------
 1928|  28.7k|      memset(scratch, 0, scratch_zero * sizeof(ui16));
 1929|  28.7k|#endif
 1930|       |
 1931|  28.7k|      assert((stride & 0x3) == 0);
 1932|       |
 1933|  28.7k|      ui32 mmsbp2 = missing_msbs + 2;
 1934|       |
 1935|       |      // The cleanup pass is decoded in two steps; in step one,
 1936|       |      // the VLC and MEL segments are decoded, generating a record that
 1937|       |      // has 2 bytes per quad. The 2 bytes contain, u, rho, e^1 & e^k.
 1938|       |      // This information should be sufficient for the next step.
 1939|       |      // In step 2, we decode the MagSgn segment.
 1940|       |
 1941|       |      // step 1: decode VLC and MEL segments into scratch
 1942|  28.7k|      decode_cb_step1_vlc(scratch, coded_data, lcup, scup, width, height, sstr);
 1943|       |
 1944|       |      // step2 we decode magsgn
 1945|       |      // mmsbp2 equals K_max + 1 (we decode up to K_max bits + 1 sign bit)
 1946|       |      // The 32 bit path decode 16 bits data, for which one would think
 1947|       |      // 16 bits are enough, because we want to put in the center of the
 1948|       |      // bin.
 1949|       |      // If you have mmsbp2 equals 16 bit, and reversible coding, and
 1950|       |      // no bitplanes are missing, then we can decoding using the 16 bit
 1951|       |      // path, but we are not doing this here.
 1952|  28.7k|      if (mmsbp2 >= 16)
  ------------------
  |  Branch (1952:11): [True: 3.13k, False: 25.6k]
  ------------------
 1953|  3.13k|      {
 1954|  3.13k|        if (!decode_cb_step2_32bit(scratch, decoded_data, coded_data,
  ------------------
  |  Branch (1954:13): [True: 719, False: 2.41k]
  ------------------
 1955|  3.13k|                                   width, height, stride, sstr, p, mmsbp2,
 1956|  3.13k|                                   lcup, scup))
 1957|    719|          return false;
 1958|  3.13k|      }
 1959|  25.6k|      else {
 1960|  25.6k|        if (!decode_cb_step2_16bit(scratch, decoded_data, coded_data,
  ------------------
  |  Branch (1960:13): [True: 9.82k, False: 15.8k]
  ------------------
 1961|  25.6k|                                   width, height, stride, sstr, p, mmsbp2,
 1962|  25.6k|                                   lcup, scup))
 1963|  9.82k|          return false;
 1964|  25.6k|      }
 1965|       |
 1966|  18.2k|      if (num_passes > 1)
  ------------------
  |  Branch (1966:11): [True: 14.6k, False: 3.57k]
  ------------------
 1967|  14.6k|        decode_cb_spp_mrp(scratch, decoded_data, coded_data, width, height,
 1968|  14.6k|                          stride, sstr, p, num_passes, lengths1, lengths2,
 1969|  14.6k|                          stripe_causal);
 1970|       |
 1971|  18.2k|      return true;
 1972|  28.7k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL19decode_cb_step1_vlcEPtPhiijjj:
 1571|  28.7k|    {
 1572|       |        // init structures
 1573|  28.7k|        dec_mel_st mel;
 1574|  28.7k|        mel_init(&mel, coded_data, lcup, scup);
 1575|       |
 1576|       |        // de-stuff the VLC segment; its size is at most scup - 1 < 4095
 1577|       |        // bytes (scup is a 12-bit value), and consumption per quad pair is
 1578|       |        // at most 7 + 7 + 30 bits, so 4096 bytes always suffice
 1579|  28.7k|        const ui32 vlc_cap = 4096;
 1580|  28.7k|        ui8 vlc_buf[vlc_cap + 72];
 1581|  28.7k|        ui32 vlc_limit = destuff_vlc(coded_data, lcup, scup,
 1582|  28.7k|                                     vlc_buf, vlc_cap);
 1583|  28.7k|        ui32 vlc_off = 0;
 1584|  28.7k|        ui32 vlc_bits = 0;
 1585|       |
 1586|  28.7k|        int run = mel_get_run(&mel); // decode runs of events from MEL bitstrm
 1587|       |                                     // data represented as runs of 0 events
 1588|       |                                     // See mel_decode description
 1589|       |
 1590|  28.7k|        ui64 vlc_val = 0;
 1591|  28.7k|        ui32 c_q = 0;
 1592|  28.7k|        ui16 *sp = scratch;
 1593|       |        //initial quad row
 1594|   129k|        for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1594:26): [True: 100k, False: 28.7k]
  ------------------
 1595|   100k|        {
 1596|       |          // decode VLC
 1597|       |          /////////////
 1598|       |
 1599|       |          // first quad
 1600|   100k|          drefill(vlc_val, vlc_bits, vlc_off, vlc_buf, vlc_limit);
 1601|       |
 1602|       |          //decode VLC using the context c_q and the head of VLC bitstream
 1603|   100k|          ui16 t0 = vlc_tbl0[ c_q + (vlc_val & 0x7F) ];
 1604|       |
 1605|       |          // if context is zero, use one MEL event
 1606|   100k|          if (c_q == 0) //zero context
  ------------------
  |  Branch (1606:15): [True: 60.4k, False: 39.8k]
  ------------------
 1607|  60.4k|          {
 1608|  60.4k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1609|       |
 1610|       |            // Is the run terminated in 1? if so, use decoded VLC code,
 1611|       |            // otherwise, discard decoded data, since we will decoded again
 1612|       |            // using a different context
 1613|  60.4k|            t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1613:18): [True: 36.2k, False: 24.1k]
  ------------------
 1614|       |
 1615|       |            // is run -1 or -2? this means a run has been consumed
 1616|  60.4k|            if (run < 0)
  ------------------
  |  Branch (1616:17): [True: 53.6k, False: 6.82k]
  ------------------
 1617|  53.6k|              run = mel_get_run(&mel);  // get another run
 1618|  60.4k|          }
 1619|       |          //run -= (c_q == 0) ? 2 : 0;
 1620|       |          //t0 = (c_q != 0 || run == -1) ? t0 : 0;
 1621|       |          //if (run < 0)
 1622|       |          //  run = mel_get_run(&mel);  // get another run
 1623|   100k|          sp[0] = t0;
 1624|   100k|          x += 2;
 1625|       |
 1626|       |          // prepare context for the next quad; eqn. 1 in ITU T.814
 1627|   100k|          c_q = ((t0 & 0x10U) << 3) | ((t0 & 0xE0U) << 2);
 1628|       |
 1629|       |          //remove data from vlc stream (0 bits are removed if vlc is not used)
 1630|   100k|          dconsume(vlc_val, vlc_bits, t0 & 0x7u);
 1631|       |
 1632|       |          //second quad
 1633|   100k|          ui16 t1 = 0;
 1634|       |
 1635|       |          //decode VLC using the context c_q and the head of VLC bitstream
 1636|   100k|          t1 = vlc_tbl0[c_q + (vlc_val & 0x7F)];
 1637|       |
 1638|       |          // if context is zero, use one MEL event
 1639|   100k|          if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1639:15): [True: 36.7k, False: 63.5k]
  |  Branch (1639:27): [True: 31.9k, False: 4.72k]
  ------------------
 1640|  31.9k|          {
 1641|  31.9k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1642|       |
 1643|       |            // if event is 0, discard decoded t1
 1644|  31.9k|            t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1644:18): [True: 13.7k, False: 18.2k]
  ------------------
 1645|       |
 1646|  31.9k|            if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1646:17): [True: 19.3k, False: 12.6k]
  ------------------
 1647|  19.3k|              run = mel_get_run(&mel); // if yes, then get another run
 1648|  31.9k|          }
 1649|   100k|          t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1649:16): [True: 81.9k, False: 18.3k]
  ------------------
 1650|       |          //run -= (c_q == 0 && x < width) ? 2 : 0;
 1651|       |          //t1 = (c_q != 0 || run == -1) ? t1 : 0;
 1652|       |          //if (run < 0)
 1653|       |          //  run = mel_get_run(&mel);  // get another run
 1654|   100k|          sp[2] = t1;
 1655|   100k|          x += 2;
 1656|       |
 1657|       |          //prepare context for the next quad, eqn. 1 in ITU T.814
 1658|   100k|          c_q = ((t1 & 0x10U) << 3) | ((t1 & 0xE0U) << 2);
 1659|       |
 1660|       |          //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1661|   100k|          dconsume(vlc_val, vlc_bits, t1 & 0x7u);
 1662|       |
 1663|       |          // decode u
 1664|       |          /////////////
 1665|       |          // uvlc_mode is made up of u_offset bits from the quad pair
 1666|   100k|          ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1667|   100k|          if (uvlc_mode == 0xc0)// if both u_offset are set, get an event from
  ------------------
  |  Branch (1667:15): [True: 22.4k, False: 77.8k]
  ------------------
 1668|  22.4k|          {                     // the MEL run of events
 1669|  22.4k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1670|       |
 1671|  22.4k|            uvlc_mode += (run == -1) ? 0x40 : 0; // increment uvlc_mode by
  ------------------
  |  Branch (1671:26): [True: 10.0k, False: 12.4k]
  ------------------
 1672|       |                                                 // is 0x40
 1673|       |
 1674|  22.4k|            if (run < 0)//if run is consumed (run is -1 or -2), get another run
  ------------------
  |  Branch (1674:17): [True: 17.3k, False: 5.06k]
  ------------------
 1675|  17.3k|              run = mel_get_run(&mel);
 1676|  22.4k|          }
 1677|       |          //run -= (uvlc_mode == 0xc0) ? 2 : 0;
 1678|       |          //uvlc_mode += (uvlc_mode == 0xc0 && run == -1) ? 0x40 : 0;
 1679|       |          //if (run < 0)
 1680|       |          //  run = mel_get_run(&mel);  // get another run
 1681|       |
 1682|       |          //decode uvlc_mode to get u for both quads
 1683|   100k|          ui32 uvlc_entry = uvlc_tbl0[uvlc_mode + (vlc_val & 0x3F)];
 1684|       |          //remove total prefix length
 1685|   100k|          dconsume(vlc_val, vlc_bits, uvlc_entry & 0x7u);
 1686|   100k|          uvlc_entry >>= 3;
 1687|       |          //extract suffixes for quad 0 and 1
 1688|   100k|          ui32 len = uvlc_entry & 0xF;           //suffix length for 2 quads
 1689|   100k|          ui32 tmp = (ui32)vlc_val & ((1u << len) - 1); //suffix value, 2 quads
 1690|   100k|          dconsume(vlc_val, vlc_bits, len);
 1691|   100k|          uvlc_entry >>= 4;
 1692|       |          // quad 0 length
 1693|   100k|          len = uvlc_entry & 0x7; // quad 0 suffix length
 1694|   100k|          uvlc_entry >>= 3;
 1695|   100k|          ui16 u_q = (ui16)(1 + (uvlc_entry&7) + (tmp&~(0xFFU<<len))); //kap. 1
 1696|   100k|          sp[1] = u_q;
 1697|   100k|          u_q = (ui16)(1 + (uvlc_entry >> 3) + (tmp >> len));  //kappa == 1
 1698|   100k|          sp[3] = u_q;
 1699|   100k|        }
 1700|  28.7k|        sp[0] = sp[1] = 0;
 1701|       |
 1702|       |        //non initial quad rows
 1703|   319k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1703:26): [True: 290k, False: 28.7k]
  ------------------
 1704|   290k|        {
 1705|   290k|          c_q = 0;                                // context
 1706|   290k|          ui16 *sp = scratch + (y >> 1) * sstr;   // this row of quads
 1707|       |
 1708|   803k|          for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1708:28): [True: 512k, False: 290k]
  ------------------
 1709|   512k|          {
 1710|       |            // decode VLC
 1711|       |            /////////////
 1712|       |
 1713|       |            // sigma_q (n, ne, nf)
 1714|   512k|            c_q |= ((sp[0 - (si32)sstr] & 0xA0U) << 2);
 1715|   512k|            c_q |= ((sp[2 - (si32)sstr] & 0x20U) << 4);
 1716|       |
 1717|       |            // first quad
 1718|   512k|            drefill(vlc_val, vlc_bits, vlc_off, vlc_buf, vlc_limit);
 1719|       |
 1720|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1721|   512k|            ui16 t0 = vlc_tbl1[ c_q + (vlc_val & 0x7F) ];
 1722|       |
 1723|       |            // if context is zero, use one MEL event
 1724|   512k|            if (c_q == 0) //zero context
  ------------------
  |  Branch (1724:17): [True: 443k, False: 68.7k]
  ------------------
 1725|   443k|            {
 1726|   443k|              run -= 2; //subtract 2, since events number is multiplied by 2
 1727|       |
 1728|       |              // Is the run terminated in 1? if so, use decoded VLC code,
 1729|       |              // otherwise, discard decoded data, since we will decoded again
 1730|       |              // using a different context
 1731|   443k|              t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1731:20): [True: 134k, False: 309k]
  ------------------
 1732|       |
 1733|       |              // is run -1 or -2? this means a run has been consumed
 1734|   443k|              if (run < 0)
  ------------------
  |  Branch (1734:19): [True: 249k, False: 193k]
  ------------------
 1735|   249k|                run = mel_get_run(&mel);  // get another run
 1736|   443k|            }
 1737|       |            //run -= (c_q == 0) ? 2 : 0;
 1738|       |            //t0 = (c_q != 0 || run == -1) ? t0 : 0;
 1739|       |            //if (run < 0)
 1740|       |            //  run = mel_get_run(&mel);  // get another run
 1741|   512k|            sp[0] = t0;
 1742|   512k|            x += 2;
 1743|       |
 1744|       |            // prepare context for the next quad; eqn. 2 in ITU T.814
 1745|       |            // sigma_q (w, sw)
 1746|   512k|            c_q = ((t0 & 0x40U) << 2) | ((t0 & 0x80U) << 1);
 1747|       |            // sigma_q (nw)
 1748|   512k|            c_q |= sp[0 - (si32)sstr] & 0x80;
 1749|       |            // sigma_q (n, ne, nf)
 1750|   512k|            c_q |= ((sp[2 - (si32)sstr] & 0xA0U) << 2);
 1751|   512k|            c_q |= ((sp[4 - (si32)sstr] & 0x20U) << 4);
 1752|       |
 1753|       |            //remove data from vlc stream (0 bits are removed if vlc is unused)
 1754|   512k|            dconsume(vlc_val, vlc_bits, t0 & 0x7u);
 1755|       |
 1756|       |            //second quad
 1757|   512k|            ui16 t1 = 0;
 1758|       |
 1759|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1760|   512k|            t1 = vlc_tbl1[ c_q + (vlc_val & 0x7F)];
 1761|       |
 1762|       |            // if context is zero, use one MEL event
 1763|   512k|            if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1763:17): [True: 438k, False: 74.1k]
  |  Branch (1763:29): [True: 269k, False: 168k]
  ------------------
 1764|   269k|            {
 1765|   269k|              run -= 2; //subtract 2, since events number if multiplied by 2
 1766|       |
 1767|       |              // if event is 0, discard decoded t1
 1768|   269k|              t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1768:20): [True: 72.6k, False: 196k]
  ------------------
 1769|       |
 1770|   269k|              if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1770:19): [True: 123k, False: 145k]
  ------------------
 1771|   123k|                run = mel_get_run(&mel); // if yes, then get another run
 1772|   269k|            }
 1773|   512k|            t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1773:18): [True: 320k, False: 192k]
  ------------------
 1774|       |            //run -= (c_q == 0 && x < width) ? 2 : 0;
 1775|       |            //t1 = (c_q != 0 || run == -1) ? t1 : 0;
 1776|       |            //if (run < 0)
 1777|       |            //  run = mel_get_run(&mel);  // get another run
 1778|   512k|            sp[2] = t1;
 1779|   512k|            x += 2;
 1780|       |
 1781|       |            // partial c_q, will be completed when we process the next quad
 1782|       |            // sigma_q (w, sw)
 1783|   512k|            c_q = ((t1 & 0x40U) << 2) | ((t1 & 0x80U) << 1);
 1784|       |            // sigma_q (nw)
 1785|   512k|            c_q |= sp[2 - (si32)sstr] & 0x80;
 1786|       |
 1787|       |            //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1788|   512k|            dconsume(vlc_val, vlc_bits, t1 & 0x7u);
 1789|       |
 1790|       |            // decode u using wide UVLC table
 1791|       |            /////////////
 1792|   512k|            ui32 uvlc_mode = (((t0 >> 3) & 1u) | (((t1 >> 3) & 1u) << 1));
 1793|   512k|            ui32 uvlc_entry =
 1794|   512k|              uvlc_tbl1_wide[(uvlc_mode << 10) | (vlc_val & 0x3FF)];
 1795|   512k|            ui32 total_bits = uvlc_entry & 0x1F;
 1796|   512k|            if (total_bits < 0x1F) {
  ------------------
  |  Branch (1796:17): [True: 511k, False: 902]
  ------------------
 1797|   511k|              sp[1] = (ui16)((uvlc_entry >> 5) & 0xFF);
 1798|   511k|              sp[3] = (ui16)((uvlc_entry >> 13) & 0xFF);
 1799|   511k|              dconsume(vlc_val, vlc_bits, total_bits);
 1800|   511k|            } else {
 1801|    902|              uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1802|    902|              uvlc_entry = uvlc_tbl1[uvlc_mode + (vlc_val & 0x3F)];
 1803|    902|              dconsume(vlc_val, vlc_bits, uvlc_entry & 0x7u);
 1804|    902|              uvlc_entry >>= 3;
 1805|    902|              ui32 len = uvlc_entry & 0xF;
 1806|    902|              ui32 tmp = (ui32)vlc_val & ((1u << len) - 1);
 1807|    902|              dconsume(vlc_val, vlc_bits, len);
 1808|    902|              uvlc_entry >>= 4;
 1809|    902|              len = uvlc_entry & 0x7;
 1810|    902|              uvlc_entry >>= 3;
 1811|    902|              sp[1] = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
 1812|    902|              sp[3] = (ui16)((uvlc_entry >> 3) + (tmp >> len));
 1813|    902|            }
 1814|   512k|          }
 1815|   290k|          sp[0] = sp[1] = 0;
 1816|   290k|        }
 1817|  28.7k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8mel_initEPNS0_10dec_mel_stEPhii:
  226|  28.7k|    {
  227|  28.7k|      melp->data = bbuf + lcup - scup; // move the pointer to the start of MEL
  228|  28.7k|      melp->bits = 0;                  // 0 bits in tmp
  229|  28.7k|      melp->tmp = 0;                   //
  230|  28.7k|      melp->unstuff = false;           // no unstuffing
  231|  28.7k|      melp->size = scup - 1;           // size is the length of MEL+VLC-1
  232|  28.7k|      melp->k = 0;                     // 0 for state
  233|  28.7k|      melp->num_runs = 0;              // num_runs is 0
  234|  28.7k|      melp->runs = 0;                  //
  235|       |
  236|       |      //This code is borrowed; original is for a different architecture
  237|       |      //These few lines take care of the case where data is not at a multiple
  238|       |      // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the MEL segment
  239|  28.7k|      int num = 4 - (int)(intptr_t(melp->data) & 0x3);
  240|   103k|      for (int i = 0; i < num; ++i) { // this code is similar to mel_read
  ------------------
  |  Branch (240:23): [True: 74.2k, False: 28.7k]
  ------------------
  241|  74.2k|        assert(melp->unstuff == false || melp->data[0] <= 0x8F);
  242|  74.2k|        ui64 d = (melp->size > 0) ? *melp->data : 0xFF;//if buffer is consumed
  ------------------
  |  Branch (242:18): [True: 65.8k, False: 8.36k]
  ------------------
  243|       |                                                       //set data to 0xFF
  244|  74.2k|        if (melp->size == 1) d |= 0xF; //if this is MEL+VLC-1, set LSBs to 0xF
  ------------------
  |  Branch (244:13): [True: 13.4k, False: 60.8k]
  ------------------
  245|       |                                       // see the standard
  246|  74.2k|        melp->data += melp->size-- > 0; //increment if the end is not reached
  247|  74.2k|        int d_bits = 8 - melp->unstuff; //if unstuffing is needed, reduce by 1
  248|  74.2k|        melp->tmp = (melp->tmp << d_bits) | d; //store bits in tmp
  249|  74.2k|        melp->bits += d_bits;  //increment tmp by number of bits
  250|  74.2k|        melp->unstuff = ((d & 0xFF) == 0xFF); //true of next byte needs
  251|       |                                              //unstuffing
  252|  74.2k|      }
  253|  28.7k|      melp->tmp <<= (64 - melp->bits); //push all the way up so the first bit
  254|       |                                       // is the MSB
  255|  28.7k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11destuff_vlcEPKhiiPhj:
  588|  28.7k|    {
  589|  28.7k|      const ui8* p = data + lcup - 2;
  590|  28.7k|      ui32 d = *p; // first byte, only the upper 4 bits are used
  591|  28.7k|      ui64 acc = d >> 4;
  592|  28.7k|      ui32 nb = 4 - ((acc & 7) == 7); // check standard
  593|  28.7k|      bool unstuff = (d | 0xF) > 0x8F;
  594|  28.7k|      return destuff_rev(p - 1, scup - 2, unstuff, acc, nb, dst, cap);
  595|  28.7k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11destuff_revEPKhibmjPhj:
  488|  38.9k|    {
  489|  38.9k|      ui8* o = dst;
  490|  38.9k|      ui8* o_end = dst + cap;
  491|       |
  492|       |      // process the first byte with the caller-provided unstuff state;
  493|       |      // afterwards the state is implied by the byte at p[1], which the
  494|       |      // fast path checks vectorially (and which stays inside the segment)
  495|  38.9k|      if (size > 0 && o < o_end)
  ------------------
  |  Branch (495:11): [True: 34.9k, False: 4.05k]
  |  Branch (495:23): [True: 34.9k, False: 0]
  ------------------
  496|  34.9k|      {
  497|  34.9k|        ui32 d = *p--;
  498|  34.9k|        --size;
  499|  34.9k|        acc |= (ui64)d << nb;
  500|  34.9k|        nb += 8 - ((unstuff && ((d & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (500:21): [True: 23.5k, False: 11.3k]
  |  Branch (500:32): [True: 2.02k, False: 21.5k]
  ------------------
  501|  34.9k|        unstuff = d > 0x8F;
  502|  34.9k|        if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (502:13): [True: 33.2k, False: 1.68k]
  ------------------
  503|  34.9k|      }
  504|       |
  505|       |      // fast path; 16 source bytes at a time when none needs unstuffing
  506|   114k|      while (size >= 16 && o + 24 <= o_end)
  ------------------
  |  Branch (506:14): [True: 75.9k, False: 38.7k]
  |  Branch (506:28): [True: 75.6k, False: 246]
  ------------------
  507|  75.6k|      {
  508|  75.6k|        __m128i v = _mm_loadu_si128((const __m128i*)(p - 15));
  509|  75.6k|        __m128i nx = _mm_loadu_si128((const __m128i*)(p - 14));
  510|  75.6k|        __m128i is7f = _mm_cmpeq_epi8(
  511|  75.6k|            _mm_and_si128(v, _mm_set1_epi8(0x7F)), _mm_set1_epi8(0x7F));
  512|       |        // le8f is 0xFF where the byte after (in memory) is <= 0x8F
  513|  75.6k|        __m128i le8f = _mm_cmpeq_epi8(
  514|  75.6k|            _mm_subs_epu8(nx, _mm_set1_epi8((char)0x8F)),
  515|  75.6k|            _mm_setzero_si128());
  516|  75.6k|        __m128i stuff = _mm_andnot_si128(le8f, is7f);
  517|  75.6k|        if (!_mm_testz_si128(stuff, stuff))
  ------------------
  |  Branch (517:13): [True: 42.5k, False: 33.1k]
  ------------------
  518|  42.5k|        { // process these 16 bytes one at a time
  519|   723k|          for (int i = 0; i < 16; ++i) {
  ------------------
  |  Branch (519:27): [True: 681k, False: 42.5k]
  ------------------
  520|   681k|            ui32 d = *p--;
  521|   681k|            acc |= (ui64)d << nb;
  522|   681k|            nb += 8 - ((unstuff && ((d & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (522:25): [True: 303k, False: 378k]
  |  Branch (522:36): [True: 209k, False: 93.4k]
  ------------------
  523|   681k|            unstuff = d > 0x8F;
  524|   681k|            if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (524:17): [True: 652k, False: 28.3k]
  ------------------
  525|   681k|          }
  526|  42.5k|          size -= 16;
  527|  42.5k|          continue;
  528|  42.5k|        }
  529|  33.1k|        __m128i r = _mm_shuffle_epi8(v,
  530|  33.1k|            _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7,
  531|  33.1k|                         8, 9, 10, 11, 12, 13, 14, 15)); // reverse bytes
  532|  33.1k|#ifdef OJPH_ARCH_X86_64
  533|  33.1k|        ui64 v0 = (ui64)_mm_cvtsi128_si64(r);
  534|  33.1k|        ui64 v1 = (ui64)_mm_extract_epi64(r, 1);
  535|       |#else // 32-bit x86 lacks the 64-bit extract intrinsics
  536|       |        ui64 v0 = (ui32)_mm_cvtsi128_si32(r)
  537|       |                | ((ui64)(ui32)_mm_extract_epi32(r, 1) << 32);
  538|       |        ui64 v1 = (ui32)_mm_extract_epi32(r, 2)
  539|       |                | ((ui64)(ui32)_mm_extract_epi32(r, 3) << 32);
  540|       |#endif
  541|  33.1k|        ui64 w0 = acc | (v0 << nb);
  542|  33.1k|        ui64 w1 = (v1 << nb) | (nb ? (v0 >> (64 - nb)) : 0);
  ------------------
  |  Branch (542:33): [True: 28.4k, False: 4.64k]
  ------------------
  543|  33.1k|        memcpy(o, &w0, 8);
  544|  33.1k|        memcpy(o + 8, &w1, 8);
  545|  33.1k|        acc = nb ? (v1 >> (64 - nb)) : 0;
  ------------------
  |  Branch (545:15): [True: 28.4k, False: 4.64k]
  ------------------
  546|  33.1k|        o += 16;
  547|  33.1k|        p -= 16;
  548|  33.1k|        size -= 16;
  549|  33.1k|        unstuff = p[1] > 0x8F;
  550|  33.1k|      }
  551|       |      // tail; one byte at a time
  552|   206k|      while (size > 0 && o < o_end)
  ------------------
  |  Branch (552:14): [True: 167k, False: 38.7k]
  |  Branch (552:26): [True: 167k, False: 246]
  ------------------
  553|   167k|      {
  554|   167k|        ui32 d = *p--;
  555|   167k|        --size;
  556|   167k|        acc |= (ui64)d << nb;
  557|   167k|        nb += 8 - ((unstuff && ((d & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (557:21): [True: 50.6k, False: 116k]
  |  Branch (557:32): [True: 12.5k, False: 38.0k]
  ------------------
  558|   167k|        unstuff = d > 0x8F;
  559|   167k|        if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (559:13): [True: 165k, False: 1.92k]
  ------------------
  560|   167k|      }
  561|       |      // the bits above nb are already 0 = fill; pad with zero bytes
  562|  38.9k|      *o = (ui8)acc;
  563|  38.9k|      __m256i z = _mm256_setzero_si256();
  564|  38.9k|      _mm256_storeu_si256((__m256i*)(o + 1), z);
  565|  38.9k|      _mm256_storeu_si256((__m256i*)(o + 33), z);
  566|  38.9k|      return (ui32)(o - dst) + 1;
  567|  38.9k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11mel_get_runEPNS0_10dec_mel_stE:
  265|   492k|    {
  266|   492k|      if (melp->num_runs == 0)  //if no runs, decode more bit from MEL segment
  ------------------
  |  Branch (266:11): [True: 86.6k, False: 405k]
  ------------------
  267|  86.6k|        mel_decode(melp);
  268|       |
  269|   492k|      int t = melp->runs & 0x7F; //retrieve one run
  270|   492k|      melp->runs >>= 7;  // remove the retrieved run
  271|   492k|      melp->num_runs--;
  272|   492k|      return t; // return run
  273|   492k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL10mel_decodeEPNS0_10dec_mel_stE:
  175|  86.6k|    {
  176|  86.6k|      static const int mel_exp[13] = { //MEL exponents
  177|  86.6k|        0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5
  178|  86.6k|      };
  179|       |
  180|  86.6k|      if (melp->bits < 6) // if there are less than 6 bits in tmp
  ------------------
  |  Branch (180:11): [True: 17.5k, False: 69.0k]
  ------------------
  181|  17.5k|        mel_read(melp);   // then read from the MEL bitstream
  182|       |                          // 6 bits is the largest decodable MEL cwd
  183|       |
  184|       |      //repeat so long that there is enough decodable bits in tmp,
  185|       |      // and the runs store is not full (num_runs < 8)
  186|   696k|      while (melp->bits >= 6 && melp->num_runs < 8)
  ------------------
  |  Branch (186:14): [True: 674k, False: 21.9k]
  |  Branch (186:33): [True: 609k, False: 64.6k]
  ------------------
  187|   609k|      {
  188|   609k|        int eval = mel_exp[melp->k]; // number of bits associated with state
  189|   609k|        int run = 0;
  190|   609k|        if (melp->tmp & (1ull<<63)) //The next bit to decode (stored in MSB)
  ------------------
  |  Branch (190:13): [True: 284k, False: 325k]
  ------------------
  191|   284k|        { //one is found
  192|   284k|          run = 1 << eval;
  193|   284k|          run--; // consecutive runs of 0 events - 1
  194|   284k|          melp->k = melp->k + 1 < 12 ? melp->k + 1 : 12;//increment, max is 12
  ------------------
  |  Branch (194:21): [True: 257k, False: 26.1k]
  ------------------
  195|   284k|          melp->tmp <<= 1; // consume one bit from tmp
  196|   284k|          melp->bits -= 1;
  197|   284k|          run = run << 1; // a stretch of zeros not terminating in one
  198|   284k|        }
  199|   325k|        else
  200|   325k|        { //0 is found
  201|   325k|          run = (int)(melp->tmp >> (63 - eval)) & ((1 << eval) - 1);
  202|   325k|          melp->k = melp->k - 1 > 0 ? melp->k - 1 : 0; //decrement, min is 0
  ------------------
  |  Branch (202:21): [True: 64.8k, False: 260k]
  ------------------
  203|   325k|          melp->tmp <<= eval + 1; //consume eval + 1 bits (max is 6)
  204|   325k|          melp->bits -= eval + 1;
  205|   325k|          run = (run << 1) + 1; // a stretch of zeros terminating with one
  206|   325k|        }
  207|   609k|        eval = melp->num_runs * 7;           // 7 bits per run
  208|   609k|        melp->runs &= ~((ui64)0x3F << eval); // 6 bits are sufficient
  209|   609k|        melp->runs |= ((ui64)run) << eval;   // store the value in runs
  210|   609k|        melp->num_runs++;                    // increment count
  211|   609k|      }
  212|  86.6k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8mel_readEPNS0_10dec_mel_stE:
   98|  17.5k|    {
   99|  17.5k|      if (melp->bits > 32)  //there are enough bits in the tmp variable
  ------------------
  |  Branch (99:11): [True: 0, False: 17.5k]
  ------------------
  100|      0|        return;             // return without reading new data
  101|       |
  102|  17.5k|      ui32 val = 0xFFFFFFFF;       // feed in 0xFF if buffer is exhausted
  103|  17.5k|      if (melp->size > 4) {        // if there is data in the MEL segment
  ------------------
  |  Branch (103:11): [True: 5.74k, False: 11.8k]
  ------------------
  104|  5.74k|        memcpy(&val, melp->data, 4);  // read 32 bits from MEL data
  105|  5.74k|        melp->data += 4;           // advance pointer
  106|  5.74k|        melp->size -= 4;           // reduce counter
  107|  5.74k|      }
  108|  11.8k|      else if (melp->size > 0)
  ------------------
  |  Branch (108:16): [True: 6.27k, False: 5.54k]
  ------------------
  109|  6.27k|      { // 4 or less
  110|  6.27k|        int i = 0;
  111|  12.2k|        while (melp->size > 1) {
  ------------------
  |  Branch (111:16): [True: 5.93k, False: 6.27k]
  ------------------
  112|  5.93k|          ui32 v = *melp->data++;    // read one byte at a time
  113|  5.93k|          ui32 m = ~(0xFFu << i);    // mask of location
  114|  5.93k|          val = (val & m) | (v << i);// put one byte in its correct location
  115|  5.93k|          --melp->size;
  116|  5.93k|          i += 8;
  117|  5.93k|        }
  118|       |        // size equal to 1
  119|  6.27k|        ui32 v = *melp->data++;    // the one before the last is different
  120|  6.27k|        v |= 0xF;                  // MEL and VLC segments can overlap
  121|  6.27k|        ui32 m = ~(0xFFu << i);
  122|  6.27k|        val = (val & m) | (v << i);
  123|  6.27k|        --melp->size;
  124|  6.27k|      }
  125|       |
  126|       |      // next we unstuff them before adding them to the buffer
  127|  17.5k|      int bits = 32 - melp->unstuff; // number of bits in val, subtract 1 if
  128|       |                                     // the previously read byte requires
  129|       |                                     // unstuffing
  130|       |
  131|       |      // data is unstuffed and accumulated in t
  132|       |      // bits has the number of bits in t
  133|  17.5k|      ui32 t = val & 0xFF;
  134|  17.5k|      bool unstuff = ((val & 0xFF) == 0xFF); // true if we need unstuffing
  135|  17.5k|      bits -= unstuff; // there is one less bit in t if unstuffing is needed
  136|  17.5k|      t = t << (8 - unstuff); // move up to make room for the next byte
  137|       |
  138|       |      //this is a repeat of the above
  139|  17.5k|      t |= (val>>8) & 0xFF;
  140|  17.5k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  141|  17.5k|      bits -= unstuff;
  142|  17.5k|      t = t << (8 - unstuff);
  143|       |
  144|  17.5k|      t |= (val>>16) & 0xFF;
  145|  17.5k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  146|  17.5k|      bits -= unstuff;
  147|  17.5k|      t = t << (8 - unstuff);
  148|       |
  149|  17.5k|      t |= (val>>24) & 0xFF;
  150|  17.5k|      melp->unstuff = (((val >> 24) & 0xFF) == 0xFF);
  151|       |
  152|       |      // move t to tmp, and push the result all the way up, so we read from
  153|       |      // the MSB
  154|  17.5k|      melp->tmp |= ((ui64)t) << (64 - bits - melp->bits);
  155|  17.5k|      melp->bits += bits; //increment the number of bits in tmp
  156|  17.5k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL7drefillERmRjS2_PKhj:
  432|   612k|    {
  433|   612k|      ui64 v;
  434|   612k|      ui32 o = off < limit ? off : limit;
  ------------------
  |  Branch (434:16): [True: 94.0k, False: 518k]
  ------------------
  435|   612k|      memcpy(&v, dbuf + o, 8);
  436|   612k|      val |= v << bits;
  437|   612k|      off += (63 - bits) >> 3;
  438|   612k|      bits |= 56;
  439|   612k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8dconsumeERmRjj:
  450|  1.93M|    {
  451|  1.93M|      val >>= num_bits;
  452|  1.93M|      bits -= num_bits;
  453|  1.93M|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL21decode_cb_step2_32bitEPtPjPhjjjjjjii:
 1045|  3.13k|    {
 1046|  3.13k|        const int v_n_size = 512 + 16;
 1047|       |#ifdef __MINGW64__
 1048|       |        ui32 v_n_scratch[2 * v_n_size] = {0};
 1049|       |#else
 1050|  3.13k|        ui32 v_n_scratch[2 * v_n_size];
 1051|  3.13k|        memset(v_n_scratch + (width >> 1) + 2, 0, 14 * sizeof(ui32));
 1052|  3.13k|#endif
 1053|       |
 1054|       |        // maximum consumable MagSgn bits: 4096 samples x (mmsbp2 <= 32) bits
 1055|  3.13k|        const ui32 dbuf_cap = 4096 * 32 / 8;
 1056|  3.13k|        ui8 dbuf[dbuf_cap + 72];
 1057|  3.13k|        ui32 limit = destuff_frwd<0xFF>(coded_data, lcup - scup, dbuf, dbuf_cap);
 1058|  3.13k|        ui32 pos = 0;
 1059|       |
 1060|  3.13k|        const __m256i avx_mmsbp2 = _mm256_set1_epi32((int)mmsbp2);
 1061|       |
 1062|  3.13k|        {
 1063|  3.13k|          ui16 *sp = scratch;
 1064|  3.13k|          ui32 *vp = v_n_scratch;
 1065|  3.13k|          ui32 *dp = decoded_data;
 1066|  3.13k|          vp[0] = 2; // for easy calculation of emax
 1067|       |
 1068|  14.7k|          for (ui32 x = 0; x < width; x += 4, sp += 4, vp += 2, dp += 4)
  ------------------
  |  Branch (1068:28): [True: 11.9k, False: 2.83k]
  ------------------
 1069|  11.9k|          {
 1070|  11.9k|            __m128i vn = _mm_set1_epi32(2);
 1071|       |
 1072|  11.9k|            __m256i inf_u_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)sp));
 1073|  11.9k|            inf_u_q = _mm256_permutevar8x32_epi32(inf_u_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1074|       |
 1075|  11.9k|            __m256i U_q = _mm256_srli_epi32(inf_u_q, 16);
 1076|  11.9k|            __m256i w = _mm256_cmpgt_epi32(U_q, avx_mmsbp2);
 1077|  11.9k|            if (!_mm256_testz_si256(w, w)) {
  ------------------
  |  Branch (1077:17): [True: 300, False: 11.6k]
  ------------------
 1078|    300|                return false;
 1079|    300|            }
 1080|       |
 1081|  11.6k|            __m256i row = decode_two_quad32_avx2(inf_u_q, U_q, dbuf, limit, pos, p, vn);
 1082|  11.6k|            row = _mm256_permutevar8x32_epi32(row, _mm256_setr_epi32(0, 2, 4, 6, 1, 3, 5, 7));
 1083|  11.6k|            _mm_store_si128((__m128i*)dp, _mm256_castsi256_si128(row));
 1084|  11.6k|            _mm_store_si128((__m128i*)(dp + stride), _mm256_extracti128_si256(row, 0x1));
 1085|       |
 1086|  11.6k|            __m128i w0 = _mm_cvtsi32_si128(*(int const*)vp);
 1087|  11.6k|            w0 = _mm_or_si128(w0, vn);
 1088|  11.6k|            _mm_storeu_si128((__m128i*)vp, w0);
 1089|  11.6k|          }
 1090|  3.13k|        }
 1091|       |
 1092|  17.6k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1092:26): [True: 15.2k, False: 2.41k]
  ------------------
 1093|  15.2k|        {
 1094|  15.2k|          {
 1095|       |            // perform 31 - count_leading_zeros(*vp) here
 1096|  15.2k|            ui32 *vp = v_n_scratch;
 1097|  15.2k|            ui16* sp = scratch + (y >> 1) * sstr;
 1098|       |
 1099|  15.2k|            const __m256i avx_31 = _mm256_set1_epi32(31);
 1100|  15.2k|            const __m256i avx_f0 = _mm256_set1_epi32(0xF0);
 1101|  15.2k|            const __m256i avx_1 = _mm256_set1_epi32(1);
 1102|  15.2k|            const __m256i avx_0 = _mm256_setzero_si256();
 1103|       |
 1104|  32.6k|            for (ui32 x = 0; x <= width; x += 16, vp += 8, sp += 16) {
  ------------------
  |  Branch (1104:30): [True: 17.8k, False: 14.7k]
  ------------------
 1105|  17.8k|              __m256i v = _mm256_loadu_si256((__m256i*)vp);
 1106|  17.8k|              __m256i v_p1 = _mm256_loadu_si256((__m256i*)(vp + 1));
 1107|  17.8k|              v = _mm256_or_si256(v, v_p1);
 1108|  17.8k|              v = avx2_lzcnt_epi32(v);
 1109|  17.8k|              v = _mm256_sub_epi32(avx_31, v);
 1110|       |
 1111|  17.8k|              __m256i inf_u_q = _mm256_loadu_si256((__m256i*)sp);
 1112|  17.8k|              __m256i gamma = _mm256_and_si256(inf_u_q, avx_f0);
 1113|  17.8k|              __m256i w0 = _mm256_sub_epi32(gamma, avx_1);
 1114|  17.8k|              gamma = _mm256_and_si256(gamma, w0);
 1115|  17.8k|              gamma = _mm256_cmpeq_epi32(gamma, avx_0);
 1116|       |
 1117|  17.8k|              v = _mm256_andnot_si256(gamma, v);
 1118|  17.8k|              v = _mm256_max_epi32(v, avx_1);
 1119|       |
 1120|  17.8k|              inf_u_q = _mm256_srli_epi32(inf_u_q, 16);
 1121|  17.8k|              v = _mm256_add_epi32(inf_u_q, v);
 1122|       |
 1123|  17.8k|              w0 = _mm256_cmpgt_epi32(v, avx_mmsbp2);
 1124|  17.8k|              if (!_mm256_testz_si256(w0, w0)) {
  ------------------
  |  Branch (1124:19): [True: 419, False: 17.4k]
  ------------------
 1125|    419|                  return false;
 1126|    419|              }
 1127|       |
 1128|  17.4k|              _mm256_storeu_si256((__m256i*)(vp + v_n_size), v);
 1129|  17.4k|            }
 1130|  15.2k|          }
 1131|       |
 1132|  14.7k|          ui32 *vp = v_n_scratch;
 1133|  14.7k|          ui16 *sp = scratch + (y >> 1) * sstr;
 1134|  14.7k|          ui32 *dp = decoded_data + y * stride;
 1135|  14.7k|          vp[0] = 2; // for easy calculation of emax
 1136|       |
 1137|  51.6k|          for (ui32 x = 0; x < width; x += 4, sp += 4, vp += 2, dp += 4) {
  ------------------
  |  Branch (1137:28): [True: 36.8k, False: 14.7k]
  ------------------
 1138|       |            //process two quads
 1139|  36.8k|            __m128i vn = _mm_set1_epi32(2);
 1140|       |
 1141|  36.8k|            __m256i inf_u_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)sp));
 1142|  36.8k|            inf_u_q = _mm256_permutevar8x32_epi32(inf_u_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1143|       |
 1144|  36.8k|            __m256i U_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)(vp + v_n_size)));
 1145|  36.8k|            U_q = _mm256_permutevar8x32_epi32(U_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1146|       |
 1147|  36.8k|            __m256i row = decode_two_quad32_avx2(inf_u_q, U_q, dbuf, limit, pos, p, vn);
 1148|  36.8k|            row = _mm256_permutevar8x32_epi32(row, _mm256_setr_epi32(0, 2, 4, 6, 1, 3, 5, 7));
 1149|  36.8k|            _mm_store_si128((__m128i*)dp, _mm256_castsi256_si128(row));
 1150|  36.8k|            _mm_store_si128((__m128i*)(dp + stride), _mm256_extracti128_si256(row, 0x1));
 1151|       |
 1152|  36.8k|            __m128i w0 = _mm_cvtsi32_si128(*(int const*)vp);
 1153|  36.8k|            w0 = _mm_or_si128(w0, vn);
 1154|  36.8k|            _mm_storeu_si128((__m128i*)vp, w0);
 1155|  36.8k|          }
 1156|  14.7k|        }
 1157|  2.41k|        return true;
 1158|  2.83k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL12destuff_frwdILi255EEEjPKhiPhj:
  305|  28.7k|    {
  306|  28.7k|      if (size < 0)
  ------------------
  |  Branch (306:11): [True: 0, False: 28.7k]
  ------------------
  307|      0|        size = 0;
  308|  28.7k|      ui8* o = dst;
  309|  28.7k|      ui8* o_end = dst + cap;
  310|  28.7k|      const ui8* s = src;
  311|  28.7k|      const ui8* s_end = src + size;
  312|  28.7k|      ui64 acc = 0;       // partial output byte, low nb bits are valid
  313|  28.7k|      ui32 nb = 0;        // number of valid bits in acc; always < 8
  314|  28.7k|      bool prev_ff = false;
  315|       |
  316|       |      // fast path; 16 source bytes at a time when they contain no 0xFF
  317|   229k|      while (s + 16 <= s_end && o + 24 <= o_end)
  ------------------
  |  Branch (317:14): [True: 201k, False: 28.5k]
  |  Branch (317:33): [True: 201k, False: 230]
  ------------------
  318|   201k|      {
  319|   201k|        __m128i v = _mm_loadu_si128((const __m128i*)s);
  320|   201k|        int ff = _mm_movemask_epi8(_mm_cmpeq_epi8(v, _mm_set1_epi8(-1)));
  321|   201k|        if (ff != 0 || prev_ff)
  ------------------
  |  Branch (321:13): [True: 154k, False: 46.3k]
  |  Branch (321:24): [True: 2.37k, False: 43.9k]
  ------------------
  322|   157k|        { // process these 16 bytes one at a time
  323|  2.67M|          for (int i = 0; i < 16; ++i) {
  ------------------
  |  Branch (323:27): [True: 2.51M, False: 157k]
  ------------------
  324|  2.51M|            ui8 b = *s++;
  325|  2.51M|            acc |= (ui64)b << nb;
  326|  2.51M|            nb += prev_ff ? 7u : 8u;
  ------------------
  |  Branch (326:19): [True: 428k, False: 2.08M]
  ------------------
  327|  2.51M|            prev_ff = (b == 0xFFu);
  328|  2.51M|            if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (328:17): [True: 2.45M, False: 56.9k]
  ------------------
  329|  2.51M|          }
  330|   157k|          continue;
  331|   157k|        }
  332|  43.9k|        ui64 v0, v1;
  333|  43.9k|        memcpy(&v0, s, 8);
  334|  43.9k|        memcpy(&v1, s + 8, 8);
  335|  43.9k|        ui64 w0 = acc | (v0 << nb);
  336|  43.9k|        ui64 w1 = (v1 << nb) | (nb ? (v0 >> (64 - nb)) : 0);
  ------------------
  |  Branch (336:33): [True: 36.9k, False: 6.94k]
  ------------------
  337|  43.9k|        memcpy(o, &w0, 8);
  338|  43.9k|        memcpy(o + 8, &w1, 8);
  339|  43.9k|        acc = nb ? (v1 >> (64 - nb)) : 0;
  ------------------
  |  Branch (339:15): [True: 36.9k, False: 6.94k]
  ------------------
  340|  43.9k|        o += 16;
  341|  43.9k|        s += 16;
  342|  43.9k|      }
  343|       |      // tail; one byte at a time
  344|   131k|      while (s < s_end && o < o_end)
  ------------------
  |  Branch (344:14): [True: 102k, False: 28.5k]
  |  Branch (344:27): [True: 102k, False: 230]
  ------------------
  345|   102k|      {
  346|   102k|        ui8 b = *s++;
  347|   102k|        acc |= (ui64)b << nb;
  348|   102k|        nb += prev_ff ? 7u : 8u;
  ------------------
  |  Branch (348:15): [True: 8.76k, False: 93.9k]
  ------------------
  349|   102k|        prev_ff = (b == 0xFFu);
  350|   102k|        if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (350:13): [True: 100k, False: 2.23k]
  ------------------
  351|   102k|      }
  352|       |      // fill the bits above nb with X, and pad with X bytes
  353|  28.7k|      ui32 fill = (X == 0xFF) ? (0xFFu << nb) : 0;
  ------------------
  |  Branch (353:19): [True: 28.7k, Folded]
  ------------------
  354|  28.7k|      *o = (ui8)((ui32)acc | fill);
  355|  28.7k|      __m256i pad = _mm256_set1_epi8((char)X);
  356|  28.7k|      _mm256_storeu_si256((__m256i*)(o + 1), pad);
  357|  28.7k|      _mm256_storeu_si256((__m256i*)(o + 33), pad);
  358|  28.7k|      return (ui32)(o - dst) + 1;
  359|  28.7k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL22decode_two_quad32_avx2EDv4_xS1_PKhjRjjRDv2_x:
  633|  48.4k|                                   ui32 p, __m128i& vn) {
  634|  48.4k|        __m256i row = _mm256_setzero_si256();
  635|       |
  636|       |        // we keeps e_k, e_1, and rho in w2
  637|  48.4k|        __m256i flags = _mm256_and_si256(inf_u_q, _mm256_set_epi32(0x8880, 0x4440, 0x2220, 0x1110, 0x8880, 0x4440, 0x2220, 0x1110));
  638|  48.4k|        __m256i insig = _mm256_cmpeq_epi32(flags, _mm256_setzero_si256());
  639|       |
  640|  48.4k|        if ((uint32_t)_mm256_movemask_epi8(insig) != (uint32_t)0xFFFFFFFF) //are all insignificant?
  ------------------
  |  Branch (640:13): [True: 31.1k, False: 17.3k]
  ------------------
  641|  31.1k|        {
  642|  31.1k|            flags = _mm256_mullo_epi16(flags, _mm256_set_epi16(1, 1, 2, 2, 4, 4, 8, 8, 1, 1, 2, 2, 4, 4, 8, 8));
  643|       |
  644|       |            // U_q holds U_q for this quad
  645|       |            // flags has e_k, e_1, and rho such that e_k is sitting in the
  646|       |            // 0x8000, e_1 in 0x800, and rho in 0x80
  647|       |
  648|       |            // next e_k and m_n
  649|  31.1k|            __m256i m_n;
  650|  31.1k|            __m256i w0 = _mm256_srli_epi32(flags, 15); // e_k
  651|  31.1k|            m_n = _mm256_sub_epi32(U_q, w0);
  652|  31.1k|            m_n = _mm256_andnot_si256(insig, m_n);
  653|       |
  654|       |            // find cumulative sums
  655|       |            // to find at which bit in ms_vec the sample starts
  656|  31.1k|            __m256i inc_sum = m_n; // inclusive scan
  657|  31.1k|            inc_sum = _mm256_add_epi32(inc_sum, _mm256_bslli_epi128(inc_sum, 4));
  658|  31.1k|            inc_sum = _mm256_add_epi32(inc_sum, _mm256_bslli_epi128(inc_sum, 8));
  659|  31.1k|            ui32 total_mn1 = (ui32)_mm256_extract_epi16(inc_sum, 6);
  660|  31.1k|            ui32 total_mn2 = (ui32)_mm256_extract_epi16(inc_sum, 14);
  661|       |
  662|  31.1k|            __m128i ms_vec0 = dfetch(dbuf, limit, pos);
  663|  31.1k|            __m128i ms_vec1 = dfetch(dbuf, limit, pos + total_mn1);
  664|  31.1k|            pos += total_mn1 + total_mn2;
  665|       |
  666|  31.1k|            __m256i ms_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ms_vec0), ms_vec1, 0x1);
  667|       |
  668|  31.1k|            __m256i ex_sum = _mm256_bslli_epi128(inc_sum, 4); // exclusive scan
  669|       |
  670|       |            // find the starting byte and starting bit
  671|  31.1k|            __m256i byte_idx = _mm256_srli_epi32(ex_sum, 3);
  672|  31.1k|            __m256i bit_idx = _mm256_and_si256(ex_sum, _mm256_set1_epi32(7));
  673|  31.1k|            byte_idx = _mm256_shuffle_epi8(byte_idx,
  674|  31.1k|                _mm256_set_epi32(0x0C0C0C0C, 0x08080808, 0x04040404, 0x00000000, 0x0C0C0C0C, 0x08080808, 0x04040404, 0x00000000));
  675|  31.1k|            byte_idx = _mm256_add_epi32(byte_idx, _mm256_set1_epi32(0x03020100));
  676|  31.1k|            __m256i d0 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  677|  31.1k|            byte_idx = _mm256_add_epi32(byte_idx, _mm256_set1_epi32(0x01010101));
  678|  31.1k|            __m256i d1 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  679|       |
  680|       |            // shift samples values to correct location
  681|  31.1k|            bit_idx = _mm256_or_si256(bit_idx, _mm256_slli_epi32(bit_idx, 16));
  682|       |
  683|  31.1k|            __m128i a = _mm_set_epi8(1, 3, 7, 15, 31, 63, 127, -1, 1, 3, 7, 15, 31, 63, 127, -1);
  684|  31.1k|            __m256i aa = _mm256_inserti128_si256(_mm256_castsi128_si256(a), a, 0x1);
  685|       |
  686|  31.1k|            __m256i bit_shift = _mm256_shuffle_epi8(aa, bit_idx);
  687|  31.1k|            bit_shift = _mm256_add_epi16(bit_shift, _mm256_set1_epi16(0x0101));
  688|  31.1k|            d0 = _mm256_mullo_epi16(d0, bit_shift);
  689|  31.1k|            d0 = _mm256_srli_epi16(d0, 8); // we should have 8 bits in the LSB
  690|  31.1k|            d1 = _mm256_mullo_epi16(d1, bit_shift);
  691|  31.1k|            d1 = _mm256_and_si256(d1, _mm256_set1_epi32((si32)0xFF00FF00)); // 8 in MSB
  692|  31.1k|            d0 = _mm256_or_si256(d0, d1);
  693|       |
  694|       |            // find location of e_k and mask
  695|  31.1k|            __m256i shift;
  696|  31.1k|            __m256i ones = _mm256_set1_epi32(1);
  697|  31.1k|            __m256i twos = _mm256_set1_epi32(2);
  698|  31.1k|            __m256i U_q_m1 = _mm256_sub_epi32(U_q, ones);
  699|  31.1k|            U_q_m1 = _mm256_and_si256(U_q_m1, _mm256_set_epi32(0, 0, 0, 0x1F, 0, 0, 0, 0x1F));
  700|  31.1k|            U_q_m1 = _mm256_shuffle_epi32(U_q_m1, 0);
  701|  31.1k|            w0 = _mm256_sub_epi32(twos, w0);
  702|  31.1k|            shift = _mm256_sllv_epi32(w0, U_q_m1); // U_q_m1 must be no more than 31
  703|  31.1k|            ms_vec = _mm256_and_si256(d0, _mm256_sub_epi32(shift, ones));
  704|       |
  705|       |            // next e_1
  706|  31.1k|            w0 = _mm256_and_si256(flags, _mm256_set1_epi32(0x800));
  707|  31.1k|            w0 = _mm256_cmpeq_epi32(w0, _mm256_setzero_si256());
  708|  31.1k|            w0 = _mm256_andnot_si256(w0, shift);  // e_1 in correct position
  709|  31.1k|            ms_vec = _mm256_or_si256(ms_vec, w0); // e_1
  710|  31.1k|            w0 = _mm256_slli_epi32(ms_vec, 31);   // sign
  711|  31.1k|            ms_vec = _mm256_or_si256(ms_vec, ones); // bin center
  712|  31.1k|            __m256i tvn = ms_vec;
  713|  31.1k|            ms_vec = _mm256_add_epi32(ms_vec, twos);// + 2
  714|  31.1k|            ms_vec = _mm256_slli_epi32(ms_vec, (si32)p - 1);
  715|  31.1k|            ms_vec = _mm256_or_si256(ms_vec, w0); // sign
  716|  31.1k|            row = _mm256_andnot_si256(insig, ms_vec); // significant only
  717|       |
  718|  31.1k|            ms_vec = _mm256_andnot_si256(insig, tvn); // significant only
  719|       |
  720|  31.1k|            tvn = _mm256_shuffle_epi8(ms_vec, _mm256_set_epi32(-1, 0x0F0E0D0C, 0x07060504, -1, -1, -1, 0x0F0E0D0C, 0x07060504));
  721|       |
  722|  31.1k|            vn = _mm_or_si128(vn, _mm256_castsi256_si128(tvn));
  723|       |            vn = _mm_or_si128(vn, _mm256_extracti128_si256(tvn, 0x1));
  724|  31.1k|        }
  725|  48.4k|        return row;
  726|  48.4k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL6dfetchEPKhjj:
  377|   250k|    {
  378|   250k|      ui32 off = pos >> 3;
  379|   250k|      off = off < limit ? off : limit;
  ------------------
  |  Branch (379:13): [True: 190k, False: 59.7k]
  ------------------
  380|   250k|      const ui8* p = dbuf + off;
  381|   250k|      __m128i v = _mm_loadu_si128((const __m128i*)p);
  382|   250k|      __m128i w = _mm_loadu_si128((const __m128i*)(p + 8));
  383|   250k|      int k = (int)(pos & 7);
  384|   250k|      __m128i r = _mm_srl_epi64(v, _mm_cvtsi32_si128(k));
  385|   250k|      __m128i c = _mm_sll_epi64(w, _mm_cvtsi32_si128(64 - k));
  386|   250k|      return _mm_or_si128(r, c);
  387|   250k|    }
_ZN4ojph5local16avx2_lzcnt_epi32EDv4_x:
  870|   169k|    inline __m256i avx2_lzcnt_epi32(__m256i v) {
  871|       |        // prevent value from being rounded up to the next power of two
  872|   169k|        v = _mm256_andnot_si256(_mm256_srli_epi32(v, 8), v);  // keep 8 MSB
  873|       |
  874|   169k|        v = _mm256_castps_si256(_mm256_cvtepi32_ps(v));    // convert an integer to float
  875|   169k|        v = _mm256_srli_epi32(v, 23);                   // shift down the exponent
  876|   169k|        v = _mm256_subs_epu16(_mm256_set1_epi32(158), v);  // undo bias
  877|   169k|        v = _mm256_min_epi16(v, _mm256_set1_epi32(32));    // clamp at 32
  878|       |
  879|   169k|        return v;
  880|   169k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL21decode_cb_step2_16bitEPtPjPhjjjjjjii:
  913|  25.6k|    {
  914|       |        // reduce bitplane by 16 because we now have 16 bits instead of 32
  915|  25.6k|        p -= 16;
  916|       |
  917|  25.6k|        const int v_n_size = 512 + 16;
  918|       |#ifdef __MINGW64__
  919|       |        ui16 v_n_scratch[v_n_size] = {0};
  920|       |        ui32 v_n_scratch_32[v_n_size] = {0};
  921|       |#else
  922|  25.6k|        ui16 v_n_scratch[v_n_size];
  923|  25.6k|        memset(v_n_scratch + (width >> 1) + 4, 0, 8 * sizeof(ui16));
  924|  25.6k|        ui32 v_n_scratch_32[v_n_size];
  925|  25.6k|#endif
  926|       |
  927|       |        // maximum consumable MagSgn bits: 4096 samples x (mmsbp2 < 16) bits
  928|  25.6k|        const ui32 dbuf_cap = 4096 * 15 / 8;
  929|  25.6k|        ui8 dbuf[dbuf_cap + 72];
  930|  25.6k|        ui32 limit = destuff_frwd<0xFF>(coded_data, lcup - scup, dbuf, dbuf_cap);
  931|  25.6k|        ui32 pos = 0;
  932|       |
  933|  25.6k|        {
  934|  25.6k|          ui16 *sp = scratch;
  935|  25.6k|          ui16 *vp = v_n_scratch;
  936|  25.6k|          ui32 *dp = decoded_data;
  937|  25.6k|          vp[0] = 2; // for easy calculation of emax
  938|       |
  939|  61.9k|          for (ui32 x = 0; x < width; x += 8, sp += 8, vp += 4, dp += 8) {
  ------------------
  |  Branch (939:28): [True: 41.6k, False: 20.3k]
  ------------------
  940|       |              ////process four quads
  941|  41.6k|              __m128i inf_u_q = _mm_loadu_si128((__m128i*)sp);
  942|  41.6k|              __m128i U_q = _mm_srli_epi32(inf_u_q, 16);
  943|  41.6k|              __m128i w = _mm_cmpgt_epi32(U_q, _mm_set1_epi32((int)mmsbp2));
  944|  41.6k|              if (!_mm_testz_si128(w, w)) {
  ------------------
  |  Branch (944:19): [True: 5.34k, False: 36.3k]
  ------------------
  945|  5.34k|                  return false;
  946|  5.34k|              }
  947|       |
  948|  36.3k|              __m128i vn = _mm_set1_epi16(2);
  949|  36.3k|              __m256i row = decode_four_quad16(inf_u_q, U_q, dbuf, limit, pos, p, vn);
  950|       |
  951|  36.3k|              w = _mm_cvtsi32_si128(*(unsigned short const*)(vp));
  952|  36.3k|              _mm_storeu_si128((__m128i*)vp, _mm_or_si128(w, vn));
  953|       |
  954|  36.3k|              __m256i  w0 = _mm256_shuffle_epi8(row, _mm256_set_epi16(0x0D0C, -1, 0x0908, -1, 0x0504, -1, 0x0100, -1, 0x0D0C, -1, 0x0908, -1, 0x0504, -1, 0x0100, -1));
  955|  36.3k|              __m256i  w1 = _mm256_shuffle_epi8(row, _mm256_set_epi16(0x0F0E, -1, 0x0B0A, -1, 0x0706, -1, 0x0302, -1, 0x0F0E, -1, 0x0B0A, -1, 0x0706, -1, 0x0302, -1));
  956|       |
  957|  36.3k|              _mm256_storeu_si256((__m256i*)dp, w0);
  958|  36.3k|              _mm256_storeu_si256((__m256i*)(dp + stride), w1);
  959|  36.3k|          }
  960|  25.6k|        }
  961|       |
  962|   147k|        for (ui32 y = 2; y < height; y += 2) {
  ------------------
  |  Branch (962:26): [True: 131k, False: 15.8k]
  ------------------
  963|   131k|          {
  964|       |            // perform 15 - count_leading_zeros(*vp) here
  965|   131k|            ui16 *vp = v_n_scratch;
  966|   131k|            ui32 *vp_32 = v_n_scratch_32;
  967|       |
  968|   131k|            ui16* sp = scratch + (y >> 1) * sstr;
  969|   131k|            const __m256i avx_mmsbp2 = _mm256_set1_epi32((int)mmsbp2);
  970|   131k|            const __m256i avx_31 = _mm256_set1_epi32(31);
  971|   131k|            const __m256i avx_f0 = _mm256_set1_epi32(0xF0);
  972|   131k|            const __m256i avx_1 = _mm256_set1_epi32(1);
  973|   131k|            const __m256i avx_0 = _mm256_setzero_si256();
  974|       |
  975|   279k|            for (ui32 x = 0; x <= width; x += 16, vp += 8, sp += 16, vp_32 += 8) {
  ------------------
  |  Branch (975:30): [True: 152k, False: 127k]
  ------------------
  976|   152k|              __m128i v = _mm_loadu_si128((__m128i*)vp);
  977|   152k|              __m128i v_p1 = _mm_loadu_si128((__m128i*)(vp + 1));
  978|   152k|              v = _mm_or_si128(v, v_p1);
  979|       |
  980|   152k|              __m256i v_avx = _mm256_cvtepu16_epi32(v);
  981|   152k|              v_avx = avx2_lzcnt_epi32(v_avx);
  982|   152k|              v_avx = _mm256_sub_epi32(avx_31, v_avx);
  983|       |
  984|   152k|              __m256i inf_u_q = _mm256_loadu_si256((__m256i*)sp);
  985|   152k|              __m256i gamma = _mm256_and_si256(inf_u_q, avx_f0);
  986|   152k|              __m256i w0 = _mm256_sub_epi32(gamma, avx_1);
  987|   152k|              gamma = _mm256_and_si256(gamma, w0);
  988|   152k|              gamma = _mm256_cmpeq_epi32(gamma, avx_0);
  989|       |
  990|   152k|              v_avx = _mm256_andnot_si256(gamma, v_avx);
  991|   152k|              v_avx = _mm256_max_epi32(v_avx, avx_1);
  992|       |
  993|   152k|              inf_u_q = _mm256_srli_epi32(inf_u_q, 16);
  994|   152k|              v_avx = _mm256_add_epi32(inf_u_q, v_avx);
  995|       |
  996|   152k|              w0 = _mm256_cmpgt_epi32(v_avx, avx_mmsbp2);
  997|   152k|              if (!_mm256_testz_si256(w0, w0)) {
  ------------------
  |  Branch (997:19): [True: 4.48k, False: 147k]
  ------------------
  998|  4.48k|                  return false;
  999|  4.48k|              }
 1000|       |
 1001|   147k|              _mm256_storeu_si256((__m256i*)vp_32, v_avx);
 1002|   147k|            }
 1003|   131k|          }
 1004|       |
 1005|   127k|          ui16 *vp = v_n_scratch;
 1006|   127k|          ui32* vp_32 = v_n_scratch_32;
 1007|   127k|          ui16 *sp = scratch + (y >> 1) * sstr;
 1008|   127k|          ui32 *dp = decoded_data + y * stride;
 1009|   127k|          vp[0] = 2; // for easy calculation of emax
 1010|       |
 1011|   291k|          for (ui32 x = 0; x < width; x += 8, sp += 8, vp += 4, dp += 8, vp_32 += 4) {
  ------------------
  |  Branch (1011:28): [True: 163k, False: 127k]
  ------------------
 1012|       |            ////process four quads
 1013|   163k|              __m128i inf_u_q = _mm_loadu_si128((__m128i*)sp);
 1014|   163k|              __m128i U_q = _mm_loadu_si128((__m128i*)vp_32);
 1015|       |
 1016|   163k|            __m128i vn = _mm_set1_epi16(2);
 1017|   163k|            __m256i row = decode_four_quad16(inf_u_q, U_q, dbuf, limit, pos, p, vn);
 1018|       |
 1019|   163k|            __m128i w = _mm_cvtsi32_si128(*(unsigned short const*)(vp));
 1020|   163k|            _mm_storeu_si128((__m128i*)vp, _mm_or_si128(w, vn));
 1021|       |
 1022|   163k|            __m256i  w0 = _mm256_shuffle_epi8(row, _mm256_set_epi16(0x0D0C, -1, 0x0908, -1, 0x0504, -1, 0x0100, -1, 0x0D0C, -1, 0x0908, -1, 0x0504, -1, 0x0100, -1));
 1023|   163k|            __m256i  w1 = _mm256_shuffle_epi8(row, _mm256_set_epi16(0x0F0E, -1, 0x0B0A, -1, 0x0706, -1, 0x0302, -1, 0x0F0E, -1, 0x0B0A, -1, 0x0706, -1, 0x0302, -1));
 1024|       |
 1025|   163k|            _mm256_storeu_si256((__m256i*)dp, w0);
 1026|   163k|            _mm256_storeu_si256((__m256i*)(dp + stride), w1);
 1027|   163k|          }
 1028|   127k|        }
 1029|  15.8k|        return true;
 1030|  20.3k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL18decode_four_quad16EDv2_xS1_PKhjRjjRS1_:
  743|   200k|                               ui32 p, __m128i& vn) {
  744|       |
  745|   200k|        __m256i w0;     // workers
  746|   200k|        __m256i insig;  // lanes hold FF's if samples are insignificant
  747|   200k|        __m256i flags;  // lanes hold e_k, e_1, and rho
  748|       |
  749|   200k|        __m256i row = _mm256_setzero_si256();
  750|   200k|        __m128i ddd = _mm_shuffle_epi8(inf_u_q,
  751|   200k|            _mm_set_epi16(0x0d0c, 0x0d0c, 0x0908, 0x908, 0x0504, 0x0504, 0x0100, 0x0100));
  752|   200k|        w0 = _mm256_permutevar8x32_epi32(_mm256_castsi128_si256(ddd),
  753|   200k|            _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3));
  754|       |        // we keeps e_k, e_1, and rho in w2
  755|   200k|        flags = _mm256_and_si256(w0,
  756|   200k|            _mm256_set_epi16((si16)0x8880, 0x4440, 0x2220, 0x1110,
  757|   200k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110,
  758|   200k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110,
  759|   200k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110));
  760|   200k|        insig = _mm256_cmpeq_epi16(flags, _mm256_setzero_si256());
  761|   200k|        if ((uint32_t)_mm256_movemask_epi8(insig) != (uint32_t)0xFFFFFFFF) //are all insignificant?
  ------------------
  |  Branch (761:13): [True: 94.0k, False: 106k]
  ------------------
  762|  94.0k|        {
  763|  94.0k|            ddd = _mm_or_si128(_mm_bslli_si128(U_q, 2), U_q);
  764|  94.0k|            __m256i U_q_avx = _mm256_permutevar8x32_epi32(_mm256_castsi128_si256(ddd),
  765|  94.0k|                _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3));
  766|  94.0k|            flags = _mm256_mullo_epi16(flags, _mm256_set_epi16(1, 2, 4, 8, 1, 2, 4, 8, 1, 2, 4, 8, 1, 2, 4, 8));
  767|       |
  768|       |            // U_q holds U_q for this quad
  769|       |            // flags has e_k, e_1, and rho such that e_k is sitting in the
  770|       |            // 0x8000, e_1 in 0x800, and rho in 0x80
  771|       |
  772|       |            // next e_k and m_n
  773|  94.0k|            __m256i m_n;
  774|  94.0k|            w0 = _mm256_srli_epi16(flags, 15); // e_k
  775|  94.0k|            m_n = _mm256_sub_epi16(U_q_avx, w0);
  776|  94.0k|            m_n = _mm256_andnot_si256(insig, m_n);
  777|       |
  778|       |            // find cumulative sums
  779|       |            // to find at which bit in ms_vec the sample starts
  780|  94.0k|            __m256i inc_sum = m_n; // inclusive scan
  781|  94.0k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 2));
  782|  94.0k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 4));
  783|  94.0k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 8));
  784|  94.0k|            ui32 total_mn1 = (ui32)_mm256_extract_epi16(inc_sum, 7);
  785|  94.0k|            ui32 total_mn2 = (ui32)_mm256_extract_epi16(inc_sum, 15);
  786|  94.0k|            __m256i ex_sum = _mm256_bslli_epi128(inc_sum, 2); // exclusive scan
  787|       |
  788|  94.0k|            __m128i ms_vec0 = dfetch(dbuf, limit, pos);
  789|  94.0k|            __m128i ms_vec1 = dfetch(dbuf, limit, pos + total_mn1);
  790|  94.0k|            pos += total_mn1 + total_mn2;
  791|       |
  792|  94.0k|            __m256i ms_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ms_vec0), ms_vec1, 0x1);
  793|       |
  794|       |            // find the starting byte and starting bit
  795|  94.0k|            __m256i byte_idx = _mm256_srli_epi16(ex_sum, 3);
  796|  94.0k|            __m256i bit_idx = _mm256_and_si256(ex_sum, _mm256_set1_epi16(7));
  797|  94.0k|            byte_idx = _mm256_shuffle_epi8(byte_idx,
  798|  94.0k|                _mm256_set_epi16(0x0E0E, 0x0C0C, 0x0A0A, 0x0808,
  799|  94.0k|                    0x0606, 0x0404, 0x0202, 0x0000, 0x0E0E, 0x0C0C, 0x0A0A, 0x0808,
  800|  94.0k|                    0x0606, 0x0404, 0x0202, 0x0000));
  801|  94.0k|            byte_idx = _mm256_add_epi16(byte_idx, _mm256_set1_epi16(0x0100));
  802|  94.0k|            __m256i d0 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  803|  94.0k|            byte_idx = _mm256_add_epi16(byte_idx, _mm256_set1_epi16(0x0101));
  804|  94.0k|            __m256i d1 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  805|       |
  806|       |            // shift samples values to correct location
  807|  94.0k|            __m256i bit_shift = _mm256_shuffle_epi8(
  808|  94.0k|                _mm256_set_epi8(1, 3, 7, 15, 31, 63, 127, -1,
  809|  94.0k|                    1, 3, 7, 15, 31, 63, 127, -1, 1, 3, 7, 15, 31, 63, 127, -1,
  810|  94.0k|                    1, 3, 7, 15, 31, 63, 127, -1), bit_idx);
  811|  94.0k|            bit_shift = _mm256_add_epi16(bit_shift, _mm256_set1_epi16(0x0101));
  812|  94.0k|            d0 = _mm256_mullo_epi16(d0, bit_shift);
  813|  94.0k|            d0 = _mm256_srli_epi16(d0, 8); // we should have 8 bits in the LSB
  814|  94.0k|            d1 = _mm256_mullo_epi16(d1, bit_shift);
  815|  94.0k|            d1 = _mm256_and_si256(d1, _mm256_set1_epi16((si16)0xFF00)); // 8 in MSB
  816|  94.0k|            d0 = _mm256_or_si256(d0, d1);
  817|       |
  818|       |            // find location of e_k and mask
  819|  94.0k|            __m256i shift;
  820|  94.0k|            __m256i ones = _mm256_set1_epi16(1);
  821|  94.0k|            __m256i twos = _mm256_set1_epi16(2);
  822|       |            // shift = (2 - e_k) << (U_q - 1); AVX2 has no _mm256_sllv_epi16,
  823|       |            // so the variable shift is emulated with a pshufb power-of-two
  824|       |            // lookup and a 16-bit multiply.  U_q - 1 <= 14 in this path;
  825|       |            // for U_q == 0 the lookup indices have their MSB set, so pshufb
  826|       |            // returns 0, the same shift value the former uniform 16-bit
  827|       |            // shift emulation produced (it shifted by 31)
  828|  94.0k|            __m256i kq = _mm256_sub_epi16(U_q_avx, ones);
  829|  94.0k|            __m256i idx = _mm256_or_si256(kq,
  830|  94.0k|                _mm256_slli_epi16(_mm256_sub_epi16(kq,
  831|  94.0k|                                            _mm256_set1_epi16(8)), 8));
  832|  94.0k|            const __m256i pow2_tbl = _mm256_setr_epi8(
  833|  94.0k|                1, 2, 4, 8, 16, 32, 64, (char)128, 0, 0, 0, 0, 0, 0, 0, 0,
  834|  94.0k|                1, 2, 4, 8, 16, 32, 64, (char)128, 0, 0, 0, 0, 0, 0, 0, 0);
  835|  94.0k|            __m256i pow2 = _mm256_shuffle_epi8(pow2_tbl, idx);
  836|  94.0k|            w0 = _mm256_sub_epi16(twos, w0);
  837|  94.0k|            shift = _mm256_mullo_epi16(w0, pow2);
  838|  94.0k|            ms_vec = _mm256_and_si256(d0, _mm256_sub_epi16(shift, ones));
  839|       |
  840|       |            // next e_1
  841|  94.0k|            w0 = _mm256_and_si256(flags, _mm256_set1_epi16(0x800));
  842|  94.0k|            w0 = _mm256_cmpeq_epi16(w0, _mm256_setzero_si256());
  843|  94.0k|            w0 = _mm256_andnot_si256(w0, shift);  // e_1 in correct position
  844|  94.0k|            ms_vec = _mm256_or_si256(ms_vec, w0); // e_1
  845|  94.0k|            w0 = _mm256_slli_epi16(ms_vec, 15);   // sign
  846|  94.0k|            ms_vec = _mm256_or_si256(ms_vec, ones); // bin center
  847|  94.0k|            __m256i tvn = ms_vec;
  848|  94.0k|            ms_vec = _mm256_add_epi16(ms_vec, twos);// + 2
  849|  94.0k|            ms_vec = _mm256_slli_epi16(ms_vec, (si32)p - 1);
  850|  94.0k|            ms_vec = _mm256_or_si256(ms_vec, w0); // sign
  851|  94.0k|            row = _mm256_andnot_si256(insig, ms_vec); // significant only
  852|       |
  853|  94.0k|            ms_vec = _mm256_andnot_si256(insig, tvn); // significant only
  854|       |
  855|  94.0k|            __m256i ms_vec_shuffle1 = _mm256_shuffle_epi8(ms_vec,
  856|  94.0k|                _mm256_set_epi16(-1, -1, -1, -1, 0x0706, 0x0302, -1, -1,
  857|  94.0k|                                 -1, -1, -1, -1, -1, -1, 0x0706, 0x0302));
  858|  94.0k|            __m256i ms_vec_shuffle2 = _mm256_shuffle_epi8(ms_vec,
  859|  94.0k|                _mm256_set_epi16(-1, -1, -1, 0x0F0E, 0x0B0A, -1, -1, -1,
  860|  94.0k|                                 -1, -1, -1, -1, -1, 0x0F0E, 0x0B0A, -1));
  861|  94.0k|            ms_vec = _mm256_or_si256(ms_vec_shuffle1, ms_vec_shuffle2);
  862|       |
  863|  94.0k|            vn = _mm_or_si128(vn, _mm256_castsi256_si128(ms_vec));
  864|       |            vn = _mm_or_si128(vn, _mm256_extracti128_si256(ms_vec, 0x1));
  865|  94.0k|        }
  866|   200k|        return row;
  867|   200k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL17decode_cb_spp_mrpEPtPjPhjjjjjjjjb:
 1172|  14.6k|    {
 1173|       |        // We use scratch again, we can divide it into multiple regions
 1174|       |        // sigma holds all the significant samples, and it cannot
 1175|       |        // be modified after it is set.  it will be used during the
 1176|       |        // Magnitude Refinement Pass
 1177|  14.6k|        ui16* const sigma = scratch;
 1178|       |
 1179|  14.6k|        ui32 mstr = (width + 3u) >> 2;   // divide by 4, since each
 1180|       |                                         // ui16 contains 4 columns
 1181|  14.6k|        mstr = ((mstr + 2u) + 7u) & ~7u; // multiples of 8
 1182|       |
 1183|       |        // We re-arrange quad significance, where each 4 consecutive
 1184|       |        // bits represent one quad, into column significance, where,
 1185|       |        // each 4 consequtive bits represent one column of 4 rows
 1186|  14.6k|        {
 1187|  14.6k|          ui32 y;
 1188|       |
 1189|  14.6k|          const __m128i mask_3 = _mm_set1_epi32(0x30);
 1190|  14.6k|          const __m128i mask_C = _mm_set1_epi32(0xC0);
 1191|  14.6k|          const __m128i shuffle_mask = _mm_set_epi32(-1, -1, -1, 0x0C080400);
 1192|  81.7k|          for (y = 0; y < height; y += 4)
  ------------------
  |  Branch (1192:23): [True: 67.0k, False: 14.6k]
  ------------------
 1193|  67.0k|          {
 1194|  67.0k|            ui16* sp = scratch + (y >> 1) * sstr;
 1195|  67.0k|            ui16* dp = sigma + (y >> 2) * mstr;
 1196|   160k|            for (ui32 x = 0; x < width; x += 8, sp += 8, dp += 2)
  ------------------
  |  Branch (1196:30): [True: 93.2k, False: 67.0k]
  ------------------
 1197|  93.2k|            {
 1198|  93.2k|              __m128i s0, s1, u3, uC, t0, t1;
 1199|       |
 1200|  93.2k|              s0 = _mm_loadu_si128((__m128i*)(sp));
 1201|  93.2k|              u3 = _mm_and_si128(s0, mask_3);
 1202|  93.2k|              u3 = _mm_srli_epi32(u3, 4);
 1203|  93.2k|              uC = _mm_and_si128(s0, mask_C);
 1204|  93.2k|              uC = _mm_srli_epi32(uC, 2);
 1205|  93.2k|              t0 = _mm_or_si128(u3, uC);
 1206|       |
 1207|  93.2k|              s1 = _mm_loadu_si128((__m128i*)(sp + sstr));
 1208|  93.2k|              u3 = _mm_and_si128(s1, mask_3);
 1209|  93.2k|              u3 = _mm_srli_epi32(u3, 2);
 1210|  93.2k|              uC = _mm_and_si128(s1, mask_C);
 1211|  93.2k|              t1 = _mm_or_si128(u3, uC);
 1212|       |
 1213|  93.2k|              __m128i r = _mm_or_si128(t0, t1);
 1214|  93.2k|              r = _mm_shuffle_epi8(r, shuffle_mask);
 1215|       |
 1216|  93.2k|              ui32 t = (ui32)_mm_extract_epi32(r, 0);
 1217|  93.2k|              memcpy(dp, &t, 4);
 1218|  93.2k|            }
 1219|  67.0k|            dp[0] = 0; // set an extra entry on the right with 0
 1220|  67.0k|          }
 1221|  14.6k|          {
 1222|       |            // reset one row after the codeblock
 1223|  14.6k|            ui16* dp = sigma + (y >> 2) * mstr;
 1224|  14.6k|            __m128i zero = _mm_setzero_si128();
 1225|  31.1k|            for (ui32 x = 0; x < width; x += 32, dp += 8)
  ------------------
  |  Branch (1225:30): [True: 16.4k, False: 14.6k]
  ------------------
 1226|  16.4k|              _mm_storeu_si128((__m128i*)dp, zero);
 1227|  14.6k|            dp[0] = 0; // set an extra entry on the right with 0
 1228|  14.6k|          }
 1229|  14.6k|        }
 1230|       |
 1231|       |        // We perform Significance Propagation Pass here
 1232|  14.6k|        {
 1233|       |          // This stores significance information of the previous
 1234|       |          // 4 rows.  Significance information in this array includes
 1235|       |          // all signicant samples in bitplane p - 1; that is,
 1236|       |          // significant samples for bitplane p (discovered during the
 1237|       |          // cleanup pass and stored in sigma) and samples that have recently
 1238|       |          // became significant (during the SPP) in bitplane p-1.
 1239|       |          // We store enough for the widest row, containing 1024 columns,
 1240|       |          // which is equivalent to 256 of ui16, since each stores 4 columns.
 1241|       |          // We add an extra 8 entries, just in case we need more
 1242|  14.6k|          ui16 prev_row_sig[256 + 8] = {0}; // 528 Bytes
 1243|       |
 1244|       |          // maximum consumable SPP bits: 4096 samples x 2 bits (one
 1245|       |          // significance bit and one sign bit per sample)
 1246|  14.6k|          const ui32 spp_cap = 4096 * 2 / 8;
 1247|  14.6k|          ui8 spp_buf[spp_cap + 72];
 1248|  14.6k|          ui32 spp_limit = destuff_frwd<0>(coded_data + lengths1,
 1249|  14.6k|                                           (int)lengths2, spp_buf, spp_cap);
 1250|  14.6k|          ui32 spp_pos = 0;
 1251|       |
 1252|  81.7k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1252:28): [True: 67.0k, False: 14.6k]
  ------------------
 1253|  67.0k|          {
 1254|  67.0k|            ui32 pattern = 0xFFFFu; // a pattern needed samples
 1255|  67.0k|            if (height - y < 4) {
  ------------------
  |  Branch (1255:17): [True: 9.34k, False: 57.7k]
  ------------------
 1256|  9.34k|              pattern = 0x7777u;
 1257|  9.34k|              if (height - y < 3) {
  ------------------
  |  Branch (1257:19): [True: 6.96k, False: 2.37k]
  ------------------
 1258|  6.96k|                pattern = 0x3333u;
 1259|  6.96k|                if (height - y < 2)
  ------------------
  |  Branch (1259:21): [True: 2.53k, False: 4.43k]
  ------------------
 1260|  2.53k|                  pattern = 0x1111u;
 1261|  6.96k|              }
 1262|  9.34k|            }
 1263|       |
 1264|       |            // prev holds sign. info. for the previous quad, together
 1265|       |            // with the rows on top of it and below it.
 1266|  67.0k|            ui32 prev = 0;
 1267|  67.0k|            ui16 *prev_sig = prev_row_sig;
 1268|  67.0k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1269|  67.0k|            ui32 *dpp = decoded_data + y * stride;
 1270|   213k|            for (ui32 x = 0; x < width; x += 4, dpp += 4, ++cur_sig, ++prev_sig)
  ------------------
  |  Branch (1270:30): [True: 146k, False: 67.0k]
  ------------------
 1271|   146k|            {
 1272|       |              // only rows and columns inside the stripe are included
 1273|   146k|              si32 s = (si32)x + 4 - (si32)width;
 1274|   146k|              s = ojph_max(s, 0);
  ------------------
  |  |   73|   146k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 41.7k, False: 104k]
  |  |  ------------------
  ------------------
 1275|   146k|              pattern = pattern >> (s * 4);
 1276|       |
 1277|       |              // We first find locations that need to be tested (potential
 1278|       |              // SPP members); these location will end up in mbr
 1279|       |              // In each iteration, we produce 16 bits because cwd can have
 1280|       |              // up to 16 bits of significance information, followed by the
 1281|       |              // corresponding 16 bits of sign information; therefore, it is
 1282|       |              // sufficient to fetch 32 bit data per loop.
 1283|       |
 1284|       |              // Althougth we are interested in 16 bits only, we load 32 bits.
 1285|       |              // For the 16 bits we are producing, we need the next 4 bits --
 1286|       |              // We need data for at least 5 columns out of 8.
 1287|       |              // Therefore loading 32 bits is easier than loading 16 bits
 1288|       |              // twice.
 1289|   146k|              ui32 ps, ns, cs;
 1290|   146k|              memcpy(&ps, prev_sig, 4);
 1291|   146k|              memcpy(&ns, cur_sig + mstr, 4);
 1292|   146k|              ui32 u = (ps & 0x88888888) >> 3; // the row on top
 1293|   146k|              if (!stripe_causal)
  ------------------
  |  Branch (1293:19): [True: 136k, False: 9.94k]
  ------------------
 1294|   136k|                u |= (ns & 0x11111111) << 3;   // the row below
 1295|       |
 1296|   146k|              memcpy(&cs, cur_sig, 4);
 1297|       |              // vertical integration
 1298|   146k|              ui32 mbr =  cs;                // this sig. info.
 1299|   146k|              mbr |= (cs & 0x77777777) << 1; //above neighbors
 1300|   146k|              mbr |= (cs & 0xEEEEEEEE) >> 1; //below neighbors
 1301|   146k|              mbr |= u;
 1302|       |              // horizontal integration
 1303|   146k|              ui32 t = mbr;
 1304|   146k|              mbr |= t << 4;      // neighbors on the left
 1305|   146k|              mbr |= t >> 4;      // neighbors on the right
 1306|   146k|              mbr |= prev >> 12;  // significance of previous group
 1307|       |
 1308|       |              // remove outside samples, and already significant samples
 1309|   146k|              mbr &= pattern;
 1310|   146k|              mbr &= ~cs;
 1311|       |
 1312|       |              // find samples that become significant during the SPP
 1313|   146k|              ui32 new_sig = mbr;
 1314|   146k|              if (new_sig)
  ------------------
  |  Branch (1314:19): [True: 95.8k, False: 50.5k]
  ------------------
 1315|  95.8k|              {
 1316|  95.8k|                ui64 cwd = dfetch64(spp_buf, spp_limit, spp_pos);
 1317|       |
 1318|  95.8k|                ui32 cnt = 0;
 1319|  95.8k|                ui32 col_mask = 0xFu;
 1320|  95.8k|                ui32 inv_sig = ~cs & pattern;
 1321|   479k|                for (int i = 0; i < 16; i += 4, col_mask <<= 4)
  ------------------
  |  Branch (1321:33): [True: 383k, False: 95.8k]
  ------------------
 1322|   383k|                {
 1323|   383k|                  if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1323:23): [True: 114k, False: 269k]
  ------------------
 1324|   114k|                    continue;
 1325|       |
 1326|       |                  //scan one column
 1327|   269k|                  ui32 sample_mask = 0x1111u & col_mask;
 1328|   269k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1328:23): [True: 168k, False: 100k]
  ------------------
 1329|   168k|                  {
 1330|   168k|                    new_sig &= ~sample_mask;
 1331|   168k|                    if (cwd & 1)
  ------------------
  |  Branch (1331:25): [True: 35.4k, False: 133k]
  ------------------
 1332|  35.4k|                    {
 1333|  35.4k|                      ui32 t = 0x33u << i;
 1334|  35.4k|                      new_sig |= t & inv_sig;
 1335|  35.4k|                    }
 1336|   168k|                    cwd >>= 1; ++cnt;
 1337|   168k|                  }
 1338|       |
 1339|   269k|                  sample_mask <<= 1;
 1340|   269k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1340:23): [True: 187k, False: 81.3k]
  ------------------
 1341|   187k|                  {
 1342|   187k|                    new_sig &= ~sample_mask;
 1343|   187k|                    if (cwd & 1)
  ------------------
  |  Branch (1343:25): [True: 29.5k, False: 158k]
  ------------------
 1344|  29.5k|                    {
 1345|  29.5k|                      ui32 t = 0x76u << i;
 1346|  29.5k|                      new_sig |= t & inv_sig;
 1347|  29.5k|                    }
 1348|   187k|                    cwd >>= 1; ++cnt;
 1349|   187k|                  }
 1350|       |
 1351|   269k|                  sample_mask <<= 1;
 1352|   269k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1352:23): [True: 121k, False: 148k]
  ------------------
 1353|   121k|                  {
 1354|   121k|                    new_sig &= ~sample_mask;
 1355|   121k|                    if (cwd & 1)
  ------------------
  |  Branch (1355:25): [True: 21.0k, False: 100k]
  ------------------
 1356|  21.0k|                    {
 1357|  21.0k|                      ui32 t = 0xECu << i;
 1358|  21.0k|                      new_sig |= t & inv_sig;
 1359|  21.0k|                    }
 1360|   121k|                    cwd >>= 1; ++cnt;
 1361|   121k|                  }
 1362|       |
 1363|   269k|                  sample_mask <<= 1;
 1364|   269k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1364:23): [True: 159k, False: 109k]
  ------------------
 1365|   159k|                  {
 1366|   159k|                    new_sig &= ~sample_mask;
 1367|   159k|                    if (cwd & 1)
  ------------------
  |  Branch (1367:25): [True: 27.4k, False: 131k]
  ------------------
 1368|  27.4k|                    {
 1369|  27.4k|                      ui32 t = 0xC8u << i;
 1370|  27.4k|                      new_sig |= t & inv_sig;
 1371|  27.4k|                    }
 1372|   159k|                    cwd >>= 1; ++cnt;
 1373|   159k|                  }
 1374|   269k|                }
 1375|       |
 1376|  95.8k|                if (new_sig)
  ------------------
  |  Branch (1376:21): [True: 33.4k, False: 62.3k]
  ------------------
 1377|  33.4k|                {
 1378|       |                  // the sign bits sit right after the cnt consumed bits
 1379|       |                  // of cwd; no reassembly is needed
 1380|       |
 1381|       |                  // Spread new_sig, such that each bit is in one byte with a
 1382|       |                  // value of 0 if new_sig bit is 0, and 0xFF if new_sig is 1
 1383|  33.4k|                  __m128i new_sig_vec = _mm_set1_epi16((si16)new_sig);
 1384|  33.4k|                  new_sig_vec = _mm_shuffle_epi8(new_sig_vec,
 1385|  33.4k|                    _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1386|  33.4k|                  new_sig_vec = _mm_and_si128(new_sig_vec,
 1387|  33.4k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1388|  33.4k|                  new_sig_vec = _mm_cmpeq_epi8(new_sig_vec,
 1389|  33.4k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1390|       |
 1391|       |                  // find cumulative sums
 1392|       |                  // to find which bit in cwd we should extract
 1393|  33.4k|                  __m128i inc_sum = new_sig_vec; // inclusive scan
 1394|  33.4k|                  inc_sum = _mm_abs_epi8(inc_sum); // cvrt to 0 or 1
 1395|  33.4k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 1));
 1396|  33.4k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 2));
 1397|  33.4k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 4));
 1398|  33.4k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 8));
 1399|  33.4k|                  cnt += (ui32)_mm_extract_epi16(inc_sum, 7) >> 8;
 1400|       |                  // exclusive scan
 1401|  33.4k|                  __m128i ex_sum = _mm_bslli_si128(inc_sum, 1);
 1402|       |
 1403|       |                  // Spread cwd, such that each bit is in one byte
 1404|       |                  // with a value of 0 or 1.
 1405|  33.4k|                  __m128i cwd_vec = _mm_set1_epi16((si16)cwd);
 1406|  33.4k|                  cwd_vec = _mm_shuffle_epi8(cwd_vec,
 1407|  33.4k|                    _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1408|  33.4k|                  cwd_vec = _mm_and_si128(cwd_vec,
 1409|  33.4k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1410|  33.4k|                  cwd_vec = _mm_cmpeq_epi8(cwd_vec,
 1411|  33.4k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1412|  33.4k|                  cwd_vec = _mm_abs_epi8(cwd_vec);
 1413|       |
 1414|       |                  // Obtain bit from cwd_vec correspondig to ex_sum
 1415|       |                  // Basically, collect needed bits from cwd_vec
 1416|  33.4k|                  __m128i v = _mm_shuffle_epi8(cwd_vec, ex_sum);
 1417|       |
 1418|       |                  // load data and set spp coefficients
 1419|  33.4k|                  __m128i m =
 1420|  33.4k|                    _mm_set_epi8(-1,-1,-1,12,-1,-1,-1,8,-1,-1,-1,4,-1,-1,-1,0);
 1421|  33.4k|                  __m128i val = _mm_set1_epi32(3 << (p - 2));
 1422|  33.4k|                  ui32 *dp = dpp;
 1423|   167k|                  for (int c = 0; c < 4; ++ c) {
  ------------------
  |  Branch (1423:35): [True: 133k, False: 33.4k]
  ------------------
 1424|   133k|                    __m128i s0, s0_ns, s0_val;
 1425|       |                    // load coefficients
 1426|   133k|                    s0 = _mm_load_si128((__m128i*)dp);
 1427|       |
 1428|       |                    // epi32 is -1 only for coefficient that
 1429|       |                    // are changed during the SPP
 1430|   133k|                    s0_ns = _mm_shuffle_epi8(new_sig_vec, m);
 1431|   133k|                    s0_ns = _mm_cmpeq_epi32(s0_ns, _mm_set1_epi32(0xFF));
 1432|       |
 1433|       |                    // obtain sign for coefficients in SPP
 1434|   133k|                    s0_val = _mm_shuffle_epi8(v, m);
 1435|   133k|                    s0_val = _mm_slli_epi32(s0_val, 31);
 1436|   133k|                    s0_val = _mm_or_si128(s0_val, val);
 1437|   133k|                    s0_val = _mm_and_si128(s0_val, s0_ns);
 1438|       |
 1439|       |                    // update vector
 1440|   133k|                    s0 = _mm_or_si128(s0, s0_val);
 1441|       |                    // store coefficients
 1442|   133k|                    _mm_store_si128((__m128i*)dp, s0);
 1443|       |                    // prepare for next row
 1444|   133k|                    dp += stride;
 1445|   133k|                    m = _mm_add_epi32(m, _mm_set1_epi32(1));
 1446|   133k|                  }
 1447|  33.4k|                }
 1448|  95.8k|                spp_pos += cnt;
 1449|  95.8k|              }
 1450|       |
 1451|   146k|              new_sig |= cs;
 1452|   146k|              *prev_sig = (ui16)(new_sig);
 1453|       |
 1454|       |              // vertical integration for the new sig. info.
 1455|   146k|              t = new_sig;
 1456|   146k|              new_sig |= (t & 0x7777) << 1; //above neighbors
 1457|   146k|              new_sig |= (t & 0xEEEE) >> 1; //below neighbors
 1458|       |              // add sig. info. from the row on top and below
 1459|   146k|              prev = new_sig | u;
 1460|       |              // we need only the bits in 0xF000
 1461|   146k|              prev &= 0xF000;
 1462|   146k|            }
 1463|  67.0k|          }
 1464|  14.6k|        }
 1465|       |
 1466|       |        // We perform Magnitude Refinement Pass here
 1467|  14.6k|        if (num_passes > 2)
  ------------------
  |  Branch (1467:13): [True: 10.1k, False: 4.49k]
  ------------------
 1468|  10.1k|        {
 1469|       |          // de-stuff the MRP segment; consumption is at most 1 bit per
 1470|       |          // sample = 512 bytes, so 1024 bytes always suffice
 1471|  10.1k|          const ui32 mrp_cap = 1024;
 1472|  10.1k|          ui8 mrp_buf[mrp_cap + 72];
 1473|  10.1k|          ui32 mrp_limit = destuff_mrp(coded_data, (int)lengths1,
 1474|  10.1k|                                       (int)lengths2, mrp_buf, mrp_cap);
 1475|  10.1k|          ui32 mrp_pos = 0;
 1476|       |
 1477|  47.4k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1477:28): [True: 37.2k, False: 10.1k]
  ------------------
 1478|  37.2k|          {
 1479|  37.2k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1480|  37.2k|            ui32 *dpp = decoded_data + y * stride;
 1481|   110k|            for (ui32 i = 0; i < width; i += 4, dpp += 4)
  ------------------
  |  Branch (1481:30): [True: 72.9k, False: 37.2k]
  ------------------
 1482|  72.9k|            {
 1483|       |              //Process one entry from sigma array at a time
 1484|       |              // Each nibble (4 bits) in the sigma array represents 4 rows,
 1485|  72.9k|              ui64 cwd = dfetch64(mrp_buf, mrp_limit, mrp_pos);
 1486|  72.9k|              ui16 sig = *cur_sig++; // 16 bit that will be processed now
 1487|  72.9k|              int total_bits = 0;
 1488|  72.9k|              if (sig) // if any of the 32 bits are set
  ------------------
  |  Branch (1488:19): [True: 47.7k, False: 25.2k]
  ------------------
 1489|  47.7k|              {
 1490|       |                // We work on 4 rows, with 4 samples each, since
 1491|       |                // data is 32 bit (4 bytes)
 1492|       |
 1493|       |                // spread the 16 bits in sig to 0 or 1 bytes in sig_vec
 1494|  47.7k|                __m128i sig_vec = _mm_set1_epi16((si16)sig);
 1495|  47.7k|                sig_vec = _mm_shuffle_epi8(sig_vec,
 1496|  47.7k|                  _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1497|  47.7k|                sig_vec = _mm_and_si128(sig_vec,
 1498|  47.7k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1499|  47.7k|                sig_vec = _mm_cmpeq_epi8(sig_vec,
 1500|  47.7k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1501|  47.7k|                sig_vec = _mm_abs_epi8(sig_vec);
 1502|       |
 1503|       |                // find cumulative sums
 1504|       |                // to find which bit in cwd we should extract
 1505|  47.7k|                __m128i inc_sum = sig_vec; // inclusive scan
 1506|  47.7k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 1));
 1507|  47.7k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 2));
 1508|  47.7k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 4));
 1509|  47.7k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 8));
 1510|  47.7k|                total_bits = _mm_extract_epi16(inc_sum, 7) >> 8;
 1511|  47.7k|                __m128i ex_sum = _mm_bslli_si128(inc_sum, 1); // exclusive scan
 1512|       |
 1513|       |                // Spread the 16 bits in cwd to inverted 0 or 1 bytes in
 1514|       |                // cwd_vec. Then, convert these to a form suitable
 1515|       |                // for coefficient modifications; in particular, a value
 1516|       |                // of 0 is presented as binary 11, and a value of 1 is
 1517|       |                // represented as binary 01
 1518|  47.7k|                __m128i cwd_vec = _mm_set1_epi16((si16)cwd);
 1519|  47.7k|                cwd_vec = _mm_shuffle_epi8(cwd_vec,
 1520|  47.7k|                  _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1521|  47.7k|                cwd_vec = _mm_and_si128(cwd_vec,
 1522|  47.7k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1523|  47.7k|                cwd_vec = _mm_cmpeq_epi8(cwd_vec,
 1524|  47.7k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1525|  47.7k|                cwd_vec = _mm_add_epi8(cwd_vec, _mm_set1_epi8(1));
 1526|  47.7k|                cwd_vec = _mm_add_epi8(cwd_vec, cwd_vec);
 1527|  47.7k|                cwd_vec = _mm_or_si128(cwd_vec, _mm_set1_epi8(1));
 1528|       |
 1529|       |                // load data and insert the mrp bit
 1530|  47.7k|                __m128i m =
 1531|  47.7k|                  _mm_set_epi8(-1,-1,-1,12,-1,-1,-1,8,-1,-1,-1,4,-1,-1,-1,0);
 1532|  47.7k|                ui32 *dp = dpp;
 1533|   238k|                for (int c = 0; c < 4; ++c) {
  ------------------
  |  Branch (1533:33): [True: 190k, False: 47.7k]
  ------------------
 1534|   190k|                  __m128i s0, s0_sig, s0_idx, s0_val;
 1535|       |                  // load coefficients
 1536|   190k|                  s0 = _mm_load_si128((__m128i*)dp);
 1537|       |                  // find significant samples in this row
 1538|   190k|                  s0_sig = _mm_shuffle_epi8(sig_vec, m);
 1539|   190k|                  s0_sig = _mm_cmpeq_epi8(s0_sig, _mm_setzero_si128());
 1540|       |                  // get MRP bit index, and MRP pattern
 1541|   190k|                  s0_idx = _mm_shuffle_epi8(ex_sum, m);
 1542|   190k|                  s0_val = _mm_shuffle_epi8(cwd_vec, s0_idx);
 1543|       |                  // keep data from significant samples only
 1544|   190k|                  s0_val = _mm_andnot_si128(s0_sig, s0_val);
 1545|       |                  // move mrp bits to correct position, and employ
 1546|   190k|                  s0_val = _mm_slli_epi32(s0_val, (si32)p - 2);
 1547|   190k|                  s0 = _mm_xor_si128(s0, s0_val);
 1548|       |                  // store coefficients
 1549|   190k|                  _mm_store_si128((__m128i*)dp, s0);
 1550|       |                  // prepare for next row
 1551|   190k|                  dp += stride;
 1552|   190k|                  m = _mm_add_epi32(m, _mm_set1_epi32(1));
 1553|   190k|                }
 1554|  47.7k|              }
 1555|       |              // consume data according to the number of bits set
 1556|  72.9k|              mrp_pos += (ui32)total_bits;
 1557|  72.9k|            }
 1558|  37.2k|          }
 1559|  10.1k|        }
 1560|  14.6k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL12destuff_frwdILi0EEEjPKhiPhj:
  305|  14.6k|    {
  306|  14.6k|      if (size < 0)
  ------------------
  |  Branch (306:11): [True: 0, False: 14.6k]
  ------------------
  307|      0|        size = 0;
  308|  14.6k|      ui8* o = dst;
  309|  14.6k|      ui8* o_end = dst + cap;
  310|  14.6k|      const ui8* s = src;
  311|  14.6k|      const ui8* s_end = src + size;
  312|  14.6k|      ui64 acc = 0;       // partial output byte, low nb bits are valid
  313|  14.6k|      ui32 nb = 0;        // number of valid bits in acc; always < 8
  314|  14.6k|      bool prev_ff = false;
  315|       |
  316|       |      // fast path; 16 source bytes at a time when they contain no 0xFF
  317|  59.8k|      while (s + 16 <= s_end && o + 24 <= o_end)
  ------------------
  |  Branch (317:14): [True: 45.3k, False: 14.4k]
  |  Branch (317:33): [True: 45.1k, False: 248]
  ------------------
  318|  45.1k|      {
  319|  45.1k|        __m128i v = _mm_loadu_si128((const __m128i*)s);
  320|  45.1k|        int ff = _mm_movemask_epi8(_mm_cmpeq_epi8(v, _mm_set1_epi8(-1)));
  321|  45.1k|        if (ff != 0 || prev_ff)
  ------------------
  |  Branch (321:13): [True: 35.4k, False: 9.72k]
  |  Branch (321:24): [True: 402, False: 9.32k]
  ------------------
  322|  35.8k|        { // process these 16 bytes one at a time
  323|   609k|          for (int i = 0; i < 16; ++i) {
  ------------------
  |  Branch (323:27): [True: 573k, False: 35.8k]
  ------------------
  324|   573k|            ui8 b = *s++;
  325|   573k|            acc |= (ui64)b << nb;
  326|   573k|            nb += prev_ff ? 7u : 8u;
  ------------------
  |  Branch (326:19): [True: 189k, False: 383k]
  ------------------
  327|   573k|            prev_ff = (b == 0xFFu);
  328|   573k|            if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (328:17): [True: 545k, False: 27.7k]
  ------------------
  329|   573k|          }
  330|  35.8k|          continue;
  331|  35.8k|        }
  332|  9.32k|        ui64 v0, v1;
  333|  9.32k|        memcpy(&v0, s, 8);
  334|  9.32k|        memcpy(&v1, s + 8, 8);
  335|  9.32k|        ui64 w0 = acc | (v0 << nb);
  336|  9.32k|        ui64 w1 = (v1 << nb) | (nb ? (v0 >> (64 - nb)) : 0);
  ------------------
  |  Branch (336:33): [True: 6.19k, False: 3.12k]
  ------------------
  337|  9.32k|        memcpy(o, &w0, 8);
  338|  9.32k|        memcpy(o + 8, &w1, 8);
  339|  9.32k|        acc = nb ? (v1 >> (64 - nb)) : 0;
  ------------------
  |  Branch (339:15): [True: 6.19k, False: 3.12k]
  ------------------
  340|  9.32k|        o += 16;
  341|  9.32k|        s += 16;
  342|  9.32k|      }
  343|       |      // tail; one byte at a time
  344|   121k|      while (s < s_end && o < o_end)
  ------------------
  |  Branch (344:14): [True: 107k, False: 14.4k]
  |  Branch (344:27): [True: 106k, False: 247]
  ------------------
  345|   106k|      {
  346|   106k|        ui8 b = *s++;
  347|   106k|        acc |= (ui64)b << nb;
  348|   106k|        nb += prev_ff ? 7u : 8u;
  ------------------
  |  Branch (348:15): [True: 19.4k, False: 87.2k]
  ------------------
  349|   106k|        prev_ff = (b == 0xFFu);
  350|   106k|        if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (350:13): [True: 102k, False: 4.41k]
  ------------------
  351|   106k|      }
  352|       |      // fill the bits above nb with X, and pad with X bytes
  353|  14.6k|      ui32 fill = (X == 0xFF) ? (0xFFu << nb) : 0;
  ------------------
  |  Branch (353:19): [Folded, False: 14.6k]
  ------------------
  354|  14.6k|      *o = (ui8)((ui32)acc | fill);
  355|  14.6k|      __m256i pad = _mm256_set1_epi8((char)X);
  356|  14.6k|      _mm256_storeu_si256((__m256i*)(o + 1), pad);
  357|  14.6k|      _mm256_storeu_si256((__m256i*)(o + 33), pad);
  358|  14.6k|      return (ui32)(o - dst) + 1;
  359|  14.6k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8dfetch64EPKhjj:
  402|   168k|    {
  403|   168k|      ui32 off = pos >> 3;
  404|   168k|      off = off < limit ? off : limit;
  ------------------
  |  Branch (404:13): [True: 132k, False: 36.7k]
  ------------------
  405|   168k|      ui64 v;
  406|   168k|      memcpy(&v, dbuf + off, 8);
  407|   168k|      return v >> (pos & 7);
  408|   168k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11destuff_mrpEPKhiiPhj:
  615|  10.1k|    {
  616|  10.1k|      return destuff_rev(data + lcup + len2 - 1, len2, true, 0, 0,
  617|  10.1k|                         dst, cap);
  618|  10.1k|    }

_ZN4ojph5local31initialize_block_encoder_tablesEv:
  258|  5.64M|    bool initialize_block_encoder_tables() {
  259|  5.64M|      static bool tables_initialized = false;
  260|  5.64M|      static std::once_flag tables_initialized_flag;
  261|  5.64M|      std::call_once(tables_initialized_flag, []() {
  262|  5.64M|        memset(vlc_tbl0, 0, 2048 * sizeof(ui16));
  263|  5.64M|        memset(vlc_tbl1, 0, 2048 * sizeof(ui16));
  264|  5.64M|        tables_initialized = vlc_init_tables();
  265|  5.64M|        tables_initialized = tables_initialized && uvlc_init_tables();
  266|  5.64M|      });
  267|  5.64M|      return tables_initialized;
  268|  5.64M|    }
ojph_block_encoder.cpp:_ZZN4ojph5local31initialize_block_encoder_tablesEvENK3$_0clEv:
  261|      1|      std::call_once(tables_initialized_flag, []() {
  262|      1|        memset(vlc_tbl0, 0, 2048 * sizeof(ui16));
  263|      1|        memset(vlc_tbl1, 0, 2048 * sizeof(ui16));
  264|      1|        tables_initialized = vlc_init_tables();
  265|      1|        tables_initialized = tables_initialized && uvlc_init_tables();
  ------------------
  |  Branch (265:30): [True: 1, False: 0]
  |  Branch (265:52): [True: 1, False: 0]
  ------------------
  266|      1|      });
ojph_block_encoder.cpp:_ZN4ojph5localL15vlc_init_tablesEv:
   77|      1|    {
   78|      1|      struct vlc_src_table { int c_q, rho, u_off, e_k, e_1, cwd, cwd_len; };
   79|      1|      vlc_src_table tbl0[] = {
   80|      1|    #include "table0.h"
  ------------------
  |  |    1|      1|{0, 0x1, 0x0, 0x0, 0x0, 0x06, 4},
  |  |    2|      1|{0, 0x1, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |    3|      1|{0, 0x2, 0x0, 0x0, 0x0, 0x00, 3},
  |  |    4|      1|{0, 0x2, 0x1, 0x2, 0x2, 0x7F, 7},
  |  |    5|      1|{0, 0x3, 0x0, 0x0, 0x0, 0x11, 5},
  |  |    6|      1|{0, 0x3, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |    7|      1|{0, 0x3, 0x1, 0x3, 0x1, 0x1F, 7},
  |  |    8|      1|{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3},
  |  |    9|      1|{0, 0x4, 0x1, 0x4, 0x4, 0x13, 6},
  |  |   10|      1|{0, 0x5, 0x0, 0x0, 0x0, 0x0E, 5},
  |  |   11|      1|{0, 0x5, 0x1, 0x4, 0x4, 0x23, 6},
  |  |   12|      1|{0, 0x5, 0x1, 0x5, 0x1, 0x0F, 7},
  |  |   13|      1|{0, 0x6, 0x0, 0x0, 0x0, 0x03, 6},
  |  |   14|      1|{0, 0x6, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |   15|      1|{0, 0x7, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   16|      1|{0, 0x7, 0x1, 0x2, 0x2, 0x4F, 7},
  |  |   17|      1|{0, 0x7, 0x1, 0x2, 0x0, 0x0D, 6},
  |  |   18|      1|{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3},
  |  |   19|      1|{0, 0x8, 0x1, 0x8, 0x8, 0x3D, 6},
  |  |   20|      1|{0, 0x9, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |   21|      1|{0, 0x9, 0x1, 0x0, 0x0, 0x2D, 6},
  |  |   22|      1|{0, 0xA, 0x0, 0x0, 0x0, 0x01, 5},
  |  |   23|      1|{0, 0xA, 0x1, 0x8, 0x8, 0x35, 6},
  |  |   24|      1|{0, 0xA, 0x1, 0xA, 0x2, 0x77, 7},
  |  |   25|      1|{0, 0xB, 0x0, 0x0, 0x0, 0x37, 7},
  |  |   26|      1|{0, 0xB, 0x1, 0x1, 0x1, 0x57, 7},
  |  |   27|      1|{0, 0xB, 0x1, 0x1, 0x0, 0x09, 6},
  |  |   28|      1|{0, 0xC, 0x0, 0x0, 0x0, 0x1E, 5},
  |  |   29|      1|{0, 0xC, 0x1, 0xC, 0xC, 0x17, 7},
  |  |   30|      1|{0, 0xC, 0x1, 0xC, 0x4, 0x15, 6},
  |  |   31|      1|{0, 0xC, 0x1, 0xC, 0x8, 0x25, 6},
  |  |   32|      1|{0, 0xD, 0x0, 0x0, 0x0, 0x67, 7},
  |  |   33|      1|{0, 0xD, 0x1, 0x1, 0x1, 0x27, 7},
  |  |   34|      1|{0, 0xD, 0x1, 0x5, 0x4, 0x47, 7},
  |  |   35|      1|{0, 0xD, 0x1, 0xD, 0x8, 0x07, 7},
  |  |   36|      1|{0, 0xE, 0x0, 0x0, 0x0, 0x7B, 7},
  |  |   37|      1|{0, 0xE, 0x1, 0x2, 0x2, 0x4B, 7},
  |  |   38|      1|{0, 0xE, 0x1, 0xA, 0x8, 0x05, 6},
  |  |   39|      1|{0, 0xE, 0x1, 0xE, 0x4, 0x3B, 7},
  |  |   40|      1|{0, 0xF, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |   41|      1|{0, 0xF, 0x1, 0x9, 0x9, 0x1B, 7},
  |  |   42|      1|{0, 0xF, 0x1, 0xB, 0xA, 0x6B, 7},
  |  |   43|      1|{0, 0xF, 0x1, 0xF, 0xC, 0x2B, 7},
  |  |   44|      1|{0, 0xF, 0x1, 0xF, 0x8, 0x39, 6},
  |  |   45|      1|{0, 0xF, 0x1, 0xE, 0x6, 0x73, 7},
  |  |   46|      1|{0, 0xF, 0x1, 0xE, 0x2, 0x19, 6},
  |  |   47|      1|{0, 0xF, 0x1, 0xF, 0x5, 0x0B, 7},
  |  |   48|      1|{0, 0xF, 0x1, 0xF, 0x4, 0x29, 6},
  |  |   49|      1|{0, 0xF, 0x1, 0xF, 0x1, 0x33, 7},
  |  |   50|      1|{1, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |   51|      1|{1, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
  |  |   52|      1|{1, 0x1, 0x1, 0x1, 0x1, 0x1F, 7},
  |  |   53|      1|{1, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
  |  |   54|      1|{1, 0x2, 0x1, 0x2, 0x2, 0x3B, 6},
  |  |   55|      1|{1, 0x3, 0x0, 0x0, 0x0, 0x1B, 6},
  |  |   56|      1|{1, 0x3, 0x1, 0x0, 0x0, 0x3D, 6},
  |  |   57|      1|{1, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |   58|      1|{1, 0x4, 0x1, 0x4, 0x4, 0x2B, 6},
  |  |   59|      1|{1, 0x5, 0x0, 0x0, 0x0, 0x0B, 6},
  |  |   60|      1|{1, 0x5, 0x1, 0x4, 0x4, 0x33, 6},
  |  |   61|      1|{1, 0x5, 0x1, 0x5, 0x1, 0x7F, 7},
  |  |   62|      1|{1, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |   63|      1|{1, 0x6, 0x1, 0x0, 0x0, 0x23, 6},
  |  |   64|      1|{1, 0x7, 0x0, 0x0, 0x0, 0x3F, 7},
  |  |   65|      1|{1, 0x7, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |   66|      1|{1, 0x7, 0x1, 0x2, 0x0, 0x03, 6},
  |  |   67|      1|{1, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
  |  |   68|      1|{1, 0x8, 0x1, 0x8, 0x8, 0x1D, 6},
  |  |   69|      1|{1, 0x9, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |   70|      1|{1, 0x9, 0x1, 0x0, 0x0, 0x0D, 6},
  |  |   71|      1|{1, 0xA, 0x0, 0x0, 0x0, 0x35, 6},
  |  |   72|      1|{1, 0xA, 0x1, 0x8, 0x8, 0x15, 6},
  |  |   73|      1|{1, 0xA, 0x1, 0xA, 0x2, 0x6F, 7},
  |  |   74|      1|{1, 0xB, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   75|      1|{1, 0xB, 0x1, 0x1, 0x1, 0x4F, 7},
  |  |   76|      1|{1, 0xB, 0x1, 0x1, 0x0, 0x11, 6},
  |  |   77|      1|{1, 0xC, 0x0, 0x0, 0x0, 0x01, 5},
  |  |   78|      1|{1, 0xC, 0x1, 0x8, 0x8, 0x25, 6},
  |  |   79|      1|{1, 0xC, 0x1, 0xC, 0x4, 0x05, 6},
  |  |   80|      1|{1, 0xD, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   81|      1|{1, 0xD, 0x1, 0x1, 0x1, 0x17, 7},
  |  |   82|      1|{1, 0xD, 0x1, 0x5, 0x4, 0x39, 6},
  |  |   83|      1|{1, 0xD, 0x1, 0xD, 0x8, 0x77, 7},
  |  |   84|      1|{1, 0xE, 0x0, 0x0, 0x0, 0x37, 7},
  |  |   85|      1|{1, 0xE, 0x1, 0x2, 0x2, 0x57, 7},
  |  |   86|      1|{1, 0xE, 0x1, 0xA, 0x8, 0x19, 6},
  |  |   87|      1|{1, 0xE, 0x1, 0xE, 0x4, 0x67, 7},
  |  |   88|      1|{1, 0xF, 0x0, 0x0, 0x0, 0x07, 7},
  |  |   89|      1|{1, 0xF, 0x1, 0xB, 0x8, 0x29, 6},
  |  |   90|      1|{1, 0xF, 0x1, 0x8, 0x8, 0x27, 7},
  |  |   91|      1|{1, 0xF, 0x1, 0xA, 0x2, 0x09, 6},
  |  |   92|      1|{1, 0xF, 0x1, 0xE, 0x4, 0x31, 6},
  |  |   93|      1|{1, 0xF, 0x1, 0xF, 0x1, 0x47, 7},
  |  |   94|      1|{2, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |   95|      1|{2, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
  |  |   96|      1|{2, 0x1, 0x1, 0x1, 0x1, 0x1B, 6},
  |  |   97|      1|{2, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
  |  |   98|      1|{2, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |   99|      1|{2, 0x3, 0x0, 0x0, 0x0, 0x2B, 6},
  |  |  100|      1|{2, 0x3, 0x1, 0x1, 0x1, 0x33, 6},
  |  |  101|      1|{2, 0x3, 0x1, 0x3, 0x2, 0x7F, 7},
  |  |  102|      1|{2, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |  103|      1|{2, 0x4, 0x1, 0x4, 0x4, 0x0B, 6},
  |  |  104|      1|{2, 0x5, 0x0, 0x0, 0x0, 0x01, 5},
  |  |  105|      1|{2, 0x5, 0x1, 0x5, 0x5, 0x2F, 7},
  |  |  106|      1|{2, 0x5, 0x1, 0x5, 0x1, 0x13, 6},
  |  |  107|      1|{2, 0x5, 0x1, 0x5, 0x4, 0x23, 6},
  |  |  108|      1|{2, 0x6, 0x0, 0x0, 0x0, 0x03, 6},
  |  |  109|      1|{2, 0x6, 0x1, 0x0, 0x0, 0x5F, 7},
  |  |  110|      1|{2, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
  |  |  111|      1|{2, 0x7, 0x1, 0x2, 0x2, 0x6F, 7},
  |  |  112|      1|{2, 0x7, 0x1, 0x3, 0x1, 0x11, 6},
  |  |  113|      1|{2, 0x7, 0x1, 0x7, 0x4, 0x37, 7},
  |  |  114|      1|{2, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  115|      1|{2, 0x8, 0x1, 0x8, 0x8, 0x4F, 7},
  |  |  116|      1|{2, 0x9, 0x0, 0x0, 0x0, 0x3D, 6},
  |  |  117|      1|{2, 0x9, 0x1, 0x0, 0x0, 0x1D, 6},
  |  |  118|      1|{2, 0xA, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  119|      1|{2, 0xA, 0x1, 0x0, 0x0, 0x0D, 6},
  |  |  120|      1|{2, 0xB, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |  121|      1|{2, 0xB, 0x1, 0x2, 0x2, 0x77, 7},
  |  |  122|      1|{2, 0xB, 0x1, 0x2, 0x0, 0x35, 6},
  |  |  123|      1|{2, 0xC, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  124|      1|{2, 0xC, 0x1, 0x4, 0x4, 0x25, 6},
  |  |  125|      1|{2, 0xC, 0x1, 0xC, 0x8, 0x57, 7},
  |  |  126|      1|{2, 0xD, 0x0, 0x0, 0x0, 0x17, 7},
  |  |  127|      1|{2, 0xD, 0x1, 0x8, 0x8, 0x05, 6},
  |  |  128|      1|{2, 0xD, 0x1, 0xC, 0x4, 0x39, 6},
  |  |  129|      1|{2, 0xD, 0x1, 0xD, 0x1, 0x67, 7},
  |  |  130|      1|{2, 0xE, 0x0, 0x0, 0x0, 0x27, 7},
  |  |  131|      1|{2, 0xE, 0x1, 0x2, 0x2, 0x7B, 7},
  |  |  132|      1|{2, 0xE, 0x1, 0x2, 0x0, 0x19, 6},
  |  |  133|      1|{2, 0xF, 0x0, 0x0, 0x0, 0x47, 7},
  |  |  134|      1|{2, 0xF, 0x1, 0xF, 0x1, 0x29, 6},
  |  |  135|      1|{2, 0xF, 0x1, 0x1, 0x1, 0x09, 6},
  |  |  136|      1|{2, 0xF, 0x1, 0x3, 0x2, 0x07, 7},
  |  |  137|      1|{2, 0xF, 0x1, 0x7, 0x4, 0x31, 6},
  |  |  138|      1|{2, 0xF, 0x1, 0xF, 0x8, 0x3B, 7},
  |  |  139|      1|{3, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  140|      1|{3, 0x1, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  141|      1|{3, 0x1, 0x1, 0x1, 0x1, 0x3D, 6},
  |  |  142|      1|{3, 0x2, 0x0, 0x0, 0x0, 0x0C, 5},
  |  |  143|      1|{3, 0x2, 0x1, 0x2, 0x2, 0x4F, 7},
  |  |  144|      1|{3, 0x3, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  145|      1|{3, 0x3, 0x1, 0x1, 0x1, 0x05, 6},
  |  |  146|      1|{3, 0x3, 0x1, 0x3, 0x2, 0x7F, 7},
  |  |  147|      1|{3, 0x4, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  148|      1|{3, 0x4, 0x1, 0x4, 0x4, 0x2D, 6},
  |  |  149|      1|{3, 0x5, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  150|      1|{3, 0x5, 0x1, 0x5, 0x5, 0x1A, 5},
  |  |  151|      1|{3, 0x5, 0x1, 0x5, 0x1, 0x0D, 6},
  |  |  152|      1|{3, 0x5, 0x1, 0x5, 0x4, 0x35, 6},
  |  |  153|      1|{3, 0x6, 0x0, 0x0, 0x0, 0x3F, 7},
  |  |  154|      1|{3, 0x6, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |  155|      1|{3, 0x6, 0x1, 0x6, 0x2, 0x1F, 7},
  |  |  156|      1|{3, 0x7, 0x0, 0x0, 0x0, 0x6F, 7},
  |  |  157|      1|{3, 0x7, 0x1, 0x6, 0x6, 0x2F, 7},
  |  |  158|      1|{3, 0x7, 0x1, 0x6, 0x4, 0x15, 6},
  |  |  159|      1|{3, 0x7, 0x1, 0x7, 0x3, 0x77, 7},
  |  |  160|      1|{3, 0x7, 0x1, 0x7, 0x1, 0x25, 6},
  |  |  161|      1|{3, 0x7, 0x1, 0x7, 0x2, 0x0F, 7},
  |  |  162|      1|{3, 0x8, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  163|      1|{3, 0x8, 0x1, 0x8, 0x8, 0x07, 7},
  |  |  164|      1|{3, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  165|      1|{3, 0x9, 0x1, 0x1, 0x1, 0x37, 7},
  |  |  166|      1|{3, 0x9, 0x1, 0x9, 0x8, 0x57, 7},
  |  |  167|      1|{3, 0xA, 0x0, 0x0, 0x0, 0x19, 6},
  |  |  168|      1|{3, 0xA, 0x1, 0x8, 0x8, 0x29, 6},
  |  |  169|      1|{3, 0xA, 0x1, 0xA, 0x2, 0x17, 7},
  |  |  170|      1|{3, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  171|      1|{3, 0xB, 0x1, 0xB, 0x1, 0x27, 7},
  |  |  172|      1|{3, 0xB, 0x1, 0x1, 0x1, 0x47, 7},
  |  |  173|      1|{3, 0xB, 0x1, 0x3, 0x2, 0x09, 6},
  |  |  174|      1|{3, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
  |  |  175|      1|{3, 0xC, 0x0, 0x0, 0x0, 0x31, 6},
  |  |  176|      1|{3, 0xC, 0x1, 0x4, 0x4, 0x11, 6},
  |  |  177|      1|{3, 0xC, 0x1, 0xC, 0x8, 0x3B, 7},
  |  |  178|      1|{3, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  179|      1|{3, 0xD, 0x1, 0x9, 0x9, 0x1B, 7},
  |  |  180|      1|{3, 0xD, 0x1, 0xD, 0x5, 0x2B, 7},
  |  |  181|      1|{3, 0xD, 0x1, 0xD, 0x1, 0x21, 6},
  |  |  182|      1|{3, 0xD, 0x1, 0xD, 0xC, 0x6B, 7},
  |  |  183|      1|{3, 0xD, 0x1, 0xD, 0x4, 0x01, 6},
  |  |  184|      1|{3, 0xD, 0x1, 0xD, 0x8, 0x4B, 7},
  |  |  185|      1|{3, 0xE, 0x0, 0x0, 0x0, 0x0B, 7},
  |  |  186|      1|{3, 0xE, 0x1, 0xE, 0x4, 0x73, 7},
  |  |  187|      1|{3, 0xE, 0x1, 0x4, 0x4, 0x13, 7},
  |  |  188|      1|{3, 0xE, 0x1, 0xC, 0x8, 0x3E, 6},
  |  |  189|      1|{3, 0xE, 0x1, 0xE, 0x2, 0x33, 7},
  |  |  190|      1|{3, 0xF, 0x0, 0x0, 0x0, 0x53, 7},
  |  |  191|      1|{3, 0xF, 0x1, 0xA, 0xA, 0x0E, 6},
  |  |  192|      1|{3, 0xF, 0x1, 0xB, 0x9, 0x63, 7},
  |  |  193|      1|{3, 0xF, 0x1, 0xF, 0xC, 0x03, 7},
  |  |  194|      1|{3, 0xF, 0x1, 0xF, 0x8, 0x12, 5},
  |  |  195|      1|{3, 0xF, 0x1, 0xE, 0x6, 0x23, 7},
  |  |  196|      1|{3, 0xF, 0x1, 0xF, 0x5, 0x1E, 6},
  |  |  197|      1|{3, 0xF, 0x1, 0xF, 0x4, 0x02, 5},
  |  |  198|      1|{3, 0xF, 0x1, 0xF, 0x3, 0x43, 7},
  |  |  199|      1|{3, 0xF, 0x1, 0xF, 0x1, 0x1C, 5},
  |  |  200|      1|{3, 0xF, 0x1, 0xF, 0x2, 0x2E, 6},
  |  |  201|      1|{4, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |  202|      1|{4, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
  |  |  203|      1|{4, 0x1, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |  204|      1|{4, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
  |  |  205|      1|{4, 0x2, 0x1, 0x2, 0x2, 0x1B, 6},
  |  |  206|      1|{4, 0x3, 0x0, 0x0, 0x0, 0x2B, 6},
  |  |  207|      1|{4, 0x3, 0x1, 0x2, 0x2, 0x3D, 6},
  |  |  208|      1|{4, 0x3, 0x1, 0x3, 0x1, 0x7F, 7},
  |  |  209|      1|{4, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |  210|      1|{4, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |  211|      1|{4, 0x5, 0x0, 0x0, 0x0, 0x0B, 6},
  |  |  212|      1|{4, 0x5, 0x1, 0x0, 0x0, 0x33, 6},
  |  |  213|      1|{4, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |  214|      1|{4, 0x6, 0x1, 0x0, 0x0, 0x23, 6},
  |  |  215|      1|{4, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
  |  |  216|      1|{4, 0x7, 0x1, 0x4, 0x4, 0x6F, 7},
  |  |  217|      1|{4, 0x7, 0x1, 0x4, 0x0, 0x03, 6},
  |  |  218|      1|{4, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  219|      1|{4, 0x8, 0x1, 0x8, 0x8, 0x1D, 6},
  |  |  220|      1|{4, 0x9, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  221|      1|{4, 0x9, 0x1, 0x0, 0x0, 0x77, 7},
  |  |  222|      1|{4, 0xA, 0x0, 0x0, 0x0, 0x01, 5},
  |  |  223|      1|{4, 0xA, 0x1, 0xA, 0xA, 0x2F, 7},
  |  |  224|      1|{4, 0xA, 0x1, 0xA, 0x2, 0x2D, 6},
  |  |  225|      1|{4, 0xA, 0x1, 0xA, 0x8, 0x0D, 6},
  |  |  226|      1|{4, 0xB, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  227|      1|{4, 0xB, 0x1, 0xB, 0x2, 0x0F, 7},
  |  |  228|      1|{4, 0xB, 0x1, 0x0, 0x0, 0x35, 6},
  |  |  229|      1|{4, 0xC, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  230|      1|{4, 0xC, 0x1, 0x8, 0x8, 0x25, 6},
  |  |  231|      1|{4, 0xC, 0x1, 0xC, 0x4, 0x37, 7},
  |  |  232|      1|{4, 0xD, 0x0, 0x0, 0x0, 0x57, 7},
  |  |  233|      1|{4, 0xD, 0x1, 0x1, 0x1, 0x07, 7},
  |  |  234|      1|{4, 0xD, 0x1, 0x1, 0x0, 0x05, 6},
  |  |  235|      1|{4, 0xE, 0x0, 0x0, 0x0, 0x17, 7},
  |  |  236|      1|{4, 0xE, 0x1, 0x4, 0x4, 0x39, 6},
  |  |  237|      1|{4, 0xE, 0x1, 0xC, 0x8, 0x19, 6},
  |  |  238|      1|{4, 0xE, 0x1, 0xE, 0x2, 0x67, 7},
  |  |  239|      1|{4, 0xF, 0x0, 0x0, 0x0, 0x27, 7},
  |  |  240|      1|{4, 0xF, 0x1, 0x9, 0x9, 0x47, 7},
  |  |  241|      1|{4, 0xF, 0x1, 0x9, 0x1, 0x29, 6},
  |  |  242|      1|{4, 0xF, 0x1, 0x7, 0x6, 0x7B, 7},
  |  |  243|      1|{4, 0xF, 0x1, 0x7, 0x2, 0x09, 6},
  |  |  244|      1|{4, 0xF, 0x1, 0xB, 0x8, 0x31, 6},
  |  |  245|      1|{4, 0xF, 0x1, 0xF, 0x4, 0x3B, 7},
  |  |  246|      1|{5, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  247|      1|{5, 0x1, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  248|      1|{5, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |  249|      1|{5, 0x2, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  250|      1|{5, 0x2, 0x1, 0x2, 0x2, 0x1D, 6},
  |  |  251|      1|{5, 0x3, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  252|      1|{5, 0x3, 0x1, 0x3, 0x3, 0x5F, 7},
  |  |  253|      1|{5, 0x3, 0x1, 0x3, 0x2, 0x39, 6},
  |  |  254|      1|{5, 0x3, 0x1, 0x3, 0x1, 0x3F, 7},
  |  |  255|      1|{5, 0x4, 0x0, 0x0, 0x0, 0x12, 5},
  |  |  256|      1|{5, 0x4, 0x1, 0x4, 0x4, 0x1F, 7},
  |  |  257|      1|{5, 0x5, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |  258|      1|{5, 0x5, 0x1, 0x4, 0x4, 0x35, 6},
  |  |  259|      1|{5, 0x5, 0x1, 0x5, 0x1, 0x6F, 7},
  |  |  260|      1|{5, 0x6, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  261|      1|{5, 0x6, 0x1, 0x2, 0x2, 0x25, 6},
  |  |  262|      1|{5, 0x6, 0x1, 0x6, 0x4, 0x2F, 7},
  |  |  263|      1|{5, 0x7, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  264|      1|{5, 0x7, 0x1, 0x6, 0x6, 0x57, 7},
  |  |  265|      1|{5, 0x7, 0x1, 0x6, 0x4, 0x05, 6},
  |  |  266|      1|{5, 0x7, 0x1, 0x7, 0x3, 0x0F, 7},
  |  |  267|      1|{5, 0x7, 0x1, 0x7, 0x2, 0x77, 7},
  |  |  268|      1|{5, 0x7, 0x1, 0x7, 0x1, 0x37, 7},
  |  |  269|      1|{5, 0x8, 0x0, 0x0, 0x0, 0x02, 5},
  |  |  270|      1|{5, 0x8, 0x1, 0x8, 0x8, 0x19, 6},
  |  |  271|      1|{5, 0x9, 0x0, 0x0, 0x0, 0x26, 6},
  |  |  272|      1|{5, 0x9, 0x1, 0x8, 0x8, 0x17, 7},
  |  |  273|      1|{5, 0x9, 0x1, 0x9, 0x1, 0x67, 7},
  |  |  274|      1|{5, 0xA, 0x0, 0x0, 0x0, 0x1C, 5},
  |  |  275|      1|{5, 0xA, 0x1, 0xA, 0xA, 0x29, 6},
  |  |  276|      1|{5, 0xA, 0x1, 0xA, 0x2, 0x09, 6},
  |  |  277|      1|{5, 0xA, 0x1, 0xA, 0x8, 0x31, 6},
  |  |  278|      1|{5, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
  |  |  279|      1|{5, 0xB, 0x1, 0x9, 0x9, 0x07, 7},
  |  |  280|      1|{5, 0xB, 0x1, 0x9, 0x8, 0x11, 6},
  |  |  281|      1|{5, 0xB, 0x1, 0xB, 0x3, 0x47, 7},
  |  |  282|      1|{5, 0xB, 0x1, 0xB, 0x2, 0x21, 6},
  |  |  283|      1|{5, 0xB, 0x1, 0xB, 0x1, 0x7B, 7},
  |  |  284|      1|{5, 0xC, 0x0, 0x0, 0x0, 0x01, 6},
  |  |  285|      1|{5, 0xC, 0x1, 0x8, 0x8, 0x3E, 6},
  |  |  286|      1|{5, 0xC, 0x1, 0xC, 0x4, 0x3B, 7},
  |  |  287|      1|{5, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  288|      1|{5, 0xD, 0x1, 0x9, 0x9, 0x6B, 7},
  |  |  289|      1|{5, 0xD, 0x1, 0x9, 0x8, 0x1E, 6},
  |  |  290|      1|{5, 0xD, 0x1, 0xD, 0x5, 0x1B, 7},
  |  |  291|      1|{5, 0xD, 0x1, 0xD, 0x4, 0x2E, 6},
  |  |  292|      1|{5, 0xD, 0x1, 0xD, 0x1, 0x2B, 7},
  |  |  293|      1|{5, 0xE, 0x0, 0x0, 0x0, 0x4B, 7},
  |  |  294|      1|{5, 0xE, 0x1, 0x6, 0x6, 0x0B, 7},
  |  |  295|      1|{5, 0xE, 0x1, 0xE, 0xA, 0x33, 7},
  |  |  296|      1|{5, 0xE, 0x1, 0xE, 0x2, 0x0E, 6},
  |  |  297|      1|{5, 0xE, 0x1, 0xE, 0xC, 0x73, 7},
  |  |  298|      1|{5, 0xE, 0x1, 0xE, 0x8, 0x36, 6},
  |  |  299|      1|{5, 0xE, 0x1, 0xE, 0x4, 0x53, 7},
  |  |  300|      1|{5, 0xF, 0x0, 0x0, 0x0, 0x13, 7},
  |  |  301|      1|{5, 0xF, 0x1, 0x7, 0x7, 0x43, 7},
  |  |  302|      1|{5, 0xF, 0x1, 0x7, 0x6, 0x16, 6},
  |  |  303|      1|{5, 0xF, 0x1, 0x7, 0x5, 0x63, 7},
  |  |  304|      1|{5, 0xF, 0x1, 0xF, 0xC, 0x23, 7},
  |  |  305|      1|{5, 0xF, 0x1, 0xF, 0x4, 0x0C, 5},
  |  |  306|      1|{5, 0xF, 0x1, 0xD, 0x9, 0x03, 7},
  |  |  307|      1|{5, 0xF, 0x1, 0xF, 0xA, 0x3D, 7},
  |  |  308|      1|{5, 0xF, 0x1, 0xF, 0x8, 0x14, 5},
  |  |  309|      1|{5, 0xF, 0x1, 0xF, 0x3, 0x7D, 7},
  |  |  310|      1|{5, 0xF, 0x1, 0xF, 0x2, 0x04, 5},
  |  |  311|      1|{5, 0xF, 0x1, 0xF, 0x1, 0x06, 6},
  |  |  312|      1|{6, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  313|      1|{6, 0x1, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  314|      1|{6, 0x1, 0x1, 0x1, 0x1, 0x03, 6},
  |  |  315|      1|{6, 0x2, 0x0, 0x0, 0x0, 0x0C, 5},
  |  |  316|      1|{6, 0x2, 0x1, 0x2, 0x2, 0x0D, 6},
  |  |  317|      1|{6, 0x3, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  318|      1|{6, 0x3, 0x1, 0x3, 0x3, 0x3D, 6},
  |  |  319|      1|{6, 0x3, 0x1, 0x3, 0x1, 0x1D, 6},
  |  |  320|      1|{6, 0x3, 0x1, 0x3, 0x2, 0x2D, 6},
  |  |  321|      1|{6, 0x4, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  322|      1|{6, 0x4, 0x1, 0x4, 0x4, 0x3F, 7},
  |  |  323|      1|{6, 0x5, 0x0, 0x0, 0x0, 0x35, 6},
  |  |  324|      1|{6, 0x5, 0x1, 0x1, 0x1, 0x15, 6},
  |  |  325|      1|{6, 0x5, 0x1, 0x5, 0x4, 0x7F, 7},
  |  |  326|      1|{6, 0x6, 0x0, 0x0, 0x0, 0x25, 6},
  |  |  327|      1|{6, 0x6, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |  328|      1|{6, 0x6, 0x1, 0x6, 0x4, 0x1F, 7},
  |  |  329|      1|{6, 0x7, 0x0, 0x0, 0x0, 0x6F, 7},
  |  |  330|      1|{6, 0x7, 0x1, 0x6, 0x6, 0x4F, 7},
  |  |  331|      1|{6, 0x7, 0x1, 0x6, 0x4, 0x05, 6},
  |  |  332|      1|{6, 0x7, 0x1, 0x7, 0x3, 0x2F, 7},
  |  |  333|      1|{6, 0x7, 0x1, 0x7, 0x1, 0x36, 6},
  |  |  334|      1|{6, 0x7, 0x1, 0x7, 0x2, 0x77, 7},
  |  |  335|      1|{6, 0x8, 0x0, 0x0, 0x0, 0x12, 5},
  |  |  336|      1|{6, 0x8, 0x1, 0x8, 0x8, 0x0F, 7},
  |  |  337|      1|{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  338|      1|{6, 0x9, 0x1, 0x1, 0x1, 0x37, 7},
  |  |  339|      1|{6, 0x9, 0x1, 0x9, 0x8, 0x57, 7},
  |  |  340|      1|{6, 0xA, 0x0, 0x0, 0x0, 0x19, 6},
  |  |  341|      1|{6, 0xA, 0x1, 0x2, 0x2, 0x29, 6},
  |  |  342|      1|{6, 0xA, 0x1, 0xA, 0x8, 0x17, 7},
  |  |  343|      1|{6, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  344|      1|{6, 0xB, 0x1, 0x9, 0x9, 0x47, 7},
  |  |  345|      1|{6, 0xB, 0x1, 0x9, 0x1, 0x09, 6},
  |  |  346|      1|{6, 0xB, 0x1, 0xB, 0xA, 0x27, 7},
  |  |  347|      1|{6, 0xB, 0x1, 0xB, 0x2, 0x31, 6},
  |  |  348|      1|{6, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
  |  |  349|      1|{6, 0xC, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  350|      1|{6, 0xC, 0x1, 0xC, 0xC, 0x07, 7},
  |  |  351|      1|{6, 0xC, 0x1, 0xC, 0x8, 0x21, 6},
  |  |  352|      1|{6, 0xC, 0x1, 0xC, 0x4, 0x3B, 7},
  |  |  353|      1|{6, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  354|      1|{6, 0xD, 0x1, 0x5, 0x5, 0x33, 7},
  |  |  355|      1|{6, 0xD, 0x1, 0x5, 0x4, 0x01, 6},
  |  |  356|      1|{6, 0xD, 0x1, 0xC, 0x8, 0x1B, 7},
  |  |  357|      1|{6, 0xD, 0x1, 0xD, 0x1, 0x6B, 7},
  |  |  358|      1|{6, 0xE, 0x0, 0x0, 0x0, 0x2B, 7},
  |  |  359|      1|{6, 0xE, 0x1, 0xE, 0x2, 0x4B, 7},
  |  |  360|      1|{6, 0xE, 0x1, 0x2, 0x2, 0x0B, 7},
  |  |  361|      1|{6, 0xE, 0x1, 0xE, 0xC, 0x73, 7},
  |  |  362|      1|{6, 0xE, 0x1, 0xE, 0x8, 0x3E, 6},
  |  |  363|      1|{6, 0xE, 0x1, 0xE, 0x4, 0x53, 7},
  |  |  364|      1|{6, 0xF, 0x0, 0x0, 0x0, 0x13, 7},
  |  |  365|      1|{6, 0xF, 0x1, 0x6, 0x6, 0x1E, 6},
  |  |  366|      1|{6, 0xF, 0x1, 0xE, 0xA, 0x2E, 6},
  |  |  367|      1|{6, 0xF, 0x1, 0xF, 0x3, 0x0E, 6},
  |  |  368|      1|{6, 0xF, 0x1, 0xF, 0x2, 0x02, 5},
  |  |  369|      1|{6, 0xF, 0x1, 0xB, 0x9, 0x63, 7},
  |  |  370|      1|{6, 0xF, 0x1, 0xF, 0xC, 0x16, 6},
  |  |  371|      1|{6, 0xF, 0x1, 0xF, 0x8, 0x06, 6},
  |  |  372|      1|{6, 0xF, 0x1, 0xF, 0x5, 0x23, 7},
  |  |  373|      1|{6, 0xF, 0x1, 0xF, 0x1, 0x1C, 5},
  |  |  374|      1|{6, 0xF, 0x1, 0xF, 0x4, 0x26, 6},
  |  |  375|      1|{7, 0x0, 0x0, 0x0, 0x0, 0x12, 5},
  |  |  376|      1|{7, 0x1, 0x0, 0x0, 0x0, 0x05, 6},
  |  |  377|      1|{7, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |  378|      1|{7, 0x2, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  379|      1|{7, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  380|      1|{7, 0x3, 0x0, 0x0, 0x0, 0x5F, 7},
  |  |  381|      1|{7, 0x3, 0x1, 0x3, 0x3, 0x1F, 7},
  |  |  382|      1|{7, 0x3, 0x1, 0x3, 0x2, 0x6F, 7},
  |  |  383|      1|{7, 0x3, 0x1, 0x3, 0x1, 0x2F, 7},
  |  |  384|      1|{7, 0x4, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  385|      1|{7, 0x4, 0x1, 0x4, 0x4, 0x0F, 7},
  |  |  386|      1|{7, 0x5, 0x0, 0x0, 0x0, 0x57, 7},
  |  |  387|      1|{7, 0x5, 0x1, 0x1, 0x1, 0x19, 6},
  |  |  388|      1|{7, 0x5, 0x1, 0x5, 0x4, 0x77, 7},
  |  |  389|      1|{7, 0x6, 0x0, 0x0, 0x0, 0x37, 7},
  |  |  390|      1|{7, 0x6, 0x1, 0x0, 0x0, 0x29, 6},
  |  |  391|      1|{7, 0x7, 0x0, 0x0, 0x0, 0x17, 7},
  |  |  392|      1|{7, 0x7, 0x1, 0x6, 0x6, 0x67, 7},
  |  |  393|      1|{7, 0x7, 0x1, 0x7, 0x3, 0x27, 7},
  |  |  394|      1|{7, 0x7, 0x1, 0x7, 0x2, 0x47, 7},
  |  |  395|      1|{7, 0x7, 0x1, 0x7, 0x5, 0x1B, 7},
  |  |  396|      1|{7, 0x7, 0x1, 0x7, 0x1, 0x09, 6},
  |  |  397|      1|{7, 0x7, 0x1, 0x7, 0x4, 0x07, 7},
  |  |  398|      1|{7, 0x8, 0x0, 0x0, 0x0, 0x7B, 7},
  |  |  399|      1|{7, 0x8, 0x1, 0x8, 0x8, 0x3B, 7},
  |  |  400|      1|{7, 0x9, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  401|      1|{7, 0x9, 0x1, 0x0, 0x0, 0x31, 6},
  |  |  402|      1|{7, 0xA, 0x0, 0x0, 0x0, 0x53, 7},
  |  |  403|      1|{7, 0xA, 0x1, 0x2, 0x2, 0x11, 6},
  |  |  404|      1|{7, 0xA, 0x1, 0xA, 0x8, 0x6B, 7},
  |  |  405|      1|{7, 0xB, 0x0, 0x0, 0x0, 0x2B, 7},
  |  |  406|      1|{7, 0xB, 0x1, 0x9, 0x9, 0x4B, 7},
  |  |  407|      1|{7, 0xB, 0x1, 0xB, 0x3, 0x0B, 7},
  |  |  408|      1|{7, 0xB, 0x1, 0xB, 0x1, 0x73, 7},
  |  |  409|      1|{7, 0xB, 0x1, 0xB, 0xA, 0x33, 7},
  |  |  410|      1|{7, 0xB, 0x1, 0xB, 0x2, 0x21, 6},
  |  |  411|      1|{7, 0xB, 0x1, 0xB, 0x8, 0x13, 7},
  |  |  412|      1|{7, 0xC, 0x0, 0x0, 0x0, 0x63, 7},
  |  |  413|      1|{7, 0xC, 0x1, 0x8, 0x8, 0x23, 7},
  |  |  414|      1|{7, 0xC, 0x1, 0xC, 0x4, 0x43, 7},
  |  |  415|      1|{7, 0xD, 0x0, 0x0, 0x0, 0x03, 7},
  |  |  416|      1|{7, 0xD, 0x1, 0x9, 0x9, 0x7D, 7},
  |  |  417|      1|{7, 0xD, 0x1, 0xD, 0x5, 0x5D, 7},
  |  |  418|      1|{7, 0xD, 0x1, 0xD, 0x1, 0x01, 6},
  |  |  419|      1|{7, 0xD, 0x1, 0xD, 0xC, 0x3D, 7},
  |  |  420|      1|{7, 0xD, 0x1, 0xD, 0x4, 0x3E, 6},
  |  |  421|      1|{7, 0xD, 0x1, 0xD, 0x8, 0x1D, 7},
  |  |  422|      1|{7, 0xE, 0x0, 0x0, 0x0, 0x6D, 7},
  |  |  423|      1|{7, 0xE, 0x1, 0x6, 0x6, 0x2D, 7},
  |  |  424|      1|{7, 0xE, 0x1, 0xE, 0xA, 0x0D, 7},
  |  |  425|      1|{7, 0xE, 0x1, 0xE, 0x2, 0x1E, 6},
  |  |  426|      1|{7, 0xE, 0x1, 0xE, 0xC, 0x4D, 7},
  |  |  427|      1|{7, 0xE, 0x1, 0xE, 0x8, 0x0E, 6},
  |  |  428|      1|{7, 0xE, 0x1, 0xE, 0x4, 0x75, 7},
  |  |  429|      1|{7, 0xF, 0x0, 0x0, 0x0, 0x15, 7},
  |  |  430|      1|{7, 0xF, 0x1, 0xF, 0xF, 0x06, 5},
  |  |  431|      1|{7, 0xF, 0x1, 0xF, 0xD, 0x35, 7},
  |  |  432|      1|{7, 0xF, 0x1, 0xF, 0x7, 0x55, 7},
  |  |  433|      1|{7, 0xF, 0x1, 0xF, 0x5, 0x1A, 5},
  |  |  434|      1|{7, 0xF, 0x1, 0xF, 0xB, 0x25, 7},
  |  |  435|      1|{7, 0xF, 0x1, 0xF, 0x3, 0x0A, 5},
  |  |  436|      1|{7, 0xF, 0x1, 0xF, 0x9, 0x2E, 6},
  |  |  437|      1|{7, 0xF, 0x1, 0xF, 0x1, 0x00, 4},
  |  |  438|      1|{7, 0xF, 0x1, 0xF, 0xE, 0x65, 7},
  |  |  439|      1|{7, 0xF, 0x1, 0xF, 0x6, 0x36, 6},
  |  |  440|      1|{7, 0xF, 0x1, 0xF, 0xA, 0x02, 5},
  |  |  441|      1|{7, 0xF, 0x1, 0xF, 0x2, 0x0C, 4},
  |  |  442|      1|{7, 0xF, 0x1, 0xF, 0xC, 0x16, 6},
  |  |  443|      1|{7, 0xF, 0x1, 0xF, 0x8, 0x04, 4},
  |  |  444|      1|{7, 0xF, 0x1, 0xF, 0x4, 0x08, 4}
  ------------------
   81|      1|      };
   82|      1|      size_t tbl0_size = sizeof(tbl0) / sizeof(vlc_src_table);
   83|       |
   84|      1|      si32 pattern_popcnt[16];
   85|     17|      for (ui32 i = 0; i < 16; ++i)
  ------------------
  |  Branch (85:24): [True: 16, False: 1]
  ------------------
   86|     16|        pattern_popcnt[i] = (si32)population_count(i);
   87|       |
   88|      1|      vlc_src_table* src_tbl = tbl0;
   89|      1|      ui16 *tgt_tbl = vlc_tbl0;
   90|      1|      size_t tbl_size = tbl0_size;
   91|  2.04k|      for (int i = 0; i < 2048; ++i)
  ------------------
  |  Branch (91:23): [True: 2.04k, False: 1]
  ------------------
   92|  2.04k|      {
   93|  2.04k|        int c_q = i >> 8, rho = (i >> 4) & 0xF, emb = i & 0xF;
   94|  2.04k|        if (((emb & rho) != emb) || (rho == 0 && c_q == 0))
  ------------------
  |  Branch (94:13): [True: 1.40k, False: 648]
  |  Branch (94:38): [True: 8, False: 640]
  |  Branch (94:50): [True: 1, False: 7]
  ------------------
   95|  1.40k|          tgt_tbl[i] = 0;
   96|    647|        else
   97|    647|        {
   98|    647|          vlc_src_table *best_entry = NULL;
   99|    647|          if (emb) // u_off = 1
  ------------------
  |  Branch (99:15): [True: 520, False: 127]
  ------------------
  100|    520|          {
  101|    520|            int best_e_k = -1;
  102|   231k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (102:32): [True: 230k, False: 520]
  ------------------
  103|   230k|            {
  104|   230k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (104:19): [True: 28.8k, False: 202k]
  |  Branch (104:44): [True: 2.74k, False: 26.1k]
  ------------------
  105|  2.74k|                if (src_tbl[j].u_off == 1)
  ------------------
  |  Branch (105:21): [True: 2.22k, False: 520]
  ------------------
  106|  2.22k|                  if ((emb & src_tbl[j].e_k) == src_tbl[j].e_1)
  ------------------
  |  Branch (106:23): [True: 527, False: 1.70k]
  ------------------
  107|    527|                  {
  108|       |                    //now we need to find the smallest cwd with the highest
  109|       |                    // number of bits set in e_k
  110|    527|                    int ones_count = pattern_popcnt[src_tbl[j].e_k];
  111|    527|                    if (ones_count >= best_e_k)
  ------------------
  |  Branch (111:25): [True: 520, False: 7]
  ------------------
  112|    520|                    {
  113|    520|                      best_entry = src_tbl + j;
  114|    520|                      best_e_k = ones_count;
  115|    520|                    }
  116|    527|                  }
  117|   230k|            }
  118|    520|          }
  119|    127|          else // u_off = 0
  120|    127|          {
  121|  25.1k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (121:32): [True: 25.1k, False: 0]
  ------------------
  122|  25.1k|            {
  123|  25.1k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (123:19): [True: 2.57k, False: 22.5k]
  |  Branch (123:44): [True: 127, False: 2.44k]
  ------------------
  124|    127|                if (src_tbl[j].u_off == 0)
  ------------------
  |  Branch (124:21): [True: 127, False: 0]
  ------------------
  125|    127|                {
  126|    127|                  best_entry = src_tbl + j;
  127|    127|                  break;
  128|    127|                }
  129|  25.1k|            }
  130|    127|          }
  131|    647|          assert(best_entry);
  132|    647|          tgt_tbl[i] = (ui16)((best_entry->cwd<<8) + (best_entry->cwd_len<<4)
  133|    647|                             + best_entry->e_k);
  134|    647|        }
  135|  2.04k|      }
  136|       |
  137|      1|      vlc_src_table tbl1[] = {
  138|      1|    #include "table1.h"
  ------------------
  |  |    1|      1|{0, 0x1, 0x0, 0x0, 0x0, 0x00, 3},
  |  |    2|      1|{0, 0x1, 0x1, 0x1, 0x1, 0x27, 6},
  |  |    3|      1|{0, 0x2, 0x0, 0x0, 0x0, 0x06, 3},
  |  |    4|      1|{0, 0x2, 0x1, 0x2, 0x2, 0x17, 6},
  |  |    5|      1|{0, 0x3, 0x0, 0x0, 0x0, 0x0D, 5},
  |  |    6|      1|{0, 0x3, 0x1, 0x0, 0x0, 0x3B, 6},
  |  |    7|      1|{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3},
  |  |    8|      1|{0, 0x4, 0x1, 0x4, 0x4, 0x07, 6},
  |  |    9|      1|{0, 0x5, 0x0, 0x0, 0x0, 0x15, 5},
  |  |   10|      1|{0, 0x5, 0x1, 0x0, 0x0, 0x2B, 6},
  |  |   11|      1|{0, 0x6, 0x0, 0x0, 0x0, 0x01, 5},
  |  |   12|      1|{0, 0x6, 0x1, 0x0, 0x0, 0x7F, 7},
  |  |   13|      1|{0, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
  |  |   14|      1|{0, 0x7, 0x1, 0x0, 0x0, 0x1B, 6},
  |  |   15|      1|{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3},
  |  |   16|      1|{0, 0x8, 0x1, 0x8, 0x8, 0x05, 5},
  |  |   17|      1|{0, 0x9, 0x0, 0x0, 0x0, 0x19, 5},
  |  |   18|      1|{0, 0x9, 0x1, 0x0, 0x0, 0x13, 6},
  |  |   19|      1|{0, 0xA, 0x0, 0x0, 0x0, 0x09, 5},
  |  |   20|      1|{0, 0xA, 0x1, 0x8, 0x8, 0x0B, 6},
  |  |   21|      1|{0, 0xA, 0x1, 0xA, 0x2, 0x3F, 7},
  |  |   22|      1|{0, 0xB, 0x0, 0x0, 0x0, 0x5F, 7},
  |  |   23|      1|{0, 0xB, 0x1, 0x0, 0x0, 0x33, 6},
  |  |   24|      1|{0, 0xC, 0x0, 0x0, 0x0, 0x11, 5},
  |  |   25|      1|{0, 0xC, 0x1, 0x8, 0x8, 0x23, 6},
  |  |   26|      1|{0, 0xC, 0x1, 0xC, 0x4, 0x6F, 7},
  |  |   27|      1|{0, 0xD, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   28|      1|{0, 0xD, 0x1, 0x0, 0x0, 0x03, 6},
  |  |   29|      1|{0, 0xE, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   30|      1|{0, 0xE, 0x1, 0x4, 0x4, 0x4F, 7},
  |  |   31|      1|{0, 0xE, 0x1, 0x4, 0x0, 0x3D, 6},
  |  |   32|      1|{0, 0xF, 0x0, 0x0, 0x0, 0x77, 7},
  |  |   33|      1|{0, 0xF, 0x1, 0x1, 0x1, 0x37, 7},
  |  |   34|      1|{0, 0xF, 0x1, 0x1, 0x0, 0x1D, 6},
  |  |   35|      1|{1, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
  |  |   36|      1|{1, 0x1, 0x0, 0x0, 0x0, 0x05, 4},
  |  |   37|      1|{1, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |   38|      1|{1, 0x2, 0x0, 0x0, 0x0, 0x09, 4},
  |  |   39|      1|{1, 0x2, 0x1, 0x2, 0x2, 0x1F, 7},
  |  |   40|      1|{1, 0x3, 0x0, 0x0, 0x0, 0x1D, 5},
  |  |   41|      1|{1, 0x3, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |   42|      1|{1, 0x3, 0x1, 0x3, 0x2, 0x5F, 7},
  |  |   43|      1|{1, 0x4, 0x0, 0x0, 0x0, 0x0D, 5},
  |  |   44|      1|{1, 0x4, 0x1, 0x4, 0x4, 0x37, 7},
  |  |   45|      1|{1, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
  |  |   46|      1|{1, 0x5, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |   47|      1|{1, 0x6, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   48|      1|{1, 0x6, 0x1, 0x0, 0x0, 0x4F, 7},
  |  |   49|      1|{1, 0x7, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   50|      1|{1, 0x7, 0x1, 0x0, 0x0, 0x77, 7},
  |  |   51|      1|{1, 0x8, 0x0, 0x0, 0x0, 0x01, 4},
  |  |   52|      1|{1, 0x8, 0x1, 0x8, 0x8, 0x17, 7},
  |  |   53|      1|{1, 0x9, 0x0, 0x0, 0x0, 0x0B, 6},
  |  |   54|      1|{1, 0x9, 0x1, 0x0, 0x0, 0x57, 7},
  |  |   55|      1|{1, 0xA, 0x0, 0x0, 0x0, 0x33, 6},
  |  |   56|      1|{1, 0xA, 0x1, 0x0, 0x0, 0x67, 7},
  |  |   57|      1|{1, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
  |  |   58|      1|{1, 0xB, 0x1, 0x0, 0x0, 0x2B, 7},
  |  |   59|      1|{1, 0xC, 0x0, 0x0, 0x0, 0x13, 6},
  |  |   60|      1|{1, 0xC, 0x1, 0x0, 0x0, 0x47, 7},
  |  |   61|      1|{1, 0xD, 0x0, 0x0, 0x0, 0x07, 7},
  |  |   62|      1|{1, 0xD, 0x1, 0x0, 0x0, 0x7B, 7},
  |  |   63|      1|{1, 0xE, 0x0, 0x0, 0x0, 0x3B, 7},
  |  |   64|      1|{1, 0xE, 0x1, 0x0, 0x0, 0x5B, 7},
  |  |   65|      1|{1, 0xF, 0x0, 0x0, 0x0, 0x1B, 7},
  |  |   66|      1|{1, 0xF, 0x1, 0x4, 0x4, 0x6B, 7},
  |  |   67|      1|{1, 0xF, 0x1, 0x4, 0x0, 0x23, 6},
  |  |   68|      1|{2, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
  |  |   69|      1|{2, 0x1, 0x0, 0x0, 0x0, 0x09, 4},
  |  |   70|      1|{2, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |   71|      1|{2, 0x2, 0x0, 0x0, 0x0, 0x01, 4},
  |  |   72|      1|{2, 0x2, 0x1, 0x2, 0x2, 0x23, 6},
  |  |   73|      1|{2, 0x3, 0x0, 0x0, 0x0, 0x3D, 6},
  |  |   74|      1|{2, 0x3, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |   75|      1|{2, 0x3, 0x1, 0x3, 0x1, 0x1F, 7},
  |  |   76|      1|{2, 0x4, 0x0, 0x0, 0x0, 0x15, 5},
  |  |   77|      1|{2, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |   78|      1|{2, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
  |  |   79|      1|{2, 0x5, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |   80|      1|{2, 0x6, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   81|      1|{2, 0x6, 0x1, 0x0, 0x0, 0x4F, 7},
  |  |   82|      1|{2, 0x7, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   83|      1|{2, 0x7, 0x1, 0x0, 0x0, 0x17, 7},
  |  |   84|      1|{2, 0x8, 0x0, 0x0, 0x0, 0x05, 5},
  |  |   85|      1|{2, 0x8, 0x1, 0x8, 0x8, 0x77, 7},
  |  |   86|      1|{2, 0x9, 0x0, 0x0, 0x0, 0x37, 7},
  |  |   87|      1|{2, 0x9, 0x1, 0x0, 0x0, 0x57, 7},
  |  |   88|      1|{2, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |   89|      1|{2, 0xA, 0x1, 0xA, 0xA, 0x7B, 7},
  |  |   90|      1|{2, 0xA, 0x1, 0xA, 0x2, 0x2D, 6},
  |  |   91|      1|{2, 0xA, 0x1, 0xA, 0x8, 0x67, 7},
  |  |   92|      1|{2, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
  |  |   93|      1|{2, 0xB, 0x1, 0xB, 0x2, 0x47, 7},
  |  |   94|      1|{2, 0xB, 0x1, 0x0, 0x0, 0x07, 7},
  |  |   95|      1|{2, 0xC, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |   96|      1|{2, 0xC, 0x1, 0x0, 0x0, 0x3B, 7},
  |  |   97|      1|{2, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |   98|      1|{2, 0xD, 0x1, 0x0, 0x0, 0x1B, 7},
  |  |   99|      1|{2, 0xE, 0x0, 0x0, 0x0, 0x6B, 7},
  |  |  100|      1|{2, 0xE, 0x1, 0x4, 0x4, 0x2B, 7},
  |  |  101|      1|{2, 0xE, 0x1, 0x4, 0x0, 0x4B, 7},
  |  |  102|      1|{2, 0xF, 0x0, 0x0, 0x0, 0x0B, 7},
  |  |  103|      1|{2, 0xF, 0x1, 0x4, 0x4, 0x73, 7},
  |  |  104|      1|{2, 0xF, 0x1, 0x5, 0x1, 0x33, 7},
  |  |  105|      1|{2, 0xF, 0x1, 0x7, 0x2, 0x53, 7},
  |  |  106|      1|{2, 0xF, 0x1, 0xF, 0x8, 0x13, 7},
  |  |  107|      1|{3, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |  108|      1|{3, 0x1, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |  109|      1|{3, 0x1, 0x1, 0x1, 0x1, 0x0B, 6},
  |  |  110|      1|{3, 0x2, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  111|      1|{3, 0x2, 0x1, 0x2, 0x2, 0x23, 6},
  |  |  112|      1|{3, 0x3, 0x0, 0x0, 0x0, 0x0E, 5},
  |  |  113|      1|{3, 0x3, 0x1, 0x3, 0x3, 0x7F, 7},
  |  |  114|      1|{3, 0x3, 0x1, 0x3, 0x2, 0x33, 6},
  |  |  115|      1|{3, 0x3, 0x1, 0x3, 0x1, 0x13, 6},
  |  |  116|      1|{3, 0x4, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  117|      1|{3, 0x4, 0x1, 0x4, 0x4, 0x3F, 7},
  |  |  118|      1|{3, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
  |  |  119|      1|{3, 0x5, 0x1, 0x1, 0x1, 0x3D, 6},
  |  |  120|      1|{3, 0x5, 0x1, 0x5, 0x4, 0x1F, 7},
  |  |  121|      1|{3, 0x6, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  122|      1|{3, 0x6, 0x1, 0x0, 0x0, 0x5F, 7},
  |  |  123|      1|{3, 0x7, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  124|      1|{3, 0x7, 0x1, 0x4, 0x4, 0x2F, 7},
  |  |  125|      1|{3, 0x7, 0x1, 0x5, 0x1, 0x1E, 6},
  |  |  126|      1|{3, 0x7, 0x1, 0x7, 0x2, 0x6F, 7},
  |  |  127|      1|{3, 0x8, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  128|      1|{3, 0x8, 0x1, 0x8, 0x8, 0x4F, 7},
  |  |  129|      1|{3, 0x9, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |  130|      1|{3, 0x9, 0x1, 0x0, 0x0, 0x35, 6},
  |  |  131|      1|{3, 0xA, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  132|      1|{3, 0xA, 0x1, 0x2, 0x2, 0x25, 6},
  |  |  133|      1|{3, 0xA, 0x1, 0xA, 0x8, 0x0F, 7},
  |  |  134|      1|{3, 0xB, 0x0, 0x0, 0x0, 0x05, 6},
  |  |  135|      1|{3, 0xB, 0x1, 0x8, 0x8, 0x39, 6},
  |  |  136|      1|{3, 0xB, 0x1, 0xB, 0x3, 0x17, 7},
  |  |  137|      1|{3, 0xB, 0x1, 0xB, 0x2, 0x19, 6},
  |  |  138|      1|{3, 0xB, 0x1, 0xB, 0x1, 0x77, 7},
  |  |  139|      1|{3, 0xC, 0x0, 0x0, 0x0, 0x29, 6},
  |  |  140|      1|{3, 0xC, 0x1, 0x0, 0x0, 0x09, 6},
  |  |  141|      1|{3, 0xD, 0x0, 0x0, 0x0, 0x37, 7},
  |  |  142|      1|{3, 0xD, 0x1, 0x4, 0x4, 0x57, 7},
  |  |  143|      1|{3, 0xD, 0x1, 0x4, 0x0, 0x31, 6},
  |  |  144|      1|{3, 0xE, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  145|      1|{3, 0xE, 0x1, 0x4, 0x4, 0x27, 7},
  |  |  146|      1|{3, 0xE, 0x1, 0xC, 0x8, 0x47, 7},
  |  |  147|      1|{3, 0xE, 0x1, 0xE, 0x2, 0x6B, 7},
  |  |  148|      1|{3, 0xF, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  149|      1|{3, 0xF, 0x1, 0x6, 0x6, 0x07, 7},
  |  |  150|      1|{3, 0xF, 0x1, 0x7, 0x3, 0x7B, 7},
  |  |  151|      1|{3, 0xF, 0x1, 0xF, 0xA, 0x3B, 7},
  |  |  152|      1|{3, 0xF, 0x1, 0xF, 0x2, 0x21, 6},
  |  |  153|      1|{3, 0xF, 0x1, 0xF, 0x8, 0x01, 6},
  |  |  154|      1|{3, 0xF, 0x1, 0xA, 0x8, 0x5B, 7},
  |  |  155|      1|{3, 0xF, 0x1, 0xF, 0x5, 0x1B, 7},
  |  |  156|      1|{3, 0xF, 0x1, 0xF, 0x1, 0x3E, 6},
  |  |  157|      1|{3, 0xF, 0x1, 0xF, 0x4, 0x2B, 7},
  |  |  158|      1|{4, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
  |  |  159|      1|{4, 0x1, 0x0, 0x0, 0x0, 0x0D, 5},
  |  |  160|      1|{4, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |  161|      1|{4, 0x2, 0x0, 0x0, 0x0, 0x15, 5},
  |  |  162|      1|{4, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  163|      1|{4, 0x3, 0x0, 0x0, 0x0, 0x5F, 7},
  |  |  164|      1|{4, 0x3, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |  165|      1|{4, 0x4, 0x0, 0x0, 0x0, 0x09, 4},
  |  |  166|      1|{4, 0x4, 0x1, 0x4, 0x4, 0x23, 6},
  |  |  167|      1|{4, 0x5, 0x0, 0x0, 0x0, 0x33, 6},
  |  |  168|      1|{4, 0x5, 0x1, 0x0, 0x0, 0x1F, 7},
  |  |  169|      1|{4, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |  170|      1|{4, 0x6, 0x1, 0x0, 0x0, 0x2F, 7},
  |  |  171|      1|{4, 0x7, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  172|      1|{4, 0x7, 0x1, 0x0, 0x0, 0x57, 7},
  |  |  173|      1|{4, 0x8, 0x0, 0x0, 0x0, 0x01, 4},
  |  |  174|      1|{4, 0x8, 0x1, 0x8, 0x8, 0x0F, 7},
  |  |  175|      1|{4, 0x9, 0x0, 0x0, 0x0, 0x77, 7},
  |  |  176|      1|{4, 0x9, 0x1, 0x0, 0x0, 0x37, 7},
  |  |  177|      1|{4, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  178|      1|{4, 0xA, 0x1, 0x0, 0x0, 0x17, 7},
  |  |  179|      1|{4, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  180|      1|{4, 0xB, 0x1, 0x0, 0x0, 0x6B, 7},
  |  |  181|      1|{4, 0xC, 0x0, 0x0, 0x0, 0x05, 5},
  |  |  182|      1|{4, 0xC, 0x1, 0xC, 0xC, 0x27, 7},
  |  |  183|      1|{4, 0xC, 0x1, 0xC, 0x8, 0x47, 7},
  |  |  184|      1|{4, 0xC, 0x1, 0xC, 0x4, 0x07, 7},
  |  |  185|      1|{4, 0xD, 0x0, 0x0, 0x0, 0x7B, 7},
  |  |  186|      1|{4, 0xD, 0x1, 0x0, 0x0, 0x3B, 7},
  |  |  187|      1|{4, 0xE, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  188|      1|{4, 0xE, 0x1, 0x2, 0x2, 0x1B, 7},
  |  |  189|      1|{4, 0xE, 0x1, 0x2, 0x0, 0x03, 6},
  |  |  190|      1|{4, 0xF, 0x0, 0x0, 0x0, 0x2B, 7},
  |  |  191|      1|{4, 0xF, 0x1, 0x1, 0x1, 0x4B, 7},
  |  |  192|      1|{4, 0xF, 0x1, 0x3, 0x2, 0x0B, 7},
  |  |  193|      1|{4, 0xF, 0x1, 0x3, 0x0, 0x3D, 6},
  |  |  194|      1|{5, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |  195|      1|{5, 0x1, 0x0, 0x0, 0x0, 0x1E, 5},
  |  |  196|      1|{5, 0x1, 0x1, 0x1, 0x1, 0x3B, 6},
  |  |  197|      1|{5, 0x2, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  198|      1|{5, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  199|      1|{5, 0x3, 0x0, 0x0, 0x0, 0x1B, 6},
  |  |  200|      1|{5, 0x3, 0x1, 0x0, 0x0, 0x0B, 6},
  |  |  201|      1|{5, 0x4, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  202|      1|{5, 0x4, 0x1, 0x4, 0x4, 0x2B, 6},
  |  |  203|      1|{5, 0x5, 0x0, 0x0, 0x0, 0x0E, 5},
  |  |  204|      1|{5, 0x5, 0x1, 0x4, 0x4, 0x33, 6},
  |  |  205|      1|{5, 0x5, 0x1, 0x5, 0x1, 0x7F, 7},
  |  |  206|      1|{5, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |  207|      1|{5, 0x6, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |  208|      1|{5, 0x7, 0x0, 0x0, 0x0, 0x23, 6},
  |  |  209|      1|{5, 0x7, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |  210|      1|{5, 0x7, 0x1, 0x2, 0x0, 0x15, 6},
  |  |  211|      1|{5, 0x8, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  212|      1|{5, 0x8, 0x1, 0x8, 0x8, 0x03, 6},
  |  |  213|      1|{5, 0x9, 0x0, 0x0, 0x0, 0x3D, 6},
  |  |  214|      1|{5, 0x9, 0x1, 0x0, 0x0, 0x1F, 7},
  |  |  215|      1|{5, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  216|      1|{5, 0xA, 0x1, 0x0, 0x0, 0x2D, 6},
  |  |  217|      1|{5, 0xB, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |  218|      1|{5, 0xB, 0x1, 0x1, 0x1, 0x4F, 7},
  |  |  219|      1|{5, 0xB, 0x1, 0x1, 0x0, 0x35, 6},
  |  |  220|      1|{5, 0xC, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  221|      1|{5, 0xC, 0x1, 0x4, 0x4, 0x25, 6},
  |  |  222|      1|{5, 0xC, 0x1, 0xC, 0x8, 0x2F, 7},
  |  |  223|      1|{5, 0xD, 0x0, 0x0, 0x0, 0x05, 6},
  |  |  224|      1|{5, 0xD, 0x1, 0x1, 0x1, 0x77, 7},
  |  |  225|      1|{5, 0xD, 0x1, 0x5, 0x4, 0x39, 6},
  |  |  226|      1|{5, 0xD, 0x1, 0xD, 0x8, 0x0F, 7},
  |  |  227|      1|{5, 0xE, 0x0, 0x0, 0x0, 0x19, 6},
  |  |  228|      1|{5, 0xE, 0x1, 0x2, 0x2, 0x57, 7},
  |  |  229|      1|{5, 0xE, 0x1, 0xA, 0x8, 0x01, 6},
  |  |  230|      1|{5, 0xE, 0x1, 0xE, 0x4, 0x37, 7},
  |  |  231|      1|{5, 0xF, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  232|      1|{5, 0xF, 0x1, 0x9, 0x9, 0x17, 7},
  |  |  233|      1|{5, 0xF, 0x1, 0xD, 0x5, 0x67, 7},
  |  |  234|      1|{5, 0xF, 0x1, 0xF, 0x3, 0x07, 7},
  |  |  235|      1|{5, 0xF, 0x1, 0xF, 0x1, 0x29, 6},
  |  |  236|      1|{5, 0xF, 0x1, 0x7, 0x6, 0x27, 7},
  |  |  237|      1|{5, 0xF, 0x1, 0xF, 0xC, 0x09, 6},
  |  |  238|      1|{5, 0xF, 0x1, 0xF, 0x4, 0x31, 6},
  |  |  239|      1|{5, 0xF, 0x1, 0xF, 0xA, 0x47, 7},
  |  |  240|      1|{5, 0xF, 0x1, 0xF, 0x8, 0x11, 6},
  |  |  241|      1|{5, 0xF, 0x1, 0xF, 0x2, 0x21, 6},
  |  |  242|      1|{6, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  243|      1|{6, 0x1, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  244|      1|{6, 0x1, 0x1, 0x1, 0x1, 0x03, 6},
  |  |  245|      1|{6, 0x2, 0x0, 0x0, 0x0, 0x0C, 4},
  |  |  246|      1|{6, 0x2, 0x1, 0x2, 0x2, 0x3D, 6},
  |  |  247|      1|{6, 0x3, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  248|      1|{6, 0x3, 0x1, 0x2, 0x2, 0x0D, 6},
  |  |  249|      1|{6, 0x3, 0x1, 0x3, 0x1, 0x7F, 7},
  |  |  250|      1|{6, 0x4, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  251|      1|{6, 0x4, 0x1, 0x4, 0x4, 0x2D, 6},
  |  |  252|      1|{6, 0x5, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  253|      1|{6, 0x5, 0x1, 0x4, 0x4, 0x35, 6},
  |  |  254|      1|{6, 0x5, 0x1, 0x5, 0x1, 0x2F, 7},
  |  |  255|      1|{6, 0x6, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  256|      1|{6, 0x6, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  257|      1|{6, 0x6, 0x1, 0x6, 0x4, 0x5F, 7},
  |  |  258|      1|{6, 0x7, 0x0, 0x0, 0x0, 0x25, 6},
  |  |  259|      1|{6, 0x7, 0x1, 0x2, 0x2, 0x29, 6},
  |  |  260|      1|{6, 0x7, 0x1, 0x3, 0x1, 0x1F, 7},
  |  |  261|      1|{6, 0x7, 0x1, 0x7, 0x4, 0x6F, 7},
  |  |  262|      1|{6, 0x8, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  263|      1|{6, 0x8, 0x1, 0x8, 0x8, 0x05, 6},
  |  |  264|      1|{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  265|      1|{6, 0x9, 0x1, 0x0, 0x0, 0x19, 6},
  |  |  266|      1|{6, 0xA, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  267|      1|{6, 0xA, 0x1, 0xA, 0xA, 0x0F, 7},
  |  |  268|      1|{6, 0xA, 0x1, 0xA, 0x2, 0x09, 6},
  |  |  269|      1|{6, 0xA, 0x1, 0xA, 0x8, 0x4F, 7},
  |  |  270|      1|{6, 0xB, 0x0, 0x0, 0x0, 0x0E, 6},
  |  |  271|      1|{6, 0xB, 0x1, 0xB, 0x2, 0x77, 7},
  |  |  272|      1|{6, 0xB, 0x1, 0x2, 0x2, 0x37, 7},
  |  |  273|      1|{6, 0xB, 0x1, 0xA, 0x8, 0x57, 7},
  |  |  274|      1|{6, 0xB, 0x1, 0xB, 0x1, 0x47, 7},
  |  |  275|      1|{6, 0xC, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  276|      1|{6, 0xC, 0x1, 0xC, 0xC, 0x17, 7},
  |  |  277|      1|{6, 0xC, 0x1, 0xC, 0x8, 0x67, 7},
  |  |  278|      1|{6, 0xC, 0x1, 0xC, 0x4, 0x27, 7},
  |  |  279|      1|{6, 0xD, 0x0, 0x0, 0x0, 0x31, 6},
  |  |  280|      1|{6, 0xD, 0x1, 0xD, 0x4, 0x07, 7},
  |  |  281|      1|{6, 0xD, 0x1, 0x4, 0x4, 0x7B, 7},
  |  |  282|      1|{6, 0xD, 0x1, 0xC, 0x8, 0x3B, 7},
  |  |  283|      1|{6, 0xD, 0x1, 0xD, 0x1, 0x2B, 7},
  |  |  284|      1|{6, 0xE, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  285|      1|{6, 0xE, 0x1, 0xE, 0x4, 0x5B, 7},
  |  |  286|      1|{6, 0xE, 0x1, 0x4, 0x4, 0x1B, 7},
  |  |  287|      1|{6, 0xE, 0x1, 0xE, 0xA, 0x6B, 7},
  |  |  288|      1|{6, 0xE, 0x1, 0xE, 0x8, 0x21, 6},
  |  |  289|      1|{6, 0xE, 0x1, 0xE, 0x2, 0x33, 7},
  |  |  290|      1|{6, 0xF, 0x0, 0x0, 0x0, 0x01, 6},
  |  |  291|      1|{6, 0xF, 0x1, 0x3, 0x3, 0x4B, 7},
  |  |  292|      1|{6, 0xF, 0x1, 0x7, 0x6, 0x0B, 7},
  |  |  293|      1|{6, 0xF, 0x1, 0xF, 0xA, 0x73, 7},
  |  |  294|      1|{6, 0xF, 0x1, 0xF, 0x2, 0x3E, 6},
  |  |  295|      1|{6, 0xF, 0x1, 0xB, 0x9, 0x53, 7},
  |  |  296|      1|{6, 0xF, 0x1, 0xF, 0xC, 0x63, 7},
  |  |  297|      1|{6, 0xF, 0x1, 0xF, 0x8, 0x1E, 6},
  |  |  298|      1|{6, 0xF, 0x1, 0xF, 0x5, 0x13, 7},
  |  |  299|      1|{6, 0xF, 0x1, 0xF, 0x4, 0x2E, 6},
  |  |  300|      1|{6, 0xF, 0x1, 0xF, 0x1, 0x23, 7},
  |  |  301|      1|{7, 0x0, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  302|      1|{7, 0x1, 0x0, 0x0, 0x0, 0x33, 6},
  |  |  303|      1|{7, 0x1, 0x1, 0x1, 0x1, 0x13, 6},
  |  |  304|      1|{7, 0x2, 0x0, 0x0, 0x0, 0x23, 6},
  |  |  305|      1|{7, 0x2, 0x1, 0x2, 0x2, 0x7F, 7},
  |  |  306|      1|{7, 0x3, 0x0, 0x0, 0x0, 0x03, 6},
  |  |  307|      1|{7, 0x3, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |  308|      1|{7, 0x3, 0x1, 0x3, 0x2, 0x6F, 7},
  |  |  309|      1|{7, 0x4, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  310|      1|{7, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |  311|      1|{7, 0x5, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  312|      1|{7, 0x5, 0x1, 0x1, 0x1, 0x3D, 6},
  |  |  313|      1|{7, 0x5, 0x1, 0x5, 0x4, 0x1F, 7},
  |  |  314|      1|{7, 0x6, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  315|      1|{7, 0x6, 0x1, 0x0, 0x0, 0x77, 7},
  |  |  316|      1|{7, 0x7, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  317|      1|{7, 0x7, 0x1, 0x7, 0x4, 0x2F, 7},
  |  |  318|      1|{7, 0x7, 0x1, 0x4, 0x4, 0x4F, 7},
  |  |  319|      1|{7, 0x7, 0x1, 0x7, 0x3, 0x0F, 7},
  |  |  320|      1|{7, 0x7, 0x1, 0x7, 0x1, 0x0D, 6},
  |  |  321|      1|{7, 0x7, 0x1, 0x7, 0x2, 0x57, 7},
  |  |  322|      1|{7, 0x8, 0x0, 0x0, 0x0, 0x35, 6},
  |  |  323|      1|{7, 0x8, 0x1, 0x8, 0x8, 0x37, 7},
  |  |  324|      1|{7, 0x9, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  325|      1|{7, 0x9, 0x1, 0x0, 0x0, 0x27, 7},
  |  |  326|      1|{7, 0xA, 0x0, 0x0, 0x0, 0x25, 6},
  |  |  327|      1|{7, 0xA, 0x1, 0x0, 0x0, 0x29, 6},
  |  |  328|      1|{7, 0xB, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  329|      1|{7, 0xB, 0x1, 0xB, 0x1, 0x17, 7},
  |  |  330|      1|{7, 0xB, 0x1, 0x1, 0x1, 0x67, 7},
  |  |  331|      1|{7, 0xB, 0x1, 0x3, 0x2, 0x05, 6},
  |  |  332|      1|{7, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
  |  |  333|      1|{7, 0xC, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  334|      1|{7, 0xC, 0x1, 0x0, 0x0, 0x19, 6},
  |  |  335|      1|{7, 0xD, 0x0, 0x0, 0x0, 0x0C, 5},
  |  |  336|      1|{7, 0xD, 0x1, 0xD, 0x1, 0x47, 7},
  |  |  337|      1|{7, 0xD, 0x1, 0x1, 0x1, 0x07, 7},
  |  |  338|      1|{7, 0xD, 0x1, 0x5, 0x4, 0x09, 6},
  |  |  339|      1|{7, 0xD, 0x1, 0xD, 0x8, 0x1B, 7},
  |  |  340|      1|{7, 0xE, 0x0, 0x0, 0x0, 0x31, 6},
  |  |  341|      1|{7, 0xE, 0x1, 0xE, 0x2, 0x3B, 7},
  |  |  342|      1|{7, 0xE, 0x1, 0x2, 0x2, 0x5B, 7},
  |  |  343|      1|{7, 0xE, 0x1, 0xA, 0x8, 0x3E, 6},
  |  |  344|      1|{7, 0xE, 0x1, 0xE, 0x4, 0x0B, 7},
  |  |  345|      1|{7, 0xF, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  346|      1|{7, 0xF, 0x1, 0xF, 0xF, 0x6B, 7},
  |  |  347|      1|{7, 0xF, 0x1, 0xF, 0x7, 0x2B, 7},
  |  |  348|      1|{7, 0xF, 0x1, 0xF, 0xB, 0x4B, 7},
  |  |  349|      1|{7, 0xF, 0x1, 0xF, 0x3, 0x11, 6},
  |  |  350|      1|{7, 0xF, 0x1, 0x7, 0x6, 0x21, 6},
  |  |  351|      1|{7, 0xF, 0x1, 0xF, 0xA, 0x01, 6},
  |  |  352|      1|{7, 0xF, 0x1, 0xF, 0x2, 0x0A, 5},
  |  |  353|      1|{7, 0xF, 0x1, 0xB, 0x9, 0x1E, 6},
  |  |  354|      1|{7, 0xF, 0x1, 0xF, 0xC, 0x0E, 6},
  |  |  355|      1|{7, 0xF, 0x1, 0xF, 0x8, 0x12, 5},
  |  |  356|      1|{7, 0xF, 0x1, 0xF, 0x5, 0x2E, 6},
  |  |  357|      1|{7, 0xF, 0x1, 0xF, 0x1, 0x02, 5},
  |  |  358|      1|{7, 0xF, 0x1, 0xF, 0x4, 0x1C, 5}
  ------------------
  139|      1|      };
  140|      1|      size_t tbl1_size = sizeof(tbl1) / sizeof(vlc_src_table);
  141|       |
  142|      1|      src_tbl = tbl1;
  143|      1|      tgt_tbl = vlc_tbl1;
  144|      1|      tbl_size = tbl1_size;
  145|  2.04k|      for (int i = 0; i < 2048; ++i)
  ------------------
  |  Branch (145:23): [True: 2.04k, False: 1]
  ------------------
  146|  2.04k|      {
  147|  2.04k|        int c_q = i >> 8, rho = (i >> 4) & 0xF, emb = i & 0xF;
  148|  2.04k|        if (((emb & rho) != emb) || (rho == 0 && c_q == 0))
  ------------------
  |  Branch (148:13): [True: 1.40k, False: 648]
  |  Branch (148:38): [True: 8, False: 640]
  |  Branch (148:50): [True: 1, False: 7]
  ------------------
  149|  1.40k|          tgt_tbl[i] = 0;
  150|    647|        else
  151|    647|        {
  152|    647|          vlc_src_table *best_entry = NULL;
  153|    647|          if (emb) // u_off = 1
  ------------------
  |  Branch (153:15): [True: 520, False: 127]
  ------------------
  154|    520|          {
  155|    520|            int best_e_k = -1;
  156|   186k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (156:32): [True: 186k, False: 520]
  ------------------
  157|   186k|            {
  158|   186k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (158:19): [True: 23.2k, False: 162k]
  |  Branch (158:44): [True: 2.08k, False: 21.1k]
  ------------------
  159|  2.08k|                if (src_tbl[j].u_off == 1)
  ------------------
  |  Branch (159:21): [True: 1.56k, False: 520]
  ------------------
  160|  1.56k|                  if ((emb & src_tbl[j].e_k) == src_tbl[j].e_1)
  ------------------
  |  Branch (160:23): [True: 529, False: 1.03k]
  ------------------
  161|    529|                  {
  162|       |                    //now we need to find the smallest cwd with the highest
  163|       |                    // number of bits set in e_k
  164|    529|                    int ones_count = pattern_popcnt[src_tbl[j].e_k];
  165|    529|                    if (ones_count >= best_e_k)
  ------------------
  |  Branch (165:25): [True: 520, False: 9]
  ------------------
  166|    520|                    {
  167|    520|                      best_entry = src_tbl + j;
  168|    520|                      best_e_k = ones_count;
  169|    520|                    }
  170|    529|                  }
  171|   186k|            }
  172|    520|          }
  173|    127|          else // u_off = 0
  174|    127|          {
  175|  19.7k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (175:32): [True: 19.7k, False: 0]
  ------------------
  176|  19.7k|            {
  177|  19.7k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (177:19): [True: 2.22k, False: 17.5k]
  |  Branch (177:44): [True: 127, False: 2.10k]
  ------------------
  178|    127|                if (src_tbl[j].u_off == 0)
  ------------------
  |  Branch (178:21): [True: 127, False: 0]
  ------------------
  179|    127|                {
  180|    127|                  best_entry = src_tbl + j;
  181|    127|                  break;
  182|    127|                }
  183|  19.7k|            }
  184|    127|          }
  185|    647|          assert(best_entry);
  186|    647|          tgt_tbl[i] = (ui16)((best_entry->cwd<<8) + (best_entry->cwd_len<<4)
  187|    647|                             + best_entry->e_k);
  188|    647|        }
  189|  2.04k|      }
  190|       |
  191|       |
  192|      1|      return true;
  193|      1|    }
ojph_block_encoder.cpp:_ZN4ojph5localL16uvlc_init_tablesEv:
  197|      1|    {
  198|       |      //code goes from 0 to 31, extension and 32 are not supported here
  199|      1|      uvlc_tbl[0].pre = 0;
  200|      1|      uvlc_tbl[0].pre_len = 0;
  201|      1|      uvlc_tbl[0].suf = 0;
  202|      1|      uvlc_tbl[0].suf_len = 0;
  203|      1|      uvlc_tbl[0].ext = 0;
  204|      1|      uvlc_tbl[0].ext_len = 0;
  205|       |
  206|      1|      uvlc_tbl[1].pre = 1;
  207|      1|      uvlc_tbl[1].pre_len = 1;
  208|      1|      uvlc_tbl[1].suf = 0;
  209|      1|      uvlc_tbl[1].suf_len = 0;
  210|      1|      uvlc_tbl[1].ext = 0;
  211|      1|      uvlc_tbl[1].ext_len = 0;
  212|       |
  213|      1|      uvlc_tbl[2].pre = 2;
  214|      1|      uvlc_tbl[2].pre_len = 2;
  215|      1|      uvlc_tbl[2].suf = 0;
  216|      1|      uvlc_tbl[2].suf_len = 0;
  217|      1|      uvlc_tbl[2].ext = 0;
  218|      1|      uvlc_tbl[2].ext_len = 0;
  219|       |
  220|      1|      uvlc_tbl[3].pre = 4;
  221|      1|      uvlc_tbl[3].pre_len = 3;
  222|      1|      uvlc_tbl[3].suf = 0;
  223|      1|      uvlc_tbl[3].suf_len = 1;
  224|      1|      uvlc_tbl[3].ext = 0;
  225|      1|      uvlc_tbl[3].ext_len = 0;
  226|       |
  227|      1|      uvlc_tbl[4].pre = 4;
  228|      1|      uvlc_tbl[4].pre_len = 3;
  229|      1|      uvlc_tbl[4].suf = 1;
  230|      1|      uvlc_tbl[4].suf_len = 1;
  231|      1|      uvlc_tbl[4].ext = 0;
  232|      1|      uvlc_tbl[4].ext_len = 0;
  233|       |
  234|     29|      for (int i = 5; i < 33; ++i)
  ------------------
  |  Branch (234:23): [True: 28, False: 1]
  ------------------
  235|     28|      {
  236|     28|        uvlc_tbl[i].pre = 0;
  237|     28|        uvlc_tbl[i].pre_len = 3;
  238|     28|        uvlc_tbl[i].suf = (ui8)(i - 5);
  239|     28|        uvlc_tbl[i].suf_len = 5;
  240|     28|        uvlc_tbl[i].ext = 0;
  241|     28|        uvlc_tbl[i].ext_len = 0;
  242|     28|      }
  243|       |
  244|     43|      for (int i = 33; i < num_uvlc_entries; ++i)
  ------------------
  |  Branch (244:24): [True: 42, False: 1]
  ------------------
  245|     42|      {
  246|     42|        uvlc_tbl[i].pre = 0;
  247|     42|        uvlc_tbl[i].pre_len = 3;
  248|     42|        uvlc_tbl[i].suf = (ui8)(28 + (i - 33) % 4);
  249|     42|        uvlc_tbl[i].suf_len = 5;
  250|     42|        uvlc_tbl[i].ext = (ui8)((i - 33) / 4);
  251|     42|        uvlc_tbl[i].ext_len = 4;
  252|     42|      }
  253|       |
  254|      1|      return true;
  255|      1|    }

_ZN4ojph5local36initialize_block_encoder_tables_avx2Ev:
  286|  5.64M|    bool initialize_block_encoder_tables_avx2() {
  287|  5.64M|      static bool tables_initialized = false;
  288|  5.64M|      static std::once_flag tables_initialized_flag;
  289|  5.64M|      std::call_once(tables_initialized_flag, []() {
  290|  5.64M|        memset(vlc_tbl0, 0, 2048 * sizeof(ui32));
  291|  5.64M|        memset(vlc_tbl1, 0, 2048 * sizeof(ui32));
  292|  5.64M|        tables_initialized = vlc_init_tables();
  293|  5.64M|        tables_initialized = tables_initialized && uvlc_init_tables();
  294|  5.64M|        uvlc_init_pair_tables();
  295|  5.64M|      });
  296|  5.64M|      return tables_initialized;
  297|  5.64M|    }
ojph_block_encoder_avx2.cpp:_ZZN4ojph5local36initialize_block_encoder_tables_avx2EvENK3$_0clEv:
  289|      1|      std::call_once(tables_initialized_flag, []() {
  290|      1|        memset(vlc_tbl0, 0, 2048 * sizeof(ui32));
  291|      1|        memset(vlc_tbl1, 0, 2048 * sizeof(ui32));
  292|      1|        tables_initialized = vlc_init_tables();
  293|      1|        tables_initialized = tables_initialized && uvlc_init_tables();
  ------------------
  |  Branch (293:30): [True: 1, False: 0]
  |  Branch (293:52): [True: 1, False: 0]
  ------------------
  294|      1|        uvlc_init_pair_tables();
  295|      1|      });
ojph_block_encoder_avx2.cpp:_ZN4ojph5localL15vlc_init_tablesEv:
   93|      1|    {
   94|      1|      struct vlc_src_table { int c_q, rho, u_off, e_k, e_1, cwd, cwd_len; };
   95|      1|      vlc_src_table tbl0[] = {
   96|      1|    #include "table0.h"
  ------------------
  |  |    1|      1|{0, 0x1, 0x0, 0x0, 0x0, 0x06, 4},
  |  |    2|      1|{0, 0x1, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |    3|      1|{0, 0x2, 0x0, 0x0, 0x0, 0x00, 3},
  |  |    4|      1|{0, 0x2, 0x1, 0x2, 0x2, 0x7F, 7},
  |  |    5|      1|{0, 0x3, 0x0, 0x0, 0x0, 0x11, 5},
  |  |    6|      1|{0, 0x3, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |    7|      1|{0, 0x3, 0x1, 0x3, 0x1, 0x1F, 7},
  |  |    8|      1|{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3},
  |  |    9|      1|{0, 0x4, 0x1, 0x4, 0x4, 0x13, 6},
  |  |   10|      1|{0, 0x5, 0x0, 0x0, 0x0, 0x0E, 5},
  |  |   11|      1|{0, 0x5, 0x1, 0x4, 0x4, 0x23, 6},
  |  |   12|      1|{0, 0x5, 0x1, 0x5, 0x1, 0x0F, 7},
  |  |   13|      1|{0, 0x6, 0x0, 0x0, 0x0, 0x03, 6},
  |  |   14|      1|{0, 0x6, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |   15|      1|{0, 0x7, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   16|      1|{0, 0x7, 0x1, 0x2, 0x2, 0x4F, 7},
  |  |   17|      1|{0, 0x7, 0x1, 0x2, 0x0, 0x0D, 6},
  |  |   18|      1|{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3},
  |  |   19|      1|{0, 0x8, 0x1, 0x8, 0x8, 0x3D, 6},
  |  |   20|      1|{0, 0x9, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |   21|      1|{0, 0x9, 0x1, 0x0, 0x0, 0x2D, 6},
  |  |   22|      1|{0, 0xA, 0x0, 0x0, 0x0, 0x01, 5},
  |  |   23|      1|{0, 0xA, 0x1, 0x8, 0x8, 0x35, 6},
  |  |   24|      1|{0, 0xA, 0x1, 0xA, 0x2, 0x77, 7},
  |  |   25|      1|{0, 0xB, 0x0, 0x0, 0x0, 0x37, 7},
  |  |   26|      1|{0, 0xB, 0x1, 0x1, 0x1, 0x57, 7},
  |  |   27|      1|{0, 0xB, 0x1, 0x1, 0x0, 0x09, 6},
  |  |   28|      1|{0, 0xC, 0x0, 0x0, 0x0, 0x1E, 5},
  |  |   29|      1|{0, 0xC, 0x1, 0xC, 0xC, 0x17, 7},
  |  |   30|      1|{0, 0xC, 0x1, 0xC, 0x4, 0x15, 6},
  |  |   31|      1|{0, 0xC, 0x1, 0xC, 0x8, 0x25, 6},
  |  |   32|      1|{0, 0xD, 0x0, 0x0, 0x0, 0x67, 7},
  |  |   33|      1|{0, 0xD, 0x1, 0x1, 0x1, 0x27, 7},
  |  |   34|      1|{0, 0xD, 0x1, 0x5, 0x4, 0x47, 7},
  |  |   35|      1|{0, 0xD, 0x1, 0xD, 0x8, 0x07, 7},
  |  |   36|      1|{0, 0xE, 0x0, 0x0, 0x0, 0x7B, 7},
  |  |   37|      1|{0, 0xE, 0x1, 0x2, 0x2, 0x4B, 7},
  |  |   38|      1|{0, 0xE, 0x1, 0xA, 0x8, 0x05, 6},
  |  |   39|      1|{0, 0xE, 0x1, 0xE, 0x4, 0x3B, 7},
  |  |   40|      1|{0, 0xF, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |   41|      1|{0, 0xF, 0x1, 0x9, 0x9, 0x1B, 7},
  |  |   42|      1|{0, 0xF, 0x1, 0xB, 0xA, 0x6B, 7},
  |  |   43|      1|{0, 0xF, 0x1, 0xF, 0xC, 0x2B, 7},
  |  |   44|      1|{0, 0xF, 0x1, 0xF, 0x8, 0x39, 6},
  |  |   45|      1|{0, 0xF, 0x1, 0xE, 0x6, 0x73, 7},
  |  |   46|      1|{0, 0xF, 0x1, 0xE, 0x2, 0x19, 6},
  |  |   47|      1|{0, 0xF, 0x1, 0xF, 0x5, 0x0B, 7},
  |  |   48|      1|{0, 0xF, 0x1, 0xF, 0x4, 0x29, 6},
  |  |   49|      1|{0, 0xF, 0x1, 0xF, 0x1, 0x33, 7},
  |  |   50|      1|{1, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |   51|      1|{1, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
  |  |   52|      1|{1, 0x1, 0x1, 0x1, 0x1, 0x1F, 7},
  |  |   53|      1|{1, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
  |  |   54|      1|{1, 0x2, 0x1, 0x2, 0x2, 0x3B, 6},
  |  |   55|      1|{1, 0x3, 0x0, 0x0, 0x0, 0x1B, 6},
  |  |   56|      1|{1, 0x3, 0x1, 0x0, 0x0, 0x3D, 6},
  |  |   57|      1|{1, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |   58|      1|{1, 0x4, 0x1, 0x4, 0x4, 0x2B, 6},
  |  |   59|      1|{1, 0x5, 0x0, 0x0, 0x0, 0x0B, 6},
  |  |   60|      1|{1, 0x5, 0x1, 0x4, 0x4, 0x33, 6},
  |  |   61|      1|{1, 0x5, 0x1, 0x5, 0x1, 0x7F, 7},
  |  |   62|      1|{1, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |   63|      1|{1, 0x6, 0x1, 0x0, 0x0, 0x23, 6},
  |  |   64|      1|{1, 0x7, 0x0, 0x0, 0x0, 0x3F, 7},
  |  |   65|      1|{1, 0x7, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |   66|      1|{1, 0x7, 0x1, 0x2, 0x0, 0x03, 6},
  |  |   67|      1|{1, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
  |  |   68|      1|{1, 0x8, 0x1, 0x8, 0x8, 0x1D, 6},
  |  |   69|      1|{1, 0x9, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |   70|      1|{1, 0x9, 0x1, 0x0, 0x0, 0x0D, 6},
  |  |   71|      1|{1, 0xA, 0x0, 0x0, 0x0, 0x35, 6},
  |  |   72|      1|{1, 0xA, 0x1, 0x8, 0x8, 0x15, 6},
  |  |   73|      1|{1, 0xA, 0x1, 0xA, 0x2, 0x6F, 7},
  |  |   74|      1|{1, 0xB, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   75|      1|{1, 0xB, 0x1, 0x1, 0x1, 0x4F, 7},
  |  |   76|      1|{1, 0xB, 0x1, 0x1, 0x0, 0x11, 6},
  |  |   77|      1|{1, 0xC, 0x0, 0x0, 0x0, 0x01, 5},
  |  |   78|      1|{1, 0xC, 0x1, 0x8, 0x8, 0x25, 6},
  |  |   79|      1|{1, 0xC, 0x1, 0xC, 0x4, 0x05, 6},
  |  |   80|      1|{1, 0xD, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   81|      1|{1, 0xD, 0x1, 0x1, 0x1, 0x17, 7},
  |  |   82|      1|{1, 0xD, 0x1, 0x5, 0x4, 0x39, 6},
  |  |   83|      1|{1, 0xD, 0x1, 0xD, 0x8, 0x77, 7},
  |  |   84|      1|{1, 0xE, 0x0, 0x0, 0x0, 0x37, 7},
  |  |   85|      1|{1, 0xE, 0x1, 0x2, 0x2, 0x57, 7},
  |  |   86|      1|{1, 0xE, 0x1, 0xA, 0x8, 0x19, 6},
  |  |   87|      1|{1, 0xE, 0x1, 0xE, 0x4, 0x67, 7},
  |  |   88|      1|{1, 0xF, 0x0, 0x0, 0x0, 0x07, 7},
  |  |   89|      1|{1, 0xF, 0x1, 0xB, 0x8, 0x29, 6},
  |  |   90|      1|{1, 0xF, 0x1, 0x8, 0x8, 0x27, 7},
  |  |   91|      1|{1, 0xF, 0x1, 0xA, 0x2, 0x09, 6},
  |  |   92|      1|{1, 0xF, 0x1, 0xE, 0x4, 0x31, 6},
  |  |   93|      1|{1, 0xF, 0x1, 0xF, 0x1, 0x47, 7},
  |  |   94|      1|{2, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |   95|      1|{2, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
  |  |   96|      1|{2, 0x1, 0x1, 0x1, 0x1, 0x1B, 6},
  |  |   97|      1|{2, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
  |  |   98|      1|{2, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |   99|      1|{2, 0x3, 0x0, 0x0, 0x0, 0x2B, 6},
  |  |  100|      1|{2, 0x3, 0x1, 0x1, 0x1, 0x33, 6},
  |  |  101|      1|{2, 0x3, 0x1, 0x3, 0x2, 0x7F, 7},
  |  |  102|      1|{2, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |  103|      1|{2, 0x4, 0x1, 0x4, 0x4, 0x0B, 6},
  |  |  104|      1|{2, 0x5, 0x0, 0x0, 0x0, 0x01, 5},
  |  |  105|      1|{2, 0x5, 0x1, 0x5, 0x5, 0x2F, 7},
  |  |  106|      1|{2, 0x5, 0x1, 0x5, 0x1, 0x13, 6},
  |  |  107|      1|{2, 0x5, 0x1, 0x5, 0x4, 0x23, 6},
  |  |  108|      1|{2, 0x6, 0x0, 0x0, 0x0, 0x03, 6},
  |  |  109|      1|{2, 0x6, 0x1, 0x0, 0x0, 0x5F, 7},
  |  |  110|      1|{2, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
  |  |  111|      1|{2, 0x7, 0x1, 0x2, 0x2, 0x6F, 7},
  |  |  112|      1|{2, 0x7, 0x1, 0x3, 0x1, 0x11, 6},
  |  |  113|      1|{2, 0x7, 0x1, 0x7, 0x4, 0x37, 7},
  |  |  114|      1|{2, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  115|      1|{2, 0x8, 0x1, 0x8, 0x8, 0x4F, 7},
  |  |  116|      1|{2, 0x9, 0x0, 0x0, 0x0, 0x3D, 6},
  |  |  117|      1|{2, 0x9, 0x1, 0x0, 0x0, 0x1D, 6},
  |  |  118|      1|{2, 0xA, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  119|      1|{2, 0xA, 0x1, 0x0, 0x0, 0x0D, 6},
  |  |  120|      1|{2, 0xB, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |  121|      1|{2, 0xB, 0x1, 0x2, 0x2, 0x77, 7},
  |  |  122|      1|{2, 0xB, 0x1, 0x2, 0x0, 0x35, 6},
  |  |  123|      1|{2, 0xC, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  124|      1|{2, 0xC, 0x1, 0x4, 0x4, 0x25, 6},
  |  |  125|      1|{2, 0xC, 0x1, 0xC, 0x8, 0x57, 7},
  |  |  126|      1|{2, 0xD, 0x0, 0x0, 0x0, 0x17, 7},
  |  |  127|      1|{2, 0xD, 0x1, 0x8, 0x8, 0x05, 6},
  |  |  128|      1|{2, 0xD, 0x1, 0xC, 0x4, 0x39, 6},
  |  |  129|      1|{2, 0xD, 0x1, 0xD, 0x1, 0x67, 7},
  |  |  130|      1|{2, 0xE, 0x0, 0x0, 0x0, 0x27, 7},
  |  |  131|      1|{2, 0xE, 0x1, 0x2, 0x2, 0x7B, 7},
  |  |  132|      1|{2, 0xE, 0x1, 0x2, 0x0, 0x19, 6},
  |  |  133|      1|{2, 0xF, 0x0, 0x0, 0x0, 0x47, 7},
  |  |  134|      1|{2, 0xF, 0x1, 0xF, 0x1, 0x29, 6},
  |  |  135|      1|{2, 0xF, 0x1, 0x1, 0x1, 0x09, 6},
  |  |  136|      1|{2, 0xF, 0x1, 0x3, 0x2, 0x07, 7},
  |  |  137|      1|{2, 0xF, 0x1, 0x7, 0x4, 0x31, 6},
  |  |  138|      1|{2, 0xF, 0x1, 0xF, 0x8, 0x3B, 7},
  |  |  139|      1|{3, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  140|      1|{3, 0x1, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  141|      1|{3, 0x1, 0x1, 0x1, 0x1, 0x3D, 6},
  |  |  142|      1|{3, 0x2, 0x0, 0x0, 0x0, 0x0C, 5},
  |  |  143|      1|{3, 0x2, 0x1, 0x2, 0x2, 0x4F, 7},
  |  |  144|      1|{3, 0x3, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  145|      1|{3, 0x3, 0x1, 0x1, 0x1, 0x05, 6},
  |  |  146|      1|{3, 0x3, 0x1, 0x3, 0x2, 0x7F, 7},
  |  |  147|      1|{3, 0x4, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  148|      1|{3, 0x4, 0x1, 0x4, 0x4, 0x2D, 6},
  |  |  149|      1|{3, 0x5, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  150|      1|{3, 0x5, 0x1, 0x5, 0x5, 0x1A, 5},
  |  |  151|      1|{3, 0x5, 0x1, 0x5, 0x1, 0x0D, 6},
  |  |  152|      1|{3, 0x5, 0x1, 0x5, 0x4, 0x35, 6},
  |  |  153|      1|{3, 0x6, 0x0, 0x0, 0x0, 0x3F, 7},
  |  |  154|      1|{3, 0x6, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |  155|      1|{3, 0x6, 0x1, 0x6, 0x2, 0x1F, 7},
  |  |  156|      1|{3, 0x7, 0x0, 0x0, 0x0, 0x6F, 7},
  |  |  157|      1|{3, 0x7, 0x1, 0x6, 0x6, 0x2F, 7},
  |  |  158|      1|{3, 0x7, 0x1, 0x6, 0x4, 0x15, 6},
  |  |  159|      1|{3, 0x7, 0x1, 0x7, 0x3, 0x77, 7},
  |  |  160|      1|{3, 0x7, 0x1, 0x7, 0x1, 0x25, 6},
  |  |  161|      1|{3, 0x7, 0x1, 0x7, 0x2, 0x0F, 7},
  |  |  162|      1|{3, 0x8, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  163|      1|{3, 0x8, 0x1, 0x8, 0x8, 0x07, 7},
  |  |  164|      1|{3, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  165|      1|{3, 0x9, 0x1, 0x1, 0x1, 0x37, 7},
  |  |  166|      1|{3, 0x9, 0x1, 0x9, 0x8, 0x57, 7},
  |  |  167|      1|{3, 0xA, 0x0, 0x0, 0x0, 0x19, 6},
  |  |  168|      1|{3, 0xA, 0x1, 0x8, 0x8, 0x29, 6},
  |  |  169|      1|{3, 0xA, 0x1, 0xA, 0x2, 0x17, 7},
  |  |  170|      1|{3, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  171|      1|{3, 0xB, 0x1, 0xB, 0x1, 0x27, 7},
  |  |  172|      1|{3, 0xB, 0x1, 0x1, 0x1, 0x47, 7},
  |  |  173|      1|{3, 0xB, 0x1, 0x3, 0x2, 0x09, 6},
  |  |  174|      1|{3, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
  |  |  175|      1|{3, 0xC, 0x0, 0x0, 0x0, 0x31, 6},
  |  |  176|      1|{3, 0xC, 0x1, 0x4, 0x4, 0x11, 6},
  |  |  177|      1|{3, 0xC, 0x1, 0xC, 0x8, 0x3B, 7},
  |  |  178|      1|{3, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  179|      1|{3, 0xD, 0x1, 0x9, 0x9, 0x1B, 7},
  |  |  180|      1|{3, 0xD, 0x1, 0xD, 0x5, 0x2B, 7},
  |  |  181|      1|{3, 0xD, 0x1, 0xD, 0x1, 0x21, 6},
  |  |  182|      1|{3, 0xD, 0x1, 0xD, 0xC, 0x6B, 7},
  |  |  183|      1|{3, 0xD, 0x1, 0xD, 0x4, 0x01, 6},
  |  |  184|      1|{3, 0xD, 0x1, 0xD, 0x8, 0x4B, 7},
  |  |  185|      1|{3, 0xE, 0x0, 0x0, 0x0, 0x0B, 7},
  |  |  186|      1|{3, 0xE, 0x1, 0xE, 0x4, 0x73, 7},
  |  |  187|      1|{3, 0xE, 0x1, 0x4, 0x4, 0x13, 7},
  |  |  188|      1|{3, 0xE, 0x1, 0xC, 0x8, 0x3E, 6},
  |  |  189|      1|{3, 0xE, 0x1, 0xE, 0x2, 0x33, 7},
  |  |  190|      1|{3, 0xF, 0x0, 0x0, 0x0, 0x53, 7},
  |  |  191|      1|{3, 0xF, 0x1, 0xA, 0xA, 0x0E, 6},
  |  |  192|      1|{3, 0xF, 0x1, 0xB, 0x9, 0x63, 7},
  |  |  193|      1|{3, 0xF, 0x1, 0xF, 0xC, 0x03, 7},
  |  |  194|      1|{3, 0xF, 0x1, 0xF, 0x8, 0x12, 5},
  |  |  195|      1|{3, 0xF, 0x1, 0xE, 0x6, 0x23, 7},
  |  |  196|      1|{3, 0xF, 0x1, 0xF, 0x5, 0x1E, 6},
  |  |  197|      1|{3, 0xF, 0x1, 0xF, 0x4, 0x02, 5},
  |  |  198|      1|{3, 0xF, 0x1, 0xF, 0x3, 0x43, 7},
  |  |  199|      1|{3, 0xF, 0x1, 0xF, 0x1, 0x1C, 5},
  |  |  200|      1|{3, 0xF, 0x1, 0xF, 0x2, 0x2E, 6},
  |  |  201|      1|{4, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |  202|      1|{4, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
  |  |  203|      1|{4, 0x1, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |  204|      1|{4, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
  |  |  205|      1|{4, 0x2, 0x1, 0x2, 0x2, 0x1B, 6},
  |  |  206|      1|{4, 0x3, 0x0, 0x0, 0x0, 0x2B, 6},
  |  |  207|      1|{4, 0x3, 0x1, 0x2, 0x2, 0x3D, 6},
  |  |  208|      1|{4, 0x3, 0x1, 0x3, 0x1, 0x7F, 7},
  |  |  209|      1|{4, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |  210|      1|{4, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |  211|      1|{4, 0x5, 0x0, 0x0, 0x0, 0x0B, 6},
  |  |  212|      1|{4, 0x5, 0x1, 0x0, 0x0, 0x33, 6},
  |  |  213|      1|{4, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |  214|      1|{4, 0x6, 0x1, 0x0, 0x0, 0x23, 6},
  |  |  215|      1|{4, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
  |  |  216|      1|{4, 0x7, 0x1, 0x4, 0x4, 0x6F, 7},
  |  |  217|      1|{4, 0x7, 0x1, 0x4, 0x0, 0x03, 6},
  |  |  218|      1|{4, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  219|      1|{4, 0x8, 0x1, 0x8, 0x8, 0x1D, 6},
  |  |  220|      1|{4, 0x9, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  221|      1|{4, 0x9, 0x1, 0x0, 0x0, 0x77, 7},
  |  |  222|      1|{4, 0xA, 0x0, 0x0, 0x0, 0x01, 5},
  |  |  223|      1|{4, 0xA, 0x1, 0xA, 0xA, 0x2F, 7},
  |  |  224|      1|{4, 0xA, 0x1, 0xA, 0x2, 0x2D, 6},
  |  |  225|      1|{4, 0xA, 0x1, 0xA, 0x8, 0x0D, 6},
  |  |  226|      1|{4, 0xB, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  227|      1|{4, 0xB, 0x1, 0xB, 0x2, 0x0F, 7},
  |  |  228|      1|{4, 0xB, 0x1, 0x0, 0x0, 0x35, 6},
  |  |  229|      1|{4, 0xC, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  230|      1|{4, 0xC, 0x1, 0x8, 0x8, 0x25, 6},
  |  |  231|      1|{4, 0xC, 0x1, 0xC, 0x4, 0x37, 7},
  |  |  232|      1|{4, 0xD, 0x0, 0x0, 0x0, 0x57, 7},
  |  |  233|      1|{4, 0xD, 0x1, 0x1, 0x1, 0x07, 7},
  |  |  234|      1|{4, 0xD, 0x1, 0x1, 0x0, 0x05, 6},
  |  |  235|      1|{4, 0xE, 0x0, 0x0, 0x0, 0x17, 7},
  |  |  236|      1|{4, 0xE, 0x1, 0x4, 0x4, 0x39, 6},
  |  |  237|      1|{4, 0xE, 0x1, 0xC, 0x8, 0x19, 6},
  |  |  238|      1|{4, 0xE, 0x1, 0xE, 0x2, 0x67, 7},
  |  |  239|      1|{4, 0xF, 0x0, 0x0, 0x0, 0x27, 7},
  |  |  240|      1|{4, 0xF, 0x1, 0x9, 0x9, 0x47, 7},
  |  |  241|      1|{4, 0xF, 0x1, 0x9, 0x1, 0x29, 6},
  |  |  242|      1|{4, 0xF, 0x1, 0x7, 0x6, 0x7B, 7},
  |  |  243|      1|{4, 0xF, 0x1, 0x7, 0x2, 0x09, 6},
  |  |  244|      1|{4, 0xF, 0x1, 0xB, 0x8, 0x31, 6},
  |  |  245|      1|{4, 0xF, 0x1, 0xF, 0x4, 0x3B, 7},
  |  |  246|      1|{5, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  247|      1|{5, 0x1, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  248|      1|{5, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |  249|      1|{5, 0x2, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  250|      1|{5, 0x2, 0x1, 0x2, 0x2, 0x1D, 6},
  |  |  251|      1|{5, 0x3, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  252|      1|{5, 0x3, 0x1, 0x3, 0x3, 0x5F, 7},
  |  |  253|      1|{5, 0x3, 0x1, 0x3, 0x2, 0x39, 6},
  |  |  254|      1|{5, 0x3, 0x1, 0x3, 0x1, 0x3F, 7},
  |  |  255|      1|{5, 0x4, 0x0, 0x0, 0x0, 0x12, 5},
  |  |  256|      1|{5, 0x4, 0x1, 0x4, 0x4, 0x1F, 7},
  |  |  257|      1|{5, 0x5, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |  258|      1|{5, 0x5, 0x1, 0x4, 0x4, 0x35, 6},
  |  |  259|      1|{5, 0x5, 0x1, 0x5, 0x1, 0x6F, 7},
  |  |  260|      1|{5, 0x6, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  261|      1|{5, 0x6, 0x1, 0x2, 0x2, 0x25, 6},
  |  |  262|      1|{5, 0x6, 0x1, 0x6, 0x4, 0x2F, 7},
  |  |  263|      1|{5, 0x7, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  264|      1|{5, 0x7, 0x1, 0x6, 0x6, 0x57, 7},
  |  |  265|      1|{5, 0x7, 0x1, 0x6, 0x4, 0x05, 6},
  |  |  266|      1|{5, 0x7, 0x1, 0x7, 0x3, 0x0F, 7},
  |  |  267|      1|{5, 0x7, 0x1, 0x7, 0x2, 0x77, 7},
  |  |  268|      1|{5, 0x7, 0x1, 0x7, 0x1, 0x37, 7},
  |  |  269|      1|{5, 0x8, 0x0, 0x0, 0x0, 0x02, 5},
  |  |  270|      1|{5, 0x8, 0x1, 0x8, 0x8, 0x19, 6},
  |  |  271|      1|{5, 0x9, 0x0, 0x0, 0x0, 0x26, 6},
  |  |  272|      1|{5, 0x9, 0x1, 0x8, 0x8, 0x17, 7},
  |  |  273|      1|{5, 0x9, 0x1, 0x9, 0x1, 0x67, 7},
  |  |  274|      1|{5, 0xA, 0x0, 0x0, 0x0, 0x1C, 5},
  |  |  275|      1|{5, 0xA, 0x1, 0xA, 0xA, 0x29, 6},
  |  |  276|      1|{5, 0xA, 0x1, 0xA, 0x2, 0x09, 6},
  |  |  277|      1|{5, 0xA, 0x1, 0xA, 0x8, 0x31, 6},
  |  |  278|      1|{5, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
  |  |  279|      1|{5, 0xB, 0x1, 0x9, 0x9, 0x07, 7},
  |  |  280|      1|{5, 0xB, 0x1, 0x9, 0x8, 0x11, 6},
  |  |  281|      1|{5, 0xB, 0x1, 0xB, 0x3, 0x47, 7},
  |  |  282|      1|{5, 0xB, 0x1, 0xB, 0x2, 0x21, 6},
  |  |  283|      1|{5, 0xB, 0x1, 0xB, 0x1, 0x7B, 7},
  |  |  284|      1|{5, 0xC, 0x0, 0x0, 0x0, 0x01, 6},
  |  |  285|      1|{5, 0xC, 0x1, 0x8, 0x8, 0x3E, 6},
  |  |  286|      1|{5, 0xC, 0x1, 0xC, 0x4, 0x3B, 7},
  |  |  287|      1|{5, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  288|      1|{5, 0xD, 0x1, 0x9, 0x9, 0x6B, 7},
  |  |  289|      1|{5, 0xD, 0x1, 0x9, 0x8, 0x1E, 6},
  |  |  290|      1|{5, 0xD, 0x1, 0xD, 0x5, 0x1B, 7},
  |  |  291|      1|{5, 0xD, 0x1, 0xD, 0x4, 0x2E, 6},
  |  |  292|      1|{5, 0xD, 0x1, 0xD, 0x1, 0x2B, 7},
  |  |  293|      1|{5, 0xE, 0x0, 0x0, 0x0, 0x4B, 7},
  |  |  294|      1|{5, 0xE, 0x1, 0x6, 0x6, 0x0B, 7},
  |  |  295|      1|{5, 0xE, 0x1, 0xE, 0xA, 0x33, 7},
  |  |  296|      1|{5, 0xE, 0x1, 0xE, 0x2, 0x0E, 6},
  |  |  297|      1|{5, 0xE, 0x1, 0xE, 0xC, 0x73, 7},
  |  |  298|      1|{5, 0xE, 0x1, 0xE, 0x8, 0x36, 6},
  |  |  299|      1|{5, 0xE, 0x1, 0xE, 0x4, 0x53, 7},
  |  |  300|      1|{5, 0xF, 0x0, 0x0, 0x0, 0x13, 7},
  |  |  301|      1|{5, 0xF, 0x1, 0x7, 0x7, 0x43, 7},
  |  |  302|      1|{5, 0xF, 0x1, 0x7, 0x6, 0x16, 6},
  |  |  303|      1|{5, 0xF, 0x1, 0x7, 0x5, 0x63, 7},
  |  |  304|      1|{5, 0xF, 0x1, 0xF, 0xC, 0x23, 7},
  |  |  305|      1|{5, 0xF, 0x1, 0xF, 0x4, 0x0C, 5},
  |  |  306|      1|{5, 0xF, 0x1, 0xD, 0x9, 0x03, 7},
  |  |  307|      1|{5, 0xF, 0x1, 0xF, 0xA, 0x3D, 7},
  |  |  308|      1|{5, 0xF, 0x1, 0xF, 0x8, 0x14, 5},
  |  |  309|      1|{5, 0xF, 0x1, 0xF, 0x3, 0x7D, 7},
  |  |  310|      1|{5, 0xF, 0x1, 0xF, 0x2, 0x04, 5},
  |  |  311|      1|{5, 0xF, 0x1, 0xF, 0x1, 0x06, 6},
  |  |  312|      1|{6, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  313|      1|{6, 0x1, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  314|      1|{6, 0x1, 0x1, 0x1, 0x1, 0x03, 6},
  |  |  315|      1|{6, 0x2, 0x0, 0x0, 0x0, 0x0C, 5},
  |  |  316|      1|{6, 0x2, 0x1, 0x2, 0x2, 0x0D, 6},
  |  |  317|      1|{6, 0x3, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  318|      1|{6, 0x3, 0x1, 0x3, 0x3, 0x3D, 6},
  |  |  319|      1|{6, 0x3, 0x1, 0x3, 0x1, 0x1D, 6},
  |  |  320|      1|{6, 0x3, 0x1, 0x3, 0x2, 0x2D, 6},
  |  |  321|      1|{6, 0x4, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  322|      1|{6, 0x4, 0x1, 0x4, 0x4, 0x3F, 7},
  |  |  323|      1|{6, 0x5, 0x0, 0x0, 0x0, 0x35, 6},
  |  |  324|      1|{6, 0x5, 0x1, 0x1, 0x1, 0x15, 6},
  |  |  325|      1|{6, 0x5, 0x1, 0x5, 0x4, 0x7F, 7},
  |  |  326|      1|{6, 0x6, 0x0, 0x0, 0x0, 0x25, 6},
  |  |  327|      1|{6, 0x6, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |  328|      1|{6, 0x6, 0x1, 0x6, 0x4, 0x1F, 7},
  |  |  329|      1|{6, 0x7, 0x0, 0x0, 0x0, 0x6F, 7},
  |  |  330|      1|{6, 0x7, 0x1, 0x6, 0x6, 0x4F, 7},
  |  |  331|      1|{6, 0x7, 0x1, 0x6, 0x4, 0x05, 6},
  |  |  332|      1|{6, 0x7, 0x1, 0x7, 0x3, 0x2F, 7},
  |  |  333|      1|{6, 0x7, 0x1, 0x7, 0x1, 0x36, 6},
  |  |  334|      1|{6, 0x7, 0x1, 0x7, 0x2, 0x77, 7},
  |  |  335|      1|{6, 0x8, 0x0, 0x0, 0x0, 0x12, 5},
  |  |  336|      1|{6, 0x8, 0x1, 0x8, 0x8, 0x0F, 7},
  |  |  337|      1|{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  338|      1|{6, 0x9, 0x1, 0x1, 0x1, 0x37, 7},
  |  |  339|      1|{6, 0x9, 0x1, 0x9, 0x8, 0x57, 7},
  |  |  340|      1|{6, 0xA, 0x0, 0x0, 0x0, 0x19, 6},
  |  |  341|      1|{6, 0xA, 0x1, 0x2, 0x2, 0x29, 6},
  |  |  342|      1|{6, 0xA, 0x1, 0xA, 0x8, 0x17, 7},
  |  |  343|      1|{6, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  344|      1|{6, 0xB, 0x1, 0x9, 0x9, 0x47, 7},
  |  |  345|      1|{6, 0xB, 0x1, 0x9, 0x1, 0x09, 6},
  |  |  346|      1|{6, 0xB, 0x1, 0xB, 0xA, 0x27, 7},
  |  |  347|      1|{6, 0xB, 0x1, 0xB, 0x2, 0x31, 6},
  |  |  348|      1|{6, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
  |  |  349|      1|{6, 0xC, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  350|      1|{6, 0xC, 0x1, 0xC, 0xC, 0x07, 7},
  |  |  351|      1|{6, 0xC, 0x1, 0xC, 0x8, 0x21, 6},
  |  |  352|      1|{6, 0xC, 0x1, 0xC, 0x4, 0x3B, 7},
  |  |  353|      1|{6, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  354|      1|{6, 0xD, 0x1, 0x5, 0x5, 0x33, 7},
  |  |  355|      1|{6, 0xD, 0x1, 0x5, 0x4, 0x01, 6},
  |  |  356|      1|{6, 0xD, 0x1, 0xC, 0x8, 0x1B, 7},
  |  |  357|      1|{6, 0xD, 0x1, 0xD, 0x1, 0x6B, 7},
  |  |  358|      1|{6, 0xE, 0x0, 0x0, 0x0, 0x2B, 7},
  |  |  359|      1|{6, 0xE, 0x1, 0xE, 0x2, 0x4B, 7},
  |  |  360|      1|{6, 0xE, 0x1, 0x2, 0x2, 0x0B, 7},
  |  |  361|      1|{6, 0xE, 0x1, 0xE, 0xC, 0x73, 7},
  |  |  362|      1|{6, 0xE, 0x1, 0xE, 0x8, 0x3E, 6},
  |  |  363|      1|{6, 0xE, 0x1, 0xE, 0x4, 0x53, 7},
  |  |  364|      1|{6, 0xF, 0x0, 0x0, 0x0, 0x13, 7},
  |  |  365|      1|{6, 0xF, 0x1, 0x6, 0x6, 0x1E, 6},
  |  |  366|      1|{6, 0xF, 0x1, 0xE, 0xA, 0x2E, 6},
  |  |  367|      1|{6, 0xF, 0x1, 0xF, 0x3, 0x0E, 6},
  |  |  368|      1|{6, 0xF, 0x1, 0xF, 0x2, 0x02, 5},
  |  |  369|      1|{6, 0xF, 0x1, 0xB, 0x9, 0x63, 7},
  |  |  370|      1|{6, 0xF, 0x1, 0xF, 0xC, 0x16, 6},
  |  |  371|      1|{6, 0xF, 0x1, 0xF, 0x8, 0x06, 6},
  |  |  372|      1|{6, 0xF, 0x1, 0xF, 0x5, 0x23, 7},
  |  |  373|      1|{6, 0xF, 0x1, 0xF, 0x1, 0x1C, 5},
  |  |  374|      1|{6, 0xF, 0x1, 0xF, 0x4, 0x26, 6},
  |  |  375|      1|{7, 0x0, 0x0, 0x0, 0x0, 0x12, 5},
  |  |  376|      1|{7, 0x1, 0x0, 0x0, 0x0, 0x05, 6},
  |  |  377|      1|{7, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |  378|      1|{7, 0x2, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  379|      1|{7, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  380|      1|{7, 0x3, 0x0, 0x0, 0x0, 0x5F, 7},
  |  |  381|      1|{7, 0x3, 0x1, 0x3, 0x3, 0x1F, 7},
  |  |  382|      1|{7, 0x3, 0x1, 0x3, 0x2, 0x6F, 7},
  |  |  383|      1|{7, 0x3, 0x1, 0x3, 0x1, 0x2F, 7},
  |  |  384|      1|{7, 0x4, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  385|      1|{7, 0x4, 0x1, 0x4, 0x4, 0x0F, 7},
  |  |  386|      1|{7, 0x5, 0x0, 0x0, 0x0, 0x57, 7},
  |  |  387|      1|{7, 0x5, 0x1, 0x1, 0x1, 0x19, 6},
  |  |  388|      1|{7, 0x5, 0x1, 0x5, 0x4, 0x77, 7},
  |  |  389|      1|{7, 0x6, 0x0, 0x0, 0x0, 0x37, 7},
  |  |  390|      1|{7, 0x6, 0x1, 0x0, 0x0, 0x29, 6},
  |  |  391|      1|{7, 0x7, 0x0, 0x0, 0x0, 0x17, 7},
  |  |  392|      1|{7, 0x7, 0x1, 0x6, 0x6, 0x67, 7},
  |  |  393|      1|{7, 0x7, 0x1, 0x7, 0x3, 0x27, 7},
  |  |  394|      1|{7, 0x7, 0x1, 0x7, 0x2, 0x47, 7},
  |  |  395|      1|{7, 0x7, 0x1, 0x7, 0x5, 0x1B, 7},
  |  |  396|      1|{7, 0x7, 0x1, 0x7, 0x1, 0x09, 6},
  |  |  397|      1|{7, 0x7, 0x1, 0x7, 0x4, 0x07, 7},
  |  |  398|      1|{7, 0x8, 0x0, 0x0, 0x0, 0x7B, 7},
  |  |  399|      1|{7, 0x8, 0x1, 0x8, 0x8, 0x3B, 7},
  |  |  400|      1|{7, 0x9, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  401|      1|{7, 0x9, 0x1, 0x0, 0x0, 0x31, 6},
  |  |  402|      1|{7, 0xA, 0x0, 0x0, 0x0, 0x53, 7},
  |  |  403|      1|{7, 0xA, 0x1, 0x2, 0x2, 0x11, 6},
  |  |  404|      1|{7, 0xA, 0x1, 0xA, 0x8, 0x6B, 7},
  |  |  405|      1|{7, 0xB, 0x0, 0x0, 0x0, 0x2B, 7},
  |  |  406|      1|{7, 0xB, 0x1, 0x9, 0x9, 0x4B, 7},
  |  |  407|      1|{7, 0xB, 0x1, 0xB, 0x3, 0x0B, 7},
  |  |  408|      1|{7, 0xB, 0x1, 0xB, 0x1, 0x73, 7},
  |  |  409|      1|{7, 0xB, 0x1, 0xB, 0xA, 0x33, 7},
  |  |  410|      1|{7, 0xB, 0x1, 0xB, 0x2, 0x21, 6},
  |  |  411|      1|{7, 0xB, 0x1, 0xB, 0x8, 0x13, 7},
  |  |  412|      1|{7, 0xC, 0x0, 0x0, 0x0, 0x63, 7},
  |  |  413|      1|{7, 0xC, 0x1, 0x8, 0x8, 0x23, 7},
  |  |  414|      1|{7, 0xC, 0x1, 0xC, 0x4, 0x43, 7},
  |  |  415|      1|{7, 0xD, 0x0, 0x0, 0x0, 0x03, 7},
  |  |  416|      1|{7, 0xD, 0x1, 0x9, 0x9, 0x7D, 7},
  |  |  417|      1|{7, 0xD, 0x1, 0xD, 0x5, 0x5D, 7},
  |  |  418|      1|{7, 0xD, 0x1, 0xD, 0x1, 0x01, 6},
  |  |  419|      1|{7, 0xD, 0x1, 0xD, 0xC, 0x3D, 7},
  |  |  420|      1|{7, 0xD, 0x1, 0xD, 0x4, 0x3E, 6},
  |  |  421|      1|{7, 0xD, 0x1, 0xD, 0x8, 0x1D, 7},
  |  |  422|      1|{7, 0xE, 0x0, 0x0, 0x0, 0x6D, 7},
  |  |  423|      1|{7, 0xE, 0x1, 0x6, 0x6, 0x2D, 7},
  |  |  424|      1|{7, 0xE, 0x1, 0xE, 0xA, 0x0D, 7},
  |  |  425|      1|{7, 0xE, 0x1, 0xE, 0x2, 0x1E, 6},
  |  |  426|      1|{7, 0xE, 0x1, 0xE, 0xC, 0x4D, 7},
  |  |  427|      1|{7, 0xE, 0x1, 0xE, 0x8, 0x0E, 6},
  |  |  428|      1|{7, 0xE, 0x1, 0xE, 0x4, 0x75, 7},
  |  |  429|      1|{7, 0xF, 0x0, 0x0, 0x0, 0x15, 7},
  |  |  430|      1|{7, 0xF, 0x1, 0xF, 0xF, 0x06, 5},
  |  |  431|      1|{7, 0xF, 0x1, 0xF, 0xD, 0x35, 7},
  |  |  432|      1|{7, 0xF, 0x1, 0xF, 0x7, 0x55, 7},
  |  |  433|      1|{7, 0xF, 0x1, 0xF, 0x5, 0x1A, 5},
  |  |  434|      1|{7, 0xF, 0x1, 0xF, 0xB, 0x25, 7},
  |  |  435|      1|{7, 0xF, 0x1, 0xF, 0x3, 0x0A, 5},
  |  |  436|      1|{7, 0xF, 0x1, 0xF, 0x9, 0x2E, 6},
  |  |  437|      1|{7, 0xF, 0x1, 0xF, 0x1, 0x00, 4},
  |  |  438|      1|{7, 0xF, 0x1, 0xF, 0xE, 0x65, 7},
  |  |  439|      1|{7, 0xF, 0x1, 0xF, 0x6, 0x36, 6},
  |  |  440|      1|{7, 0xF, 0x1, 0xF, 0xA, 0x02, 5},
  |  |  441|      1|{7, 0xF, 0x1, 0xF, 0x2, 0x0C, 4},
  |  |  442|      1|{7, 0xF, 0x1, 0xF, 0xC, 0x16, 6},
  |  |  443|      1|{7, 0xF, 0x1, 0xF, 0x8, 0x04, 4},
  |  |  444|      1|{7, 0xF, 0x1, 0xF, 0x4, 0x08, 4}
  ------------------
   97|      1|      };
   98|      1|      size_t tbl0_size = sizeof(tbl0) / sizeof(vlc_src_table);
   99|       |
  100|      1|      si32 pattern_popcnt[16];
  101|     17|      for (ui32 i = 0; i < 16; ++i)
  ------------------
  |  Branch (101:24): [True: 16, False: 1]
  ------------------
  102|     16|        pattern_popcnt[i] = (si32)population_count(i);
  103|       |
  104|      1|      vlc_src_table* src_tbl = tbl0;
  105|      1|      ui32 *tgt_tbl = vlc_tbl0;
  106|      1|      size_t tbl_size = tbl0_size;
  107|  2.04k|      for (int i = 0; i < 2048; ++i)
  ------------------
  |  Branch (107:23): [True: 2.04k, False: 1]
  ------------------
  108|  2.04k|      {
  109|  2.04k|        int c_q = i >> 8, rho = (i >> 4) & 0xF, emb = i & 0xF;
  110|  2.04k|        if (((emb & rho) != emb) || (rho == 0 && c_q == 0))
  ------------------
  |  Branch (110:13): [True: 1.40k, False: 648]
  |  Branch (110:38): [True: 8, False: 640]
  |  Branch (110:50): [True: 1, False: 7]
  ------------------
  111|  1.40k|          tgt_tbl[i] = 0;
  112|    647|        else
  113|    647|        {
  114|    647|          vlc_src_table *best_entry = NULL;
  115|    647|          if (emb) // u_off = 1
  ------------------
  |  Branch (115:15): [True: 520, False: 127]
  ------------------
  116|    520|          {
  117|    520|            int best_e_k = -1;
  118|   231k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (118:32): [True: 230k, False: 520]
  ------------------
  119|   230k|            {
  120|   230k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (120:19): [True: 28.8k, False: 202k]
  |  Branch (120:44): [True: 2.74k, False: 26.1k]
  ------------------
  121|  2.74k|                if (src_tbl[j].u_off == 1)
  ------------------
  |  Branch (121:21): [True: 2.22k, False: 520]
  ------------------
  122|  2.22k|                  if ((emb & src_tbl[j].e_k) == src_tbl[j].e_1)
  ------------------
  |  Branch (122:23): [True: 527, False: 1.70k]
  ------------------
  123|    527|                  {
  124|       |                    //now we need to find the smallest cwd with the highest
  125|       |                    // number of bits set in e_k
  126|    527|                    int ones_count = pattern_popcnt[src_tbl[j].e_k];
  127|    527|                    if (ones_count >= best_e_k)
  ------------------
  |  Branch (127:25): [True: 520, False: 7]
  ------------------
  128|    520|                    {
  129|    520|                      best_entry = src_tbl + j;
  130|    520|                      best_e_k = ones_count;
  131|    520|                    }
  132|    527|                  }
  133|   230k|            }
  134|    520|          }
  135|    127|          else // u_off = 0
  136|    127|          {
  137|  25.1k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (137:32): [True: 25.1k, False: 0]
  ------------------
  138|  25.1k|            {
  139|  25.1k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (139:19): [True: 2.57k, False: 22.5k]
  |  Branch (139:44): [True: 127, False: 2.44k]
  ------------------
  140|    127|                if (src_tbl[j].u_off == 0)
  ------------------
  |  Branch (140:21): [True: 127, False: 0]
  ------------------
  141|    127|                {
  142|    127|                  best_entry = src_tbl + j;
  143|    127|                  break;
  144|    127|                }
  145|  25.1k|            }
  146|    127|          }
  147|    647|          assert(best_entry);
  148|    647|          tgt_tbl[i] = (ui16)((best_entry->cwd<<8) + (best_entry->cwd_len<<4)
  149|    647|                             + best_entry->e_k);
  150|    647|        }
  151|  2.04k|      }
  152|       |
  153|      1|      vlc_src_table tbl1[] = {
  154|      1|    #include "table1.h"
  ------------------
  |  |    1|      1|{0, 0x1, 0x0, 0x0, 0x0, 0x00, 3},
  |  |    2|      1|{0, 0x1, 0x1, 0x1, 0x1, 0x27, 6},
  |  |    3|      1|{0, 0x2, 0x0, 0x0, 0x0, 0x06, 3},
  |  |    4|      1|{0, 0x2, 0x1, 0x2, 0x2, 0x17, 6},
  |  |    5|      1|{0, 0x3, 0x0, 0x0, 0x0, 0x0D, 5},
  |  |    6|      1|{0, 0x3, 0x1, 0x0, 0x0, 0x3B, 6},
  |  |    7|      1|{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3},
  |  |    8|      1|{0, 0x4, 0x1, 0x4, 0x4, 0x07, 6},
  |  |    9|      1|{0, 0x5, 0x0, 0x0, 0x0, 0x15, 5},
  |  |   10|      1|{0, 0x5, 0x1, 0x0, 0x0, 0x2B, 6},
  |  |   11|      1|{0, 0x6, 0x0, 0x0, 0x0, 0x01, 5},
  |  |   12|      1|{0, 0x6, 0x1, 0x0, 0x0, 0x7F, 7},
  |  |   13|      1|{0, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
  |  |   14|      1|{0, 0x7, 0x1, 0x0, 0x0, 0x1B, 6},
  |  |   15|      1|{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3},
  |  |   16|      1|{0, 0x8, 0x1, 0x8, 0x8, 0x05, 5},
  |  |   17|      1|{0, 0x9, 0x0, 0x0, 0x0, 0x19, 5},
  |  |   18|      1|{0, 0x9, 0x1, 0x0, 0x0, 0x13, 6},
  |  |   19|      1|{0, 0xA, 0x0, 0x0, 0x0, 0x09, 5},
  |  |   20|      1|{0, 0xA, 0x1, 0x8, 0x8, 0x0B, 6},
  |  |   21|      1|{0, 0xA, 0x1, 0xA, 0x2, 0x3F, 7},
  |  |   22|      1|{0, 0xB, 0x0, 0x0, 0x0, 0x5F, 7},
  |  |   23|      1|{0, 0xB, 0x1, 0x0, 0x0, 0x33, 6},
  |  |   24|      1|{0, 0xC, 0x0, 0x0, 0x0, 0x11, 5},
  |  |   25|      1|{0, 0xC, 0x1, 0x8, 0x8, 0x23, 6},
  |  |   26|      1|{0, 0xC, 0x1, 0xC, 0x4, 0x6F, 7},
  |  |   27|      1|{0, 0xD, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   28|      1|{0, 0xD, 0x1, 0x0, 0x0, 0x03, 6},
  |  |   29|      1|{0, 0xE, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   30|      1|{0, 0xE, 0x1, 0x4, 0x4, 0x4F, 7},
  |  |   31|      1|{0, 0xE, 0x1, 0x4, 0x0, 0x3D, 6},
  |  |   32|      1|{0, 0xF, 0x0, 0x0, 0x0, 0x77, 7},
  |  |   33|      1|{0, 0xF, 0x1, 0x1, 0x1, 0x37, 7},
  |  |   34|      1|{0, 0xF, 0x1, 0x1, 0x0, 0x1D, 6},
  |  |   35|      1|{1, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
  |  |   36|      1|{1, 0x1, 0x0, 0x0, 0x0, 0x05, 4},
  |  |   37|      1|{1, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |   38|      1|{1, 0x2, 0x0, 0x0, 0x0, 0x09, 4},
  |  |   39|      1|{1, 0x2, 0x1, 0x2, 0x2, 0x1F, 7},
  |  |   40|      1|{1, 0x3, 0x0, 0x0, 0x0, 0x1D, 5},
  |  |   41|      1|{1, 0x3, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |   42|      1|{1, 0x3, 0x1, 0x3, 0x2, 0x5F, 7},
  |  |   43|      1|{1, 0x4, 0x0, 0x0, 0x0, 0x0D, 5},
  |  |   44|      1|{1, 0x4, 0x1, 0x4, 0x4, 0x37, 7},
  |  |   45|      1|{1, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
  |  |   46|      1|{1, 0x5, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |   47|      1|{1, 0x6, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   48|      1|{1, 0x6, 0x1, 0x0, 0x0, 0x4F, 7},
  |  |   49|      1|{1, 0x7, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   50|      1|{1, 0x7, 0x1, 0x0, 0x0, 0x77, 7},
  |  |   51|      1|{1, 0x8, 0x0, 0x0, 0x0, 0x01, 4},
  |  |   52|      1|{1, 0x8, 0x1, 0x8, 0x8, 0x17, 7},
  |  |   53|      1|{1, 0x9, 0x0, 0x0, 0x0, 0x0B, 6},
  |  |   54|      1|{1, 0x9, 0x1, 0x0, 0x0, 0x57, 7},
  |  |   55|      1|{1, 0xA, 0x0, 0x0, 0x0, 0x33, 6},
  |  |   56|      1|{1, 0xA, 0x1, 0x0, 0x0, 0x67, 7},
  |  |   57|      1|{1, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
  |  |   58|      1|{1, 0xB, 0x1, 0x0, 0x0, 0x2B, 7},
  |  |   59|      1|{1, 0xC, 0x0, 0x0, 0x0, 0x13, 6},
  |  |   60|      1|{1, 0xC, 0x1, 0x0, 0x0, 0x47, 7},
  |  |   61|      1|{1, 0xD, 0x0, 0x0, 0x0, 0x07, 7},
  |  |   62|      1|{1, 0xD, 0x1, 0x0, 0x0, 0x7B, 7},
  |  |   63|      1|{1, 0xE, 0x0, 0x0, 0x0, 0x3B, 7},
  |  |   64|      1|{1, 0xE, 0x1, 0x0, 0x0, 0x5B, 7},
  |  |   65|      1|{1, 0xF, 0x0, 0x0, 0x0, 0x1B, 7},
  |  |   66|      1|{1, 0xF, 0x1, 0x4, 0x4, 0x6B, 7},
  |  |   67|      1|{1, 0xF, 0x1, 0x4, 0x0, 0x23, 6},
  |  |   68|      1|{2, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
  |  |   69|      1|{2, 0x1, 0x0, 0x0, 0x0, 0x09, 4},
  |  |   70|      1|{2, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |   71|      1|{2, 0x2, 0x0, 0x0, 0x0, 0x01, 4},
  |  |   72|      1|{2, 0x2, 0x1, 0x2, 0x2, 0x23, 6},
  |  |   73|      1|{2, 0x3, 0x0, 0x0, 0x0, 0x3D, 6},
  |  |   74|      1|{2, 0x3, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |   75|      1|{2, 0x3, 0x1, 0x3, 0x1, 0x1F, 7},
  |  |   76|      1|{2, 0x4, 0x0, 0x0, 0x0, 0x15, 5},
  |  |   77|      1|{2, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |   78|      1|{2, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
  |  |   79|      1|{2, 0x5, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |   80|      1|{2, 0x6, 0x0, 0x0, 0x0, 0x2F, 7},
  |  |   81|      1|{2, 0x6, 0x1, 0x0, 0x0, 0x4F, 7},
  |  |   82|      1|{2, 0x7, 0x0, 0x0, 0x0, 0x0F, 7},
  |  |   83|      1|{2, 0x7, 0x1, 0x0, 0x0, 0x17, 7},
  |  |   84|      1|{2, 0x8, 0x0, 0x0, 0x0, 0x05, 5},
  |  |   85|      1|{2, 0x8, 0x1, 0x8, 0x8, 0x77, 7},
  |  |   86|      1|{2, 0x9, 0x0, 0x0, 0x0, 0x37, 7},
  |  |   87|      1|{2, 0x9, 0x1, 0x0, 0x0, 0x57, 7},
  |  |   88|      1|{2, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |   89|      1|{2, 0xA, 0x1, 0xA, 0xA, 0x7B, 7},
  |  |   90|      1|{2, 0xA, 0x1, 0xA, 0x2, 0x2D, 6},
  |  |   91|      1|{2, 0xA, 0x1, 0xA, 0x8, 0x67, 7},
  |  |   92|      1|{2, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
  |  |   93|      1|{2, 0xB, 0x1, 0xB, 0x2, 0x47, 7},
  |  |   94|      1|{2, 0xB, 0x1, 0x0, 0x0, 0x07, 7},
  |  |   95|      1|{2, 0xC, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |   96|      1|{2, 0xC, 0x1, 0x0, 0x0, 0x3B, 7},
  |  |   97|      1|{2, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |   98|      1|{2, 0xD, 0x1, 0x0, 0x0, 0x1B, 7},
  |  |   99|      1|{2, 0xE, 0x0, 0x0, 0x0, 0x6B, 7},
  |  |  100|      1|{2, 0xE, 0x1, 0x4, 0x4, 0x2B, 7},
  |  |  101|      1|{2, 0xE, 0x1, 0x4, 0x0, 0x4B, 7},
  |  |  102|      1|{2, 0xF, 0x0, 0x0, 0x0, 0x0B, 7},
  |  |  103|      1|{2, 0xF, 0x1, 0x4, 0x4, 0x73, 7},
  |  |  104|      1|{2, 0xF, 0x1, 0x5, 0x1, 0x33, 7},
  |  |  105|      1|{2, 0xF, 0x1, 0x7, 0x2, 0x53, 7},
  |  |  106|      1|{2, 0xF, 0x1, 0xF, 0x8, 0x13, 7},
  |  |  107|      1|{3, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |  108|      1|{3, 0x1, 0x0, 0x0, 0x0, 0x0A, 4},
  |  |  109|      1|{3, 0x1, 0x1, 0x1, 0x1, 0x0B, 6},
  |  |  110|      1|{3, 0x2, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  111|      1|{3, 0x2, 0x1, 0x2, 0x2, 0x23, 6},
  |  |  112|      1|{3, 0x3, 0x0, 0x0, 0x0, 0x0E, 5},
  |  |  113|      1|{3, 0x3, 0x1, 0x3, 0x3, 0x7F, 7},
  |  |  114|      1|{3, 0x3, 0x1, 0x3, 0x2, 0x33, 6},
  |  |  115|      1|{3, 0x3, 0x1, 0x3, 0x1, 0x13, 6},
  |  |  116|      1|{3, 0x4, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  117|      1|{3, 0x4, 0x1, 0x4, 0x4, 0x3F, 7},
  |  |  118|      1|{3, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
  |  |  119|      1|{3, 0x5, 0x1, 0x1, 0x1, 0x3D, 6},
  |  |  120|      1|{3, 0x5, 0x1, 0x5, 0x4, 0x1F, 7},
  |  |  121|      1|{3, 0x6, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  122|      1|{3, 0x6, 0x1, 0x0, 0x0, 0x5F, 7},
  |  |  123|      1|{3, 0x7, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  124|      1|{3, 0x7, 0x1, 0x4, 0x4, 0x2F, 7},
  |  |  125|      1|{3, 0x7, 0x1, 0x5, 0x1, 0x1E, 6},
  |  |  126|      1|{3, 0x7, 0x1, 0x7, 0x2, 0x6F, 7},
  |  |  127|      1|{3, 0x8, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  128|      1|{3, 0x8, 0x1, 0x8, 0x8, 0x4F, 7},
  |  |  129|      1|{3, 0x9, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |  130|      1|{3, 0x9, 0x1, 0x0, 0x0, 0x35, 6},
  |  |  131|      1|{3, 0xA, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  132|      1|{3, 0xA, 0x1, 0x2, 0x2, 0x25, 6},
  |  |  133|      1|{3, 0xA, 0x1, 0xA, 0x8, 0x0F, 7},
  |  |  134|      1|{3, 0xB, 0x0, 0x0, 0x0, 0x05, 6},
  |  |  135|      1|{3, 0xB, 0x1, 0x8, 0x8, 0x39, 6},
  |  |  136|      1|{3, 0xB, 0x1, 0xB, 0x3, 0x17, 7},
  |  |  137|      1|{3, 0xB, 0x1, 0xB, 0x2, 0x19, 6},
  |  |  138|      1|{3, 0xB, 0x1, 0xB, 0x1, 0x77, 7},
  |  |  139|      1|{3, 0xC, 0x0, 0x0, 0x0, 0x29, 6},
  |  |  140|      1|{3, 0xC, 0x1, 0x0, 0x0, 0x09, 6},
  |  |  141|      1|{3, 0xD, 0x0, 0x0, 0x0, 0x37, 7},
  |  |  142|      1|{3, 0xD, 0x1, 0x4, 0x4, 0x57, 7},
  |  |  143|      1|{3, 0xD, 0x1, 0x4, 0x0, 0x31, 6},
  |  |  144|      1|{3, 0xE, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  145|      1|{3, 0xE, 0x1, 0x4, 0x4, 0x27, 7},
  |  |  146|      1|{3, 0xE, 0x1, 0xC, 0x8, 0x47, 7},
  |  |  147|      1|{3, 0xE, 0x1, 0xE, 0x2, 0x6B, 7},
  |  |  148|      1|{3, 0xF, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  149|      1|{3, 0xF, 0x1, 0x6, 0x6, 0x07, 7},
  |  |  150|      1|{3, 0xF, 0x1, 0x7, 0x3, 0x7B, 7},
  |  |  151|      1|{3, 0xF, 0x1, 0xF, 0xA, 0x3B, 7},
  |  |  152|      1|{3, 0xF, 0x1, 0xF, 0x2, 0x21, 6},
  |  |  153|      1|{3, 0xF, 0x1, 0xF, 0x8, 0x01, 6},
  |  |  154|      1|{3, 0xF, 0x1, 0xA, 0x8, 0x5B, 7},
  |  |  155|      1|{3, 0xF, 0x1, 0xF, 0x5, 0x1B, 7},
  |  |  156|      1|{3, 0xF, 0x1, 0xF, 0x1, 0x3E, 6},
  |  |  157|      1|{3, 0xF, 0x1, 0xF, 0x4, 0x2B, 7},
  |  |  158|      1|{4, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
  |  |  159|      1|{4, 0x1, 0x0, 0x0, 0x0, 0x0D, 5},
  |  |  160|      1|{4, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
  |  |  161|      1|{4, 0x2, 0x0, 0x0, 0x0, 0x15, 5},
  |  |  162|      1|{4, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  163|      1|{4, 0x3, 0x0, 0x0, 0x0, 0x5F, 7},
  |  |  164|      1|{4, 0x3, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |  165|      1|{4, 0x4, 0x0, 0x0, 0x0, 0x09, 4},
  |  |  166|      1|{4, 0x4, 0x1, 0x4, 0x4, 0x23, 6},
  |  |  167|      1|{4, 0x5, 0x0, 0x0, 0x0, 0x33, 6},
  |  |  168|      1|{4, 0x5, 0x1, 0x0, 0x0, 0x1F, 7},
  |  |  169|      1|{4, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |  170|      1|{4, 0x6, 0x1, 0x0, 0x0, 0x2F, 7},
  |  |  171|      1|{4, 0x7, 0x0, 0x0, 0x0, 0x4F, 7},
  |  |  172|      1|{4, 0x7, 0x1, 0x0, 0x0, 0x57, 7},
  |  |  173|      1|{4, 0x8, 0x0, 0x0, 0x0, 0x01, 4},
  |  |  174|      1|{4, 0x8, 0x1, 0x8, 0x8, 0x0F, 7},
  |  |  175|      1|{4, 0x9, 0x0, 0x0, 0x0, 0x77, 7},
  |  |  176|      1|{4, 0x9, 0x1, 0x0, 0x0, 0x37, 7},
  |  |  177|      1|{4, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  178|      1|{4, 0xA, 0x1, 0x0, 0x0, 0x17, 7},
  |  |  179|      1|{4, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
  |  |  180|      1|{4, 0xB, 0x1, 0x0, 0x0, 0x6B, 7},
  |  |  181|      1|{4, 0xC, 0x0, 0x0, 0x0, 0x05, 5},
  |  |  182|      1|{4, 0xC, 0x1, 0xC, 0xC, 0x27, 7},
  |  |  183|      1|{4, 0xC, 0x1, 0xC, 0x8, 0x47, 7},
  |  |  184|      1|{4, 0xC, 0x1, 0xC, 0x4, 0x07, 7},
  |  |  185|      1|{4, 0xD, 0x0, 0x0, 0x0, 0x7B, 7},
  |  |  186|      1|{4, 0xD, 0x1, 0x0, 0x0, 0x3B, 7},
  |  |  187|      1|{4, 0xE, 0x0, 0x0, 0x0, 0x5B, 7},
  |  |  188|      1|{4, 0xE, 0x1, 0x2, 0x2, 0x1B, 7},
  |  |  189|      1|{4, 0xE, 0x1, 0x2, 0x0, 0x03, 6},
  |  |  190|      1|{4, 0xF, 0x0, 0x0, 0x0, 0x2B, 7},
  |  |  191|      1|{4, 0xF, 0x1, 0x1, 0x1, 0x4B, 7},
  |  |  192|      1|{4, 0xF, 0x1, 0x3, 0x2, 0x0B, 7},
  |  |  193|      1|{4, 0xF, 0x1, 0x3, 0x0, 0x3D, 6},
  |  |  194|      1|{5, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
  |  |  195|      1|{5, 0x1, 0x0, 0x0, 0x0, 0x1E, 5},
  |  |  196|      1|{5, 0x1, 0x1, 0x1, 0x1, 0x3B, 6},
  |  |  197|      1|{5, 0x2, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  198|      1|{5, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  199|      1|{5, 0x3, 0x0, 0x0, 0x0, 0x1B, 6},
  |  |  200|      1|{5, 0x3, 0x1, 0x0, 0x0, 0x0B, 6},
  |  |  201|      1|{5, 0x4, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  202|      1|{5, 0x4, 0x1, 0x4, 0x4, 0x2B, 6},
  |  |  203|      1|{5, 0x5, 0x0, 0x0, 0x0, 0x0E, 5},
  |  |  204|      1|{5, 0x5, 0x1, 0x4, 0x4, 0x33, 6},
  |  |  205|      1|{5, 0x5, 0x1, 0x5, 0x1, 0x7F, 7},
  |  |  206|      1|{5, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
  |  |  207|      1|{5, 0x6, 0x1, 0x0, 0x0, 0x6F, 7},
  |  |  208|      1|{5, 0x7, 0x0, 0x0, 0x0, 0x23, 6},
  |  |  209|      1|{5, 0x7, 0x1, 0x2, 0x2, 0x5F, 7},
  |  |  210|      1|{5, 0x7, 0x1, 0x2, 0x0, 0x15, 6},
  |  |  211|      1|{5, 0x8, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  212|      1|{5, 0x8, 0x1, 0x8, 0x8, 0x03, 6},
  |  |  213|      1|{5, 0x9, 0x0, 0x0, 0x0, 0x3D, 6},
  |  |  214|      1|{5, 0x9, 0x1, 0x0, 0x0, 0x1F, 7},
  |  |  215|      1|{5, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  216|      1|{5, 0xA, 0x1, 0x0, 0x0, 0x2D, 6},
  |  |  217|      1|{5, 0xB, 0x0, 0x0, 0x0, 0x0D, 6},
  |  |  218|      1|{5, 0xB, 0x1, 0x1, 0x1, 0x4F, 7},
  |  |  219|      1|{5, 0xB, 0x1, 0x1, 0x0, 0x35, 6},
  |  |  220|      1|{5, 0xC, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  221|      1|{5, 0xC, 0x1, 0x4, 0x4, 0x25, 6},
  |  |  222|      1|{5, 0xC, 0x1, 0xC, 0x8, 0x2F, 7},
  |  |  223|      1|{5, 0xD, 0x0, 0x0, 0x0, 0x05, 6},
  |  |  224|      1|{5, 0xD, 0x1, 0x1, 0x1, 0x77, 7},
  |  |  225|      1|{5, 0xD, 0x1, 0x5, 0x4, 0x39, 6},
  |  |  226|      1|{5, 0xD, 0x1, 0xD, 0x8, 0x0F, 7},
  |  |  227|      1|{5, 0xE, 0x0, 0x0, 0x0, 0x19, 6},
  |  |  228|      1|{5, 0xE, 0x1, 0x2, 0x2, 0x57, 7},
  |  |  229|      1|{5, 0xE, 0x1, 0xA, 0x8, 0x01, 6},
  |  |  230|      1|{5, 0xE, 0x1, 0xE, 0x4, 0x37, 7},
  |  |  231|      1|{5, 0xF, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  232|      1|{5, 0xF, 0x1, 0x9, 0x9, 0x17, 7},
  |  |  233|      1|{5, 0xF, 0x1, 0xD, 0x5, 0x67, 7},
  |  |  234|      1|{5, 0xF, 0x1, 0xF, 0x3, 0x07, 7},
  |  |  235|      1|{5, 0xF, 0x1, 0xF, 0x1, 0x29, 6},
  |  |  236|      1|{5, 0xF, 0x1, 0x7, 0x6, 0x27, 7},
  |  |  237|      1|{5, 0xF, 0x1, 0xF, 0xC, 0x09, 6},
  |  |  238|      1|{5, 0xF, 0x1, 0xF, 0x4, 0x31, 6},
  |  |  239|      1|{5, 0xF, 0x1, 0xF, 0xA, 0x47, 7},
  |  |  240|      1|{5, 0xF, 0x1, 0xF, 0x8, 0x11, 6},
  |  |  241|      1|{5, 0xF, 0x1, 0xF, 0x2, 0x21, 6},
  |  |  242|      1|{6, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  243|      1|{6, 0x1, 0x0, 0x0, 0x0, 0x02, 4},
  |  |  244|      1|{6, 0x1, 0x1, 0x1, 0x1, 0x03, 6},
  |  |  245|      1|{6, 0x2, 0x0, 0x0, 0x0, 0x0C, 4},
  |  |  246|      1|{6, 0x2, 0x1, 0x2, 0x2, 0x3D, 6},
  |  |  247|      1|{6, 0x3, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  248|      1|{6, 0x3, 0x1, 0x2, 0x2, 0x0D, 6},
  |  |  249|      1|{6, 0x3, 0x1, 0x3, 0x1, 0x7F, 7},
  |  |  250|      1|{6, 0x4, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  251|      1|{6, 0x4, 0x1, 0x4, 0x4, 0x2D, 6},
  |  |  252|      1|{6, 0x5, 0x0, 0x0, 0x0, 0x0A, 5},
  |  |  253|      1|{6, 0x5, 0x1, 0x4, 0x4, 0x35, 6},
  |  |  254|      1|{6, 0x5, 0x1, 0x5, 0x1, 0x2F, 7},
  |  |  255|      1|{6, 0x6, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  256|      1|{6, 0x6, 0x1, 0x2, 0x2, 0x3F, 7},
  |  |  257|      1|{6, 0x6, 0x1, 0x6, 0x4, 0x5F, 7},
  |  |  258|      1|{6, 0x7, 0x0, 0x0, 0x0, 0x25, 6},
  |  |  259|      1|{6, 0x7, 0x1, 0x2, 0x2, 0x29, 6},
  |  |  260|      1|{6, 0x7, 0x1, 0x3, 0x1, 0x1F, 7},
  |  |  261|      1|{6, 0x7, 0x1, 0x7, 0x4, 0x6F, 7},
  |  |  262|      1|{6, 0x8, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  263|      1|{6, 0x8, 0x1, 0x8, 0x8, 0x05, 6},
  |  |  264|      1|{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  265|      1|{6, 0x9, 0x1, 0x0, 0x0, 0x19, 6},
  |  |  266|      1|{6, 0xA, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  267|      1|{6, 0xA, 0x1, 0xA, 0xA, 0x0F, 7},
  |  |  268|      1|{6, 0xA, 0x1, 0xA, 0x2, 0x09, 6},
  |  |  269|      1|{6, 0xA, 0x1, 0xA, 0x8, 0x4F, 7},
  |  |  270|      1|{6, 0xB, 0x0, 0x0, 0x0, 0x0E, 6},
  |  |  271|      1|{6, 0xB, 0x1, 0xB, 0x2, 0x77, 7},
  |  |  272|      1|{6, 0xB, 0x1, 0x2, 0x2, 0x37, 7},
  |  |  273|      1|{6, 0xB, 0x1, 0xA, 0x8, 0x57, 7},
  |  |  274|      1|{6, 0xB, 0x1, 0xB, 0x1, 0x47, 7},
  |  |  275|      1|{6, 0xC, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  276|      1|{6, 0xC, 0x1, 0xC, 0xC, 0x17, 7},
  |  |  277|      1|{6, 0xC, 0x1, 0xC, 0x8, 0x67, 7},
  |  |  278|      1|{6, 0xC, 0x1, 0xC, 0x4, 0x27, 7},
  |  |  279|      1|{6, 0xD, 0x0, 0x0, 0x0, 0x31, 6},
  |  |  280|      1|{6, 0xD, 0x1, 0xD, 0x4, 0x07, 7},
  |  |  281|      1|{6, 0xD, 0x1, 0x4, 0x4, 0x7B, 7},
  |  |  282|      1|{6, 0xD, 0x1, 0xC, 0x8, 0x3B, 7},
  |  |  283|      1|{6, 0xD, 0x1, 0xD, 0x1, 0x2B, 7},
  |  |  284|      1|{6, 0xE, 0x0, 0x0, 0x0, 0x11, 6},
  |  |  285|      1|{6, 0xE, 0x1, 0xE, 0x4, 0x5B, 7},
  |  |  286|      1|{6, 0xE, 0x1, 0x4, 0x4, 0x1B, 7},
  |  |  287|      1|{6, 0xE, 0x1, 0xE, 0xA, 0x6B, 7},
  |  |  288|      1|{6, 0xE, 0x1, 0xE, 0x8, 0x21, 6},
  |  |  289|      1|{6, 0xE, 0x1, 0xE, 0x2, 0x33, 7},
  |  |  290|      1|{6, 0xF, 0x0, 0x0, 0x0, 0x01, 6},
  |  |  291|      1|{6, 0xF, 0x1, 0x3, 0x3, 0x4B, 7},
  |  |  292|      1|{6, 0xF, 0x1, 0x7, 0x6, 0x0B, 7},
  |  |  293|      1|{6, 0xF, 0x1, 0xF, 0xA, 0x73, 7},
  |  |  294|      1|{6, 0xF, 0x1, 0xF, 0x2, 0x3E, 6},
  |  |  295|      1|{6, 0xF, 0x1, 0xB, 0x9, 0x53, 7},
  |  |  296|      1|{6, 0xF, 0x1, 0xF, 0xC, 0x63, 7},
  |  |  297|      1|{6, 0xF, 0x1, 0xF, 0x8, 0x1E, 6},
  |  |  298|      1|{6, 0xF, 0x1, 0xF, 0x5, 0x13, 7},
  |  |  299|      1|{6, 0xF, 0x1, 0xF, 0x4, 0x2E, 6},
  |  |  300|      1|{6, 0xF, 0x1, 0xF, 0x1, 0x23, 7},
  |  |  301|      1|{7, 0x0, 0x0, 0x0, 0x0, 0x04, 4},
  |  |  302|      1|{7, 0x1, 0x0, 0x0, 0x0, 0x33, 6},
  |  |  303|      1|{7, 0x1, 0x1, 0x1, 0x1, 0x13, 6},
  |  |  304|      1|{7, 0x2, 0x0, 0x0, 0x0, 0x23, 6},
  |  |  305|      1|{7, 0x2, 0x1, 0x2, 0x2, 0x7F, 7},
  |  |  306|      1|{7, 0x3, 0x0, 0x0, 0x0, 0x03, 6},
  |  |  307|      1|{7, 0x3, 0x1, 0x1, 0x1, 0x3F, 7},
  |  |  308|      1|{7, 0x3, 0x1, 0x3, 0x2, 0x6F, 7},
  |  |  309|      1|{7, 0x4, 0x0, 0x0, 0x0, 0x2D, 6},
  |  |  310|      1|{7, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
  |  |  311|      1|{7, 0x5, 0x0, 0x0, 0x0, 0x16, 5},
  |  |  312|      1|{7, 0x5, 0x1, 0x1, 0x1, 0x3D, 6},
  |  |  313|      1|{7, 0x5, 0x1, 0x5, 0x4, 0x1F, 7},
  |  |  314|      1|{7, 0x6, 0x0, 0x0, 0x0, 0x1D, 6},
  |  |  315|      1|{7, 0x6, 0x1, 0x0, 0x0, 0x77, 7},
  |  |  316|      1|{7, 0x7, 0x0, 0x0, 0x0, 0x06, 5},
  |  |  317|      1|{7, 0x7, 0x1, 0x7, 0x4, 0x2F, 7},
  |  |  318|      1|{7, 0x7, 0x1, 0x4, 0x4, 0x4F, 7},
  |  |  319|      1|{7, 0x7, 0x1, 0x7, 0x3, 0x0F, 7},
  |  |  320|      1|{7, 0x7, 0x1, 0x7, 0x1, 0x0D, 6},
  |  |  321|      1|{7, 0x7, 0x1, 0x7, 0x2, 0x57, 7},
  |  |  322|      1|{7, 0x8, 0x0, 0x0, 0x0, 0x35, 6},
  |  |  323|      1|{7, 0x8, 0x1, 0x8, 0x8, 0x37, 7},
  |  |  324|      1|{7, 0x9, 0x0, 0x0, 0x0, 0x15, 6},
  |  |  325|      1|{7, 0x9, 0x1, 0x0, 0x0, 0x27, 7},
  |  |  326|      1|{7, 0xA, 0x0, 0x0, 0x0, 0x25, 6},
  |  |  327|      1|{7, 0xA, 0x1, 0x0, 0x0, 0x29, 6},
  |  |  328|      1|{7, 0xB, 0x0, 0x0, 0x0, 0x1A, 5},
  |  |  329|      1|{7, 0xB, 0x1, 0xB, 0x1, 0x17, 7},
  |  |  330|      1|{7, 0xB, 0x1, 0x1, 0x1, 0x67, 7},
  |  |  331|      1|{7, 0xB, 0x1, 0x3, 0x2, 0x05, 6},
  |  |  332|      1|{7, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
  |  |  333|      1|{7, 0xC, 0x0, 0x0, 0x0, 0x39, 6},
  |  |  334|      1|{7, 0xC, 0x1, 0x0, 0x0, 0x19, 6},
  |  |  335|      1|{7, 0xD, 0x0, 0x0, 0x0, 0x0C, 5},
  |  |  336|      1|{7, 0xD, 0x1, 0xD, 0x1, 0x47, 7},
  |  |  337|      1|{7, 0xD, 0x1, 0x1, 0x1, 0x07, 7},
  |  |  338|      1|{7, 0xD, 0x1, 0x5, 0x4, 0x09, 6},
  |  |  339|      1|{7, 0xD, 0x1, 0xD, 0x8, 0x1B, 7},
  |  |  340|      1|{7, 0xE, 0x0, 0x0, 0x0, 0x31, 6},
  |  |  341|      1|{7, 0xE, 0x1, 0xE, 0x2, 0x3B, 7},
  |  |  342|      1|{7, 0xE, 0x1, 0x2, 0x2, 0x5B, 7},
  |  |  343|      1|{7, 0xE, 0x1, 0xA, 0x8, 0x3E, 6},
  |  |  344|      1|{7, 0xE, 0x1, 0xE, 0x4, 0x0B, 7},
  |  |  345|      1|{7, 0xF, 0x0, 0x0, 0x0, 0x00, 3},
  |  |  346|      1|{7, 0xF, 0x1, 0xF, 0xF, 0x6B, 7},
  |  |  347|      1|{7, 0xF, 0x1, 0xF, 0x7, 0x2B, 7},
  |  |  348|      1|{7, 0xF, 0x1, 0xF, 0xB, 0x4B, 7},
  |  |  349|      1|{7, 0xF, 0x1, 0xF, 0x3, 0x11, 6},
  |  |  350|      1|{7, 0xF, 0x1, 0x7, 0x6, 0x21, 6},
  |  |  351|      1|{7, 0xF, 0x1, 0xF, 0xA, 0x01, 6},
  |  |  352|      1|{7, 0xF, 0x1, 0xF, 0x2, 0x0A, 5},
  |  |  353|      1|{7, 0xF, 0x1, 0xB, 0x9, 0x1E, 6},
  |  |  354|      1|{7, 0xF, 0x1, 0xF, 0xC, 0x0E, 6},
  |  |  355|      1|{7, 0xF, 0x1, 0xF, 0x8, 0x12, 5},
  |  |  356|      1|{7, 0xF, 0x1, 0xF, 0x5, 0x2E, 6},
  |  |  357|      1|{7, 0xF, 0x1, 0xF, 0x1, 0x02, 5},
  |  |  358|      1|{7, 0xF, 0x1, 0xF, 0x4, 0x1C, 5}
  ------------------
  155|      1|      };
  156|      1|      size_t tbl1_size = sizeof(tbl1) / sizeof(vlc_src_table);
  157|       |
  158|      1|      src_tbl = tbl1;
  159|      1|      tgt_tbl = vlc_tbl1;
  160|      1|      tbl_size = tbl1_size;
  161|  2.04k|      for (int i = 0; i < 2048; ++i)
  ------------------
  |  Branch (161:23): [True: 2.04k, False: 1]
  ------------------
  162|  2.04k|      {
  163|  2.04k|        int c_q = i >> 8, rho = (i >> 4) & 0xF, emb = i & 0xF;
  164|  2.04k|        if (((emb & rho) != emb) || (rho == 0 && c_q == 0))
  ------------------
  |  Branch (164:13): [True: 1.40k, False: 648]
  |  Branch (164:38): [True: 8, False: 640]
  |  Branch (164:50): [True: 1, False: 7]
  ------------------
  165|  1.40k|          tgt_tbl[i] = 0;
  166|    647|        else
  167|    647|        {
  168|    647|          vlc_src_table *best_entry = NULL;
  169|    647|          if (emb) // u_off = 1
  ------------------
  |  Branch (169:15): [True: 520, False: 127]
  ------------------
  170|    520|          {
  171|    520|            int best_e_k = -1;
  172|   186k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (172:32): [True: 186k, False: 520]
  ------------------
  173|   186k|            {
  174|   186k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (174:19): [True: 23.2k, False: 162k]
  |  Branch (174:44): [True: 2.08k, False: 21.1k]
  ------------------
  175|  2.08k|                if (src_tbl[j].u_off == 1)
  ------------------
  |  Branch (175:21): [True: 1.56k, False: 520]
  ------------------
  176|  1.56k|                  if ((emb & src_tbl[j].e_k) == src_tbl[j].e_1)
  ------------------
  |  Branch (176:23): [True: 529, False: 1.03k]
  ------------------
  177|    529|                  {
  178|       |                    //now we need to find the smallest cwd with the highest
  179|       |                    // number of bits set in e_k
  180|    529|                    int ones_count = pattern_popcnt[src_tbl[j].e_k];
  181|    529|                    if (ones_count >= best_e_k)
  ------------------
  |  Branch (181:25): [True: 520, False: 9]
  ------------------
  182|    520|                    {
  183|    520|                      best_entry = src_tbl + j;
  184|    520|                      best_e_k = ones_count;
  185|    520|                    }
  186|    529|                  }
  187|   186k|            }
  188|    520|          }
  189|    127|          else // u_off = 0
  190|    127|          {
  191|  19.7k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (191:32): [True: 19.7k, False: 0]
  ------------------
  192|  19.7k|            {
  193|  19.7k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (193:19): [True: 2.22k, False: 17.5k]
  |  Branch (193:44): [True: 127, False: 2.10k]
  ------------------
  194|    127|                if (src_tbl[j].u_off == 0)
  ------------------
  |  Branch (194:21): [True: 127, False: 0]
  ------------------
  195|    127|                {
  196|    127|                  best_entry = src_tbl + j;
  197|    127|                  break;
  198|    127|                }
  199|  19.7k|            }
  200|    127|          }
  201|    647|          assert(best_entry);
  202|    647|          tgt_tbl[i] = (ui16)((best_entry->cwd<<8) + (best_entry->cwd_len<<4)
  203|    647|                             + best_entry->e_k);
  204|    647|        }
  205|  2.04k|      }
  206|       |
  207|       |
  208|      1|      return true;
  209|      1|    }
ojph_block_encoder_avx2.cpp:_ZN4ojph5localL16uvlc_init_tablesEv:
  213|      1|    {
  214|       |      //code goes from 0 to 31, extension and 32 are not supported here
  215|      1|      ulvc_cwd_pre[0] = 0; ulvc_cwd_pre[1] = 1; ulvc_cwd_pre[2] = 2;
  216|      1|      ulvc_cwd_pre[3] = 4; ulvc_cwd_pre[4] = 4;
  217|      1|      ulvc_cwd_pre_len[0] = 0; ulvc_cwd_pre_len[1] = 1;
  218|      1|      ulvc_cwd_pre_len[2] = 2;
  219|      1|      ulvc_cwd_pre_len[3] = 3; ulvc_cwd_pre_len[4] = 3;
  220|      1|      ulvc_cwd_suf[0] = 0; ulvc_cwd_suf[1] = 0; ulvc_cwd_suf[2] = 0;
  221|      1|      ulvc_cwd_suf[3] = 0; ulvc_cwd_suf[4] = 1;
  222|      1|      ulvc_cwd_suf_len[0] = 0; ulvc_cwd_suf_len[1] = 0;
  223|      1|      ulvc_cwd_suf_len[2] = 0;
  224|      1|      ulvc_cwd_suf_len[3] = 1; ulvc_cwd_suf_len[4] = 1;
  225|     29|      for (int i = 5; i < 33; ++i)
  ------------------
  |  Branch (225:23): [True: 28, False: 1]
  ------------------
  226|     28|      {
  227|     28|        ulvc_cwd_pre[i] = 0;
  228|     28|        ulvc_cwd_pre_len[i] = 3;
  229|     28|        ulvc_cwd_suf[i] = (ui32)(i-5);
  230|     28|        ulvc_cwd_suf_len[i] = 5;
  231|     28|      }
  232|      1|      return true;
  233|      1|    }
ojph_block_encoder_avx2.cpp:_ZN4ojph5localL21uvlc_init_pair_tablesEv:
  237|      1|    {
  238|     34|      for (int uq0 = 0; uq0 < 33; ++uq0) {
  ------------------
  |  Branch (238:25): [True: 33, False: 1]
  ------------------
  239|  1.12k|        for (int uq1 = 0; uq1 < 33; ++uq1) {
  ------------------
  |  Branch (239:27): [True: 1.08k, False: 33]
  ------------------
  240|  1.08k|          ui32 cwd; int len;
  241|       |
  242|  1.08k|          cwd = 0; len = 0;
  243|  1.08k|          if (uq0 > 2 && uq1 > 2) {
  ------------------
  |  Branch (243:15): [True: 990, False: 99]
  |  Branch (243:26): [True: 900, False: 90]
  ------------------
  244|    900|            cwd |= ulvc_cwd_pre[uq0 - 2];
  245|    900|            len += ulvc_cwd_pre_len[uq0 - 2];
  246|    900|            cwd |= ulvc_cwd_pre[uq1 - 2] << len;
  247|    900|            len += ulvc_cwd_pre_len[uq1 - 2];
  248|    900|            cwd |= ulvc_cwd_suf[uq0 - 2] << len;
  249|    900|            len += ulvc_cwd_suf_len[uq0 - 2];
  250|    900|            cwd |= ulvc_cwd_suf[uq1 - 2] << len;
  251|    900|            len += ulvc_cwd_suf_len[uq1 - 2];
  252|    900|          } else if (uq0 > 2 && uq1 > 0) {
  ------------------
  |  Branch (252:22): [True: 90, False: 99]
  |  Branch (252:33): [True: 60, False: 30]
  ------------------
  253|     60|            cwd |= ulvc_cwd_pre[uq0];
  254|     60|            len += ulvc_cwd_pre_len[uq0];
  255|     60|            cwd |= (ui32)(uq1 - 1) << len;
  256|     60|            len += 1;
  257|     60|            cwd |= ulvc_cwd_suf[uq0] << len;
  258|     60|            len += ulvc_cwd_suf_len[uq0];
  259|    129|          } else {
  260|    129|            cwd |= ulvc_cwd_pre[uq0];
  261|    129|            len += ulvc_cwd_pre_len[uq0];
  262|    129|            cwd |= ulvc_cwd_pre[uq1] << len;
  263|    129|            len += ulvc_cwd_pre_len[uq1];
  264|    129|            cwd |= ulvc_cwd_suf[uq0] << len;
  265|    129|            len += ulvc_cwd_suf_len[uq0];
  266|    129|            cwd |= ulvc_cwd_suf[uq1] << len;
  267|    129|            len += ulvc_cwd_suf_len[uq1];
  268|    129|          }
  269|  1.08k|          uvlc_tbl_pair1[uq0 * 33 + uq1] = (cwd << 5) | (ui32)len;
  270|       |
  271|  1.08k|          cwd = 0; len = 0;
  272|  1.08k|          cwd |= ulvc_cwd_pre[uq0];
  273|  1.08k|          len += ulvc_cwd_pre_len[uq0];
  274|  1.08k|          cwd |= ulvc_cwd_pre[uq1] << len;
  275|  1.08k|          len += ulvc_cwd_pre_len[uq1];
  276|  1.08k|          cwd |= ulvc_cwd_suf[uq0] << len;
  277|  1.08k|          len += ulvc_cwd_suf_len[uq0];
  278|  1.08k|          cwd |= ulvc_cwd_suf[uq1] << len;
  279|  1.08k|          len += ulvc_cwd_suf_len[uq1];
  280|  1.08k|          uvlc_tbl_pair2[uq0 * 33 + uq1] = (cwd << 5) | (ui32)len;
  281|  1.08k|        }
  282|     33|      }
  283|      1|    }

ojph_expand_fuzz_target.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_local.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|   125k|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|   125k|  }
ojph_codestream_local.cpp:_ZN4ojphL16swap_bytes_if_leEt:
  416|  28.3k|  {
  417|  28.3k|    if (is_machine_little_endian)
  ------------------
  |  Branch (417:9): [True: 28.3k, Folded]
  ------------------
  418|  28.3k|      return (ui16)((t << 8) | (t >> 8));
  419|      0|    else
  420|      0|      return t;
  421|  28.3k|  }
_ZN4ojph17calc_aligned_sizeINS_5local4tileELj8EEEmm:
  361|  13.6k|  size_t calc_aligned_size(size_t size) {
  362|  13.6k|    size = size * sizeof(T) + N - 1;
  363|  13.6k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  13.6k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  13.6k|    return size;
  366|  13.6k|  }
ojph_codestream_local.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  83.5k|  {
  237|       |  #ifdef OJPH_COMPILER_MSVC
  238|       |    unsigned long result = 0;
  239|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  240|       |      _BitScanReverse64(&result, val);
  241|       |    #elif (defined OJPH_ARCH_I386)
  242|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  243|       |      if (msb == 0)
  244|       |        _BitScanReverse(&result, lsb);
  245|       |      else {
  246|       |        _BitScanReverse(&result, msb);
  247|       |        result += 32;
  248|       |      }
  249|       |    #else
  250|       |      #error Error unsupport MSVC version
  251|       |    #endif
  252|       |    return 63 ^ (ui32)result;
  253|       |  #elif (defined OJPH_COMPILER_GNUC)
  254|       |    return (ui32)__builtin_clzll(val);
  255|       |  #else
  256|       |    val |= (val >> 1);
  257|       |    val |= (val >> 2);
  258|       |    val |= (val >> 4);
  259|       |    val |= (val >> 8);
  260|       |    val |= (val >> 16);
  261|       |    val |= (val >> 32);
  262|       |    return 64 - population_count64(val);
  263|       |  #endif
  264|  83.5k|  }
_ZN4ojph17calc_aligned_sizeINS_8line_bufELj8EEEmm:
  361|  13.2M|  size_t calc_aligned_size(size_t size) {
  362|  13.2M|    size = size * sizeof(T) + N - 1;
  363|  13.2M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  13.2M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  13.2M|    return size;
  366|  13.2M|  }
_ZN4ojph17calc_aligned_sizeINS_4sizeELj8EEEmm:
  361|  26.4k|  size_t calc_aligned_size(size_t size) {
  362|  26.4k|    size = size * sizeof(T) + N - 1;
  363|  26.4k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  26.4k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  26.4k|    return size;
  366|  26.4k|  }
_ZN4ojph17calc_aligned_sizeIiLj64EEEmm:
  361|  34.0M|  size_t calc_aligned_size(size_t size) {
  362|  34.0M|    size = size * sizeof(T) + N - 1;
  363|  34.0M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  34.0M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  34.0M|    return size;
  366|  34.0M|  }
_ZN4ojph17calc_aligned_sizeIhLj8EEEmm:
  361|  13.3k|  size_t calc_aligned_size(size_t size) {
  362|  13.3k|    size = size * sizeof(T) + N - 1;
  363|  13.3k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  13.3k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  13.3k|    return size;
  366|  13.3k|  }
_ZN4ojph9align_ptrIhLj8EEEPT_S2_:
  371|  6.65k|  inline T *align_ptr(T *ptr) {
  372|  6.65k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  6.65k|    p += N - 1;
  374|  6.65k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  6.65k|    return reinterpret_cast<T *>(p);
  376|  6.65k|  }
_ZN4ojph9align_ptrINS_5local4tileELj8EEEPT_S4_:
  371|  6.65k|  inline T *align_ptr(T *ptr) {
  372|  6.65k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  6.65k|    p += N - 1;
  374|  6.65k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  6.65k|    return reinterpret_cast<T *>(p);
  376|  6.65k|  }
_ZN4ojph9align_ptrINS_8line_bufELj8EEEPT_S3_:
  371|  6.42M|  inline T *align_ptr(T *ptr) {
  372|  6.42M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  6.42M|    p += N - 1;
  374|  6.42M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  6.42M|    return reinterpret_cast<T *>(p);
  376|  6.42M|  }
_ZN4ojph9align_ptrINS_4sizeELj8EEEPT_S3_:
  371|  13.1k|  inline T *align_ptr(T *ptr) {
  372|  13.1k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  13.1k|    p += N - 1;
  374|  13.1k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  13.1k|    return reinterpret_cast<T *>(p);
  376|  13.1k|  }
_ZN4ojph9align_ptrIiLj64EEEPT_S2_:
  371|  16.9M|  inline T *align_ptr(T *ptr) {
  372|  16.9M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  16.9M|    p += N - 1;
  374|  16.9M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  16.9M|    return reinterpret_cast<T *>(p);
  376|  16.9M|  }
ojph_params.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_params.cpp:_ZN4ojphL16swap_bytes_if_leEt:
  416|  2.62M|  {
  417|  2.62M|    if (is_machine_little_endian)
  ------------------
  |  Branch (417:9): [True: 2.62M, Folded]
  ------------------
  418|  2.62M|      return (ui16)((t << 8) | (t >> 8));
  419|      0|    else
  420|      0|      return t;
  421|  2.62M|  }
ojph_params.cpp:_ZN4ojphL16swap_bytes_if_leEj:
  439|   366k|  {
  440|   366k|    if (is_machine_little_endian)
  ------------------
  |  Branch (440:9): [True: 366k, Folded]
  ------------------
  441|   366k|    {
  442|   366k|      ui32 u = swap_bytes_if_le((ui16)(t & 0xFFFFu));
  443|   366k|      u <<= 16;
  444|   366k|      u |= swap_bytes_if_le((ui16)(t >> 16));
  445|   366k|      return u;
  446|   366k|    }
  447|      0|    else
  448|      0|      return t;
  449|   366k|  }
ojph_params.cpp:_ZN4ojphL16population_countEj:
  187|    361|  {
  188|       |  #if defined(OJPH_COMPILER_MSVC)  \
  189|       |    && (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  190|       |    return (ui32)__popcnt(val);
  191|       |  #elif (defined OJPH_COMPILER_GNUC)
  192|       |    return (ui32)__builtin_popcount(val);
  193|       |  #else
  194|       |    val -= ((val >> 1) & 0x55555555);
  195|       |    val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
  196|       |    val = (((val >> 4) + val) & 0x0f0f0f0f);
  197|       |    val += (val >> 8);
  198|       |    val += (val >> 16);
  199|       |    return (int)(val & 0x0000003f);
  200|       |  #endif
  201|    361|  }
ojph_params.cpp:_ZN4ojphL16swap_bytes_if_leEm:
  453|    400|  {
  454|    400|    if (is_machine_little_endian)
  ------------------
  |  Branch (454:9): [True: 400, Folded]
  ------------------
  455|    400|    {
  456|    400|      ui64 u =
  457|    400|        swap_bytes_if_le((ui32)(t & 0xFFFFFFFFu));
  458|    400|      u <<= 32;
  459|    400|      u |= swap_bytes_if_le((ui32)(t >> 32));
  460|    400|      return u;
  461|    400|    }
  462|      0|    else
  463|      0|      return t;
  464|    400|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|  30.2M|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|  30.2M|  }
_ZN4ojph17calc_aligned_sizeINS_5local9tile_compELj8EEEmm:
  361|  2.26M|  size_t calc_aligned_size(size_t size) {
  362|  2.26M|    size = size * sizeof(T) + N - 1;
  363|  2.26M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  2.26M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  2.26M|    return size;
  366|  2.26M|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  20.4M|  {
  237|       |  #ifdef OJPH_COMPILER_MSVC
  238|       |    unsigned long result = 0;
  239|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  240|       |      _BitScanReverse64(&result, val);
  241|       |    #elif (defined OJPH_ARCH_I386)
  242|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  243|       |      if (msb == 0)
  244|       |        _BitScanReverse(&result, lsb);
  245|       |      else {
  246|       |        _BitScanReverse(&result, msb);
  247|       |        result += 32;
  248|       |      }
  249|       |    #else
  250|       |      #error Error unsupport MSVC version
  251|       |    #endif
  252|       |    return 63 ^ (ui32)result;
  253|       |  #elif (defined OJPH_COMPILER_GNUC)
  254|       |    return (ui32)__builtin_clzll(val);
  255|       |  #else
  256|       |    val |= (val >> 1);
  257|       |    val |= (val >> 2);
  258|       |    val |= (val >> 4);
  259|       |    val |= (val >> 8);
  260|       |    val |= (val >> 16);
  261|       |    val |= (val >> 32);
  262|       |    return 64 - population_count64(val);
  263|       |  #endif
  264|  20.4M|  }
_ZN4ojph17calc_aligned_sizeINS_4rectELj8EEEmm:
  361|  4.52M|  size_t calc_aligned_size(size_t size) {
  362|  4.52M|    size = size * sizeof(T) + N - 1;
  363|  4.52M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  4.52M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  4.52M|    return size;
  366|  4.52M|  }
_ZN4ojph17calc_aligned_sizeIjLj8EEEmm:
  361|  6.78M|  size_t calc_aligned_size(size_t size) {
  362|  6.78M|    size = size * sizeof(T) + N - 1;
  363|  6.78M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  6.78M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  6.78M|    return size;
  366|  6.78M|  }
_ZN4ojph17calc_aligned_sizeIbLj8EEEmm:
  361|  4.52M|  size_t calc_aligned_size(size_t size) {
  362|  4.52M|    size = size * sizeof(T) + N - 1;
  363|  4.52M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  4.52M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  4.52M|    return size;
  366|  4.52M|  }
_ZN4ojph17calc_aligned_sizeIPKNS_5local7nlt_recELj8EEEmm:
  361|  2.26M|  size_t calc_aligned_size(size_t size) {
  362|  2.26M|    size = size * sizeof(T) + N - 1;
  363|  2.26M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  2.26M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  2.26M|    return size;
  366|  2.26M|  }
_ZN4ojph17calc_aligned_sizeIfLj64EEEmm:
  361|  7.19M|  size_t calc_aligned_size(size_t size) {
  362|  7.19M|    size = size * sizeof(T) + N - 1;
  363|  7.19M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  7.19M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  7.19M|    return size;
  366|  7.19M|  }
_ZN4ojph9align_ptrINS_5local9tile_compELj8EEEPT_S4_:
  371|  1.09M|  inline T *align_ptr(T *ptr) {
  372|  1.09M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  1.09M|    p += N - 1;
  374|  1.09M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  1.09M|    return reinterpret_cast<T *>(p);
  376|  1.09M|  }
_ZN4ojph9align_ptrINS_4rectELj8EEEPT_S3_:
  371|  2.18M|  inline T *align_ptr(T *ptr) {
  372|  2.18M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  2.18M|    p += N - 1;
  374|  2.18M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  2.18M|    return reinterpret_cast<T *>(p);
  376|  2.18M|  }
_ZN4ojph9align_ptrIjLj8EEEPT_S2_:
  371|  3.27M|  inline T *align_ptr(T *ptr) {
  372|  3.27M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  3.27M|    p += N - 1;
  374|  3.27M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  3.27M|    return reinterpret_cast<T *>(p);
  376|  3.27M|  }
_ZN4ojph9align_ptrIbLj8EEEPT_S2_:
  371|  2.18M|  inline T *align_ptr(T *ptr) {
  372|  2.18M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  2.18M|    p += N - 1;
  374|  2.18M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  2.18M|    return reinterpret_cast<T *>(p);
  376|  2.18M|  }
_ZN4ojph9align_ptrIPKNS_5local7nlt_recELj8EEEPT_S6_:
  371|  1.09M|  inline T *align_ptr(T *ptr) {
  372|  1.09M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  1.09M|    p += N - 1;
  374|  1.09M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  1.09M|    return reinterpret_cast<T *>(p);
  376|  1.09M|  }
_ZN4ojph9align_ptrIfLj64EEEPT_S2_:
  371|  3.49M|  inline T *align_ptr(T *ptr) {
  372|  3.49M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  3.49M|    p += N - 1;
  374|  3.49M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  3.49M|    return reinterpret_cast<T *>(p);
  376|  3.49M|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|  3.44M|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|  3.44M|  }
_ZN4ojph17calc_aligned_sizeINS_5local10resolutionELj8EEEmm:
  361|  13.1M|  size_t calc_aligned_size(size_t size) {
  362|  13.1M|    size = size * sizeof(T) + N - 1;
  363|  13.1M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  13.1M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  13.1M|    return size;
  366|  13.1M|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  2.32M|  {
  237|       |  #ifdef OJPH_COMPILER_MSVC
  238|       |    unsigned long result = 0;
  239|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  240|       |      _BitScanReverse64(&result, val);
  241|       |    #elif (defined OJPH_ARCH_I386)
  242|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  243|       |      if (msb == 0)
  244|       |        _BitScanReverse(&result, lsb);
  245|       |      else {
  246|       |        _BitScanReverse(&result, msb);
  247|       |        result += 32;
  248|       |      }
  249|       |    #else
  250|       |      #error Error unsupport MSVC version
  251|       |    #endif
  252|       |    return 63 ^ (ui32)result;
  253|       |  #elif (defined OJPH_COMPILER_GNUC)
  254|       |    return (ui32)__builtin_clzll(val);
  255|       |  #else
  256|       |    val |= (val >> 1);
  257|       |    val |= (val >> 2);
  258|       |    val |= (val >> 4);
  259|       |    val |= (val >> 8);
  260|       |    val |= (val >> 16);
  261|       |    val |= (val >> 32);
  262|       |    return 64 - population_count64(val);
  263|       |  #endif
  264|  2.32M|  }
_ZN4ojph9align_ptrINS_5local10resolutionELj8EEEPT_S4_:
  371|  6.34M|  inline T *align_ptr(T *ptr) {
  372|  6.34M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  6.34M|    p += N - 1;
  374|  6.34M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  6.34M|    return reinterpret_cast<T *>(p);
  376|  6.34M|  }
ojph_file.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_mem.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_message.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_colour.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_colour_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_colour_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_colour_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_colour_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform_avx512.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_resolution.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|   142M|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|   142M|  }
_ZN4ojph17calc_aligned_sizeINS_5local7subbandELj8EEEmm:
  361|  13.1M|  size_t calc_aligned_size(size_t size) {
  362|  13.1M|    size = size * sizeof(T) + N - 1;
  363|  13.1M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  13.1M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  13.1M|    return size;
  366|  13.1M|  }
ojph_resolution.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  95.8M|  {
  237|       |  #ifdef OJPH_COMPILER_MSVC
  238|       |    unsigned long result = 0;
  239|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  240|       |      _BitScanReverse64(&result, val);
  241|       |    #elif (defined OJPH_ARCH_I386)
  242|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  243|       |      if (msb == 0)
  244|       |        _BitScanReverse(&result, lsb);
  245|       |      else {
  246|       |        _BitScanReverse(&result, msb);
  247|       |        result += 32;
  248|       |      }
  249|       |    #else
  250|       |      #error Error unsupport MSVC version
  251|       |    #endif
  252|       |    return 63 ^ (ui32)result;
  253|       |  #elif (defined OJPH_COMPILER_GNUC)
  254|       |    return (ui32)__builtin_clzll(val);
  255|       |  #else
  256|       |    val |= (val >> 1);
  257|       |    val |= (val >> 2);
  258|       |    val |= (val >> 4);
  259|       |    val |= (val >> 8);
  260|       |    val |= (val >> 16);
  261|       |    val |= (val >> 32);
  262|       |    return 64 - population_count64(val);
  263|       |  #endif
  264|  95.8M|  }
_ZN4ojph17calc_aligned_sizeINS_5local8precinctELj8EEEmm:
  361|  3.85M|  size_t calc_aligned_size(size_t size) {
  362|  3.85M|    size = size * sizeof(T) + N - 1;
  363|  3.85M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  3.85M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  3.85M|    return size;
  366|  3.85M|  }
_ZN4ojph17calc_aligned_sizeINS_11lifting_bufELj8EEEmm:
  361|  10.9M|  size_t calc_aligned_size(size_t size) {
  362|  10.9M|    size = size * sizeof(T) + N - 1;
  363|  10.9M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  10.9M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  10.9M|    return size;
  366|  10.9M|  }
_ZN4ojph17calc_aligned_sizeIlLj64EEEmm:
  361|  7.23M|  size_t calc_aligned_size(size_t size) {
  362|  7.23M|    size = size * sizeof(T) + N - 1;
  363|  7.23M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  7.23M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  7.23M|    return size;
  366|  7.23M|  }
_ZN4ojph9align_ptrINS_5local7subbandELj8EEEPT_S4_:
  371|  6.34M|  inline T *align_ptr(T *ptr) {
  372|  6.34M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  6.34M|    p += N - 1;
  374|  6.34M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  6.34M|    return reinterpret_cast<T *>(p);
  376|  6.34M|  }
_ZN4ojph9align_ptrINS_5local8precinctELj8EEEPT_S4_:
  371|  1.92M|  inline T *align_ptr(T *ptr) {
  372|  1.92M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  1.92M|    p += N - 1;
  374|  1.92M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  1.92M|    return reinterpret_cast<T *>(p);
  376|  1.92M|  }
_ZN4ojph9align_ptrINS_11lifting_bufELj8EEEPT_S3_:
  371|  5.25M|  inline T *align_ptr(T *ptr) {
  372|  5.25M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  5.25M|    p += N - 1;
  374|  5.25M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  5.25M|    return reinterpret_cast<T *>(p);
  376|  5.25M|  }
_ZN4ojph9align_ptrIlLj64EEEPT_S2_:
  371|  2.83M|  inline T *align_ptr(T *ptr) {
  372|  2.83M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  2.83M|    p += N - 1;
  374|  2.83M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  2.83M|    return reinterpret_cast<T *>(p);
  376|  2.83M|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|  13.8M|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|  13.8M|  }
_ZN4ojph17calc_aligned_sizeINS_5local9codeblockELj8EEEmm:
  361|  2.30M|  size_t calc_aligned_size(size_t size) {
  362|  2.30M|    size = size * sizeof(T) + N - 1;
  363|  2.30M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  2.30M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  2.30M|    return size;
  366|  2.30M|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  9.22M|  {
  237|       |  #ifdef OJPH_COMPILER_MSVC
  238|       |    unsigned long result = 0;
  239|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  240|       |      _BitScanReverse64(&result, val);
  241|       |    #elif (defined OJPH_ARCH_I386)
  242|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  243|       |      if (msb == 0)
  244|       |        _BitScanReverse(&result, lsb);
  245|       |      else {
  246|       |        _BitScanReverse(&result, msb);
  247|       |        result += 32;
  248|       |      }
  249|       |    #else
  250|       |      #error Error unsupport MSVC version
  251|       |    #endif
  252|       |    return 63 ^ (ui32)result;
  253|       |  #elif (defined OJPH_COMPILER_GNUC)
  254|       |    return (ui32)__builtin_clzll(val);
  255|       |  #else
  256|       |    val |= (val >> 1);
  257|       |    val |= (val >> 2);
  258|       |    val |= (val >> 4);
  259|       |    val |= (val >> 8);
  260|       |    val |= (val >> 16);
  261|       |    val |= (val >> 32);
  262|       |    return 64 - population_count64(val);
  263|       |  #endif
  264|  9.22M|  }
_ZN4ojph17calc_aligned_sizeINS_5local15coded_cb_headerELj8EEEmm:
  361|  2.30M|  size_t calc_aligned_size(size_t size) {
  362|  2.30M|    size = size * sizeof(T) + N - 1;
  363|  2.30M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  2.30M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  2.30M|    return size;
  366|  2.30M|  }
_ZN4ojph9align_ptrINS_5local9codeblockELj8EEEPT_S4_:
  371|  1.15M|  inline T *align_ptr(T *ptr) {
  372|  1.15M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  1.15M|    p += N - 1;
  374|  1.15M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  1.15M|    return reinterpret_cast<T *>(p);
  376|  1.15M|  }
_ZN4ojph9align_ptrINS_5local15coded_cb_headerELj8EEEPT_S4_:
  371|  1.15M|  inline T *align_ptr(T *ptr) {
  372|  1.15M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  1.15M|    p += N - 1;
  374|  1.15M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  1.15M|    return reinterpret_cast<T *>(p);
  376|  1.15M|  }
ojph_arch.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codeblock.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|  17.1M|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|  17.1M|  }
_ZN4ojph17calc_aligned_sizeIjLj64EEEmm:
  361|  7.91M|  size_t calc_aligned_size(size_t size) {
  362|  7.91M|    size = size * sizeof(T) + N - 1;
  363|  7.91M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  7.91M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  7.91M|    return size;
  366|  7.91M|  }
ojph_codeblock.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  11.5M|  {
  237|       |  #ifdef OJPH_COMPILER_MSVC
  238|       |    unsigned long result = 0;
  239|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  240|       |      _BitScanReverse64(&result, val);
  241|       |    #elif (defined OJPH_ARCH_I386)
  242|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  243|       |      if (msb == 0)
  244|       |        _BitScanReverse(&result, lsb);
  245|       |      else {
  246|       |        _BitScanReverse(&result, msb);
  247|       |        result += 32;
  248|       |      }
  249|       |    #else
  250|       |      #error Error unsupport MSVC version
  251|       |    #endif
  252|       |    return 63 ^ (ui32)result;
  253|       |  #elif (defined OJPH_COMPILER_GNUC)
  254|       |    return (ui32)__builtin_clzll(val);
  255|       |  #else
  256|       |    val |= (val >> 1);
  257|       |    val |= (val >> 2);
  258|       |    val |= (val >> 4);
  259|       |    val |= (val >> 8);
  260|       |    val |= (val >> 16);
  261|       |    val |= (val >> 32);
  262|       |    return 64 - population_count64(val);
  263|       |  #endif
  264|  11.5M|  }
_ZN4ojph17calc_aligned_sizeImLj64EEEmm:
  361|  3.58M|  size_t calc_aligned_size(size_t size) {
  362|  3.58M|    size = size * sizeof(T) + N - 1;
  363|  3.58M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  3.58M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  3.58M|    return size;
  366|  3.58M|  }
_ZN4ojph9align_ptrIjLj64EEEPT_S2_:
  371|  3.86M|  inline T *align_ptr(T *ptr) {
  372|  3.86M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  3.86M|    p += N - 1;
  374|  3.86M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  3.86M|    return reinterpret_cast<T *>(p);
  376|  3.86M|  }
_ZN4ojph9align_ptrImLj64EEEPT_S2_:
  371|  1.77M|  inline T *align_ptr(T *ptr) {
  372|  1.77M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  1.77M|    p += N - 1;
  374|  1.77M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  1.77M|    return reinterpret_cast<T *>(p);
  376|  1.77M|  }
ojph_codeblock_fun.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_gen.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_precinct.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|   771k|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|   771k|  }
ojph_precinct.cpp:_ZN4ojphL16swap_bytes_if_leEt:
  416|  1.20k|  {
  417|  1.20k|    if (is_machine_little_endian)
  ------------------
  |  Branch (417:9): [True: 1.20k, Folded]
  ------------------
  418|  1.20k|      return (ui16)((t << 8) | (t >> 8));
  419|      0|    else
  420|      0|      return t;
  421|  1.20k|  }
ojph_block_decoder32.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_decoder64.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_decoder64.cpp:_ZN4ojphL12load_le_ui32EPKh:
  471|  26.3k|  {
  472|  26.3k|    if (is_machine_little_endian) {
  ------------------
  |  Branch (472:9): [True: 26.3k, Folded]
  ------------------
  473|  26.3k|      ui32 val;
  474|  26.3k|      std::memcpy(&val, p, sizeof(val));
  475|  26.3k|      return val;
  476|  26.3k|    }
  477|      0|    else
  478|      0|      return (ui32)p[0] | ((ui32)p[1] << 8)
  479|      0|        | ((ui32)p[2] << 16) | ((ui32)p[3] << 24);
  480|  26.3k|  }
ojph_block_decoder64.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|   323k|  {
  237|       |  #ifdef OJPH_COMPILER_MSVC
  238|       |    unsigned long result = 0;
  239|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  240|       |      _BitScanReverse64(&result, val);
  241|       |    #elif (defined OJPH_ARCH_I386)
  242|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  243|       |      if (msb == 0)
  244|       |        _BitScanReverse(&result, lsb);
  245|       |      else {
  246|       |        _BitScanReverse(&result, msb);
  247|       |        result += 32;
  248|       |      }
  249|       |    #else
  250|       |      #error Error unsupport MSVC version
  251|       |    #endif
  252|       |    return 63 ^ (ui32)result;
  253|       |  #elif (defined OJPH_COMPILER_GNUC)
  254|       |    return (ui32)__builtin_clzll(val);
  255|       |  #else
  256|       |    val |= (val >> 1);
  257|       |    val |= (val >> 2);
  258|       |    val |= (val >> 4);
  259|       |    val |= (val >> 8);
  260|       |    val |= (val >> 16);
  261|       |    val |= (val >> 32);
  262|       |    return 64 - population_count64(val);
  263|       |  #endif
  264|   323k|  }
ojph_block_decoder64.cpp:_ZN4ojphL14load_le_ui16x2EPKt:
  487|   383k|  {
  488|   383k|    if (is_machine_little_endian) {
  ------------------
  |  Branch (488:9): [True: 383k, Folded]
  ------------------
  489|   383k|      ui32 val;
  490|   383k|      std::memcpy(&val, p, sizeof(val));
  491|   383k|      return val;
  492|   383k|    }
  493|      0|    else
  494|      0|      return (ui32)p[0] | ((ui32)p[1] << 16);
  495|   383k|  }
ojph_block_decoder64.cpp:_ZN4ojphL16population_countEj:
  187|  41.8k|  {
  188|       |  #if defined(OJPH_COMPILER_MSVC)  \
  189|       |    && (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  190|       |    return (ui32)__popcnt(val);
  191|       |  #elif (defined OJPH_COMPILER_GNUC)
  192|       |    return (ui32)__builtin_popcount(val);
  193|       |  #else
  194|       |    val -= ((val >> 1) & 0x55555555);
  195|       |    val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
  196|       |    val = (((val >> 4) + val) & 0x0f0f0f0f);
  197|       |    val += (val >> 8);
  198|       |    val += (val >> 16);
  199|       |    return (int)(val & 0x0000003f);
  200|       |  #endif
  201|  41.8k|  }
ojph_block_encoder.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_encoder.cpp:_ZN4ojphL16population_countEj:
  187|     16|  {
  188|       |  #if defined(OJPH_COMPILER_MSVC)  \
  189|       |    && (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  190|       |    return (ui32)__popcnt(val);
  191|       |  #elif (defined OJPH_COMPILER_GNUC)
  192|       |    return (ui32)__builtin_popcount(val);
  193|       |  #else
  194|       |    val -= ((val >> 1) & 0x55555555);
  195|       |    val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
  196|       |    val = (((val >> 4) + val) & 0x0f0f0f0f);
  197|       |    val += (val >> 8);
  198|       |    val += (val >> 16);
  199|       |    return (int)(val & 0x0000003f);
  200|       |  #endif
  201|     16|  }
ojph_codestream_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_decoder_ssse3.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_decoder_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_encoder_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_encoder_avx2.cpp:_ZN4ojphL16population_countEj:
  187|     16|  {
  188|       |  #if defined(OJPH_COMPILER_MSVC)  \
  189|       |    && (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  190|       |    return (ui32)__popcnt(val);
  191|       |  #elif (defined OJPH_COMPILER_GNUC)
  192|       |    return (ui32)__builtin_popcount(val);
  193|       |  #else
  194|       |    val -= ((val >> 1) & 0x55555555);
  195|       |    val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
  196|       |    val = (((val >> 4) + val) & 0x0f0f0f0f);
  197|       |    val += (val >> 8);
  198|       |    val += (val >> 16);
  199|       |    return (int)(val & 0x0000003f);
  200|       |  #endif
  201|     16|  }
ojph_block_encoder_avx512.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }

_ZN4ojph4sizeC2Ejj:
   49|   268M|    explicit size(ui32 w = 0, ui32 h = 0) : w(w), h(h) {}
_ZNK4ojph4size4areaEv:
   53|  13.3M|    ui64 area() const { return (ui64)w * (ui64)h; }
_ZN4ojph5pointC2Ejj:
   59|   165M|    explicit point(ui32 x = 0, ui32 y = 0) : x(x), y(y) {}
_ZNK4ojph4recteqERKS0_:
   69|  12.0k|    bool operator==(const rect& a) const {
   70|  12.0k|      return a.org.x == org.x && a.org.y == org.y
  ------------------
  |  Branch (70:14): [True: 11.9k, False: 135]
  |  Branch (70:34): [True: 11.8k, False: 59]
  ------------------
   71|  11.8k|        && a.siz.w == siz.w && a.siz.h == siz.h;
  ------------------
  |  Branch (71:12): [True: 11.8k, False: 46]
  |  Branch (71:32): [True: 11.7k, False: 9]
  ------------------
   72|  12.0k|    }
_ZNK4ojph4rectneERKS0_:
   75|  12.0k|    { return !(a == *this); }

_ZN4ojph10mem_infileC2Ev:
  311|  9.05k|    mem_infile() { close(); }
_ZN4ojph11infile_baseD2Ev:
  275|  9.05k|    virtual ~infile_base() {}
_ZN4ojph10mem_infile4tellEv:
  334|   461k|    si64 tell() override { return cur_ptr - data; }
_ZN4ojph10mem_infile3eofEv:
  335|  73.1M|    bool eof() override { return cur_ptr >= data + size; }
_ZN4ojph10mem_infile5closeEv:
  336|  15.7k|    void close() override { data = cur_ptr = NULL; size = 0; }

_ZN4ojph19mem_fixed_allocatorC2Ev:
   62|  9.05k|    {
   63|       |      store = NULL; allocated_data = 0;
   64|  9.05k|      restart();
   65|  9.05k|    }
_ZN4ojph19mem_fixed_allocatorD2Ev:
   67|  9.05k|    {
   68|  9.05k|      if (store) free(store);
  ------------------
  |  Branch (68:11): [True: 6.65k, False: 2.39k]
  ------------------
   69|  9.05k|    }
_ZN4ojph19mem_fixed_allocator5allocEv:
   84|  6.65k|    {
   85|  6.65k|      assert(preallocation);
   86|  6.65k|      if (size_data + size_obj > allocated_data)
  ------------------
  |  Branch (86:11): [True: 6.65k, False: 0]
  ------------------
   87|  6.65k|      {
   88|       |        // We should be here once only, because, in subsequent, calls we
   89|       |        // should have size_data + size_obj <= allocated_data
   90|  6.65k|        free(store);
   91|  6.65k|        allocated_data = size_data + size_obj;
   92|  6.65k|        allocated_data = allocated_data + (allocated_data + 19) / 20; // 5%
   93|  6.65k|        store = malloc(allocated_data);
   94|  6.65k|        if (store == NULL)
  ------------------
  |  Branch (94:13): [True: 0, False: 6.65k]
  ------------------
   95|      0|          OJPH_ERROR(0x00090001, "malloc failed");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   96|  6.65k|      }
   97|  6.65k|      avail_obj = store;
   98|  6.65k|      avail_data = (ui8*)store + size_obj;
   99|  6.65k|      avail_size_obj = size_obj;
  100|  6.65k|      avail_size_data = size_data;
  101|  6.65k|      preallocation = false;
  102|  6.65k|    }
_ZN4ojph19mem_fixed_allocator7restartEv:
  105|  18.1k|    {
  106|       |      avail_obj = avail_data = NULL;
  107|  18.1k|      avail_size_obj = avail_size_data = size_obj = size_data = 0;
  108|  18.1k|      preallocation = true;
  109|  18.1k|    }
_ZN4ojph11lifting_bufC2Ev:
  195|  22.1M|    lifting_buf() { line = NULL;  active = false; }
_ZN4ojph11coded_listsC2Ej:
  204|  78.9k|    {
  205|       |      next_list = NULL;
  206|  78.9k|      avail_size = buf_size = size;
  207|  78.9k|      this->buf = (ui8*)this + sizeof(coded_lists);
  208|  78.9k|    }
_ZN4ojph21mem_elastic_allocatorC2Ej:
  225|  9.05k|    : chunk_size(chunk_size)
  226|  9.05k|    { cur_store = store = avail = NULL; total_allocated = 0; }
_ZN4ojph21mem_elastic_allocatorD2Ev:
  229|  9.05k|    {
  230|  13.0k|      while (store) { // stores in use
  ------------------
  |  Branch (230:14): [True: 3.99k, False: 9.05k]
  ------------------
  231|  3.99k|        stores_list* t = store->next_store;
  232|  3.99k|        free(store);
  233|  3.99k|        store = t;
  234|  3.99k|      }
  235|  9.05k|      while (avail) { // available stores
  ------------------
  |  Branch (235:14): [True: 0, False: 9.05k]
  ------------------
  236|      0|        stores_list* t = avail->next_store;
  237|      0|        free(avail);
  238|      0|        avail = t;
  239|      0|      }
  240|  9.05k|    }
_ZN4ojph21mem_elastic_allocator11stores_list18stores_list_size16Ev:
  253|  7.99k|      {
  254|  7.99k|        return (ui32) ((sizeof (stores_list) + 15u) & ~15u);
  255|  7.99k|      }
_ZN4ojph21mem_elastic_allocator11stores_listC2Ej:
  257|  3.99k|      {
  258|       |        this->next_store = NULL;
  259|  3.99k|        this->orig_size = this->available = available_bytes;
  260|  3.99k|        this->orig_data = this->data = (ui8*)this + stores_list_size16();
  261|  3.99k|      }
_ZN4ojph21mem_elastic_allocator11stores_list16eval_store_bytesEj:
  269|  3.99k|      { // calculates how many bytes need to be allocated
  270|  3.99k|        return available_bytes + stores_list_size16();
  271|  3.99k|      }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local4tileEEEvm:
   79|  6.96k|    {
   80|  6.96k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  6.96k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local4tileELi8EEEvmjRm:
  128|  6.96k|    {
  129|  6.96k|      assert(preallocation);
  130|  6.96k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  6.96k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  6.96k|      total += 2*N - 1;
  133|       |
  134|  6.96k|      sz += total;
  135|  6.96k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_8line_bufEEEvm:
   79|  6.85M|    {
   80|  6.85M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  6.85M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_8line_bufELi8EEEvmjRm:
  128|  6.85M|    {
  129|  6.85M|      assert(preallocation);
  130|  6.85M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  6.85M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  6.85M|      total += 2*N - 1;
  133|       |
  134|  6.85M|      sz += total;
  135|  6.85M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_4sizeEEEvm:
   79|  13.3k|    {
   80|  13.3k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  13.3k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_4sizeELi8EEEvmjRm:
  128|  13.3k|    {
  129|  13.3k|      assert(preallocation);
  130|  13.3k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  13.3k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  13.3k|      total += 2*N - 1;
  133|       |
  134|  13.3k|      sz += total;
  135|  13.3k|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIiEEvmj:
   73|  17.0M|    {
   74|  17.0M|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|  17.0M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIiLi64EEEvmjRm:
  128|  17.0M|    {
  129|  17.0M|      assert(preallocation);
  130|  17.0M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  17.0M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  17.0M|      total += 2*N - 1;
  133|       |
  134|  17.0M|      sz += total;
  135|  17.0M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objIhEEvm:
   79|  6.65k|    {
   80|  6.65k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  6.65k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIhLi8EEEvmjRm:
  128|  6.65k|    {
  129|  6.65k|      assert(preallocation);
  130|  6.65k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  6.65k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  6.65k|      total += 2*N - 1;
  133|       |
  134|  6.65k|      sz += total;
  135|  6.65k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objIhEEPT_m:
  120|  6.65k|    {
  121|  6.65k|      return post_alloc_local<T, object_alignment>
  122|  6.65k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  6.65k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIhLi8EEEPT_mjRmRPv:
  140|  6.65k|    {
  141|  6.65k|      assert(!preallocation);
  142|  6.65k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  6.65k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  6.65k|      total += 2*N - 1;
  145|       |
  146|  6.65k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  6.65k|      avail_p = (ui8*)avail_p + total;
  148|  6.65k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  6.65k|      return p;
  151|  6.65k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local4tileEEEPT_m:
  120|  6.65k|    {
  121|  6.65k|      return post_alloc_local<T, object_alignment>
  122|  6.65k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  6.65k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local4tileELi8EEEPT_mjRmRPv:
  140|  6.65k|    {
  141|  6.65k|      assert(!preallocation);
  142|  6.65k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  6.65k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  6.65k|      total += 2*N - 1;
  145|       |
  146|  6.65k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  6.65k|      avail_p = (ui8*)avail_p + total;
  148|  6.65k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  6.65k|      return p;
  151|  6.65k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_8line_bufEEEPT_m:
  120|  6.42M|    {
  121|  6.42M|      return post_alloc_local<T, object_alignment>
  122|  6.42M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  6.42M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_8line_bufELi8EEEPT_mjRmRPv:
  140|  6.42M|    {
  141|  6.42M|      assert(!preallocation);
  142|  6.42M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  6.42M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  6.42M|      total += 2*N - 1;
  145|       |
  146|  6.42M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  6.42M|      avail_p = (ui8*)avail_p + total;
  148|  6.42M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  6.42M|      return p;
  151|  6.42M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_4sizeEEEPT_m:
  120|  13.1k|    {
  121|  13.1k|      return post_alloc_local<T, object_alignment>
  122|  13.1k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  13.1k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_4sizeELi8EEEPT_mjRmRPv:
  140|  13.1k|    {
  141|  13.1k|      assert(!preallocation);
  142|  13.1k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  13.1k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  13.1k|      total += 2*N - 1;
  145|       |
  146|  13.1k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  13.1k|      avail_p = (ui8*)avail_p + total;
  148|  13.1k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  13.1k|      return p;
  151|  13.1k|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIiEEPT_mj:
  113|  16.9M|    {
  114|  16.9M|      return post_alloc_local<T, byte_alignment>
  115|  16.9M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  16.9M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIiLi64EEEPT_mjRmRPv:
  140|  16.9M|    {
  141|  16.9M|      assert(!preallocation);
  142|  16.9M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  16.9M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  16.9M|      total += 2*N - 1;
  145|       |
  146|  16.9M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  16.9M|      avail_p = (ui8*)avail_p + total;
  148|  16.9M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  16.9M|      return p;
  151|  16.9M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local9tile_compEEEvm:
   79|  1.17M|    {
   80|  1.17M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  1.17M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local9tile_compELi8EEEvmjRm:
  128|  1.17M|    {
  129|  1.17M|      assert(preallocation);
  130|  1.17M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.17M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.17M|      total += 2*N - 1;
  133|       |
  134|  1.17M|      sz += total;
  135|  1.17M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_4rectEEEvm:
   79|  2.34M|    {
   80|  2.34M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  2.34M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_4rectELi8EEEvmjRm:
  128|  2.34M|    {
  129|  2.34M|      assert(preallocation);
  130|  2.34M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  2.34M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  2.34M|      total += 2*N - 1;
  133|       |
  134|  2.34M|      sz += total;
  135|  2.34M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objIjEEvm:
   79|  3.51M|    {
   80|  3.51M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  3.51M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIjLi8EEEvmjRm:
  128|  3.51M|    {
  129|  3.51M|      assert(preallocation);
  130|  3.51M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  3.51M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  3.51M|      total += 2*N - 1;
  133|       |
  134|  3.51M|      sz += total;
  135|  3.51M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objIbEEvm:
   79|  2.34M|    {
   80|  2.34M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  2.34M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIbLi8EEEvmjRm:
  128|  2.34M|    {
  129|  2.34M|      assert(preallocation);
  130|  2.34M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  2.34M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  2.34M|      total += 2*N - 1;
  133|       |
  134|  2.34M|      sz += total;
  135|  2.34M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objIPKNS_5local7nlt_recEEEvm:
   79|  1.17M|    {
   80|  1.17M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  1.17M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIPKNS_5local7nlt_recELi8EEEvmjRm:
  128|  1.17M|    {
  129|  1.17M|      assert(preallocation);
  130|  1.17M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.17M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.17M|      total += 2*N - 1;
  133|       |
  134|  1.17M|      sz += total;
  135|  1.17M|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIfEEvmj:
   73|  3.69M|    {
   74|  3.69M|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|  3.69M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIfLi64EEEvmjRm:
  128|  3.69M|    {
  129|  3.69M|      assert(preallocation);
  130|  3.69M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  3.69M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  3.69M|      total += 2*N - 1;
  133|       |
  134|  3.69M|      sz += total;
  135|  3.69M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local9tile_compEEEPT_m:
  120|  1.09M|    {
  121|  1.09M|      return post_alloc_local<T, object_alignment>
  122|  1.09M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  1.09M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local9tile_compELi8EEEPT_mjRmRPv:
  140|  1.09M|    {
  141|  1.09M|      assert(!preallocation);
  142|  1.09M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  1.09M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  1.09M|      total += 2*N - 1;
  145|       |
  146|  1.09M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  1.09M|      avail_p = (ui8*)avail_p + total;
  148|  1.09M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  1.09M|      return p;
  151|  1.09M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_4rectEEEPT_m:
  120|  2.18M|    {
  121|  2.18M|      return post_alloc_local<T, object_alignment>
  122|  2.18M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  2.18M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_4rectELi8EEEPT_mjRmRPv:
  140|  2.18M|    {
  141|  2.18M|      assert(!preallocation);
  142|  2.18M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  2.18M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  2.18M|      total += 2*N - 1;
  145|       |
  146|  2.18M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  2.18M|      avail_p = (ui8*)avail_p + total;
  148|  2.18M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  2.18M|      return p;
  151|  2.18M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objIjEEPT_m:
  120|  3.27M|    {
  121|  3.27M|      return post_alloc_local<T, object_alignment>
  122|  3.27M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  3.27M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIjLi8EEEPT_mjRmRPv:
  140|  3.27M|    {
  141|  3.27M|      assert(!preallocation);
  142|  3.27M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  3.27M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  3.27M|      total += 2*N - 1;
  145|       |
  146|  3.27M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  3.27M|      avail_p = (ui8*)avail_p + total;
  148|  3.27M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  3.27M|      return p;
  151|  3.27M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objIbEEPT_m:
  120|  2.18M|    {
  121|  2.18M|      return post_alloc_local<T, object_alignment>
  122|  2.18M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  2.18M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIbLi8EEEPT_mjRmRPv:
  140|  2.18M|    {
  141|  2.18M|      assert(!preallocation);
  142|  2.18M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  2.18M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  2.18M|      total += 2*N - 1;
  145|       |
  146|  2.18M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  2.18M|      avail_p = (ui8*)avail_p + total;
  148|  2.18M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  2.18M|      return p;
  151|  2.18M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objIPKNS_5local7nlt_recEEEPT_m:
  120|  1.09M|    {
  121|  1.09M|      return post_alloc_local<T, object_alignment>
  122|  1.09M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  1.09M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIPKNS_5local7nlt_recELi8EEEPT_mjRmRPv:
  140|  1.09M|    {
  141|  1.09M|      assert(!preallocation);
  142|  1.09M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  1.09M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  1.09M|      total += 2*N - 1;
  145|       |
  146|  1.09M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  1.09M|      avail_p = (ui8*)avail_p + total;
  148|  1.09M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  1.09M|      return p;
  151|  1.09M|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIfEEPT_mj:
  113|  3.49M|    {
  114|  3.49M|      return post_alloc_local<T, byte_alignment>
  115|  3.49M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  3.49M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIfLi64EEEPT_mjRmRPv:
  140|  3.49M|    {
  141|  3.49M|      assert(!preallocation);
  142|  3.49M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  3.49M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  3.49M|      total += 2*N - 1;
  145|       |
  146|  3.49M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  3.49M|      avail_p = (ui8*)avail_p + total;
  148|  3.49M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  3.49M|      return p;
  151|  3.49M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local10resolutionEEEvm:
   79|  6.82M|    {
   80|  6.82M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  6.82M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local10resolutionELi8EEEvmjRm:
  128|  6.82M|    {
  129|  6.82M|      assert(preallocation);
  130|  6.82M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  6.82M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  6.82M|      total += 2*N - 1;
  133|       |
  134|  6.82M|      sz += total;
  135|  6.82M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local10resolutionEEEPT_m:
  120|  6.34M|    {
  121|  6.34M|      return post_alloc_local<T, object_alignment>
  122|  6.34M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  6.34M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local10resolutionELi8EEEPT_mjRmRPv:
  140|  6.34M|    {
  141|  6.34M|      assert(!preallocation);
  142|  6.34M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  6.34M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  6.34M|      total += 2*N - 1;
  145|       |
  146|  6.34M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  6.34M|      avail_p = (ui8*)avail_p + total;
  148|  6.34M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  6.34M|      return p;
  151|  6.34M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local7subbandEEEvm:
   79|  6.82M|    {
   80|  6.82M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  6.82M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local7subbandELi8EEEvmjRm:
  128|  6.82M|    {
  129|  6.82M|      assert(preallocation);
  130|  6.82M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  6.82M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  6.82M|      total += 2*N - 1;
  133|       |
  134|  6.82M|      sz += total;
  135|  6.82M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local8precinctEEEvm:
   79|  1.93M|    {
   80|  1.93M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  1.93M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local8precinctELi8EEEvmjRm:
  128|  1.93M|    {
  129|  1.93M|      assert(preallocation);
  130|  1.93M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.93M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.93M|      total += 2*N - 1;
  133|       |
  134|  1.93M|      sz += total;
  135|  1.93M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_11lifting_bufEEEvm:
   79|  5.68M|    {
   80|  5.68M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  5.68M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_11lifting_bufELi8EEEvmjRm:
  128|  5.68M|    {
  129|  5.68M|      assert(preallocation);
  130|  5.68M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  5.68M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  5.68M|      total += 2*N - 1;
  133|       |
  134|  5.68M|      sz += total;
  135|  5.68M|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIlEEvmj:
   73|  4.39M|    {
   74|  4.39M|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|  4.39M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIlLi64EEEvmjRm:
  128|  4.39M|    {
  129|  4.39M|      assert(preallocation);
  130|  4.39M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  4.39M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  4.39M|      total += 2*N - 1;
  133|       |
  134|  4.39M|      sz += total;
  135|  4.39M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local7subbandEEEPT_m:
  120|  6.34M|    {
  121|  6.34M|      return post_alloc_local<T, object_alignment>
  122|  6.34M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  6.34M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local7subbandELi8EEEPT_mjRmRPv:
  140|  6.34M|    {
  141|  6.34M|      assert(!preallocation);
  142|  6.34M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  6.34M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  6.34M|      total += 2*N - 1;
  145|       |
  146|  6.34M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  6.34M|      avail_p = (ui8*)avail_p + total;
  148|  6.34M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  6.34M|      return p;
  151|  6.34M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local8precinctEEEPT_m:
  120|  1.92M|    {
  121|  1.92M|      return post_alloc_local<T, object_alignment>
  122|  1.92M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  1.92M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local8precinctELi8EEEPT_mjRmRPv:
  140|  1.92M|    {
  141|  1.92M|      assert(!preallocation);
  142|  1.92M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  1.92M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  1.92M|      total += 2*N - 1;
  145|       |
  146|  1.92M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  1.92M|      avail_p = (ui8*)avail_p + total;
  148|  1.92M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  1.92M|      return p;
  151|  1.92M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_11lifting_bufEEEPT_m:
  120|  5.25M|    {
  121|  5.25M|      return post_alloc_local<T, object_alignment>
  122|  5.25M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  5.25M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_11lifting_bufELi8EEEPT_mjRmRPv:
  140|  5.25M|    {
  141|  5.25M|      assert(!preallocation);
  142|  5.25M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  5.25M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  5.25M|      total += 2*N - 1;
  145|       |
  146|  5.25M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  5.25M|      avail_p = (ui8*)avail_p + total;
  148|  5.25M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  5.25M|      return p;
  151|  5.25M|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIlEEPT_mj:
  113|  2.83M|    {
  114|  2.83M|      return post_alloc_local<T, byte_alignment>
  115|  2.83M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  2.83M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIlLi64EEEPT_mjRmRPv:
  140|  2.83M|    {
  141|  2.83M|      assert(!preallocation);
  142|  2.83M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  2.83M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  2.83M|      total += 2*N - 1;
  145|       |
  146|  2.83M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  2.83M|      avail_p = (ui8*)avail_p + total;
  148|  2.83M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  2.83M|      return p;
  151|  2.83M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local9codeblockEEEvm:
   79|  1.15M|    {
   80|  1.15M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  1.15M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local9codeblockELi8EEEvmjRm:
  128|  1.15M|    {
  129|  1.15M|      assert(preallocation);
  130|  1.15M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.15M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.15M|      total += 2*N - 1;
  133|       |
  134|  1.15M|      sz += total;
  135|  1.15M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local15coded_cb_headerEEEvm:
   79|  1.15M|    {
   80|  1.15M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  1.15M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local15coded_cb_headerELi8EEEvmjRm:
  128|  1.15M|    {
  129|  1.15M|      assert(preallocation);
  130|  1.15M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.15M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.15M|      total += 2*N - 1;
  133|       |
  134|  1.15M|      sz += total;
  135|  1.15M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local9codeblockEEEPT_m:
  120|  1.15M|    {
  121|  1.15M|      return post_alloc_local<T, object_alignment>
  122|  1.15M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  1.15M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local9codeblockELi8EEEPT_mjRmRPv:
  140|  1.15M|    {
  141|  1.15M|      assert(!preallocation);
  142|  1.15M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  1.15M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  1.15M|      total += 2*N - 1;
  145|       |
  146|  1.15M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  1.15M|      avail_p = (ui8*)avail_p + total;
  148|  1.15M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  1.15M|      return p;
  151|  1.15M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local15coded_cb_headerEEEPT_m:
  120|  1.15M|    {
  121|  1.15M|      return post_alloc_local<T, object_alignment>
  122|  1.15M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  1.15M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local15coded_cb_headerELi8EEEPT_mjRmRPv:
  140|  1.15M|    {
  141|  1.15M|      assert(!preallocation);
  142|  1.15M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  1.15M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  1.15M|      total += 2*N - 1;
  145|       |
  146|  1.15M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  1.15M|      avail_p = (ui8*)avail_p + total;
  148|  1.15M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  1.15M|      return p;
  151|  1.15M|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIjEEvmj:
   73|  4.04M|    {
   74|  4.04M|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|  4.04M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIjLi64EEEvmjRm:
  128|  4.04M|    {
  129|  4.04M|      assert(preallocation);
  130|  4.04M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  4.04M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  4.04M|      total += 2*N - 1;
  133|       |
  134|  4.04M|      sz += total;
  135|  4.04M|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataImEEvmj:
   73|  1.81M|    {
   74|  1.81M|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|  1.81M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localImLi64EEEvmjRm:
  128|  1.81M|    {
  129|  1.81M|      assert(preallocation);
  130|  1.81M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.81M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.81M|      total += 2*N - 1;
  133|       |
  134|  1.81M|      sz += total;
  135|  1.81M|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIjEEPT_mj:
  113|  3.86M|    {
  114|  3.86M|      return post_alloc_local<T, byte_alignment>
  115|  3.86M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  3.86M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIjLi64EEEPT_mjRmRPv:
  140|  3.86M|    {
  141|  3.86M|      assert(!preallocation);
  142|  3.86M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  3.86M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  3.86M|      total += 2*N - 1;
  145|       |
  146|  3.86M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  3.86M|      avail_p = (ui8*)avail_p + total;
  148|  3.86M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  3.86M|      return p;
  151|  3.86M|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataImEEPT_mj:
  113|  1.77M|    {
  114|  1.77M|      return post_alloc_local<T, byte_alignment>
  115|  1.77M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  1.77M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localImLi64EEEPT_mjRmRPv:
  140|  1.77M|    {
  141|  1.77M|      assert(!preallocation);
  142|  1.77M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  1.77M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  1.77M|      total += 2*N - 1;
  145|       |
  146|  1.77M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  1.77M|      avail_p = (ui8*)avail_p + total;
  148|  1.77M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  1.77M|      return p;
  151|  1.77M|    }

_ZN4ojph9param_sizC2EPNS_5local9param_sizE:
   71|  27.2k|    param_siz(local::param_siz *p) : state(p) {}
_ZN4ojph9param_codC2EPNS_5local9param_codE:
  122|  1.10M|    param_cod(local::param_cod* p) : state(p) {}

_ZN4ojph9run_cpuidEjjPj:
   54|      4|  {
   55|       |  #ifdef OJPH_COMPILER_MSVC
   56|       |    __cpuidex((int *)abcd, eax, ecx);
   57|       |  #else
   58|      4|    uint32_t ebx = 0, edx = 0;
   59|       |  #if defined( __i386__ ) && defined ( __PIC__ )
   60|       |    /* in case of PIC under 32-bit EBX cannot be clobbered */
   61|       |    __asm__ ( "movl %%ebx, %%edi \n\t cpuid \n\t xchgl %%ebx, %%edi"
   62|       |              : "=D" (ebx), "+a" (eax), "+c" (ecx), "=d" (edx) );
   63|       |  #else
   64|      4|    __asm__ ( "cpuid" : "+b" (ebx), "+a" (eax), "+c" (ecx), "=d" (edx) );
   65|      4|  #endif
   66|      4|    abcd[0] = eax; abcd[1] = ebx; abcd[2] = ecx; abcd[3] = edx;
   67|      4|  #endif
   68|      4|    return true;
   69|      4|  }
_ZN4ojph8read_xcrEj:
   73|      2|  {
   74|       |  #ifdef OJPH_COMPILER_MSVC
   75|       |    return _xgetbv(index);
   76|       |  #else
   77|      2|    uint32_t eax = 0, edx = 0;
   78|      2|    __asm__ ( "xgetbv" : "=a" (eax), "=d" (edx) : "c" (index) );
   79|      2|    return ((uint64_t)edx << 32) | eax;
   80|      2|  #endif
   81|      2|  }
_ZN4ojph18init_cpu_ext_levelERi:
   85|      2|  {
   86|      2|    uint32_t mmx_abcd[4];
   87|      2|    run_cpuid(1, 0, mmx_abcd);
   88|      2|    bool mmx_avail = ((mmx_abcd[3] & 0x00800000) == 0x00800000);
   89|       |
   90|      2|    level = 0;
   91|      2|    if (mmx_avail)
  ------------------
  |  Branch (91:9): [True: 2, False: 0]
  ------------------
   92|      2|    {
   93|      2|      level = X86_CPU_EXT_LEVEL_MMX;
   94|      2|      bool sse_avail = ((mmx_abcd[3] & 0x02000000) == 0x02000000);
   95|      2|      if (sse_avail)
  ------------------
  |  Branch (95:11): [True: 2, False: 0]
  ------------------
   96|      2|      {
   97|      2|        level = X86_CPU_EXT_LEVEL_SSE;
   98|      2|        bool sse2_avail = ((mmx_abcd[3] & 0x04000000) == 0x04000000);
   99|      2|        if (sse2_avail)
  ------------------
  |  Branch (99:13): [True: 2, False: 0]
  ------------------
  100|      2|        {
  101|      2|          level = X86_CPU_EXT_LEVEL_SSE2;
  102|      2|          bool sse3_avail = ((mmx_abcd[2] & 0x00000001) == 0x00000001);
  103|      2|          if (sse3_avail)
  ------------------
  |  Branch (103:15): [True: 2, False: 0]
  ------------------
  104|      2|          {
  105|      2|            level = X86_CPU_EXT_LEVEL_SSE3;
  106|      2|            bool ssse3_avail = ((mmx_abcd[2] & 0x00000200) == 0x00000200);
  107|      2|            if (ssse3_avail)
  ------------------
  |  Branch (107:17): [True: 2, False: 0]
  ------------------
  108|      2|            {
  109|      2|              level = X86_CPU_EXT_LEVEL_SSSE3;
  110|      2|              bool sse41_avail = ((mmx_abcd[2] & 0x00080000) == 0x00080000);
  111|      2|              if (sse41_avail) {
  ------------------
  |  Branch (111:19): [True: 2, False: 0]
  ------------------
  112|      2|                level = X86_CPU_EXT_LEVEL_SSE41;
  113|      2|                bool sse42_avail = ((mmx_abcd[2] & 0x00100000) == 0x00100000);
  114|      2|                if (sse42_avail)
  ------------------
  |  Branch (114:21): [True: 2, False: 0]
  ------------------
  115|      2|                {
  116|      2|                  level = X86_CPU_EXT_LEVEL_SSE42;
  117|       |                  
  118|      2|                  uint64_t xcr_val = 0;
  119|      2|                  bool osxsave_avail, ymm_avail, avx_avail = false;
  120|      2|                  osxsave_avail = ((mmx_abcd[2] & 0x08000000) == 0x08000000);
  121|      2|                  if (osxsave_avail)
  ------------------
  |  Branch (121:23): [True: 2, False: 0]
  ------------------
  122|      2|                  {
  123|      2|                    xcr_val = read_xcr(0); // _XCR_XFEATURE_ENABLED_MASK = 0
  124|      2|                    ymm_avail = osxsave_avail && ((xcr_val & 0x6) == 0x6);
  ------------------
  |  Branch (124:33): [True: 2, False: 0]
  |  Branch (124:50): [True: 2, False: 0]
  ------------------
  125|      2|                    avx_avail = ymm_avail && (mmx_abcd[2] & 0x10000000);
  ------------------
  |  Branch (125:33): [True: 2, False: 0]
  |  Branch (125:46): [True: 2, False: 0]
  ------------------
  126|      2|                  }
  127|      2|                  if (avx_avail)
  ------------------
  |  Branch (127:23): [True: 2, False: 0]
  ------------------
  128|      2|                  {
  129|      2|                    level = X86_CPU_EXT_LEVEL_AVX;
  130|       |
  131|      2|                    uint32_t avx2_abcd[4];
  132|      2|                    run_cpuid(7, 0, avx2_abcd);
  133|      2|                    bool avx2_avail = (avx2_abcd[1] & 0x20) != 0;
  134|      2|                    if (avx2_avail)
  ------------------
  |  Branch (134:25): [True: 2, False: 0]
  ------------------
  135|      2|                    {
  136|      2|                      level = X86_CPU_EXT_LEVEL_AVX2;
  137|      2|                      bool avx2fma_avail =
  138|      2|                        avx2_avail && ((mmx_abcd[2] & 0x1000) == 0x1000);
  ------------------
  |  Branch (138:25): [True: 2, False: 0]
  |  Branch (138:39): [True: 2, False: 0]
  ------------------
  139|      2|                      if (avx2fma_avail)
  ------------------
  |  Branch (139:27): [True: 2, False: 0]
  ------------------
  140|      2|                      {
  141|      2|                        level = X86_CPU_EXT_LEVEL_AVX2FMA;
  142|       |
  143|      2|                        bool zmm_avail =
  144|      2|                          osxsave_avail && ((xcr_val & 0xE0) == 0xE0);
  ------------------
  |  Branch (144:27): [True: 2, False: 0]
  |  Branch (144:44): [True: 0, False: 2]
  ------------------
  145|      2|                        bool avx512f_avail = (avx2_abcd[1] & 0x10000) != 0;
  146|      2|                        bool avx512cd_avail = (avx2_abcd[1] & 0x10000000) != 0;
  147|      2|                        bool avx512bw_avail = (avx2_abcd[1] & 0x40000000) != 0;
  148|      2|                        bool avx512vl_avail =
  149|      2|                          (avx2_abcd[1] & 0x80000000u) != 0;
  150|      2|                        bool avx512_avail = zmm_avail && avx512f_avail
  ------------------
  |  Branch (150:45): [True: 0, False: 2]
  |  Branch (150:58): [True: 0, False: 0]
  ------------------
  151|      0|                          && avx512cd_avail && avx512bw_avail
  ------------------
  |  Branch (151:30): [True: 0, False: 0]
  |  Branch (151:48): [True: 0, False: 0]
  ------------------
  152|      0|                          && avx512vl_avail;
  ------------------
  |  Branch (152:30): [True: 0, False: 0]
  ------------------
  153|      2|                        if (avx512_avail)
  ------------------
  |  Branch (153:29): [True: 0, False: 2]
  ------------------
  154|      0|                          level = X86_CPU_EXT_LEVEL_AVX512;
  155|      2|                      }
  156|      2|                    }
  157|      2|                  }
  158|      2|                }
  159|      2|              }
  160|      2|            }
  161|      2|          }
  162|      2|        }
  163|      2|      }
  164|      2|    }
  165|      2|    return true;
  166|      2|  }
_ZN4ojph17get_cpu_ext_levelEv:
  300|  33.8M|  {
  301|       |    assert(cpu_level_initialized);
  302|  33.8M|    return cpu_level;
  303|  33.8M|  }

_ZN4ojph10mem_infile4openEPKhm:
  338|  9.05k|  {
  339|       |    assert(this->data == NULL);
  340|  9.05k|    cur_ptr = this->data = data;
  341|  9.05k|    this->size = size;
  342|  9.05k|  }
_ZN4ojph10mem_infile4readEPvm:
  346|   141M|  {
  347|   141M|    std::ptrdiff_t bytes_left = (data + this->size) - cur_ptr;
  348|   141M|    if (bytes_left > 0)
  ------------------
  |  Branch (348:9): [True: 141M, False: 84.2k]
  ------------------
  349|   141M|    {
  350|   141M|      size_t bytes_to_read = ojph_min(size, (size_t)bytes_left);
  ------------------
  |  |   76|   141M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 141M, False: 27.3k]
  |  |  ------------------
  ------------------
  351|   141M|      memcpy(ptr, cur_ptr, bytes_to_read);
  352|   141M|      cur_ptr += bytes_to_read;
  353|   141M|      return bytes_to_read;
  354|   141M|    }
  355|  84.2k|    else
  356|  84.2k|      return 0;
  357|   141M|  }
_ZN4ojph10mem_infile4seekElNS_11infile_base4seekE:
  361|   306k|  {
  362|   306k|    int result = -1;
  363|   306k|    if (origin == OJPH_SEEK_SET)
  ------------------
  |  Branch (363:9): [True: 222k, False: 84.4k]
  ------------------
  364|   222k|    {
  365|   222k|      if (offset >= 0 && (size_t)offset <= size)
  ------------------
  |  Branch (365:11): [True: 222k, False: 0]
  |  Branch (365:26): [True: 212k, False: 10.1k]
  ------------------
  366|   212k|      {
  367|   212k|        cur_ptr = data + offset;
  368|   212k|        result = 0;
  369|   212k|      }
  370|   222k|    }
  371|  84.4k|    else if (origin == OJPH_SEEK_CUR)
  ------------------
  |  Branch (371:14): [True: 84.4k, False: 0]
  ------------------
  372|  84.4k|    {
  373|  84.4k|      si64 bytes_off = (si64)(cur_ptr - data) + offset;
  374|  84.4k|      if (bytes_off >= 0 && (size_t)bytes_off <= size)
  ------------------
  |  Branch (374:11): [True: 84.4k, False: 0]
  |  Branch (374:29): [True: 71.4k, False: 13.0k]
  ------------------
  375|  71.4k|      {
  376|  71.4k|        cur_ptr = data + bytes_off;
  377|  71.4k|        result = 0;
  378|  71.4k|      }
  379|  84.4k|    }
  380|      0|    else if (origin == OJPH_SEEK_END)
  ------------------
  |  Branch (380:14): [True: 0, False: 0]
  ------------------
  381|      0|    {
  382|      0|      if (offset <= 0 && (std::ptrdiff_t)size + offset >= 0)
  ------------------
  |  Branch (382:11): [True: 0, False: 0]
  |  Branch (382:26): [True: 0, False: 0]
  ------------------
  383|      0|      {
  384|      0|        cur_ptr = data + size + offset;
  385|      0|        result = 0;
  386|      0|      }
  387|      0|    }
  388|      0|    else
  389|      0|      assert(0);
  390|       |
  391|   306k|    return result;
  392|   306k|  }

_ZN4ojph8line_buf4wrapIiEEvPT_mj:
   55|  16.9M|  {
   56|  16.9M|    this->i32 = buffer;
   57|  16.9M|    this->size = num_ele;
   58|  16.9M|    this->pre_size = pre_size;
   59|  16.9M|    this->flags = LFT_32BIT | LFT_INTEGER;
   60|  16.9M|  }
_ZN4ojph8line_buf4wrapIfEEvPT_mj:
   65|  3.49M|  {
   66|  3.49M|    this->f32 = buffer;
   67|  3.49M|    this->size = num_ele;
   68|  3.49M|    this->pre_size = pre_size;
   69|  3.49M|    this->flags = LFT_32BIT;
   70|  3.49M|  }
_ZN4ojph8line_buf4wrapIlEEvPT_mj:
   75|  2.83M|  {
   76|  2.83M|    this->i64 = buffer;
   77|  2.83M|    this->size = num_ele;
   78|  2.83M|    this->pre_size = pre_size;
   79|  2.83M|    this->flags = LFT_64BIT | LFT_INTEGER;
   80|  2.83M|  }
_ZN4ojph21mem_elastic_allocator8allocateEPPNS0_11stores_listEj:
   94|  3.99k|  {
   95|  3.99k|    ui32 bytes = ojph_max(extended_bytes, chunk_size);
  ------------------
  |  |   73|  3.99k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 0, False: 3.99k]
  |  |  ------------------
  ------------------
   96|  3.99k|    if (avail != NULL && avail->orig_size >= bytes)
  ------------------
  |  Branch (96:9): [True: 0, False: 3.99k]
  |  Branch (96:26): [True: 0, False: 0]
  ------------------
   97|      0|    {
   98|      0|      *list = avail;
   99|      0|      avail = avail->next_store;
  100|      0|      (*list)->restart();
  101|      0|      return *list;
  102|      0|    }
  103|  3.99k|    else
  104|  3.99k|    {
  105|  3.99k|      ui32 store_bytes = stores_list::eval_store_bytes(bytes);
  106|  3.99k|      *list = (stores_list*) malloc(store_bytes);
  107|  3.99k|      total_allocated += store_bytes;
  108|  3.99k|      return new (*list) stores_list(bytes);
  109|  3.99k|    }
  110|  3.99k|  }
_ZN4ojph21mem_elastic_allocator10get_bufferEjRPNS_11coded_listsE:
  114|  78.9k|  {
  115|       |    // Round up so each coded_lists (and coded_lists::buf) stays 16-byte aligned
  116|       |    // within the store; avoids alignment fault on 32-bit architectures
  117|  78.9k|    ui32 raw = needed_bytes + (ui32)sizeof (coded_lists);
  118|  78.9k|    ui32 extended_bytes = (raw + 15u) & ~15u;
  119|       |
  120|  78.9k|    if (store == NULL)
  ------------------
  |  Branch (120:9): [True: 3.73k, False: 75.1k]
  ------------------
  121|  3.73k|      cur_store = store = allocate(&store, extended_bytes);
  122|  75.1k|    else if (cur_store->available < extended_bytes)
  ------------------
  |  Branch (122:14): [True: 265, False: 74.9k]
  ------------------
  123|    265|      cur_store = allocate(&cur_store->next_store, extended_bytes);
  124|       |
  125|  78.9k|    p = new (cur_store->data) coded_lists(needed_bytes);
  126|       |
  127|       |    assert(cur_store->available >= extended_bytes);
  128|  78.9k|    cur_store->available -= extended_bytes;
  129|  78.9k|    cur_store->data += extended_bytes;
  130|  78.9k|  }
_ZN4ojph21mem_elastic_allocator7restartEv:
  134|  9.05k|  {
  135|       |    // move to the end of avail
  136|  9.05k|    stores_list** p = &avail;
  137|  9.05k|    while (*p != NULL)
  ------------------
  |  Branch (137:12): [True: 0, False: 9.05k]
  ------------------
  138|      0|      p = &((*p)->next_store);
  139|  9.05k|    *p = store;
  140|       |    cur_store = store = NULL;
  141|  9.05k|  }

_ZN4ojph8get_infoEv:
   63|  9.81M|  {
   64|  9.81M|    return local_info;
   65|  9.81M|  }
_ZN4ojph12message_infoclEiPKciS2_z:
   76|  9.81M|  {
   77|  9.81M|    if (info_stream == NULL || message_level > OJPH_MSG_INFO)
  ------------------
  |  Branch (77:9): [True: 0, False: 9.81M]
  |  Branch (77:32): [True: 0, False: 9.81M]
  ------------------
   78|      0|      return;
   79|       |
   80|  9.81M|    fprintf(info_stream, "ojph info 0x%08X at %s:%d: ",
   81|  9.81M|      info_code, file_name, line_num);
   82|  9.81M|    va_list args;
   83|  9.81M|    va_start(args, fmt);
   84|  9.81M|    vfprintf(info_stream, fmt, args);
   85|  9.81M|    fprintf(info_stream, "\n");
   86|       |    va_end(args);
   87|  9.81M|  }
_ZN4ojph11get_warningEv:
  104|  30.8k|  {
  105|  30.8k|    return local_warn;
  106|  30.8k|  }
_ZN4ojph15message_warningclEiPKciS2_z:
  117|  30.8k|  {
  118|  30.8k|    if (warning_stream == NULL || message_level > OJPH_MSG_WARN)
  ------------------
  |  Branch (118:9): [True: 0, False: 30.8k]
  |  Branch (118:35): [True: 0, False: 30.8k]
  ------------------
  119|      0|      return;
  120|       |
  121|  30.8k|    fprintf(warning_stream, "ojph warning 0x%08X at %s:%d: ",
  122|  30.8k|      warn_code, file_name, line_num);
  123|  30.8k|    va_list args;
  124|  30.8k|    va_start(args, fmt);
  125|  30.8k|    vfprintf(warning_stream, fmt, args);
  126|  30.8k|    fprintf(warning_stream, "\n");
  127|       |    va_end(args);
  128|  30.8k|  }
_ZN4ojph9get_errorEv:
  145|  2.39k|  {
  146|  2.39k|    return local_error;
  147|  2.39k|  }
_ZN4ojph13message_errorclEiPKciS2_z:
  158|  2.39k|  {
  159|  2.39k|    if (error_stream != NULL && message_level <= OJPH_MSG_ERROR)
  ------------------
  |  Branch (159:9): [True: 2.39k, False: 0]
  |  Branch (159:33): [True: 2.39k, False: 0]
  ------------------
  160|  2.39k|    {
  161|  2.39k|      fprintf(error_stream, "ojph error 0x%08X at %s:%d: ",
  162|  2.39k|        error_code, file_name, line_num);
  163|  2.39k|      va_list args;
  164|  2.39k|      va_start(args, fmt);
  165|  2.39k|      vfprintf(error_stream, fmt, args);
  166|  2.39k|      fprintf(error_stream, "\n");
  167|  2.39k|      va_end(args);
  168|  2.39k|    }
  169|       |
  170|  2.39k|    throw std::runtime_error("ojph error");
  171|  2.39k|  }

_ZN4ojph5local31init_colour_transform_functionsEv:
  134|  9.05k|    {
  135|  9.05k|      static std::once_flag colour_transform_functions_init_flag;
  136|  9.05k|      std::call_once(colour_transform_functions_init_flag, []() {
  137|  9.05k|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  138|       |
  139|  9.05k|        rev_convert = gen_rev_convert;
  140|  9.05k|        rev_encode_nlt = gen_rev_encode_nlt;
  141|  9.05k|        rev_decode_nlt = gen_rev_decode_nlt;
  142|  9.05k|        rev_convert_nlt_type3 = gen_rev_convert_nlt_type3;
  143|  9.05k|        irv_convert_to_integer = gen_irv_convert_to_integer;
  144|  9.05k|        irv_convert_to_float = gen_irv_convert_to_float;
  145|  9.05k|        irv_convert_to_integer_nlt = gen_irv_convert_to_integer_nlt;
  146|  9.05k|        irv_convert_to_integer_nlt_type3 = gen_irv_convert_to_integer_nlt_type3;
  147|  9.05k|        irv_convert_to_float_nlt = gen_irv_convert_to_float_nlt;
  148|  9.05k|        irv_convert_to_float_nlt_type3 = gen_irv_convert_to_float_nlt_type3;
  149|  9.05k|        rct_forward = gen_rct_forward;
  150|  9.05k|        rct_backward = gen_rct_backward;
  151|  9.05k|        ict_forward = gen_ict_forward;
  152|  9.05k|        ict_backward = gen_ict_backward;
  153|       |
  154|  9.05k|  #ifndef OJPH_DISABLE_SIMD
  155|       |
  156|  9.05k|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  157|       |
  158|  9.05k|      #ifndef OJPH_DISABLE_SSE
  159|  9.05k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  160|  9.05k|        {
  161|  9.05k|          ict_forward = sse_ict_forward;
  162|  9.05k|          ict_backward = sse_ict_backward;
  163|  9.05k|        }
  164|  9.05k|      #endif // !OJPH_DISABLE_SSE
  165|       |
  166|  9.05k|      #ifndef OJPH_DISABLE_SSE2
  167|  9.05k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2)
  168|  9.05k|        {
  169|  9.05k|          rev_convert = sse2_rev_convert;
  170|  9.05k|          rev_convert_nlt_type3 = sse2_rev_convert_nlt_type3;
  171|  9.05k|          irv_convert_to_integer = sse2_irv_convert_to_integer;
  172|  9.05k|          irv_convert_to_float = sse2_irv_convert_to_float;
  173|  9.05k|          irv_convert_to_integer_nlt = sse2_irv_convert_to_integer_nlt;
  174|  9.05k|          irv_convert_to_integer_nlt_type3 =
  175|  9.05k|            sse2_irv_convert_to_integer_nlt_type3;
  176|  9.05k|          irv_convert_to_float_nlt = sse2_irv_convert_to_float_nlt;
  177|  9.05k|          irv_convert_to_float_nlt_type3 =
  178|  9.05k|            sse2_irv_convert_to_float_nlt_type3;
  179|  9.05k|          rct_forward = sse2_rct_forward;
  180|  9.05k|          rct_backward = sse2_rct_backward;
  181|  9.05k|        }
  182|  9.05k|      #endif // !OJPH_DISABLE_SSE2
  183|       |
  184|  9.05k|      #ifndef OJPH_DISABLE_AVX
  185|  9.05k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  186|  9.05k|        {
  187|  9.05k|          ict_forward = avx_ict_forward;
  188|  9.05k|          ict_backward = avx_ict_backward;
  189|  9.05k|        }
  190|  9.05k|      #endif // !OJPH_DISABLE_AVX
  191|       |
  192|  9.05k|      #ifndef OJPH_DISABLE_AVX2
  193|  9.05k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2)
  194|  9.05k|        {
  195|  9.05k|          rev_convert = avx2_rev_convert;
  196|  9.05k|          rev_convert_nlt_type3 = avx2_rev_convert_nlt_type3;
  197|  9.05k|          irv_convert_to_integer = avx2_irv_convert_to_integer;
  198|  9.05k|          irv_convert_to_float = avx2_irv_convert_to_float;
  199|  9.05k|          irv_convert_to_integer_nlt = avx2_irv_convert_to_integer_nlt;
  200|  9.05k|          irv_convert_to_integer_nlt_type3 =
  201|  9.05k|            avx2_irv_convert_to_integer_nlt_type3;
  202|  9.05k|          irv_convert_to_float_nlt = avx2_irv_convert_to_float_nlt;
  203|  9.05k|          irv_convert_to_float_nlt_type3 =
  204|  9.05k|            avx2_irv_convert_to_float_nlt_type3;
  205|  9.05k|          rct_forward = avx2_rct_forward;
  206|  9.05k|          rct_backward = avx2_rct_backward;
  207|  9.05k|        }
  208|  9.05k|      #endif // !OJPH_DISABLE_AVX2
  209|       |
  210|       |    #elif defined(OJPH_ARCH_ARM)
  211|       |
  212|       |    #elif defined(OJPH_ARCH_PPC64LE)
  213|       |
  214|       |        if (get_cpu_ext_level() >= PPC_CPU_EXT_LEVEL_ARCH_2_07)
  215|       |        {
  216|       |          // 128-bit VSX kernels; see ojph_simd_vsx.h
  217|       |          rev_convert = vsx_rev_convert;
  218|       |          rev_convert_nlt_type3 = vsx_rev_convert_nlt_type3;
  219|       |          irv_convert_to_integer = vsx_irv_convert_to_integer;
  220|       |          irv_convert_to_float = vsx_irv_convert_to_float;
  221|       |          irv_convert_to_integer_nlt_type3 =
  222|       |            vsx_irv_convert_to_integer_nlt_type3;
  223|       |          irv_convert_to_float_nlt_type3 =
  224|       |            vsx_irv_convert_to_float_nlt_type3;
  225|       |          rct_forward = vsx_rct_forward;
  226|       |          rct_backward = vsx_rct_backward;
  227|       |          ict_forward = vsx_ict_forward;
  228|       |          ict_backward = vsx_ict_backward;
  229|       |        }
  230|       |
  231|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  232|       |
  233|  9.05k|  #endif // !OJPH_DISABLE_SIMD
  234|       |
  235|       |#else // OJPH_ENABLE_WASM_SIMD
  236|       |
  237|       |        rev_convert = wasm_rev_convert;
  238|       |        rev_encode_nlt = gen_rev_encode_nlt;
  239|       |        rev_decode_nlt = gen_rev_decode_nlt;
  240|       |        rev_convert_nlt_type3 = wasm_rev_convert_nlt_type3;
  241|       |        irv_convert_to_integer = wasm_irv_convert_to_integer;
  242|       |        irv_convert_to_float = wasm_irv_convert_to_float;
  243|       |        irv_convert_to_integer_nlt = gen_irv_convert_to_integer_nlt;
  244|       |        irv_convert_to_integer_nlt_type3 = wasm_irv_convert_to_integer_nlt_type3;
  245|       |        irv_convert_to_float_nlt = gen_irv_convert_to_float_nlt;
  246|       |        irv_convert_to_float_nlt_type3 = wasm_irv_convert_to_float_nlt_type3;
  247|       |        rct_forward = wasm_rct_forward;
  248|       |        rct_backward = wasm_rct_backward;
  249|       |        ict_forward = wasm_ict_forward;
  250|       |        ict_backward = wasm_ict_backward;
  251|       |
  252|       |#endif // !OJPH_ENABLE_WASM_SIMD
  253|  9.05k|      });
  254|  9.05k|    }
ojph_colour.cpp:_ZZN4ojph5local31init_colour_transform_functionsEvENK3$_0clEv:
  136|      1|      std::call_once(colour_transform_functions_init_flag, []() {
  137|      1|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  138|       |
  139|      1|        rev_convert = gen_rev_convert;
  140|      1|        rev_encode_nlt = gen_rev_encode_nlt;
  141|      1|        rev_decode_nlt = gen_rev_decode_nlt;
  142|      1|        rev_convert_nlt_type3 = gen_rev_convert_nlt_type3;
  143|      1|        irv_convert_to_integer = gen_irv_convert_to_integer;
  144|      1|        irv_convert_to_float = gen_irv_convert_to_float;
  145|      1|        irv_convert_to_integer_nlt = gen_irv_convert_to_integer_nlt;
  146|      1|        irv_convert_to_integer_nlt_type3 = gen_irv_convert_to_integer_nlt_type3;
  147|      1|        irv_convert_to_float_nlt = gen_irv_convert_to_float_nlt;
  148|      1|        irv_convert_to_float_nlt_type3 = gen_irv_convert_to_float_nlt_type3;
  149|      1|        rct_forward = gen_rct_forward;
  150|      1|        rct_backward = gen_rct_backward;
  151|      1|        ict_forward = gen_ict_forward;
  152|      1|        ict_backward = gen_ict_backward;
  153|       |
  154|      1|  #ifndef OJPH_DISABLE_SIMD
  155|       |
  156|      1|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  157|       |
  158|      1|      #ifndef OJPH_DISABLE_SSE
  159|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  ------------------
  |  Branch (159:13): [True: 1, False: 0]
  ------------------
  160|      1|        {
  161|      1|          ict_forward = sse_ict_forward;
  162|      1|          ict_backward = sse_ict_backward;
  163|      1|        }
  164|      1|      #endif // !OJPH_DISABLE_SSE
  165|       |
  166|      1|      #ifndef OJPH_DISABLE_SSE2
  167|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2)
  ------------------
  |  Branch (167:13): [True: 1, False: 0]
  ------------------
  168|      1|        {
  169|      1|          rev_convert = sse2_rev_convert;
  170|      1|          rev_convert_nlt_type3 = sse2_rev_convert_nlt_type3;
  171|      1|          irv_convert_to_integer = sse2_irv_convert_to_integer;
  172|      1|          irv_convert_to_float = sse2_irv_convert_to_float;
  173|      1|          irv_convert_to_integer_nlt = sse2_irv_convert_to_integer_nlt;
  174|      1|          irv_convert_to_integer_nlt_type3 =
  175|      1|            sse2_irv_convert_to_integer_nlt_type3;
  176|      1|          irv_convert_to_float_nlt = sse2_irv_convert_to_float_nlt;
  177|      1|          irv_convert_to_float_nlt_type3 =
  178|      1|            sse2_irv_convert_to_float_nlt_type3;
  179|      1|          rct_forward = sse2_rct_forward;
  180|      1|          rct_backward = sse2_rct_backward;
  181|      1|        }
  182|      1|      #endif // !OJPH_DISABLE_SSE2
  183|       |
  184|      1|      #ifndef OJPH_DISABLE_AVX
  185|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  ------------------
  |  Branch (185:13): [True: 1, False: 0]
  ------------------
  186|      1|        {
  187|      1|          ict_forward = avx_ict_forward;
  188|      1|          ict_backward = avx_ict_backward;
  189|      1|        }
  190|      1|      #endif // !OJPH_DISABLE_AVX
  191|       |
  192|      1|      #ifndef OJPH_DISABLE_AVX2
  193|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2)
  ------------------
  |  Branch (193:13): [True: 1, False: 0]
  ------------------
  194|      1|        {
  195|      1|          rev_convert = avx2_rev_convert;
  196|      1|          rev_convert_nlt_type3 = avx2_rev_convert_nlt_type3;
  197|      1|          irv_convert_to_integer = avx2_irv_convert_to_integer;
  198|      1|          irv_convert_to_float = avx2_irv_convert_to_float;
  199|      1|          irv_convert_to_integer_nlt = avx2_irv_convert_to_integer_nlt;
  200|      1|          irv_convert_to_integer_nlt_type3 =
  201|      1|            avx2_irv_convert_to_integer_nlt_type3;
  202|      1|          irv_convert_to_float_nlt = avx2_irv_convert_to_float_nlt;
  203|      1|          irv_convert_to_float_nlt_type3 =
  204|      1|            avx2_irv_convert_to_float_nlt_type3;
  205|      1|          rct_forward = avx2_rct_forward;
  206|      1|          rct_backward = avx2_rct_backward;
  207|      1|        }
  208|      1|      #endif // !OJPH_DISABLE_AVX2
  209|       |
  210|       |    #elif defined(OJPH_ARCH_ARM)
  211|       |
  212|       |    #elif defined(OJPH_ARCH_PPC64LE)
  213|       |
  214|       |        if (get_cpu_ext_level() >= PPC_CPU_EXT_LEVEL_ARCH_2_07)
  215|       |        {
  216|       |          // 128-bit VSX kernels; see ojph_simd_vsx.h
  217|       |          rev_convert = vsx_rev_convert;
  218|       |          rev_convert_nlt_type3 = vsx_rev_convert_nlt_type3;
  219|       |          irv_convert_to_integer = vsx_irv_convert_to_integer;
  220|       |          irv_convert_to_float = vsx_irv_convert_to_float;
  221|       |          irv_convert_to_integer_nlt_type3 =
  222|       |            vsx_irv_convert_to_integer_nlt_type3;
  223|       |          irv_convert_to_float_nlt_type3 =
  224|       |            vsx_irv_convert_to_float_nlt_type3;
  225|       |          rct_forward = vsx_rct_forward;
  226|       |          rct_backward = vsx_rct_backward;
  227|       |          ict_forward = vsx_ict_forward;
  228|       |          ict_backward = vsx_ict_backward;
  229|       |        }
  230|       |
  231|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  232|       |
  233|      1|  #endif // !OJPH_DISABLE_SIMD
  234|       |
  235|       |#else // OJPH_ENABLE_WASM_SIMD
  236|       |
  237|       |        rev_convert = wasm_rev_convert;
  238|       |        rev_encode_nlt = gen_rev_encode_nlt;
  239|       |        rev_decode_nlt = gen_rev_decode_nlt;
  240|       |        rev_convert_nlt_type3 = wasm_rev_convert_nlt_type3;
  241|       |        irv_convert_to_integer = wasm_irv_convert_to_integer;
  242|       |        irv_convert_to_float = wasm_irv_convert_to_float;
  243|       |        irv_convert_to_integer_nlt = gen_irv_convert_to_integer_nlt;
  244|       |        irv_convert_to_integer_nlt_type3 = wasm_irv_convert_to_integer_nlt_type3;
  245|       |        irv_convert_to_float_nlt = gen_irv_convert_to_float_nlt;
  246|       |        irv_convert_to_float_nlt_type3 = wasm_irv_convert_to_float_nlt_type3;
  247|       |        rct_forward = wasm_rct_forward;
  248|       |        rct_backward = wasm_rct_backward;
  249|       |        ict_forward = wasm_ict_forward;
  250|       |        ict_backward = wasm_ict_backward;
  251|       |
  252|       |#endif // !OJPH_ENABLE_WASM_SIMD
  253|      1|      });

_ZN4ojph5local16avx_ict_backwardEPKfS2_S2_PfS3_S3_j:
   80|  4.07k|    {
   81|  4.07k|      __m256 gamma_cr2g = _mm256_set1_ps(CT_CNST::GAMMA_CR2G);
   82|  4.07k|      __m256 gamma_cb2g = _mm256_set1_ps(CT_CNST::GAMMA_CB2G);
   83|  4.07k|      __m256 gamma_cr2r = _mm256_set1_ps(CT_CNST::GAMMA_CR2R);
   84|  4.07k|      __m256 gamma_cb2b = _mm256_set1_ps(CT_CNST::GAMMA_CB2B);
   85|  14.1k|      for (int i = (repeat + 7) >> 3; i > 0; --i)
  ------------------
  |  Branch (85:39): [True: 10.1k, False: 4.07k]
  ------------------
   86|  10.1k|      {
   87|  10.1k|        __m256 my = _mm256_load_ps(y);
   88|  10.1k|        __m256 mcr = _mm256_load_ps(cr);
   89|  10.1k|        __m256 mcb = _mm256_load_ps(cb);
   90|  10.1k|        __m256 mg = _mm256_sub_ps(my, _mm256_mul_ps(gamma_cr2g, mcr));
   91|  10.1k|        _mm256_store_ps(g, _mm256_sub_ps(mg, _mm256_mul_ps(gamma_cb2g, mcb)));
   92|  10.1k|        _mm256_store_ps(r, _mm256_add_ps(my, _mm256_mul_ps(gamma_cr2r, mcr)));
   93|  10.1k|        _mm256_store_ps(b, _mm256_add_ps(my, _mm256_mul_ps(gamma_cb2b, mcb)));
   94|       |
   95|  10.1k|        y += 8; cb += 8; cr += 8;
   96|  10.1k|        r += 8; g += 8; b += 8;
   97|  10.1k|      }
   98|  4.07k|    }

_ZN4ojph5local16avx2_rev_convertEPKNS_8line_bufEjPS1_jlj:
   75|  2.51M|    {
   76|  2.51M|      if (src_line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (76:11): [True: 2.08M, False: 429k]
  ------------------
   77|  2.08M|      {
   78|  2.08M|        if (dst_line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (78:13): [True: 2.08M, False: 0]
  ------------------
   79|  2.08M|        {
   80|  2.08M|          const si32 *sp = src_line->i32 + src_line_offset;
   81|  2.08M|          si32 *dp = dst_line->i32 + dst_line_offset;
   82|  2.08M|          __m256i sh = _mm256_set1_epi32((si32)shift);
   83|  11.4M|          for (int i = (width + 7) >> 3; i > 0; --i, sp+=8, dp+=8)
  ------------------
  |  Branch (83:42): [True: 9.41M, False: 2.08M]
  ------------------
   84|  9.41M|          {
   85|  9.41M|            __m256i s = _mm256_loadu_si256((__m256i*)sp);
   86|  9.41M|            s = _mm256_add_epi32(s, sh);
   87|  9.41M|            _mm256_storeu_si256((__m256i*)dp, s);
   88|  9.41M|          }
   89|  2.08M|        }
   90|      0|        else
   91|      0|        {
   92|      0|          const si32 *sp = src_line->i32 + src_line_offset;
   93|      0|          si64 *dp = dst_line->i64 + dst_line_offset;
   94|      0|          __m256i sh = _mm256_set1_epi64x(shift);
   95|      0|          for (int i = (width + 7) >> 3; i > 0; --i, sp+=8, dp+=8)
  ------------------
  |  Branch (95:42): [True: 0, False: 0]
  ------------------
   96|      0|          {
   97|      0|            __m256i s, t;
   98|      0|            s = _mm256_loadu_si256((__m256i*)sp);
   99|       |
  100|      0|            t = _mm256_cvtepi32_epi64(_mm256_extracti128_si256(s, 0));
  101|      0|            t = _mm256_add_epi64(t, sh);
  102|      0|            _mm256_storeu_si256((__m256i*)dp, t);
  103|       |
  104|      0|            t = _mm256_cvtepi32_epi64(_mm256_extracti128_si256(s, 1));
  105|      0|            t = _mm256_add_epi64(t, sh);
  106|      0|            _mm256_storeu_si256((__m256i*)dp + 1, t);
  107|      0|          }
  108|      0|        }
  109|  2.08M|      }
  110|   429k|      else
  111|   429k|      {
  112|   429k|        assert(src_line->flags | line_buf::LFT_64BIT);
  113|   429k|        assert(dst_line->flags | line_buf::LFT_32BIT);
  114|   429k|        const si64 *sp = src_line->i64 + src_line_offset;
  115|   429k|        si32 *dp = dst_line->i32 + dst_line_offset;
  116|   429k|        __m256i low_bits = _mm256_set_epi64x(0, (si64)ULLONG_MAX,
  117|   429k|                                             0, (si64)ULLONG_MAX);
  118|   429k|        __m256i sh = _mm256_set1_epi64x(shift);
  119|  5.19M|        for (int i = (width + 7) >> 3; i > 0; --i, sp+=8, dp+=8)
  ------------------
  |  Branch (119:40): [True: 4.76M, False: 429k]
  ------------------
  120|  4.76M|        {
  121|  4.76M|          __m256i s, t;
  122|  4.76M|          s = _mm256_loadu_si256((__m256i*)sp);
  123|  4.76M|          s = _mm256_add_epi64(s, sh);
  124|       |
  125|  4.76M|          t = _mm256_shuffle_epi32(s, _MM_SHUFFLE(0, 0, 2, 0));
  126|  4.76M|          t = _mm256_and_si256(low_bits, t);
  127|       |
  128|  4.76M|          s = _mm256_loadu_si256((__m256i*)sp + 1);
  129|  4.76M|          s = _mm256_add_epi64(s, sh);
  130|       |
  131|  4.76M|          s = _mm256_shuffle_epi32(s, _MM_SHUFFLE(2, 0, 0, 0));
  132|  4.76M|          s = _mm256_andnot_si256(low_bits, s);
  133|       |
  134|  4.76M|          t = _mm256_or_si256(s, t);
  135|       |          t = _mm256_permute4x64_epi64(t, _MM_SHUFFLE(3, 1, 2, 0));
  136|  4.76M|          _mm256_storeu_si256((__m256i*)dp, t);
  137|  4.76M|        }
  138|   429k|      }
  139|  2.51M|    }
_ZN4ojph5local26avx2_rev_convert_nlt_type3EPKNS_8line_bufEjPS1_jlj:
  147|  43.5k|    {
  148|  43.5k|      if (src_line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (148:11): [True: 719, False: 42.8k]
  ------------------
  149|    719|      {
  150|    719|        if (dst_line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (150:13): [True: 719, False: 0]
  ------------------
  151|    719|        {
  152|    719|          const si32 *sp = src_line->i32 + src_line_offset;
  153|    719|          si32 *dp = dst_line->i32 + dst_line_offset;
  154|    719|          __m256i sh = _mm256_set1_epi32((si32)(-shift));
  155|    719|          __m256i zero = _mm256_setzero_si256();
  156|  22.9k|          for (int i = (width + 7) >> 3; i > 0; --i, sp += 8, dp += 8)
  ------------------
  |  Branch (156:42): [True: 22.1k, False: 719]
  ------------------
  157|  22.1k|          {
  158|  22.1k|            __m256i s = _mm256_loadu_si256((__m256i*)sp);
  159|  22.1k|            __m256i c = _mm256_cmpgt_epi32(zero, s);  // 0xFFFFFFFF for -ve val
  160|  22.1k|            __m256i v_m_sh = _mm256_sub_epi32(sh, s); // - shift - value
  161|  22.1k|            v_m_sh = _mm256_and_si256(c, v_m_sh);     // keep only -shift-val
  162|  22.1k|            s = _mm256_andnot_si256(c, s);            // keep only +ve or 0
  163|  22.1k|            s = _mm256_or_si256(s, v_m_sh);           // combine
  164|  22.1k|            _mm256_storeu_si256((__m256i*)dp, s);
  165|  22.1k|          }
  166|    719|        }
  167|      0|        else
  168|      0|        {
  169|      0|          const si32 *sp = src_line->i32 + src_line_offset;
  170|      0|          si64 *dp = dst_line->i64 + dst_line_offset;
  171|      0|          __m256i sh = _mm256_set1_epi64x(-shift);
  172|      0|          __m256i zero = _mm256_setzero_si256();
  173|      0|          for (int i = (width + 7) >> 3; i > 0; --i, sp += 8, dp += 8)
  ------------------
  |  Branch (173:42): [True: 0, False: 0]
  ------------------
  174|      0|          {
  175|      0|            __m256i s, t, u0, u1, c, v_m_sh;
  176|      0|            s = _mm256_loadu_si256((__m256i*)sp);
  177|       |
  178|      0|            t = _mm256_cmpgt_epi32(zero, s);      // find -ve 32bit -1
  179|      0|            u0 = _mm256_unpacklo_epi32(s, t);     // correct 64bit data
  180|      0|            c = _mm256_unpacklo_epi32(t, t);      // 64bit -1 for -ve value
  181|       |
  182|      0|            v_m_sh = _mm256_sub_epi64(sh, u0);    // - shift - value
  183|      0|            v_m_sh = _mm256_and_si256(c, v_m_sh); // keep only - shift - value
  184|      0|            u0 = _mm256_andnot_si256(c, u0);      // keep only +ve or 0
  185|      0|            u0 = _mm256_or_si256(u0, v_m_sh);     // combine
  186|       |
  187|      0|            u1 = _mm256_unpackhi_epi32(s, t);     // correct 64bit data
  188|      0|            c = _mm256_unpackhi_epi32(t, t);      // 64bit -1 for -ve value
  189|       |
  190|      0|            v_m_sh = _mm256_sub_epi64(sh, u1);    // - shift - value
  191|      0|            v_m_sh = _mm256_and_si256(c, v_m_sh); // keep only - shift - value
  192|      0|            u1 = _mm256_andnot_si256(c, u1);      // keep only +ve or 0
  193|      0|            u1 = _mm256_or_si256(u1, v_m_sh);     // combine
  194|       |
  195|      0|            t = _mm256_permute2x128_si256(u0, u1, (2 << 4) | 0);
  196|      0|            _mm256_storeu_si256((__m256i*)dp, t);
  197|       |
  198|      0|            t = _mm256_permute2x128_si256(u0, u1, (3 << 4) | 1);
  199|      0|            _mm256_storeu_si256((__m256i*)dp + 1, t);
  200|      0|          }
  201|      0|        }
  202|    719|      }
  203|  42.8k|      else
  204|  42.8k|      {
  205|  42.8k|        assert(src_line->flags | line_buf::LFT_64BIT);
  206|  42.8k|        assert(dst_line->flags | line_buf::LFT_32BIT);
  207|  42.8k|        const si64 *sp = src_line->i64 + src_line_offset;
  208|  42.8k|        si32 *dp = dst_line->i32 + dst_line_offset;
  209|  42.8k|        __m256i sh = _mm256_set1_epi64x(-shift);
  210|  42.8k|        __m256i zero = _mm256_setzero_si256();
  211|  42.8k|        __m256i half_mask = _mm256_set_epi64x(0, (si64)ULLONG_MAX,
  212|  42.8k|                                              0, (si64)ULLONG_MAX);
  213|   109k|        for (int i = (width + 7) >> 3; i > 0; --i, sp += 8, dp += 8)
  ------------------
  |  Branch (213:40): [True: 67.0k, False: 42.8k]
  ------------------
  214|  67.0k|        {
  215|       |          // s for source, t for target, p for positive, n for negative,
  216|       |          // m for mask, and tm for temp
  217|  67.0k|          __m256i s, t, p, n, m, tm;
  218|  67.0k|          s = _mm256_loadu_si256((__m256i*)sp);
  219|       |
  220|  67.0k|          m = _mm256_cmpgt_epi64(zero, s);    // 64b -1 for -ve value
  221|  67.0k|          tm = _mm256_sub_epi64(sh, s);       // - shift - value
  222|  67.0k|          n = _mm256_and_si256(m, tm);        // -ve
  223|  67.0k|          p = _mm256_andnot_si256(m, s);      // +ve
  224|  67.0k|          tm = _mm256_or_si256(n, p);
  225|  67.0k|          tm = _mm256_shuffle_epi32(tm, _MM_SHUFFLE(0, 0, 2, 0));
  226|  67.0k|          t = _mm256_and_si256(half_mask, tm);
  227|       |
  228|  67.0k|          s = _mm256_loadu_si256((__m256i*)sp + 1);
  229|  67.0k|          m = _mm256_cmpgt_epi64(zero, s);    // 64b -1 for -ve value
  230|  67.0k|          tm = _mm256_sub_epi64(sh, s);       // - shift - value
  231|  67.0k|          n = _mm256_and_si256(m, tm);        // -ve
  232|  67.0k|          p = _mm256_andnot_si256(m, s);      // +ve
  233|  67.0k|          tm = _mm256_or_si256(n, p);
  234|  67.0k|          tm = _mm256_shuffle_epi32(tm, _MM_SHUFFLE(2, 0, 0, 0));
  235|  67.0k|          tm = _mm256_andnot_si256(half_mask, tm);
  236|       |
  237|  67.0k|          t = _mm256_or_si256(t, tm);
  238|       |          t = _mm256_permute4x64_epi64(t, _MM_SHUFFLE(3, 1, 2, 0));
  239|  67.0k|           _mm256_storeu_si256((__m256i*)dp, t);
  240|  67.0k|        }
  241|  42.8k|      }
  242|  43.5k|    }
_ZN4ojph5local27avx2_irv_convert_to_integerEPKNS_8line_bufEPS1_jjbj:
  339|  1.57M|    {
  340|  1.57M|      local_avx2_irv_convert_to_integer<false>(src_line, dst_line,
  341|  1.57M|        dst_line_offset, bit_depth, is_signed, width);
  342|  1.57M|    }
_ZN4ojph5local37avx2_irv_convert_to_integer_nlt_type3EPKNS_8line_bufEPS1_jjbj:
  348|  21.1k|    {
  349|  21.1k|      local_avx2_irv_convert_to_integer<true>(src_line, dst_line,
  350|  21.1k|        dst_line_offset, bit_depth, is_signed, width);
  351|  21.1k|    }
_ZN4ojph5local31avx2_irv_convert_to_integer_nltEPKNS_8line_bufEPS1_jjbjPKNS0_7nlt_recE:
  442|  3.41k|    {
  443|  3.41k|      using nl = nlt_rec::nonlinearity;
  444|  3.41k|      if (rec->get_type() == nl::OJPH_NLT_LUT_STYLE_NLT)
  ------------------
  |  Branch (444:11): [True: 1.98k, False: 1.42k]
  ------------------
  445|  1.98k|        local_avx2_irv_convert_to_integer_nlt2or4<2>(src_line, dst_line,
  446|  1.98k|          dst_line_offset, bit_depth, is_signed, width, rec);
  447|  1.42k|      else if (rec->get_type() == nl::OJPH_NLT_BINARY_COMPLEMENT_PLUS_LUT)
  ------------------
  |  Branch (447:16): [True: 1.42k, False: 0]
  ------------------
  448|  1.42k|        local_avx2_irv_convert_to_integer_nlt2or4<4>(src_line, dst_line,
  449|  1.42k|          dst_line_offset, bit_depth, is_signed, width, rec);
  450|      0|      else
  451|       |        assert(0);
  452|  3.41k|    }
_ZN4ojph5local17avx2_rct_backwardEPKNS_8line_bufES3_S3_PS1_S4_S4_j:
 1008|  8.25k|    {
 1009|  8.25k|      assert((y->flags  & line_buf::LFT_INTEGER) &&
 1010|  8.25k|             (cb->flags & line_buf::LFT_INTEGER) &&
 1011|  8.25k|             (cr->flags & line_buf::LFT_INTEGER) &&
 1012|  8.25k|             (r->flags  & line_buf::LFT_INTEGER) &&
 1013|  8.25k|             (g->flags  & line_buf::LFT_INTEGER) &&
 1014|  8.25k|             (b->flags  & line_buf::LFT_INTEGER));
 1015|       |
 1016|  8.25k|      if (y->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (1016:11): [True: 4.26k, False: 3.98k]
  ------------------
 1017|  4.26k|      {
 1018|  4.26k|        assert((y->flags  & line_buf::LFT_32BIT) &&
 1019|  4.26k|               (cb->flags & line_buf::LFT_32BIT) &&
 1020|  4.26k|               (cr->flags & line_buf::LFT_32BIT) &&
 1021|  4.26k|               (r->flags  & line_buf::LFT_32BIT) &&
 1022|  4.26k|               (g->flags  & line_buf::LFT_32BIT) &&
 1023|  4.26k|               (b->flags  & line_buf::LFT_32BIT));
 1024|  4.26k|        const si32 *yp = y->i32, *cbp = cb->i32, *crp = cr->i32;
 1025|  4.26k|        si32 *rp = r->i32, *gp = g->i32, *bp = b->i32;
 1026|  15.6k|        for (int i = (repeat + 7) >> 3; i > 0; --i)
  ------------------
  |  Branch (1026:41): [True: 11.3k, False: 4.26k]
  ------------------
 1027|  11.3k|        {
 1028|  11.3k|          __m256i my  = _mm256_load_si256((__m256i*)yp);
 1029|  11.3k|          __m256i mcb = _mm256_load_si256((__m256i*)cbp);
 1030|  11.3k|          __m256i mcr = _mm256_load_si256((__m256i*)crp);
 1031|       |
 1032|  11.3k|          __m256i t = _mm256_add_epi32(mcb, mcr);
 1033|  11.3k|          t = _mm256_sub_epi32(my, _mm256_srai_epi32(t, 2));
 1034|  11.3k|          _mm256_store_si256((__m256i*)gp, t);
 1035|  11.3k|          __m256i u = _mm256_add_epi32(mcb, t);
 1036|  11.3k|          _mm256_store_si256((__m256i*)bp, u);
 1037|  11.3k|          u = _mm256_add_epi32(mcr, t);
 1038|  11.3k|          _mm256_store_si256((__m256i*)rp, u);
 1039|       |
 1040|  11.3k|          yp += 8; cbp += 8; crp += 8;
 1041|  11.3k|          rp += 8; gp += 8; bp += 8;
 1042|  11.3k|        }
 1043|  4.26k|      }
 1044|  3.98k|      else
 1045|  3.98k|      {
 1046|  3.98k|        assert((y->flags  & line_buf::LFT_64BIT) &&
 1047|  3.98k|               (cb->flags & line_buf::LFT_64BIT) &&
 1048|  3.98k|               (cr->flags & line_buf::LFT_64BIT) &&
 1049|  3.98k|               (r->flags  & line_buf::LFT_32BIT) &&
 1050|  3.98k|               (g->flags  & line_buf::LFT_32BIT) &&
 1051|  3.98k|               (b->flags  & line_buf::LFT_32BIT));
 1052|  3.98k|        __m256i v2 = _mm256_set1_epi64x(1ULL << (63 - 2));
 1053|  3.98k|        __m256i low_bits = _mm256_set_epi64x(0, (si64)ULLONG_MAX,
 1054|  3.98k|                                             0, (si64)ULLONG_MAX);
 1055|  3.98k|        const si64 *yp = y->i64, *cbp = cb->i64, *crp = cr->i64;
 1056|  3.98k|        si32 *rp = r->i32, *gp = g->i32, *bp = b->i32;
 1057|  10.2k|        for (int i = (repeat + 7) >> 3; i > 0; --i)
  ------------------
  |  Branch (1057:41): [True: 6.29k, False: 3.98k]
  ------------------
 1058|  6.29k|        {
 1059|  6.29k|          __m256i my, mcb, mcr, tr, tg, tb;
 1060|  6.29k|          my  = _mm256_load_si256((__m256i*)yp);
 1061|  6.29k|          mcb = _mm256_load_si256((__m256i*)cbp);
 1062|  6.29k|          mcr = _mm256_load_si256((__m256i*)crp);
 1063|       |
 1064|  6.29k|          tg = _mm256_add_epi64(mcb, mcr);
 1065|  6.29k|          tg = _mm256_sub_epi64(my, avx2_mm256_srai_epi64(tg, 2, v2));
 1066|  6.29k|          tb = _mm256_add_epi64(mcb, tg);
 1067|  6.29k|          tr = _mm256_add_epi64(mcr, tg);
 1068|       |
 1069|  6.29k|          __m256i mr, mg, mb;
 1070|  6.29k|          mr = _mm256_shuffle_epi32(tr, _MM_SHUFFLE(0, 0, 2, 0));
 1071|  6.29k|          mr = _mm256_and_si256(low_bits, mr);
 1072|  6.29k|          mg = _mm256_shuffle_epi32(tg, _MM_SHUFFLE(0, 0, 2, 0));
 1073|  6.29k|          mg = _mm256_and_si256(low_bits, mg);
 1074|  6.29k|          mb = _mm256_shuffle_epi32(tb, _MM_SHUFFLE(0, 0, 2, 0));
 1075|  6.29k|          mb = _mm256_and_si256(low_bits, mb);
 1076|       |
 1077|  6.29k|          yp += 4; cbp += 4; crp += 4;
 1078|       |
 1079|  6.29k|          my  = _mm256_load_si256((__m256i*)yp);
 1080|  6.29k|          mcb = _mm256_load_si256((__m256i*)cbp);
 1081|  6.29k|          mcr = _mm256_load_si256((__m256i*)crp);
 1082|       |
 1083|  6.29k|          tg = _mm256_add_epi64(mcb, mcr);
 1084|  6.29k|          tg = _mm256_sub_epi64(my, avx2_mm256_srai_epi64(tg, 2, v2));
 1085|  6.29k|          tb = _mm256_add_epi64(mcb, tg);
 1086|  6.29k|          tr = _mm256_add_epi64(mcr, tg);
 1087|       |
 1088|  6.29k|          tr = _mm256_shuffle_epi32(tr, _MM_SHUFFLE(2, 0, 0, 0));
 1089|  6.29k|          tr = _mm256_andnot_si256(low_bits, tr);
 1090|  6.29k|          mr = _mm256_or_si256(mr, tr);
 1091|  6.29k|          mr = _mm256_permute4x64_epi64(mr, _MM_SHUFFLE(3, 1, 2, 0));
 1092|       |
 1093|  6.29k|          tg = _mm256_shuffle_epi32(tg, _MM_SHUFFLE(2, 0, 0, 0));
 1094|  6.29k|          tg = _mm256_andnot_si256(low_bits, tg);
 1095|  6.29k|          mg = _mm256_or_si256(mg, tg);
 1096|  6.29k|          mg = _mm256_permute4x64_epi64(mg, _MM_SHUFFLE(3, 1, 2, 0));
 1097|       |
 1098|  6.29k|          tb = _mm256_shuffle_epi32(tb, _MM_SHUFFLE(2, 0, 0, 0));
 1099|  6.29k|          tb = _mm256_andnot_si256(low_bits, tb);
 1100|  6.29k|          mb = _mm256_or_si256(mb, tb);
 1101|  6.29k|          mb = _mm256_permute4x64_epi64(mb, _MM_SHUFFLE(3, 1, 2, 0));
 1102|       |
 1103|  6.29k|          _mm256_store_si256((__m256i*)rp, mr);
 1104|  6.29k|          _mm256_store_si256((__m256i*)gp, mg);
 1105|  6.29k|          _mm256_store_si256((__m256i*)bp, mb);
 1106|       |
 1107|  6.29k|          yp += 4; cbp += 4; crp += 4;
 1108|  6.29k|          rp += 8; gp += 8; bp += 8;
 1109|  6.29k|        }
 1110|  3.98k|      }
 1111|  8.25k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL21avx2_mm256_srai_epi64EDv4_xiS1_:
   60|  12.5k|    {
   61|       |      // note than m must be obtained using
   62|       |      // __m256i m = _mm256_set1_epi64x(1ULL << (63 - amt));
   63|  12.5k|      __m256i x = _mm256_srli_epi64(a, amt);
   64|  12.5k|      x = _mm256_xor_si256(x, m);
   65|  12.5k|      __m256i result = _mm256_sub_epi64(x, m);
   66|  12.5k|      return result;
   67|  12.5k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL33local_avx2_irv_convert_to_integerILb0EEEvPKNS_8line_bufEPS2_jjbj:
  276|  1.57M|    {
  277|  1.57M|      assert((src_line->flags & line_buf::LFT_32BIT) &&
  278|  1.57M|             (src_line->flags & line_buf::LFT_INTEGER) == 0 &&
  279|  1.57M|             (dst_line->flags & line_buf::LFT_32BIT) &&
  280|  1.57M|             (dst_line->flags & line_buf::LFT_INTEGER));
  281|       |
  282|  1.57M|      assert(bit_depth <= 32);
  283|  1.57M|      const float* sp = src_line->f32;
  284|  1.57M|      si32* dp = dst_line->i32 + dst_line_offset;
  285|       |      // There is the possibility that converting to integer will
  286|       |      // exceed the dynamic range of 32bit integer; therefore, care must be
  287|       |      // exercised.
  288|       |      // We look if the floating point number is outside the half-closed
  289|       |      // interval [-0.5f, 0.5f). If so, we limit the resulting integer
  290|       |      // to the maximum/minimum that number supports.
  291|  1.57M|      si32 neg_limit = (si32)INT_MIN >> (32 - bit_depth);
  292|  1.57M|      __m256 mul = _mm256_set1_ps((float)(1ull << bit_depth));
  293|  1.57M|      __m256 fl_up_lim = _mm256_set1_ps(-(float)neg_limit);  // val < upper
  294|  1.57M|      __m256 fl_low_lim = _mm256_set1_ps((float)neg_limit);  // val >= lower
  295|  1.57M|      __m256i s32_up_lim = _mm256_set1_epi32(INT_MAX >> (32 - bit_depth));
  296|  1.57M|      __m256i s32_low_lim = _mm256_set1_epi32(INT_MIN >> (32 - bit_depth));
  297|       |
  298|  1.57M|      if (is_signed)
  ------------------
  |  Branch (298:11): [True: 8.56k, False: 1.56M]
  ------------------
  299|  8.56k|      {
  300|  8.56k|        __m256i zero = _mm256_setzero_si256();
  301|  8.56k|        __m256i bias =
  302|  8.56k|          _mm256_set1_epi32(-(si32)((1ULL << (bit_depth - 1)) + 1));
  303|   131k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (303:34): [True: 122k, False: 8.56k]
  ------------------
  304|   122k|          __m256 t = _mm256_loadu_ps(sp);
  305|   122k|          t = _mm256_mul_ps(t, mul);
  306|   122k|          __m256i u = _mm256_cvtps_epi32(t);
  307|   122k|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  308|   122k|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  309|   122k|          if (NLT_TYPE3)
  ------------------
  |  Branch (309:15): [Folded, False: 122k]
  ------------------
  310|      0|          {
  311|      0|            __m256i c = _mm256_cmpgt_epi32(zero, u); // 0xFFFFFFFF for -ve val
  312|      0|            __m256i neg = _mm256_sub_epi32(bias, u); // -bias -value
  313|      0|            neg = _mm256_and_si256(c, neg);          // keep only - bias - val
  314|      0|            u = _mm256_andnot_si256(c, u);           // keep only +ve or 0
  315|      0|            u = _mm256_or_si256(neg, u);             // combine
  316|      0|          }
  317|   122k|          _mm256_storeu_si256((__m256i*)dp, u);
  318|   122k|        }
  319|  8.56k|      }
  320|  1.56M|      else
  321|  1.56M|      {
  322|  1.56M|        __m256i half = _mm256_set1_epi32((si32)(1ULL << (bit_depth - 1)));
  323|  7.09M|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (323:34): [True: 5.52M, False: 1.56M]
  ------------------
  324|  5.52M|          __m256 t = _mm256_loadu_ps(sp);
  325|  5.52M|          t = _mm256_mul_ps(t, mul);
  326|  5.52M|          __m256i u = _mm256_cvtps_epi32(t);
  327|  5.52M|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  328|  5.52M|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  329|  5.52M|          u = _mm256_add_epi32(u, half);
  330|  5.52M|          _mm256_storeu_si256((__m256i*)dp, u);
  331|  5.52M|        }
  332|  1.56M|      }
  333|  1.57M|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL23ojph_mm256_max_ge_epi32EDv4_xS1_Dv8_fS2_:
  247|  5.75M|    {
  248|       |      // We must use _CMP_NLT_UQ or _CMP_GE_OQ, _CMP_GE_OS, or _CMP_NLT_US
  249|       |      // It is not clear to me which to use
  250|       |      __m256 ct = _mm256_cmp_ps(x, y, _CMP_NLT_UQ); // 0xFFFFFFFF for x >= y
  251|  5.75M|      __m256i c = _mm256_castps_si256(ct);   // does not generate any code
  252|  5.75M|      __m256i d = _mm256_and_si256(c, a);    // keep only a, where x >= y
  253|  5.75M|      __m256i e = _mm256_andnot_si256(c, b); // keep only b, where x <  y
  254|  5.75M|      return _mm256_or_si256(d, e);          // combine
  255|  5.75M|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL23ojph_mm256_min_lt_epi32EDv4_xS1_Dv8_fS2_:
  260|  5.75M|    {
  261|       |      // We must use _CMP_LT_OQ or _CMP_NGE_UQ, _CMP_LT_OS, or _CMP_NGE_US
  262|       |      // It is not clear to me which to use
  263|       |      __m256 ct = _mm256_cmp_ps(x, y, _CMP_NGE_UQ); // 0xFFFFFFFF for x < y
  264|  5.75M|      __m256i c = _mm256_castps_si256(ct);   // does not generate any code
  265|  5.75M|      __m256i d = _mm256_and_si256(c, a);    // keep only a, where x <  y
  266|  5.75M|      __m256i e = _mm256_andnot_si256(c, b); // keep only b, where x >= y
  267|  5.75M|      return _mm256_or_si256(d, e);          // combine
  268|  5.75M|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL33local_avx2_irv_convert_to_integerILb1EEEvPKNS_8line_bufEPS2_jjbj:
  276|  21.1k|    {
  277|  21.1k|      assert((src_line->flags & line_buf::LFT_32BIT) &&
  278|  21.1k|             (src_line->flags & line_buf::LFT_INTEGER) == 0 &&
  279|  21.1k|             (dst_line->flags & line_buf::LFT_32BIT) &&
  280|  21.1k|             (dst_line->flags & line_buf::LFT_INTEGER));
  281|       |
  282|  21.1k|      assert(bit_depth <= 32);
  283|  21.1k|      const float* sp = src_line->f32;
  284|  21.1k|      si32* dp = dst_line->i32 + dst_line_offset;
  285|       |      // There is the possibility that converting to integer will
  286|       |      // exceed the dynamic range of 32bit integer; therefore, care must be
  287|       |      // exercised.
  288|       |      // We look if the floating point number is outside the half-closed
  289|       |      // interval [-0.5f, 0.5f). If so, we limit the resulting integer
  290|       |      // to the maximum/minimum that number supports.
  291|  21.1k|      si32 neg_limit = (si32)INT_MIN >> (32 - bit_depth);
  292|  21.1k|      __m256 mul = _mm256_set1_ps((float)(1ull << bit_depth));
  293|  21.1k|      __m256 fl_up_lim = _mm256_set1_ps(-(float)neg_limit);  // val < upper
  294|  21.1k|      __m256 fl_low_lim = _mm256_set1_ps((float)neg_limit);  // val >= lower
  295|  21.1k|      __m256i s32_up_lim = _mm256_set1_epi32(INT_MAX >> (32 - bit_depth));
  296|  21.1k|      __m256i s32_low_lim = _mm256_set1_epi32(INT_MIN >> (32 - bit_depth));
  297|       |
  298|  21.1k|      if (is_signed)
  ------------------
  |  Branch (298:11): [True: 17.2k, False: 3.92k]
  ------------------
  299|  17.2k|      {
  300|  17.2k|        __m256i zero = _mm256_setzero_si256();
  301|  17.2k|        __m256i bias =
  302|  17.2k|          _mm256_set1_epi32(-(si32)((1ULL << (bit_depth - 1)) + 1));
  303|  62.4k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (303:34): [True: 45.2k, False: 17.2k]
  ------------------
  304|  45.2k|          __m256 t = _mm256_loadu_ps(sp);
  305|  45.2k|          t = _mm256_mul_ps(t, mul);
  306|  45.2k|          __m256i u = _mm256_cvtps_epi32(t);
  307|  45.2k|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  308|  45.2k|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  309|  45.2k|          if (NLT_TYPE3)
  ------------------
  |  Branch (309:15): [True: 45.2k, Folded]
  ------------------
  310|  45.2k|          {
  311|  45.2k|            __m256i c = _mm256_cmpgt_epi32(zero, u); // 0xFFFFFFFF for -ve val
  312|  45.2k|            __m256i neg = _mm256_sub_epi32(bias, u); // -bias -value
  313|  45.2k|            neg = _mm256_and_si256(c, neg);          // keep only - bias - val
  314|  45.2k|            u = _mm256_andnot_si256(c, u);           // keep only +ve or 0
  315|  45.2k|            u = _mm256_or_si256(neg, u);             // combine
  316|  45.2k|          }
  317|  45.2k|          _mm256_storeu_si256((__m256i*)dp, u);
  318|  45.2k|        }
  319|  17.2k|      }
  320|  3.92k|      else
  321|  3.92k|      {
  322|  3.92k|        __m256i half = _mm256_set1_epi32((si32)(1ULL << (bit_depth - 1)));
  323|  68.1k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (323:34): [True: 64.2k, False: 3.92k]
  ------------------
  324|  64.2k|          __m256 t = _mm256_loadu_ps(sp);
  325|  64.2k|          t = _mm256_mul_ps(t, mul);
  326|  64.2k|          __m256i u = _mm256_cvtps_epi32(t);
  327|  64.2k|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  328|  64.2k|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  329|  64.2k|          u = _mm256_add_epi32(u, half);
  330|  64.2k|          _mm256_storeu_si256((__m256i*)dp, u);
  331|  64.2k|        }
  332|  3.92k|      }
  333|  21.1k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL41local_avx2_irv_convert_to_integer_nlt2or4ILi2EEEvPKNS_8line_bufEPS2_jjbjPKNS0_7nlt_recE:
  359|  1.98k|    {
  360|  1.98k|      assert((src_line->flags & line_buf::LFT_32BIT) &&
  361|  1.98k|             (src_line->flags & line_buf::LFT_INTEGER) == 0 &&
  362|  1.98k|             (dst_line->flags & line_buf::LFT_32BIT) &&
  363|  1.98k|             (dst_line->flags & line_buf::LFT_INTEGER));
  364|  1.98k|      ojph_unused(bit_depth);
  ------------------
  |  |   78|  1.98k|#define ojph_unused(x) (void)(x)
  ------------------
  365|  1.98k|      ojph_unused(is_signed);
  ------------------
  |  |   78|  1.98k|#define ojph_unused(x) (void)(x)
  ------------------
  366|       |
  367|  1.98k|      assert(rec->get_bit_depth() <= 32);
  368|  1.98k|      const float* sp = src_line->f32;
  369|  1.98k|      si32* dp = dst_line->i32 + dst_line_offset;
  370|       |
  371|  1.98k|      __m256 mul = _mm256_set1_ps(rec->multiplier);
  372|  1.98k|      __m256 fd_min = _mm256_set1_ps(rec->fd_min);
  373|  1.98k|      __m256 fd_max = _mm256_set1_ps(rec->fd_max);
  374|  1.98k|      __m256 delta = _mm256_set1_ps(rec->delta);
  375|  1.98k|      __m256 inv_delta = _mm256_set1_ps(rec->inv_delta);
  376|  1.98k|      const float* lut = rec->dec_points;
  377|       |
  378|  1.98k|      __m256 half_ps = _mm256_set1_ps(0.5f);
  379|  1.98k|      __m256i one = _mm256_set1_epi32(1);
  380|       |
  381|  1.98k|      if (rec->is_signed())
  ------------------
  |  Branch (381:11): [True: 1.58k, False: 405]
  ------------------
  382|  1.58k|      {
  383|  1.58k|        __m256 half =
  384|  1.58k|          _mm256_set1_ps((float)(1ULL << (rec->get_bit_depth() - 1)));
  385|  1.58k|        __m256i bias =
  386|  1.58k|          _mm256_set1_epi32(-(si32)((1ULL << (rec->get_bit_depth() - 1)) + 1));
  387|  1.58k|        __m256i zero = _mm256_setzero_si256();
  388|  40.3k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (388:34): [True: 38.7k, False: 1.58k]
  ------------------
  389|  38.7k|          __m256 t = _mm256_loadu_ps(sp);
  390|  38.7k|          t = _mm256_add_ps(t, half_ps);                 // convert to [0, 1]
  391|  38.7k|          t = _mm256_max_ps(t, fd_min);
  392|  38.7k|          t = _mm256_min_ps(t, fd_max);
  393|  38.7k|          __m256i k = _mm256_cvttps_epi32(
  394|  38.7k|            _mm256_mul_ps(_mm256_sub_ps(t, fd_min), inv_delta));
  395|  38.7k|          __m256 d_k = _mm256_add_ps(fd_min,
  396|  38.7k|            _mm256_mul_ps(_mm256_cvtepi32_ps(k), delta));
  397|  38.7k|          __m256 t_k = _mm256_i32gather_ps(lut, k, 4);
  398|  38.7k|          __m256 t_kp1 = _mm256_i32gather_ps(lut, _mm256_add_epi32(k, one), 4);
  399|  38.7k|          __m256 z = _mm256_add_ps(t_k,
  400|  38.7k|            _mm256_mul_ps(_mm256_mul_ps(_mm256_sub_ps(t, d_k), inv_delta),
  401|  38.7k|              _mm256_sub_ps(t_kp1, t_k)));
  402|  38.7k|          __m256i v =
  403|  38.7k|            _mm256_cvtps_epi32(_mm256_sub_ps(_mm256_mul_ps(z, mul), half));
  404|  38.7k|          if (NLT_TYPE == 4)
  ------------------
  |  Branch (404:15): [Folded, False: 38.7k]
  ------------------
  405|      0|          {
  406|      0|            __m256i c = _mm256_cmpgt_epi32(zero, v); // 0xFFFFFFFF for -ve val
  407|      0|            __m256i neg = _mm256_sub_epi32(bias, v); // - bias - value
  408|      0|            neg = _mm256_and_si256(c, neg);          // keep only - bias - val
  409|      0|            v = _mm256_andnot_si256(c, v);           // keep only +ve or 0
  410|      0|            v = _mm256_or_si256(neg, v);             // combine
  411|      0|          }
  412|  38.7k|          _mm256_storeu_si256((__m256i*)dp, v);
  413|  38.7k|        }
  414|  1.58k|      }
  415|    405|      else
  416|    405|      {
  417|  17.1k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (417:34): [True: 16.7k, False: 405]
  ------------------
  418|  16.7k|          __m256 t = _mm256_loadu_ps(sp);
  419|  16.7k|          t = _mm256_add_ps(t, half_ps);                 // convert to [0, 1]
  420|  16.7k|          t = _mm256_max_ps(t, fd_min);
  421|  16.7k|          t = _mm256_min_ps(t, fd_max);
  422|  16.7k|          __m256i k = _mm256_cvttps_epi32(
  423|  16.7k|            _mm256_mul_ps(_mm256_sub_ps(t, fd_min), inv_delta));
  424|  16.7k|          __m256 d_k = _mm256_add_ps(fd_min,
  425|  16.7k|            _mm256_mul_ps(_mm256_cvtepi32_ps(k), delta));
  426|  16.7k|          __m256 t_k = _mm256_i32gather_ps(lut, k, 4);
  427|  16.7k|          __m256 t_kp1 =
  428|       |            _mm256_i32gather_ps(lut, _mm256_add_epi32(k, one), 4);
  429|  16.7k|          __m256 z = _mm256_add_ps(t_k,
  430|  16.7k|            _mm256_mul_ps(_mm256_mul_ps(_mm256_sub_ps(t, d_k), inv_delta),
  431|  16.7k|              _mm256_sub_ps(t_kp1, t_k)));
  432|  16.7k|          __m256i v = _mm256_cvtps_epi32(_mm256_mul_ps(z, mul));
  433|  16.7k|          _mm256_storeu_si256((__m256i*)dp, v);
  434|  16.7k|        }
  435|    405|      }
  436|  1.98k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL41local_avx2_irv_convert_to_integer_nlt2or4ILi4EEEvPKNS_8line_bufEPS2_jjbjPKNS0_7nlt_recE:
  359|  1.42k|    {
  360|  1.42k|      assert((src_line->flags & line_buf::LFT_32BIT) &&
  361|  1.42k|             (src_line->flags & line_buf::LFT_INTEGER) == 0 &&
  362|  1.42k|             (dst_line->flags & line_buf::LFT_32BIT) &&
  363|  1.42k|             (dst_line->flags & line_buf::LFT_INTEGER));
  364|  1.42k|      ojph_unused(bit_depth);
  ------------------
  |  |   78|  1.42k|#define ojph_unused(x) (void)(x)
  ------------------
  365|  1.42k|      ojph_unused(is_signed);
  ------------------
  |  |   78|  1.42k|#define ojph_unused(x) (void)(x)
  ------------------
  366|       |
  367|  1.42k|      assert(rec->get_bit_depth() <= 32);
  368|  1.42k|      const float* sp = src_line->f32;
  369|  1.42k|      si32* dp = dst_line->i32 + dst_line_offset;
  370|       |
  371|  1.42k|      __m256 mul = _mm256_set1_ps(rec->multiplier);
  372|  1.42k|      __m256 fd_min = _mm256_set1_ps(rec->fd_min);
  373|  1.42k|      __m256 fd_max = _mm256_set1_ps(rec->fd_max);
  374|  1.42k|      __m256 delta = _mm256_set1_ps(rec->delta);
  375|  1.42k|      __m256 inv_delta = _mm256_set1_ps(rec->inv_delta);
  376|  1.42k|      const float* lut = rec->dec_points;
  377|       |
  378|  1.42k|      __m256 half_ps = _mm256_set1_ps(0.5f);
  379|  1.42k|      __m256i one = _mm256_set1_epi32(1);
  380|       |
  381|  1.42k|      if (rec->is_signed())
  ------------------
  |  Branch (381:11): [True: 755, False: 669]
  ------------------
  382|    755|      {
  383|    755|        __m256 half =
  384|    755|          _mm256_set1_ps((float)(1ULL << (rec->get_bit_depth() - 1)));
  385|    755|        __m256i bias =
  386|    755|          _mm256_set1_epi32(-(si32)((1ULL << (rec->get_bit_depth() - 1)) + 1));
  387|    755|        __m256i zero = _mm256_setzero_si256();
  388|  12.1k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (388:34): [True: 11.3k, False: 755]
  ------------------
  389|  11.3k|          __m256 t = _mm256_loadu_ps(sp);
  390|  11.3k|          t = _mm256_add_ps(t, half_ps);                 // convert to [0, 1]
  391|  11.3k|          t = _mm256_max_ps(t, fd_min);
  392|  11.3k|          t = _mm256_min_ps(t, fd_max);
  393|  11.3k|          __m256i k = _mm256_cvttps_epi32(
  394|  11.3k|            _mm256_mul_ps(_mm256_sub_ps(t, fd_min), inv_delta));
  395|  11.3k|          __m256 d_k = _mm256_add_ps(fd_min,
  396|  11.3k|            _mm256_mul_ps(_mm256_cvtepi32_ps(k), delta));
  397|  11.3k|          __m256 t_k = _mm256_i32gather_ps(lut, k, 4);
  398|  11.3k|          __m256 t_kp1 = _mm256_i32gather_ps(lut, _mm256_add_epi32(k, one), 4);
  399|  11.3k|          __m256 z = _mm256_add_ps(t_k,
  400|  11.3k|            _mm256_mul_ps(_mm256_mul_ps(_mm256_sub_ps(t, d_k), inv_delta),
  401|  11.3k|              _mm256_sub_ps(t_kp1, t_k)));
  402|  11.3k|          __m256i v =
  403|  11.3k|            _mm256_cvtps_epi32(_mm256_sub_ps(_mm256_mul_ps(z, mul), half));
  404|  11.3k|          if (NLT_TYPE == 4)
  ------------------
  |  Branch (404:15): [True: 11.3k, Folded]
  ------------------
  405|  11.3k|          {
  406|  11.3k|            __m256i c = _mm256_cmpgt_epi32(zero, v); // 0xFFFFFFFF for -ve val
  407|  11.3k|            __m256i neg = _mm256_sub_epi32(bias, v); // - bias - value
  408|  11.3k|            neg = _mm256_and_si256(c, neg);          // keep only - bias - val
  409|  11.3k|            v = _mm256_andnot_si256(c, v);           // keep only +ve or 0
  410|  11.3k|            v = _mm256_or_si256(neg, v);             // combine
  411|  11.3k|          }
  412|  11.3k|          _mm256_storeu_si256((__m256i*)dp, v);
  413|  11.3k|        }
  414|    755|      }
  415|    669|      else
  416|    669|      {
  417|  43.8k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (417:34): [True: 43.1k, False: 669]
  ------------------
  418|  43.1k|          __m256 t = _mm256_loadu_ps(sp);
  419|  43.1k|          t = _mm256_add_ps(t, half_ps);                 // convert to [0, 1]
  420|  43.1k|          t = _mm256_max_ps(t, fd_min);
  421|  43.1k|          t = _mm256_min_ps(t, fd_max);
  422|  43.1k|          __m256i k = _mm256_cvttps_epi32(
  423|  43.1k|            _mm256_mul_ps(_mm256_sub_ps(t, fd_min), inv_delta));
  424|  43.1k|          __m256 d_k = _mm256_add_ps(fd_min,
  425|  43.1k|            _mm256_mul_ps(_mm256_cvtepi32_ps(k), delta));
  426|  43.1k|          __m256 t_k = _mm256_i32gather_ps(lut, k, 4);
  427|  43.1k|          __m256 t_kp1 =
  428|       |            _mm256_i32gather_ps(lut, _mm256_add_epi32(k, one), 4);
  429|  43.1k|          __m256 z = _mm256_add_ps(t_k,
  430|  43.1k|            _mm256_mul_ps(_mm256_mul_ps(_mm256_sub_ps(t, d_k), inv_delta),
  431|  43.1k|              _mm256_sub_ps(t_kp1, t_k)));
  432|  43.1k|          __m256i v = _mm256_cvtps_epi32(_mm256_mul_ps(z, mul));
  433|  43.1k|          _mm256_storeu_si256((__m256i*)dp, v);
  434|  43.1k|        }
  435|    669|      }
  436|  1.42k|    }

_ZN4ojph5local32init_wavelet_transform_functionsEv:
   99|  9.05k|    {
  100|  9.05k|      static std::once_flag wavelet_transform_functions_init_flag;
  101|  9.05k|      std::call_once(wavelet_transform_functions_init_flag, [](){
  102|  9.05k|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  103|       |
  104|  9.05k|        rev_vert_step             = gen_rev_vert_step;
  105|  9.05k|        rev_horz_ana              = gen_rev_horz_ana;
  106|  9.05k|        rev_horz_syn              = gen_rev_horz_syn;
  107|       |
  108|  9.05k|        irv_vert_step             = gen_irv_vert_step;
  109|  9.05k|        irv_vert_times_K          = gen_irv_vert_times_K;
  110|  9.05k|        irv_horz_ana              = gen_irv_horz_ana;
  111|  9.05k|        irv_horz_syn              = gen_irv_horz_syn;
  112|       |
  113|  9.05k|  #ifndef OJPH_DISABLE_SIMD
  114|       |
  115|  9.05k|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  116|       |
  117|  9.05k|      #ifndef OJPH_DISABLE_SSE
  118|  9.05k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  119|  9.05k|        {
  120|  9.05k|          irv_vert_step             = sse_irv_vert_step;
  121|  9.05k|          irv_vert_times_K          = sse_irv_vert_times_K;
  122|  9.05k|          irv_horz_ana              = sse_irv_horz_ana;
  123|  9.05k|          irv_horz_syn              = sse_irv_horz_syn;
  124|  9.05k|        }
  125|  9.05k|      #endif // !OJPH_DISABLE_SSE
  126|       |
  127|  9.05k|      #ifndef OJPH_DISABLE_SSE2
  128|  9.05k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2)
  129|  9.05k|        {
  130|  9.05k|          rev_vert_step             = sse2_rev_vert_step;
  131|  9.05k|          rev_horz_ana              = sse2_rev_horz_ana;
  132|  9.05k|          rev_horz_syn              = sse2_rev_horz_syn;
  133|  9.05k|        }
  134|  9.05k|      #endif // !OJPH_DISABLE_SSE2
  135|       |
  136|  9.05k|      #ifndef OJPH_DISABLE_AVX
  137|  9.05k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  138|  9.05k|        {
  139|  9.05k|          irv_vert_step             = avx_irv_vert_step;
  140|  9.05k|          irv_vert_times_K          = avx_irv_vert_times_K;
  141|  9.05k|          irv_horz_ana              = avx_irv_horz_ana;      
  142|  9.05k|          irv_horz_syn              = avx_irv_horz_syn;
  143|  9.05k|        }
  144|  9.05k|      #endif // !OJPH_DISABLE_AVX
  145|       |
  146|  9.05k|      #ifndef OJPH_DISABLE_AVX2
  147|  9.05k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2)
  148|  9.05k|        {
  149|  9.05k|          rev_vert_step             = avx2_rev_vert_step;
  150|  9.05k|          rev_horz_ana              = avx2_rev_horz_ana;
  151|  9.05k|          rev_horz_syn              = avx2_rev_horz_syn;
  152|  9.05k|        }
  153|  9.05k|      #endif // !OJPH_DISABLE_AVX2
  154|       |
  155|  9.05k|      #if (defined(OJPH_ARCH_X86_64) && !defined(OJPH_DISABLE_AVX512))
  156|  9.05k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX512)
  157|  9.05k|        {
  158|       |          // rev_vert_step             = avx512_rev_vert_step;
  159|       |          // rev_horz_ana              = avx512_rev_horz_ana;
  160|       |          // rev_horz_syn              = avx512_rev_horz_syn;
  161|       |
  162|  9.05k|          irv_vert_step             = avx512_irv_vert_step;
  163|  9.05k|          irv_vert_times_K          = avx512_irv_vert_times_K;
  164|  9.05k|          irv_horz_ana              = avx512_irv_horz_ana;
  165|  9.05k|          irv_horz_syn              = avx512_irv_horz_syn;
  166|  9.05k|        }
  167|  9.05k|      #endif // !OJPH_DISABLE_AVX512
  168|       |    
  169|       |    #elif defined(OJPH_ARCH_ARM)
  170|       |
  171|       |    #elif defined(OJPH_ARCH_PPC64LE)
  172|       |
  173|       |        if (get_cpu_ext_level() >= PPC_CPU_EXT_LEVEL_ARCH_2_07)
  174|       |        {
  175|       |          // 128-bit VSX kernels; see ojph_simd_vsx.h
  176|       |          rev_vert_step             = vsx_rev_vert_step;
  177|       |          rev_horz_ana              = vsx_rev_horz_ana;
  178|       |          rev_horz_syn              = vsx_rev_horz_syn;
  179|       |
  180|       |          irv_vert_step             = vsx_irv_vert_step;
  181|       |          irv_vert_times_K          = vsx_irv_vert_times_K;
  182|       |          irv_horz_ana              = vsx_irv_horz_ana;
  183|       |          irv_horz_syn              = vsx_irv_horz_syn;
  184|       |        }
  185|       |
  186|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  187|       |
  188|  9.05k|  #endif // !OJPH_DISABLE_SIMD
  189|       |
  190|       |#else // OJPH_ENABLE_WASM_SIMD
  191|       |        rev_vert_step             = wasm_rev_vert_step;
  192|       |        rev_horz_ana              = wasm_rev_horz_ana;
  193|       |        rev_horz_syn              = wasm_rev_horz_syn;
  194|       |        
  195|       |        irv_vert_step             = wasm_irv_vert_step;
  196|       |        irv_vert_times_K          = wasm_irv_vert_times_K;
  197|       |        irv_horz_ana              = wasm_irv_horz_ana;
  198|       |        irv_horz_syn              = wasm_irv_horz_syn;
  199|       |#endif // !OJPH_ENABLE_WASM_SIMD
  200|  9.05k|      });
  201|  9.05k|    }
ojph_transform.cpp:_ZZN4ojph5local32init_wavelet_transform_functionsEvENK3$_0clEv:
  101|      1|      std::call_once(wavelet_transform_functions_init_flag, [](){
  102|      1|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  103|       |
  104|      1|        rev_vert_step             = gen_rev_vert_step;
  105|      1|        rev_horz_ana              = gen_rev_horz_ana;
  106|      1|        rev_horz_syn              = gen_rev_horz_syn;
  107|       |
  108|      1|        irv_vert_step             = gen_irv_vert_step;
  109|      1|        irv_vert_times_K          = gen_irv_vert_times_K;
  110|      1|        irv_horz_ana              = gen_irv_horz_ana;
  111|      1|        irv_horz_syn              = gen_irv_horz_syn;
  112|       |
  113|      1|  #ifndef OJPH_DISABLE_SIMD
  114|       |
  115|      1|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  116|       |
  117|      1|      #ifndef OJPH_DISABLE_SSE
  118|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  ------------------
  |  Branch (118:13): [True: 1, False: 0]
  ------------------
  119|      1|        {
  120|      1|          irv_vert_step             = sse_irv_vert_step;
  121|      1|          irv_vert_times_K          = sse_irv_vert_times_K;
  122|      1|          irv_horz_ana              = sse_irv_horz_ana;
  123|      1|          irv_horz_syn              = sse_irv_horz_syn;
  124|      1|        }
  125|      1|      #endif // !OJPH_DISABLE_SSE
  126|       |
  127|      1|      #ifndef OJPH_DISABLE_SSE2
  128|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2)
  ------------------
  |  Branch (128:13): [True: 1, False: 0]
  ------------------
  129|      1|        {
  130|      1|          rev_vert_step             = sse2_rev_vert_step;
  131|      1|          rev_horz_ana              = sse2_rev_horz_ana;
  132|      1|          rev_horz_syn              = sse2_rev_horz_syn;
  133|      1|        }
  134|      1|      #endif // !OJPH_DISABLE_SSE2
  135|       |
  136|      1|      #ifndef OJPH_DISABLE_AVX
  137|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  ------------------
  |  Branch (137:13): [True: 1, False: 0]
  ------------------
  138|      1|        {
  139|      1|          irv_vert_step             = avx_irv_vert_step;
  140|      1|          irv_vert_times_K          = avx_irv_vert_times_K;
  141|      1|          irv_horz_ana              = avx_irv_horz_ana;      
  142|      1|          irv_horz_syn              = avx_irv_horz_syn;
  143|      1|        }
  144|      1|      #endif // !OJPH_DISABLE_AVX
  145|       |
  146|      1|      #ifndef OJPH_DISABLE_AVX2
  147|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2)
  ------------------
  |  Branch (147:13): [True: 1, False: 0]
  ------------------
  148|      1|        {
  149|      1|          rev_vert_step             = avx2_rev_vert_step;
  150|      1|          rev_horz_ana              = avx2_rev_horz_ana;
  151|      1|          rev_horz_syn              = avx2_rev_horz_syn;
  152|      1|        }
  153|      1|      #endif // !OJPH_DISABLE_AVX2
  154|       |
  155|      1|      #if (defined(OJPH_ARCH_X86_64) && !defined(OJPH_DISABLE_AVX512))
  156|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX512)
  ------------------
  |  Branch (156:13): [True: 0, False: 1]
  ------------------
  157|      0|        {
  158|       |          // rev_vert_step             = avx512_rev_vert_step;
  159|       |          // rev_horz_ana              = avx512_rev_horz_ana;
  160|       |          // rev_horz_syn              = avx512_rev_horz_syn;
  161|       |
  162|      0|          irv_vert_step             = avx512_irv_vert_step;
  163|      0|          irv_vert_times_K          = avx512_irv_vert_times_K;
  164|      0|          irv_horz_ana              = avx512_irv_horz_ana;
  165|      0|          irv_horz_syn              = avx512_irv_horz_syn;
  166|      0|        }
  167|      1|      #endif // !OJPH_DISABLE_AVX512
  168|       |    
  169|       |    #elif defined(OJPH_ARCH_ARM)
  170|       |
  171|       |    #elif defined(OJPH_ARCH_PPC64LE)
  172|       |
  173|       |        if (get_cpu_ext_level() >= PPC_CPU_EXT_LEVEL_ARCH_2_07)
  174|       |        {
  175|       |          // 128-bit VSX kernels; see ojph_simd_vsx.h
  176|       |          rev_vert_step             = vsx_rev_vert_step;
  177|       |          rev_horz_ana              = vsx_rev_horz_ana;
  178|       |          rev_horz_syn              = vsx_rev_horz_syn;
  179|       |
  180|       |          irv_vert_step             = vsx_irv_vert_step;
  181|       |          irv_vert_times_K          = vsx_irv_vert_times_K;
  182|       |          irv_horz_ana              = vsx_irv_horz_ana;
  183|       |          irv_horz_syn              = vsx_irv_horz_syn;
  184|       |        }
  185|       |
  186|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  187|       |
  188|      1|  #endif // !OJPH_DISABLE_SIMD
  189|       |
  190|       |#else // OJPH_ENABLE_WASM_SIMD
  191|       |        rev_vert_step             = wasm_rev_vert_step;
  192|       |        rev_horz_ana              = wasm_rev_horz_ana;
  193|       |        rev_horz_syn              = wasm_rev_horz_syn;
  194|       |        
  195|       |        irv_vert_step             = wasm_irv_vert_step;
  196|       |        irv_vert_times_K          = wasm_irv_vert_times_K;
  197|       |        irv_horz_ana              = wasm_irv_horz_ana;
  198|       |        irv_horz_syn              = wasm_irv_horz_syn;
  199|       |#endif // !OJPH_ENABLE_WASM_SIMD
  200|      1|      });

_ZN4ojph5local17avx_irv_vert_stepEPKNS0_12lifting_stepEPKNS_8line_bufES6_S6_jb:
  104|  3.83M|    {
  105|  3.83M|      float a = s->irv.Aatk;
  106|  3.83M|      if (synthesis)
  ------------------
  |  Branch (106:11): [True: 3.83M, False: 0]
  ------------------
  107|  3.83M|        a = -a;
  108|       |
  109|  3.83M|      __m256 factor = _mm256_set1_ps(a);
  110|       |
  111|  3.83M|      float* dst = aug->f32;
  112|  3.83M|      const float* src1 = sig->f32, * src2 = other->f32;
  113|  3.83M|      int i = (int)repeat;
  114|  17.9M|      for ( ; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (114:15): [True: 14.1M, False: 3.83M]
  ------------------
  115|  14.1M|      {
  116|  14.1M|        __m256 s1 = _mm256_load_ps(src1);
  117|  14.1M|        __m256 s2 = _mm256_load_ps(src2);
  118|  14.1M|        __m256 d = _mm256_load_ps(dst);
  119|  14.1M|        d = _mm256_add_ps(d, _mm256_mul_ps(factor, _mm256_add_ps(s1, s2)));
  120|  14.1M|        _mm256_store_ps(dst, d);
  121|  14.1M|      }
  122|  3.83M|    }
_ZN4ojph5local20avx_irv_vert_times_KEfPKNS_8line_bufEj:
  126|  1.92M|    {
  127|  1.92M|      avx_multiply_const(aug->f32, K, (int)repeat);
  128|  1.92M|    }
_ZN4ojph5local16avx_irv_horz_synEPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
  212|  1.96M|    {
  213|  1.96M|      if (width > 1)
  ------------------
  |  Branch (213:11): [True: 399k, False: 1.56M]
  ------------------
  214|   399k|      {
  215|   399k|        bool ev = even;
  216|   399k|        float* oth = hsrc->f32, * aug = lsrc->f32;
  217|   399k|        ui32 aug_width = (width + (even ? 1 : 0)) >> 1;  // low pass
  ------------------
  |  Branch (217:36): [True: 185k, False: 213k]
  ------------------
  218|   399k|        ui32 oth_width = (width + (even ? 0 : 1)) >> 1;  // high pass
  ------------------
  |  Branch (218:36): [True: 185k, False: 213k]
  ------------------
  219|       |
  220|   399k|        { // multiply by K or 1/K
  221|   399k|          float K = atk->get_K();
  222|   399k|          float K_inv = 1.0f / K;
  223|   399k|          avx_multiply_const(aug, K, (int)aug_width);
  224|   399k|          avx_multiply_const(oth, K_inv, (int)oth_width);
  225|   399k|        }
  226|       |
  227|       |        // the actual horizontal transform
  228|   399k|        ui32 num_steps = atk->get_num_steps();
  229|  1.98M|        for (ui32 j = 0; j < num_steps; ++j)
  ------------------
  |  Branch (229:26): [True: 1.58M, False: 399k]
  ------------------
  230|  1.58M|        {
  231|  1.58M|          const lifting_step* s = atk->get_step(j);
  232|  1.58M|          const float a = s->irv.Aatk;
  233|       |
  234|       |          // extension
  235|  1.58M|          oth[-1] = oth[0];
  236|  1.58M|          oth[oth_width] = oth[oth_width - 1];
  237|       |          // lifting step
  238|  1.58M|          const float* sp = oth;
  239|  1.58M|          float* dp = aug;
  240|  1.58M|          int i = (int)aug_width;
  241|  1.58M|          __m256 f = _mm256_set1_ps(a);
  242|  1.58M|          if (ev)
  ------------------
  |  Branch (242:15): [True: 794k, False: 792k]
  ------------------
  243|   794k|          {
  244|  7.09M|            for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (244:20): [True: 6.29M, False: 794k]
  ------------------
  245|  6.29M|            {
  246|  6.29M|              __m256 m = _mm256_load_ps(sp);
  247|  6.29M|              __m256 n = _mm256_loadu_ps(sp - 1);
  248|  6.29M|              __m256 p = _mm256_load_ps(dp);
  249|  6.29M|              p = _mm256_sub_ps(p, _mm256_mul_ps(f, _mm256_add_ps(m, n)));
  250|  6.29M|              _mm256_store_ps(dp, p);
  251|  6.29M|            }
  252|   794k|          }
  253|   792k|          else
  254|   792k|          {
  255|  7.01M|            for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (255:20): [True: 6.22M, False: 792k]
  ------------------
  256|  6.22M|            {
  257|  6.22M|              __m256 m = _mm256_load_ps(sp);
  258|  6.22M|              __m256 n = _mm256_loadu_ps(sp + 1);
  259|  6.22M|              __m256 p = _mm256_load_ps(dp);
  260|  6.22M|              p = _mm256_sub_ps(p, _mm256_mul_ps(f, _mm256_add_ps(m, n)));
  261|  6.22M|              _mm256_store_ps(dp, p);
  262|  6.22M|            }
  263|   792k|          }
  264|       |
  265|       |          // swap buffers
  266|  1.58M|          float* t = aug; aug = oth; oth = t;
  267|  1.58M|          ev = !ev;
  268|  1.58M|          ui32 w = aug_width; aug_width = oth_width; oth_width = w;
  269|  1.58M|        }
  270|       |
  271|       |        // combine both lsrc and hsrc into dst
  272|   399k|        {
  273|   399k|          float* dp = dst->f32;
  274|   399k|          float* spl = even ? lsrc->f32 : hsrc->f32;
  ------------------
  |  Branch (274:24): [True: 185k, False: 213k]
  ------------------
  275|   399k|          float* sph = even ? hsrc->f32 : lsrc->f32;
  ------------------
  |  Branch (275:24): [True: 185k, False: 213k]
  ------------------
  276|   399k|          int w = (int)width;
  277|   399k|          avx_interleave32(dp, spl, sph, w);
  278|   399k|        }
  279|   399k|      }
  280|  1.56M|      else {
  281|  1.56M|        if (even)
  ------------------
  |  Branch (281:13): [True: 1.48M, False: 83.1k]
  ------------------
  282|  1.48M|          dst->f32[0] = lsrc->f32[0];
  283|  83.1k|        else
  284|  83.1k|          dst->f32[0] = hsrc->f32[0] * 0.5f;
  285|  1.56M|      }
  286|  1.96M|    }
ojph_transform_avx.cpp:_ZN4ojph5localL18avx_multiply_constEPffi:
   57|  2.72M|    {
   58|  2.72M|      __m256 factor = _mm256_set1_ps(f);
   59|  16.1M|      for (; width > 0; width -= 8, p += 8)
  ------------------
  |  Branch (59:14): [True: 13.3M, False: 2.72M]
  ------------------
   60|  13.3M|      {
   61|  13.3M|        __m256 s = _mm256_load_ps(p);
   62|  13.3M|        _mm256_store_ps(p, _mm256_mul_ps(factor, s));
   63|  13.3M|      }
   64|  2.72M|    }
ojph_transform_avx.cpp:_ZN4ojph5localL16avx_interleave32EPfS1_S1_i:
   86|   399k|    {
   87|  3.56M|      for (; width > 0; width -= 16, dp += 16, spl += 8, sph += 8)
  ------------------
  |  Branch (87:14): [True: 3.16M, False: 399k]
  ------------------
   88|  3.16M|      {
   89|  3.16M|        __m256 a = _mm256_load_ps(spl);
   90|  3.16M|        __m256 b = _mm256_load_ps(sph);
   91|  3.16M|        __m256 c = _mm256_unpacklo_ps(a, b);
   92|  3.16M|        __m256 d = _mm256_unpackhi_ps(a, b);
   93|  3.16M|        __m256 e = _mm256_permute2f128_ps(c, d, (2 << 4) | (0));
   94|       |        __m256 f = _mm256_permute2f128_ps(c, d, (3 << 4) | (1));
   95|  3.16M|        _mm256_store_ps(dp, e);
   96|  3.16M|        _mm256_store_ps(dp + 8, f);
   97|  3.16M|      }
   98|   399k|    }

_ZN4ojph5local18avx2_rev_vert_stepEPKNS0_12lifting_stepEPKNS_8line_bufES6_S6_jb:
  390|  2.88M|    {
  391|  2.88M|      if (((sig != NULL) && (sig->flags & line_buf::LFT_32BIT)) ||
  ------------------
  |  Branch (391:12): [True: 2.88M, False: 0]
  |  Branch (391:29): [True: 2.11M, False: 767k]
  ------------------
  392|   767k|          ((aug != NULL) && (aug->flags & line_buf::LFT_32BIT)) ||
  ------------------
  |  Branch (392:12): [True: 767k, False: 0]
  |  Branch (392:29): [True: 0, False: 767k]
  ------------------
  393|   767k|          ((other != NULL) && (other->flags & line_buf::LFT_32BIT)))
  ------------------
  |  Branch (393:12): [True: 767k, False: 0]
  |  Branch (393:31): [True: 0, False: 767k]
  ------------------
  394|  2.11M|      {
  395|  2.11M|        assert((sig == NULL || sig->flags & line_buf::LFT_32BIT) &&
  396|  2.11M|               (other == NULL || other->flags & line_buf::LFT_32BIT) &&
  397|  2.11M|               (aug == NULL || aug->flags & line_buf::LFT_32BIT));
  398|  2.11M|        avx2_rev_vert_step32(s, sig, other, aug, repeat, synthesis);
  399|  2.11M|      }
  400|   767k|      else
  401|   767k|      {
  402|       |        assert((sig == NULL || sig->flags & line_buf::LFT_64BIT) &&
  403|   767k|               (other == NULL || other->flags & line_buf::LFT_64BIT) &&
  404|   767k|               (aug == NULL || aug->flags & line_buf::LFT_64BIT));
  405|   767k|        avx2_rev_vert_step64(s, sig, other, aug, repeat, synthesis);
  406|   767k|      }
  407|  2.88M|    }
_ZN4ojph5local17avx2_rev_horz_synEPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
 1067|  4.22M|    {
 1068|  4.22M|      if (dst->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (1068:11): [True: 3.33M, False: 887k]
  ------------------
 1069|  3.33M|      {
 1070|  3.33M|        assert((lsrc == NULL || lsrc->flags & line_buf::LFT_32BIT) &&
 1071|  3.33M|               (hsrc == NULL || hsrc->flags & line_buf::LFT_32BIT));
 1072|  3.33M|        avx2_rev_horz_syn32(atk, dst, lsrc, hsrc, width, even);
 1073|  3.33M|      }
 1074|   887k|      else
 1075|   887k|      {
 1076|       |        assert((dst == NULL || dst->flags & line_buf::LFT_64BIT) &&
 1077|   887k|               (lsrc == NULL || lsrc->flags & line_buf::LFT_64BIT) &&
 1078|   887k|               (hsrc == NULL || hsrc->flags & line_buf::LFT_64BIT));
 1079|   887k|        avx2_rev_horz_syn64(atk, dst, lsrc, hsrc, width, even);
 1080|   887k|      }
 1081|  4.22M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL20avx2_rev_vert_step32EPKNS0_12lifting_stepEPKNS_8line_bufES6_S6_jb:
  150|  2.11M|    {
  151|  2.11M|      const si32 a = s->rev.Aatk;
  152|  2.11M|      const si32 b = s->rev.Batk;
  153|  2.11M|      const ui8 e = s->rev.Eatk;
  154|  2.11M|      __m256i va = _mm256_set1_epi32(a);
  155|  2.11M|      __m256i vb = _mm256_set1_epi32(b);
  156|       |
  157|  2.11M|      si32* dst = aug->i32;
  158|  2.11M|      const si32* src1 = sig->i32, * src2 = other->i32;
  159|       |      // The general definition of the wavelet in Part 2 is slightly
  160|       |      // different to part 2, although they are mathematically equivalent
  161|       |      // here, we identify the simpler form from Part 1 and employ them
  162|  2.11M|      if (a == 1)
  ------------------
  |  Branch (162:11): [True: 1.05M, False: 1.05M]
  ------------------
  163|  1.05M|      { // 5/3 update and any case with a == 1
  164|  1.05M|        int i = (int)repeat;
  165|  1.05M|        if (synthesis)
  ------------------
  |  Branch (165:13): [True: 1.05M, False: 0]
  ------------------
  166|  6.76M|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (166:18): [True: 5.70M, False: 1.05M]
  ------------------
  167|  5.70M|          {
  168|  5.70M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  169|  5.70M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  170|  5.70M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  171|  5.70M|            __m256i t = _mm256_add_epi32(s1, s2);
  172|  5.70M|            __m256i v = _mm256_add_epi32(vb, t);
  173|  5.70M|            __m256i w = _mm256_srai_epi32(v, e);
  174|  5.70M|            d = _mm256_sub_epi32(d, w);
  175|  5.70M|            _mm256_store_si256((__m256i*)dst, d);
  176|  5.70M|          }
  177|      0|        else
  178|      0|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (178:18): [True: 0, False: 0]
  ------------------
  179|      0|          {
  180|      0|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  181|      0|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  182|      0|            __m256i d = _mm256_load_si256((__m256i*)dst);
  183|      0|            __m256i t = _mm256_add_epi32(s1, s2);
  184|      0|            __m256i v = _mm256_add_epi32(vb, t);
  185|      0|            __m256i w = _mm256_srai_epi32(v, e);
  186|      0|            d = _mm256_add_epi32(d, w);
  187|      0|            _mm256_store_si256((__m256i*)dst, d);
  188|      0|          }
  189|  1.05M|      }
  190|  1.05M|      else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (190:16): [True: 1.05M, False: 0]
  |  Branch (190:27): [True: 1.05M, False: 0]
  |  Branch (190:37): [True: 1.05M, False: 0]
  ------------------
  191|  1.05M|      { // 5/3 predict
  192|  1.05M|        int i = (int)repeat;
  193|  1.05M|        if (synthesis)
  ------------------
  |  Branch (193:13): [True: 1.05M, False: 0]
  ------------------
  194|  6.74M|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (194:18): [True: 5.68M, False: 1.05M]
  ------------------
  195|  5.68M|          {
  196|  5.68M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  197|  5.68M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  198|  5.68M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  199|  5.68M|            __m256i t = _mm256_add_epi32(s1, s2);
  200|  5.68M|            __m256i w = _mm256_srai_epi32(t, e);
  201|  5.68M|            d = _mm256_add_epi32(d, w);
  202|  5.68M|            _mm256_store_si256((__m256i*)dst, d);
  203|  5.68M|          }
  204|      0|        else
  205|      0|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (205:18): [True: 0, False: 0]
  ------------------
  206|      0|          {
  207|      0|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  208|      0|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  209|      0|            __m256i d = _mm256_load_si256((__m256i*)dst);
  210|      0|            __m256i t = _mm256_add_epi32(s1, s2);
  211|      0|            __m256i w = _mm256_srai_epi32(t, e);
  212|      0|            d = _mm256_sub_epi32(d, w);
  213|      0|            _mm256_store_si256((__m256i*)dst, d);
  214|      0|          }
  215|  1.05M|      }
  216|      0|      else if (a == -1)
  ------------------
  |  Branch (216:16): [True: 0, False: 0]
  ------------------
  217|      0|      { // any case with a == -1, which is not 5/3 predict
  218|      0|        int i = (int)repeat;
  219|      0|        if (synthesis)
  ------------------
  |  Branch (219:13): [True: 0, False: 0]
  ------------------
  220|      0|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (220:18): [True: 0, False: 0]
  ------------------
  221|      0|          {
  222|      0|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  223|      0|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  224|      0|            __m256i d = _mm256_load_si256((__m256i*)dst);
  225|      0|            __m256i t = _mm256_add_epi32(s1, s2);
  226|      0|            __m256i v = _mm256_sub_epi32(vb, t);
  227|      0|            __m256i w = _mm256_srai_epi32(v, e);
  228|      0|            d = _mm256_sub_epi32(d, w);
  229|      0|            _mm256_store_si256((__m256i*)dst, d);
  230|      0|          }
  231|      0|        else
  232|      0|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (232:18): [True: 0, False: 0]
  ------------------
  233|      0|          {
  234|      0|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  235|      0|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  236|      0|            __m256i d = _mm256_load_si256((__m256i*)dst);
  237|      0|            __m256i t = _mm256_add_epi32(s1, s2);
  238|      0|            __m256i v = _mm256_sub_epi32(vb, t);
  239|      0|            __m256i w = _mm256_srai_epi32(v, e);
  240|      0|            d = _mm256_add_epi32(d, w);
  241|      0|            _mm256_store_si256((__m256i*)dst, d);
  242|      0|          }
  243|      0|      }
  244|      0|      else { // general case
  245|      0|        int i = (int)repeat;
  246|      0|        if (synthesis)
  ------------------
  |  Branch (246:13): [True: 0, False: 0]
  ------------------
  247|      0|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (247:18): [True: 0, False: 0]
  ------------------
  248|      0|          {
  249|      0|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  250|      0|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  251|      0|            __m256i d = _mm256_load_si256((__m256i*)dst);
  252|      0|            __m256i t = _mm256_add_epi32(s1, s2);
  253|      0|            __m256i u = _mm256_mullo_epi32(va, t);
  254|      0|            __m256i v = _mm256_add_epi32(vb, u);
  255|      0|            __m256i w = _mm256_srai_epi32(v, e);
  256|      0|            d = _mm256_sub_epi32(d, w);
  257|      0|            _mm256_store_si256((__m256i*)dst, d);
  258|      0|          }
  259|      0|        else
  260|      0|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (260:18): [True: 0, False: 0]
  ------------------
  261|      0|          {
  262|      0|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  263|      0|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  264|      0|            __m256i d = _mm256_load_si256((__m256i*)dst);
  265|      0|            __m256i t = _mm256_add_epi32(s1, s2);
  266|      0|            __m256i u = _mm256_mullo_epi32(va, t);
  267|      0|            __m256i v = _mm256_add_epi32(vb, u);
  268|      0|            __m256i w = _mm256_srai_epi32(v, e);
  269|      0|            d = _mm256_add_epi32(d, w);
  270|      0|            _mm256_store_si256((__m256i*)dst, d);
  271|      0|          }
  272|      0|      }
  273|  2.11M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL20avx2_rev_vert_step64EPKNS0_12lifting_stepEPKNS_8line_bufES6_S6_jb:
  280|   767k|    {
  281|   767k|      const si32 a = s->rev.Aatk;
  282|   767k|      const si32 b = s->rev.Batk;
  283|   767k|      const ui8 e = s->rev.Eatk;
  284|   767k|      __m256i vb = _mm256_set1_epi64x(b);
  285|   767k|      __m256i ve = _mm256_set1_epi64x(1LL << (63 - e));
  286|       |
  287|   767k|      si64* dst = aug->i64;
  288|   767k|      const si64* src1 = sig->i64, * src2 = other->i64;
  289|       |      // The general definition of the wavelet in Part 2 is slightly
  290|       |      // different to part 2, although they are mathematically equivalent
  291|       |      // here, we identify the simpler form from Part 1 and employ them
  292|   767k|      if (a == 1)
  ------------------
  |  Branch (292:11): [True: 384k, False: 383k]
  ------------------
  293|   384k|      { // 5/3 update and any case with a == 1
  294|   384k|        int i = (int)repeat;
  295|   384k|        if (synthesis)
  ------------------
  |  Branch (295:13): [True: 384k, False: 0]
  ------------------
  296|  6.30M|          for (; i > 0; i -= 4, dst += 4, src1 += 4, src2 += 4)
  ------------------
  |  Branch (296:18): [True: 5.92M, False: 384k]
  ------------------
  297|  5.92M|          {
  298|  5.92M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  299|  5.92M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  300|  5.92M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  301|  5.92M|            __m256i t = _mm256_add_epi64(s1, s2);
  302|  5.92M|            __m256i v = _mm256_add_epi64(vb, t);
  303|  5.92M|            __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  304|  5.92M|            d = _mm256_sub_epi64(d, w);
  305|  5.92M|            _mm256_store_si256((__m256i*)dst, d);
  306|  5.92M|          }
  307|      0|        else
  308|      0|          for (; i > 0; i -= 4, dst += 4, src1 += 4, src2 += 4)
  ------------------
  |  Branch (308:18): [True: 0, False: 0]
  ------------------
  309|      0|          {
  310|      0|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  311|      0|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  312|      0|            __m256i d = _mm256_load_si256((__m256i*)dst);
  313|      0|            __m256i t = _mm256_add_epi64(s1, s2);
  314|      0|            __m256i v = _mm256_add_epi64(vb, t);
  315|      0|            __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  316|      0|            d = _mm256_add_epi64(d, w);
  317|      0|            _mm256_store_si256((__m256i*)dst, d);
  318|      0|          }
  319|   384k|      }
  320|   383k|      else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (320:16): [True: 383k, False: 0]
  |  Branch (320:27): [True: 383k, False: 0]
  |  Branch (320:37): [True: 383k, False: 0]
  ------------------
  321|   383k|      { // 5/3 predict
  322|   383k|        int i = (int)repeat;
  323|   383k|        if (synthesis)
  ------------------
  |  Branch (323:13): [True: 383k, False: 0]
  ------------------
  324|  6.29M|          for (; i > 0; i -= 4, dst += 4, src1 += 4, src2 += 4)
  ------------------
  |  Branch (324:18): [True: 5.91M, False: 383k]
  ------------------
  325|  5.91M|          {
  326|  5.91M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  327|  5.91M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  328|  5.91M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  329|  5.91M|            __m256i t = _mm256_add_epi64(s1, s2);
  330|  5.91M|            __m256i w = avx2_mm256_srai_epi64(t, e, ve);
  331|  5.91M|            d = _mm256_add_epi64(d, w);
  332|  5.91M|            _mm256_store_si256((__m256i*)dst, d);
  333|  5.91M|          }
  334|      0|        else
  335|      0|          for (; i > 0; i -= 4, dst += 4, src1 += 4, src2 += 4)
  ------------------
  |  Branch (335:18): [True: 0, False: 0]
  ------------------
  336|      0|          {
  337|      0|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  338|      0|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  339|      0|            __m256i d = _mm256_load_si256((__m256i*)dst);
  340|      0|            __m256i t = _mm256_add_epi64(s1, s2);
  341|      0|            __m256i w = avx2_mm256_srai_epi64(t, e, ve);
  342|      0|            d = _mm256_sub_epi64(d, w);
  343|      0|            _mm256_store_si256((__m256i*)dst, d);
  344|      0|          }
  345|   383k|      }
  346|      0|      else if (a == -1)
  ------------------
  |  Branch (346:16): [True: 0, False: 0]
  ------------------
  347|      0|      { // any case with a == -1, which is not 5/3 predict
  348|      0|        int i = (int)repeat;
  349|      0|        if (synthesis)
  ------------------
  |  Branch (349:13): [True: 0, False: 0]
  ------------------
  350|      0|          for (; i > 0; i -= 4, dst += 4, src1 += 4, src2 += 4)
  ------------------
  |  Branch (350:18): [True: 0, False: 0]
  ------------------
  351|      0|          {
  352|      0|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  353|      0|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  354|      0|            __m256i d = _mm256_load_si256((__m256i*)dst);
  355|      0|            __m256i t = _mm256_add_epi64(s1, s2);
  356|      0|            __m256i v = _mm256_sub_epi64(vb, t);
  357|      0|            __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  358|      0|            d = _mm256_sub_epi64(d, w);
  359|      0|            _mm256_store_si256((__m256i*)dst, d);
  360|      0|          }
  361|      0|        else
  362|      0|          for (; i > 0; i -= 4, dst += 4, src1 += 4, src2 += 4)
  ------------------
  |  Branch (362:18): [True: 0, False: 0]
  ------------------
  363|      0|          {
  364|      0|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  365|      0|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  366|      0|            __m256i d = _mm256_load_si256((__m256i*)dst);
  367|      0|            __m256i t = _mm256_add_epi64(s1, s2);
  368|      0|            __m256i v = _mm256_sub_epi64(vb, t);
  369|      0|            __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  370|      0|            d = _mm256_add_epi64(d, w);
  371|      0|            _mm256_store_si256((__m256i*)dst, d);
  372|      0|          }
  373|      0|      }
  374|      0|      else { // general case
  375|       |        // 64bit multiplication is not supported in avx2;
  376|       |        // in particular, _mm256_mullo_epi64.
  377|      0|        if (synthesis)
  ------------------
  |  Branch (377:13): [True: 0, False: 0]
  ------------------
  378|      0|          for (ui32 i = repeat; i > 0; --i)
  ------------------
  |  Branch (378:33): [True: 0, False: 0]
  ------------------
  379|      0|            *dst++ -= (b + a * (*src1++ + *src2++)) >> e;
  380|      0|        else
  381|      0|          for (ui32 i = repeat; i > 0; --i)
  ------------------
  |  Branch (381:33): [True: 0, False: 0]
  ------------------
  382|      0|            *dst++ += (b + a * (*src1++ + *src2++)) >> e;
  383|      0|      }
  384|   767k|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL21avx2_mm256_srai_epi64EDv4_xiS1_:
   61|  23.8M|    {
   62|       |      // note than m must be obtained using
   63|       |      // __m256i m = _mm256_set1_epi64x(1ULL << (63 - amt));
   64|  23.8M|      __m256i x = _mm256_srli_epi64(a, amt);
   65|  23.8M|      x = _mm256_xor_si256(x, m);
   66|  23.8M|      __m256i result = _mm256_sub_epi64(x, m);
   67|  23.8M|      return result;
   68|  23.8M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL19avx2_rev_horz_syn32EPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
  751|  3.33M|    {
  752|  3.33M|      if (width > 1)
  ------------------
  |  Branch (752:11): [True: 628k, False: 2.70M]
  ------------------
  753|   628k|      {
  754|   628k|        bool ev = even;
  755|   628k|        si32* oth = hsrc->i32, * aug = lsrc->i32;
  756|   628k|        ui32 aug_width = (width + (even ? 1 : 0)) >> 1;  // low pass
  ------------------
  |  Branch (756:36): [True: 550k, False: 78.9k]
  ------------------
  757|   628k|        ui32 oth_width = (width + (even ? 0 : 1)) >> 1;  // high pass
  ------------------
  |  Branch (757:36): [True: 550k, False: 78.9k]
  ------------------
  758|   628k|        ui32 num_steps = atk->get_num_steps();
  759|  1.88M|        for (ui32 j = 0; j < num_steps; ++j)
  ------------------
  |  Branch (759:26): [True: 1.25M, False: 628k]
  ------------------
  760|  1.25M|        {
  761|  1.25M|          const lifting_step* s = atk->get_step(j);
  762|  1.25M|          const si32 a = s->rev.Aatk;
  763|  1.25M|          const si32 b = s->rev.Batk;
  764|  1.25M|          const ui8 e  = s->rev.Eatk;
  765|  1.25M|          __m256i va = _mm256_set1_epi32(a);
  766|  1.25M|          __m256i vb = _mm256_set1_epi32(b);
  767|       |
  768|       |          // extension
  769|  1.25M|          oth[-1] = oth[0];
  770|  1.25M|          oth[oth_width] = oth[oth_width - 1];
  771|       |          // lifting step
  772|  1.25M|          const si32* sp = oth;
  773|  1.25M|          si32* dp = aug;
  774|  1.25M|          if (a == 1)
  ------------------
  |  Branch (774:15): [True: 627k, False: 627k]
  ------------------
  775|   627k|          { // 5/3 update and any case with a == 1
  776|   627k|            int i = (int)aug_width;
  777|   627k|            if (ev)
  ------------------
  |  Branch (777:17): [True: 548k, False: 78.9k]
  ------------------
  778|   548k|            {
  779|  5.05M|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (779:22): [True: 4.50M, False: 548k]
  ------------------
  780|  4.50M|              {
  781|  4.50M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  782|  4.50M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  783|  4.50M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  784|  4.50M|                __m256i t = _mm256_add_epi32(s1, s2);
  785|  4.50M|                __m256i v = _mm256_add_epi32(vb, t);
  786|  4.50M|                __m256i w = _mm256_srai_epi32(v, e);
  787|  4.50M|                d = _mm256_sub_epi32(d, w);
  788|  4.50M|                _mm256_store_si256((__m256i*)dp, d);
  789|  4.50M|              }
  790|   548k|            }
  791|  78.9k|            else
  792|  78.9k|            {
  793|   792k|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (793:22): [True: 713k, False: 78.9k]
  ------------------
  794|   713k|              {
  795|   713k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  796|   713k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  797|   713k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  798|   713k|                __m256i t = _mm256_add_epi32(s1, s2);
  799|   713k|                __m256i v = _mm256_add_epi32(vb, t);
  800|   713k|                __m256i w = _mm256_srai_epi32(v, e);
  801|   713k|                d = _mm256_sub_epi32(d, w);
  802|   713k|                _mm256_store_si256((__m256i*)dp, d);
  803|   713k|              }
  804|  78.9k|            }
  805|   627k|          }
  806|   627k|          else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (806:20): [True: 627k, False: 0]
  |  Branch (806:31): [True: 627k, False: 0]
  |  Branch (806:41): [True: 627k, False: 0]
  ------------------
  807|   627k|          {  // 5/3 predict
  808|   627k|            int i = (int)aug_width;
  809|   627k|            if (ev)
  ------------------
  |  Branch (809:17): [True: 78.9k, False: 548k]
  ------------------
  810|   793k|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (810:22): [True: 714k, False: 78.9k]
  ------------------
  811|   714k|              {
  812|   714k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  813|   714k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  814|   714k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  815|   714k|                __m256i t = _mm256_add_epi32(s1, s2);
  816|   714k|                __m256i w = _mm256_srai_epi32(t, e);
  817|   714k|                d = _mm256_add_epi32(d, w);
  818|   714k|                _mm256_store_si256((__m256i*)dp, d);
  819|   714k|              }
  820|   548k|            else
  821|  4.94M|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (821:22): [True: 4.40M, False: 548k]
  ------------------
  822|  4.40M|              {
  823|  4.40M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  824|  4.40M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  825|  4.40M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  826|  4.40M|                __m256i t = _mm256_add_epi32(s1, s2);
  827|  4.40M|                __m256i w = _mm256_srai_epi32(t, e);
  828|  4.40M|                d = _mm256_add_epi32(d, w);
  829|  4.40M|                _mm256_store_si256((__m256i*)dp, d);
  830|  4.40M|              }
  831|   627k|          }
  832|      0|          else if (a == -1)
  ------------------
  |  Branch (832:20): [True: 0, False: 0]
  ------------------
  833|      0|          { // any case with a == -1, which is not 5/3 predict
  834|      0|            int i = (int)aug_width;
  835|      0|            if (ev)
  ------------------
  |  Branch (835:17): [True: 0, False: 0]
  ------------------
  836|      0|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (836:22): [True: 0, False: 0]
  ------------------
  837|      0|              {
  838|      0|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  839|      0|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  840|      0|                __m256i d = _mm256_load_si256((__m256i*)dp);
  841|      0|                __m256i t = _mm256_add_epi32(s1, s2);
  842|      0|                __m256i v = _mm256_sub_epi32(vb, t);
  843|      0|                __m256i w = _mm256_srai_epi32(v, e);
  844|      0|                d = _mm256_sub_epi32(d, w);
  845|      0|                _mm256_store_si256((__m256i*)dp, d);
  846|      0|              }
  847|      0|            else
  848|      0|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (848:22): [True: 0, False: 0]
  ------------------
  849|      0|              {
  850|      0|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  851|      0|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  852|      0|                __m256i d = _mm256_load_si256((__m256i*)dp);
  853|      0|                __m256i t = _mm256_add_epi32(s1, s2);
  854|      0|                __m256i v = _mm256_sub_epi32(vb, t);
  855|      0|                __m256i w = _mm256_srai_epi32(v, e);
  856|      0|                d = _mm256_sub_epi32(d, w);
  857|      0|                _mm256_store_si256((__m256i*)dp, d);
  858|      0|              }
  859|      0|          }
  860|      0|          else {
  861|       |            // general case
  862|      0|            int i = (int)aug_width;
  863|      0|            if (ev)
  ------------------
  |  Branch (863:17): [True: 0, False: 0]
  ------------------
  864|      0|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (864:22): [True: 0, False: 0]
  ------------------
  865|      0|              {
  866|      0|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  867|      0|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  868|      0|                __m256i d = _mm256_load_si256((__m256i*)dp);
  869|      0|                __m256i t = _mm256_add_epi32(s1, s2);
  870|      0|                __m256i u = _mm256_mullo_epi32(va, t);
  871|      0|                __m256i v = _mm256_add_epi32(vb, u);
  872|      0|                __m256i w = _mm256_srai_epi32(v, e);
  873|      0|                d = _mm256_sub_epi32(d, w);
  874|      0|                _mm256_store_si256((__m256i*)dp, d);
  875|      0|              }
  876|      0|            else
  877|      0|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (877:22): [True: 0, False: 0]
  ------------------
  878|      0|              {
  879|      0|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  880|      0|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  881|      0|                __m256i d = _mm256_load_si256((__m256i*)dp);
  882|      0|                __m256i t = _mm256_add_epi32(s1, s2);
  883|      0|                __m256i u = _mm256_mullo_epi32(va, t);
  884|      0|                __m256i v = _mm256_add_epi32(vb, u);
  885|      0|                __m256i w = _mm256_srai_epi32(v, e);
  886|      0|                d = _mm256_sub_epi32(d, w);
  887|      0|                _mm256_store_si256((__m256i*)dp, d);
  888|      0|              }
  889|      0|          }
  890|       |
  891|       |          // swap buffers
  892|  1.25M|          si32* t = aug; aug = oth; oth = t;
  893|  1.25M|          ev = !ev;
  894|  1.25M|          ui32 w = aug_width; aug_width = oth_width; oth_width = w;
  895|  1.25M|        }
  896|       |
  897|       |        // combine both lsrc and hsrc into dst
  898|   628k|        {
  899|   628k|          float* dp  = dst->f32;
  900|   628k|          float* spl = even ? lsrc->f32 : hsrc->f32;
  ------------------
  |  Branch (900:24): [True: 550k, False: 78.9k]
  ------------------
  901|   628k|          float* sph = even ? hsrc->f32 : lsrc->f32;
  ------------------
  |  Branch (901:24): [True: 550k, False: 78.9k]
  ------------------
  902|   628k|          int w = (int)width;
  903|   628k|          avx2_interleave32(dp, spl, sph, w);
  904|   628k|        }
  905|   628k|      }
  906|  2.70M|      else {
  907|  2.70M|        if (even)
  ------------------
  |  Branch (907:13): [True: 2.62M, False: 80.2k]
  ------------------
  908|  2.62M|          dst->i32[0] = lsrc->i32[0];
  909|  80.2k|        else
  910|  80.2k|          dst->i32[0] = hsrc->i32[0] >> 1;
  911|  2.70M|      }
  912|  3.33M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL17avx2_interleave32EPfS1_S1_i:
   90|   628k|    {
   91|  5.86M|      for (; width > 0; width -= 16, dp += 16, spl += 8, sph += 8)
  ------------------
  |  Branch (91:14): [True: 5.23M, False: 628k]
  ------------------
   92|  5.23M|      {
   93|  5.23M|        __m256 a = _mm256_load_ps(spl);
   94|  5.23M|        __m256 b = _mm256_load_ps(sph);
   95|  5.23M|        __m256 c = _mm256_unpacklo_ps(a, b);
   96|  5.23M|        __m256 d = _mm256_unpackhi_ps(a, b);
   97|  5.23M|        __m256 e = _mm256_permute2f128_ps(c, d, (2 << 4) | (0));
   98|       |        __m256 f = _mm256_permute2f128_ps(c, d, (3 << 4) | (1));
   99|  5.23M|        _mm256_store_ps(dp, e);
  100|  5.23M|        _mm256_store_ps(dp + 8, f);
  101|  5.23M|      }
  102|   628k|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL19avx2_rev_horz_syn64EPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
  919|   887k|    {
  920|   887k|      if (width > 1)
  ------------------
  |  Branch (920:11): [True: 396k, False: 490k]
  ------------------
  921|   396k|      {
  922|   396k|        bool ev = even;
  923|   396k|        si64* oth = hsrc->i64, * aug = lsrc->i64;
  924|   396k|        ui32 aug_width = (width + (even ? 1 : 0)) >> 1;  // low pass
  ------------------
  |  Branch (924:36): [True: 337k, False: 58.8k]
  ------------------
  925|   396k|        ui32 oth_width = (width + (even ? 0 : 1)) >> 1;  // high pass
  ------------------
  |  Branch (925:36): [True: 337k, False: 58.8k]
  ------------------
  926|   396k|        ui32 num_steps = atk->get_num_steps();
  927|  1.18M|        for (ui32 j = 0; j < num_steps; ++j)
  ------------------
  |  Branch (927:26): [True: 787k, False: 396k]
  ------------------
  928|   787k|        {
  929|   787k|          const lifting_step* s = atk->get_step(j);
  930|   787k|          const si32 a = s->rev.Aatk;
  931|   787k|          const si32 b = s->rev.Batk;
  932|   787k|          const ui8 e  = s->rev.Eatk;
  933|   787k|          __m256i vb = _mm256_set1_epi64x(b);
  934|   787k|          __m256i ve = _mm256_set1_epi64x(1LL << (63 - e));
  935|       |
  936|       |          // extension
  937|   787k|          oth[-1] = oth[0];
  938|   787k|          oth[oth_width] = oth[oth_width - 1];
  939|       |          // lifting step
  940|   787k|          const si64* sp = oth;
  941|   787k|          si64* dp = aug;
  942|   787k|          if (a == 1)
  ------------------
  |  Branch (942:15): [True: 393k, False: 393k]
  ------------------
  943|   393k|          { // 5/3 update and any case with a == 1
  944|   393k|            int i = (int)aug_width;
  945|   393k|            if (ev)
  ------------------
  |  Branch (945:17): [True: 335k, False: 58.4k]
  ------------------
  946|   335k|            {
  947|  5.74M|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (947:22): [True: 5.41M, False: 335k]
  ------------------
  948|  5.41M|              {
  949|  5.41M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  950|  5.41M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  951|  5.41M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  952|  5.41M|                __m256i t = _mm256_add_epi64(s1, s2);
  953|  5.41M|                __m256i v = _mm256_add_epi64(vb, t);
  954|  5.41M|                __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  955|  5.41M|                d = _mm256_sub_epi64(d, w);
  956|  5.41M|                _mm256_store_si256((__m256i*)dp, d);
  957|  5.41M|              }
  958|   335k|            }
  959|  58.4k|            else
  960|  58.4k|            {
  961|   724k|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (961:22): [True: 665k, False: 58.4k]
  ------------------
  962|   665k|              {
  963|   665k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  964|   665k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  965|   665k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  966|   665k|                __m256i t = _mm256_add_epi64(s1, s2);
  967|   665k|                __m256i v = _mm256_add_epi64(vb, t);
  968|   665k|                __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  969|   665k|                d = _mm256_sub_epi64(d, w);
  970|   665k|                _mm256_store_si256((__m256i*)dp, d);
  971|   665k|              }
  972|  58.4k|            }
  973|   393k|          }
  974|   393k|          else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (974:20): [True: 393k, False: 0]
  |  Branch (974:31): [True: 393k, False: 0]
  |  Branch (974:41): [True: 393k, False: 0]
  ------------------
  975|   393k|          {  // 5/3 predict
  976|   393k|            int i = (int)aug_width;
  977|   393k|            if (ev)
  ------------------
  |  Branch (977:17): [True: 58.4k, False: 335k]
  ------------------
  978|   726k|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (978:22): [True: 668k, False: 58.4k]
  ------------------
  979|   668k|              {
  980|   668k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  981|   668k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  982|   668k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  983|   668k|                __m256i t = _mm256_add_epi64(s1, s2);
  984|   668k|                __m256i w = avx2_mm256_srai_epi64(t, e, ve);
  985|   668k|                d = _mm256_add_epi64(d, w);
  986|   668k|                _mm256_store_si256((__m256i*)dp, d);
  987|   668k|              }
  988|   335k|            else
  989|  5.63M|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (989:22): [True: 5.29M, False: 335k]
  ------------------
  990|  5.29M|              {
  991|  5.29M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  992|  5.29M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  993|  5.29M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  994|  5.29M|                __m256i t = _mm256_add_epi64(s1, s2);
  995|  5.29M|                __m256i w = avx2_mm256_srai_epi64(t, e, ve);
  996|  5.29M|                d = _mm256_add_epi64(d, w);
  997|  5.29M|                _mm256_store_si256((__m256i*)dp, d);
  998|  5.29M|              }
  999|   393k|          }
 1000|      0|          else if (a == -1)
  ------------------
  |  Branch (1000:20): [True: 0, False: 0]
  ------------------
 1001|      0|          { // any case with a == -1, which is not 5/3 predict
 1002|      0|            int i = (int)aug_width;
 1003|      0|            if (ev)
  ------------------
  |  Branch (1003:17): [True: 0, False: 0]
  ------------------
 1004|      0|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (1004:22): [True: 0, False: 0]
  ------------------
 1005|      0|              {
 1006|      0|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
 1007|      0|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
 1008|      0|                __m256i d = _mm256_load_si256((__m256i*)dp);
 1009|      0|                __m256i t = _mm256_add_epi64(s1, s2);
 1010|      0|                __m256i v = _mm256_sub_epi64(vb, t);
 1011|      0|                __m256i w = avx2_mm256_srai_epi64(v, e, ve);
 1012|      0|                d = _mm256_sub_epi64(d, w);
 1013|      0|                _mm256_store_si256((__m256i*)dp, d);
 1014|      0|              }
 1015|      0|            else
 1016|      0|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (1016:22): [True: 0, False: 0]
  ------------------
 1017|      0|              {
 1018|      0|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
 1019|      0|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
 1020|      0|                __m256i d = _mm256_load_si256((__m256i*)dp);
 1021|      0|                __m256i t = _mm256_add_epi64(s1, s2);
 1022|      0|                __m256i v = _mm256_sub_epi64(vb, t);
 1023|      0|                __m256i w = avx2_mm256_srai_epi64(v, e, ve);
 1024|      0|                d = _mm256_sub_epi64(d, w);
 1025|      0|                _mm256_store_si256((__m256i*)dp, d);
 1026|      0|              }
 1027|      0|          }
 1028|      0|          else {
 1029|       |            // general case
 1030|       |            // 64bit multiplication is not supported in avx2;
 1031|       |            // in particular, _mm_mullo_epi64.
 1032|      0|            if (ev)
  ------------------
  |  Branch (1032:17): [True: 0, False: 0]
  ------------------
 1033|      0|              for (ui32 i = aug_width; i > 0; --i, sp++, dp++)
  ------------------
  |  Branch (1033:40): [True: 0, False: 0]
  ------------------
 1034|      0|                *dp -= (b + a * (sp[-1] + sp[0])) >> e;
 1035|      0|            else
 1036|      0|              for (ui32 i = aug_width; i > 0; --i, sp++, dp++)
  ------------------
  |  Branch (1036:40): [True: 0, False: 0]
  ------------------
 1037|      0|                *dp -= (b + a * (sp[0] + sp[1])) >> e;
 1038|      0|          }
 1039|       |
 1040|       |          // swap buffers
 1041|   787k|          si64* t = aug; aug = oth; oth = t;
 1042|   787k|          ev = !ev;
 1043|   787k|          ui32 w = aug_width; aug_width = oth_width; oth_width = w;
 1044|   787k|        }
 1045|       |
 1046|       |        // combine both lsrc and hsrc into dst
 1047|   396k|        {
 1048|   396k|          void* dp = dst->p;
 1049|   396k|          const void* spl = even ? lsrc->p : hsrc->p;
  ------------------
  |  Branch (1049:29): [True: 337k, False: 58.8k]
  ------------------
 1050|   396k|          const void* sph = even ? hsrc->p : lsrc->p;
  ------------------
  |  Branch (1050:29): [True: 337k, False: 58.8k]
  ------------------
 1051|   396k|          int w = (int)width;
 1052|   396k|          avx2_interleave64(dp, spl, sph, w);
 1053|   396k|        }
 1054|   396k|      }
 1055|   490k|      else {
 1056|   490k|        if (even)
  ------------------
  |  Branch (1056:13): [True: 434k, False: 56.6k]
  ------------------
 1057|   434k|          dst->i64[0] = lsrc->i64[0];
 1058|  56.6k|        else
 1059|  56.6k|          dst->i64[0] = hsrc->i64[0] >> 1;
 1060|   490k|      }
 1061|   887k|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL17avx2_interleave64EPvPKvS3_i:
  128|   396k|    {
  129|  6.50M|      for (; width > 0; width -= 8,
  ------------------
  |  Branch (129:14): [True: 6.10M, False: 396k]
  ------------------
  130|  6.10M|             dp = (char*)dp + 64,
  131|  6.10M|             spl = (const char*)spl + 32,
  132|  6.10M|             sph = (const char*)sph + 32)
  133|  6.10M|      {
  134|  6.10M|        __m256i a = _mm256_load_si256((const __m256i*)spl);
  135|  6.10M|        __m256i b = _mm256_load_si256((const __m256i*)sph);
  136|  6.10M|        __m256i c = _mm256_unpacklo_epi64(a, b);
  137|  6.10M|        __m256i d = _mm256_unpackhi_epi64(a, b);
  138|  6.10M|        __m256i e = _mm256_permute2f128_si256(c, d, (2 << 4) | (0));
  139|       |        __m256i f = _mm256_permute2f128_si256(c, d, (3 << 4) | (1));
  140|  6.10M|        _mm256_store_si256((__m256i*)dp, e);
  141|  6.10M|        _mm256_store_si256((__m256i*)((char*)dp + 32), f);
  142|  6.10M|      }
  143|   396k|    }

