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

ojph_precinct.cpp:_ZN4ojph5localL7bb_initEPNS0_12bit_read_bufEjPNS_11infile_baseE:
   69|   396k|    {
   70|   396k|      bbp->avail_bits = 0;
   71|   396k|      bbp->file = file;
   72|   396k|      bbp->bytes_left = bytes_left;
   73|   396k|      bbp->tmp = 0;
   74|   396k|      bbp->unstuff = false;
   75|   396k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_skip_sopEPNS0_12bit_read_bufE:
  185|  81.4k|    {
  186|  81.4k|      if (bbp->bytes_left >= 2)
  ------------------
  |  Branch (186:11): [True: 80.9k, False: 541]
  ------------------
  187|  80.9k|      {
  188|  80.9k|        ui8 marker[2];
  189|  80.9k|        if (bbp->file->read(marker, 2) != 2)
  ------------------
  |  Branch (189:13): [True: 1.83k, False: 79.0k]
  ------------------
  190|  1.83k|          throw "error reading from file";
  191|  79.0k|        if ((int)marker[0] == (SOP >> 8) && (int)marker[1] == (SOP & 0xFF))
  ------------------
  |  Branch (191:13): [True: 7.15k, False: 71.9k]
  |  Branch (191:45): [True: 1.72k, False: 5.43k]
  ------------------
  192|  1.72k|        {
  193|  1.72k|          bbp->bytes_left -= 2;
  194|  1.72k|          if (bbp->bytes_left >= 4)
  ------------------
  |  Branch (194:15): [True: 1.51k, False: 210]
  ------------------
  195|  1.51k|          {
  196|  1.51k|            ui16 com_len;
  197|  1.51k|            if (bbp->file->read(&com_len, 2) != 2)
  ------------------
  |  Branch (197:17): [True: 245, False: 1.26k]
  ------------------
  198|    245|              throw "error reading from file";
  199|  1.26k|            com_len = swap_bytes_if_le(com_len);
  200|  1.26k|            if (com_len != 4)
  ------------------
  |  Branch (200:17): [True: 245, False: 1.02k]
  ------------------
  201|    245|              throw "something is wrong with SOP length";
  202|  1.02k|            int result = 
  203|  1.02k|              bbp->file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
  204|  1.02k|            if (result != 0)
  ------------------
  |  Branch (204:17): [True: 251, False: 772]
  ------------------
  205|    251|              throw "error seeking file";
  206|    772|            bbp->bytes_left -= com_len;
  207|    772|          }
  208|    210|          else
  209|    210|            throw "precinct truncated early";
  210|    772|          return true;
  211|  1.72k|        }
  212|  77.3k|        else
  213|  77.3k|        {
  214|       |          //put the bytes back
  215|  77.3k|          if (bbp->file->seek(-2, infile_base::OJPH_SEEK_CUR) != 0)
  ------------------
  |  Branch (215:15): [True: 0, False: 77.3k]
  ------------------
  216|      0|            throw "error seeking file";
  217|  77.3k|          return false;
  218|  77.3k|        }
  219|  79.0k|      }
  220|       |
  221|    541|      return false;
  222|  81.4k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_read_bitEPNS0_12bit_read_bufERj:
  104|  24.8M|    {
  105|  24.8M|      bool result = true;
  106|  24.8M|      if (bbp->avail_bits == 0)
  ------------------
  |  Branch (106:11): [True: 3.48M, False: 21.3M]
  ------------------
  107|  3.48M|        result = bb_read(bbp);
  108|  24.8M|      bit = (bbp->tmp >> --bbp->avail_bits) & 1;
  109|  24.8M|      return result;
  110|  24.8M|    }
ojph_precinct.cpp:_ZN4ojph5localL7bb_readEPNS0_12bit_read_bufE:
   80|  4.32M|    {
   81|  4.32M|      if (bbp->bytes_left > 0)
  ------------------
  |  Branch (81:11): [True: 4.32M, False: 3.92k]
  ------------------
   82|  4.32M|      {
   83|  4.32M|        ui8 t = 0;
   84|  4.32M|        if (bbp->file->read(&t, 1) != 1)
  ------------------
  |  Branch (84:13): [True: 18.9k, False: 4.30M]
  ------------------
   85|  18.9k|          throw "error reading from file";
   86|  4.30M|        bbp->tmp = t;
   87|  4.30M|        bbp->avail_bits = 8 - bbp->unstuff;
   88|  4.30M|        bbp->unstuff = (t == 0xFF);
   89|  4.30M|        --bbp->bytes_left;
   90|  4.30M|        return true;
   91|  4.32M|      }
   92|  3.92k|      else
   93|  3.92k|      {
   94|  3.92k|        bbp->tmp = 0;
   95|  3.92k|        bbp->avail_bits = 8 - bbp->unstuff;
   96|  3.92k|        bbp->unstuff = false;
   97|  3.92k|        return false;
   98|  3.92k|      }
   99|  4.32M|    }
ojph_precinct.cpp:_ZN4ojph5localL12bb_terminateEPNS0_12bit_read_bufEb:
  170|   356k|    {
  171|   356k|      bool result = true;
  172|   356k|      if (bbp->unstuff)
  ------------------
  |  Branch (172:11): [True: 3.61k, False: 352k]
  ------------------
  173|  3.61k|        result = bb_read(bbp);
  174|   356k|      assert(bbp->unstuff == false);
  175|   356k|      if (uses_eph)
  ------------------
  |  Branch (175:11): [True: 2.10k, False: 354k]
  ------------------
  176|  2.10k|        bb_skip_eph(bbp);
  177|   356k|      bbp->tmp = 0;
  178|   356k|      bbp->avail_bits = 0;
  179|   356k|      return result;
  180|   356k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_skip_ephEPNS0_12bit_read_bufE:
  155|  2.10k|    {
  156|  2.10k|      if (bbp->bytes_left >= 2)
  ------------------
  |  Branch (156:11): [True: 1.44k, False: 656]
  ------------------
  157|  1.44k|      {
  158|  1.44k|        ui8 marker[2];
  159|  1.44k|        if (bbp->file->read(marker, 2) != 2)
  ------------------
  |  Branch (159:13): [True: 346, False: 1.09k]
  ------------------
  160|    346|          throw "error reading from file";
  161|  1.09k|        bbp->bytes_left -= 2;
  162|  1.09k|        if ((int)marker[0] != (EPH >> 8) || (int)marker[1] != (EPH & 0xFF))
  ------------------
  |  Branch (162:13): [True: 604, False: 494]
  |  Branch (162:45): [True: 293, False: 201]
  ------------------
  163|    897|          throw "should find EPH, but found something else";
  164|  1.09k|      }
  165|  2.10k|    }
ojph_precinct.cpp:_ZN4ojph5localL12bb_read_bitsEPNS0_12bit_read_bufEiRj:
  115|   350k|    {
  116|   350k|      assert(num_bits <= 32);
  117|       |
  118|   350k|      bits = 0;
  119|   350k|      bool result = true;
  120|  1.51M|      while (num_bits) {
  ------------------
  |  Branch (120:14): [True: 1.16M, False: 350k]
  ------------------
  121|  1.16M|        if (bbp->avail_bits == 0)
  ------------------
  |  Branch (121:13): [True: 841k, False: 319k]
  ------------------
  122|   841k|          result = bb_read(bbp);
  123|  1.16M|        int tx_bits = ojph_min(bbp->avail_bits, num_bits);
  ------------------
  |  |   76|  1.16M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 810k, False: 350k]
  |  |  ------------------
  ------------------
  124|  1.16M|        bits <<= tx_bits;
  125|  1.16M|        bbp->avail_bits -= tx_bits;
  126|  1.16M|        num_bits -= tx_bits;
  127|  1.16M|        bits |= (bbp->tmp >> bbp->avail_bits) & ((1 << tx_bits) - 1);
  128|  1.16M|      }
  129|   350k|      return result;
  130|   350k|    }
ojph_precinct.cpp:_ZN4ojph5localL13bb_read_chunkEPNS0_12bit_read_bufEjRPNS_11coded_listsEPNS_21mem_elastic_allocatorE:
  137|  94.6k|    {
  138|  94.6k|      assert(bbp->avail_bits == 0 && bbp->unstuff == false);
  139|  94.6k|      elastic->get_buffer(num_bytes + coded_cb_header::prefix_buf_size
  140|  94.6k|        + coded_cb_header::suffix_buf_size, cur_coded_list);
  141|  94.6k|      ui32 bytes = ojph_min(num_bytes, bbp->bytes_left);
  ------------------
  |  |   76|  94.6k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 93.6k, False: 1.03k]
  |  |  ------------------
  ------------------
  142|  94.6k|      ui32 bytes_read = (ui32)bbp->file->read(
  143|  94.6k|        cur_coded_list->buf + coded_cb_header::prefix_buf_size, bytes);
  144|  94.6k|      if (num_bytes > bytes_read)
  ------------------
  |  Branch (144:11): [True: 13.8k, False: 80.7k]
  ------------------
  145|  13.8k|        memset(
  146|  13.8k|          cur_coded_list->buf + coded_cb_header::prefix_buf_size + bytes_read,
  147|  13.8k|          0, num_bytes - bytes_read);
  148|  94.6k|      bbp->bytes_left -= bytes_read;
  149|  94.6k|      return bytes_read == bytes;
  150|  94.6k|    }

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

_ZN4ojph5local13codeblock_fun4initEb:
  147|  5.45M|    void codeblock_fun::init(bool reversible) {
  148|       |
  149|  5.45M|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  150|       |
  151|       |      // Default path, no acceleration.  We may change this later
  152|  5.45M|      decode_cb32 = ojph_decode_codeblock32;
  153|  5.45M|      find_max_val32 = gen_find_max_val32;
  154|  5.45M|      mem_clear = gen_mem_clear;
  155|  5.45M|      if (reversible) {
  ------------------
  |  Branch (155:11): [True: 4.02M, False: 1.42M]
  ------------------
  156|  4.02M|        tx_to_cb32 = gen_rev_tx_to_cb32;
  157|  4.02M|        tx_from_cb32 = gen_rev_tx_from_cb32;
  158|  4.02M|      }
  159|  1.42M|      else
  160|  1.42M|      {
  161|  1.42M|        tx_to_cb32 = gen_irv_tx_to_cb32;
  162|  1.42M|        tx_from_cb32 = gen_irv_tx_from_cb32;
  163|  1.42M|      }
  164|  5.45M|      encode_cb32 = ojph_encode_codeblock32;
  165|       |
  166|  5.45M|      decode_cb64 = ojph_decode_codeblock64;
  167|  5.45M|      find_max_val64 = gen_find_max_val64;
  168|  5.45M|      if (reversible) {
  ------------------
  |  Branch (168:11): [True: 4.02M, False: 1.42M]
  ------------------
  169|  4.02M|        tx_to_cb64 = gen_rev_tx_to_cb64;
  170|  4.02M|        tx_from_cb64 = gen_rev_tx_from_cb64;
  171|  4.02M|      }
  172|  1.42M|      else
  173|  1.42M|      {
  174|  1.42M|        tx_to_cb64 = NULL;
  175|  1.42M|        tx_from_cb64 = gen_irv_tx_from_cb64;
  176|  1.42M|      }
  177|  5.45M|      encode_cb64 = ojph_encode_codeblock64;
  178|  5.45M|      bool result = initialize_block_encoder_tables();
  179|  5.45M|      assert(result); ojph_unused(result);
  ------------------
  |  |   78|  5.45M|#define ojph_unused(x) (void)(x)
  ------------------
  180|       |
  181|  5.45M|  #ifndef OJPH_DISABLE_SIMD
  182|       |
  183|  5.45M|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  184|       |
  185|       |      // Accelerated functions for INTEL/AMD CPUs
  186|  5.45M|      #ifndef OJPH_DISABLE_SSE
  187|  5.45M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  ------------------
  |  Branch (187:13): [True: 5.45M, False: 0]
  ------------------
  188|  5.45M|          mem_clear = sse_mem_clear;
  189|  5.45M|      #endif // !OJPH_DISABLE_SSE
  190|       |
  191|  5.45M|      #ifndef OJPH_DISABLE_SSE2
  192|  5.45M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2) {
  ------------------
  |  Branch (192:13): [True: 5.45M, False: 0]
  ------------------
  193|  5.45M|          find_max_val32 = sse2_find_max_val32;
  194|  5.45M|          if (reversible) {
  ------------------
  |  Branch (194:15): [True: 4.02M, False: 1.42M]
  ------------------
  195|  4.02M|            tx_to_cb32 = sse2_rev_tx_to_cb32;
  196|  4.02M|            tx_from_cb32 = sse2_rev_tx_from_cb32;
  197|  4.02M|          }
  198|  1.42M|          else {
  199|  1.42M|            tx_to_cb32 = sse2_irv_tx_to_cb32;
  200|  1.42M|            tx_from_cb32 = sse2_irv_tx_from_cb32;
  201|  1.42M|          }
  202|  5.45M|          find_max_val64 = sse2_find_max_val64;
  203|  5.45M|          if (reversible) {
  ------------------
  |  Branch (203:15): [True: 4.02M, False: 1.42M]
  ------------------
  204|  4.02M|            tx_to_cb64 = sse2_rev_tx_to_cb64;
  205|  4.02M|            tx_from_cb64 = sse2_rev_tx_from_cb64;
  206|  4.02M|          }
  207|  1.42M|          else
  208|  1.42M|          {
  209|  1.42M|            tx_to_cb64 = NULL;
  210|  1.42M|            tx_from_cb64 = gen_irv_tx_from_cb64;
  211|  1.42M|          }
  212|  5.45M|        }
  213|  5.45M|      #endif // !OJPH_DISABLE_SSE2
  214|       |
  215|  5.45M|      #ifndef OJPH_DISABLE_SSSE3
  216|  5.45M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSSE3)
  ------------------
  |  Branch (216:13): [True: 5.45M, False: 0]
  ------------------
  217|  5.45M|          decode_cb32 = ojph_decode_codeblock_ssse3;
  218|  5.45M|      #endif // !OJPH_DISABLE_SSSE3
  219|       |
  220|  5.45M|      #ifndef OJPH_DISABLE_AVX
  221|  5.45M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  ------------------
  |  Branch (221:13): [True: 5.45M, False: 0]
  ------------------
  222|  5.45M|          mem_clear = avx_mem_clear;
  223|  5.45M|      #endif // !OJPH_DISABLE_AVX
  224|       |
  225|  5.45M|      #ifndef OJPH_DISABLE_AVX2
  226|  5.45M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2) {
  ------------------
  |  Branch (226:13): [True: 5.45M, False: 0]
  ------------------
  227|  5.45M|          decode_cb32 = ojph_decode_codeblock_avx2;
  228|  5.45M|          find_max_val32 = avx2_find_max_val32;
  229|  5.45M|          if (reversible) {
  ------------------
  |  Branch (229:15): [True: 4.02M, False: 1.42M]
  ------------------
  230|  4.02M|            tx_to_cb32 = avx2_rev_tx_to_cb32;
  231|  4.02M|            tx_from_cb32 = avx2_rev_tx_from_cb32;
  232|  4.02M|          }
  233|  1.42M|          else {
  234|  1.42M|            tx_to_cb32 = avx2_irv_tx_to_cb32;
  235|  1.42M|            tx_from_cb32 = avx2_irv_tx_from_cb32;
  236|  1.42M|          }
  237|  5.45M|          encode_cb32 = ojph_encode_codeblock_avx2;
  238|  5.45M|          bool result = initialize_block_encoder_tables_avx2();
  239|  5.45M|          assert(result); ojph_unused(result);
  ------------------
  |  |   78|  5.45M|#define ojph_unused(x) (void)(x)
  ------------------
  240|       |
  241|  5.45M|          find_max_val64 = avx2_find_max_val64;
  242|  5.45M|          if (reversible) {
  ------------------
  |  Branch (242:15): [True: 4.02M, False: 1.42M]
  ------------------
  243|  4.02M|            tx_to_cb64 = avx2_rev_tx_to_cb64;
  244|  4.02M|            tx_from_cb64 = avx2_rev_tx_from_cb64;
  245|  4.02M|          }
  246|  1.42M|          else
  247|  1.42M|          {
  248|  1.42M|            tx_to_cb64 = NULL;
  249|  1.42M|            tx_from_cb64 = gen_irv_tx_from_cb64;
  250|  1.42M|          }
  251|  5.45M|        }
  252|  5.45M|      #endif // !OJPH_DISABLE_AVX2
  253|       |
  254|  5.45M|      #if (defined(OJPH_ARCH_X86_64) && !defined(OJPH_DISABLE_AVX512))
  255|  5.45M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX512) {
  ------------------
  |  Branch (255:13): [True: 0, False: 5.45M]
  ------------------
  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.45M|      #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.45M|  #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.45M|    }

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

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

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

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

_ZN4ojph5local10codestreamC2Ev:
   57|  7.38k|    : precinct_scratch(NULL), allocator(NULL), elastic_alloc(NULL)
   58|  7.38k|    {
   59|  7.38k|      allocator = new mem_fixed_allocator;
   60|  7.38k|      elastic_alloc = new mem_elastic_allocator(1048576); // 1 megabyte
   61|       |
   62|  7.38k|      init_colour_transform_functions();
   63|  7.38k|      init_wavelet_transform_functions();
   64|       |
   65|  7.38k|      restart();
   66|  7.38k|    }
_ZN4ojph5local10codestreamD2Ev:
   70|  7.38k|    {
   71|  7.38k|      if (allocator)
  ------------------
  |  Branch (71:11): [True: 7.38k, False: 0]
  ------------------
   72|  7.38k|        delete allocator;
   73|  7.38k|      if (elastic_alloc)
  ------------------
  |  Branch (73:11): [True: 7.38k, False: 0]
  ------------------
   74|  7.38k|        delete elastic_alloc;
   75|  7.38k|    }
_ZN4ojph5local10codestream7restartEv:
   79|  7.38k|    {
   80|  7.38k|      tiles = NULL;
   81|  7.38k|      lines = NULL;
   82|  7.38k|      comp_size = NULL;
   83|  7.38k|      recon_comp_size = NULL;
   84|  7.38k|      outfile = NULL;
   85|  7.38k|      infile = NULL;
   86|       |
   87|  7.38k|      num_comps = 0;
   88|  7.38k|      employ_color_transform = false;
   89|  7.38k|      planar = -1;
   90|  7.38k|      profile = OJPH_PN_UNDEFINED;
   91|  7.38k|      tilepart_div = OJPH_TILEPART_NO_DIVISIONS;
   92|  7.38k|      need_tlm = false;
   93|       |
   94|  7.38k|      cur_comp = 0;
   95|  7.38k|      cur_line = 0;
   96|  7.38k|      cur_tile_row = 0;
   97|  7.38k|      resilient = false;
   98|  7.38k|      skipped_res_for_read = skipped_res_for_recon = 0;
   99|       |
  100|  7.38k|      precinct_scratch_needed_bytes = 0;
  101|       |
  102|  7.38k|      cod.restart();
  103|  7.38k|      qcd.restart();
  104|  7.38k|      nlt.restart();
  105|  7.38k|      dfs.restart();
  106|  7.38k|      atk.restart();
  107|       |
  108|  7.38k|      allocator->restart();
  109|  7.38k|      elastic_alloc->restart();
  110|  7.38k|    }
_ZN4ojph5local10codestream9pre_allocEv:
  114|  5.73k|    {
  115|  5.73k|      ojph::param_siz sz = access_siz();
  116|  5.73k|      num_tiles.w = sz.get_image_extent().x - sz.get_tile_offset().x;
  117|  5.73k|      num_tiles.w = ojph_div_ceil(num_tiles.w, sz.get_tile_size().w);
  ------------------
  |  |   70|  5.73k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  118|  5.73k|      num_tiles.h = sz.get_image_extent().y - sz.get_tile_offset().y;
  119|  5.73k|      num_tiles.h = ojph_div_ceil(num_tiles.h, sz.get_tile_size().h);
  ------------------
  |  |   70|  5.73k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  120|  5.73k|      if (num_tiles.area() > 65535)
  ------------------
  |  Branch (120:11): [True: 1, False: 5.73k]
  ------------------
  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|  5.73k|      if (num_tiles.area() == 0)
  ------------------
  |  Branch (122:11): [True: 2, False: 5.73k]
  ------------------
  123|      2|        OJPH_ERROR(0x00030012, "the number of tiles cannot be 0");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|       |
  125|       |      //allocate tiles
  126|  5.73k|      allocator->pre_alloc_obj<tile>((size_t)num_tiles.area());
  127|       |
  128|  5.73k|      ui32 num_tileparts = 0;
  129|  5.73k|      point index;
  130|  5.73k|      rect tile_rect, recon_tile_rect;
  131|  5.73k|      ui32 ds = 1 << skipped_res_for_recon;
  132|   109k|      for (index.y = 0; index.y < num_tiles.h; ++index.y)
  ------------------
  |  Branch (132:25): [True: 103k, False: 5.73k]
  ------------------
  133|   103k|      {
  134|   103k|        ui32 y0 = sz.get_tile_offset().y
  135|   103k|                + index.y * sz.get_tile_size().h;
  136|   103k|        ui32 y1 = y0 + sz.get_tile_size().h; //end of tile
  137|       |
  138|   103k|        tile_rect.org.y = ojph_max(y0, sz.get_image_offset().y);
  ------------------
  |  |   73|   103k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 97.8k, False: 5.73k]
  |  |  ------------------
  ------------------
  139|   103k|        tile_rect.siz.h =
  140|   103k|          ojph_min(y1, sz.get_image_extent().y) - tile_rect.org.y;
  ------------------
  |  |   76|   103k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 97.8k, False: 5.69k]
  |  |  ------------------
  ------------------
  141|       |
  142|   103k|        recon_tile_rect.org.y = ojph_max(ojph_div_ceil(y0, ds),
  ------------------
  |  |   73|   103k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 97.7k, False: 5.83k]
  |  |  ------------------
  ------------------
  143|   103k|          ojph_div_ceil(sz.get_image_offset().y, ds));
  144|   103k|        recon_tile_rect.siz.h = ojph_min(ojph_div_ceil(y1, ds),
  ------------------
  |  |   76|   103k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 97.6k, False: 5.95k]
  |  |  ------------------
  ------------------
  145|   103k|          ojph_div_ceil(sz.get_image_extent().y, ds))
  146|   103k|          - recon_tile_rect.org.y;
  147|       |
  148|   613k|        for (index.x = 0; index.x < num_tiles.w; ++index.x)
  ------------------
  |  Branch (148:27): [True: 509k, False: 103k]
  ------------------
  149|   509k|        {
  150|   509k|          ui32 x0 = sz.get_tile_offset().x
  151|   509k|                  + index.x * sz.get_tile_size().w;
  152|   509k|          ui32 x1 = x0 + sz.get_tile_size().w;
  153|       |
  154|   509k|          tile_rect.org.x = ojph_max(x0, sz.get_image_offset().x);
  ------------------
  |  |   73|   509k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 406k, False: 103k]
  |  |  ------------------
  ------------------
  155|   509k|          tile_rect.siz.w =
  156|   509k|            ojph_min(x1, sz.get_image_extent().x) - tile_rect.org.x;
  ------------------
  |  |   76|   509k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 406k, False: 103k]
  |  |  ------------------
  ------------------
  157|       |
  158|   509k|          recon_tile_rect.org.x = ojph_max(ojph_div_ceil(x0, ds),
  ------------------
  |  |   73|   509k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 406k, False: 103k]
  |  |  ------------------
  ------------------
  159|   509k|            ojph_div_ceil(sz.get_image_offset().x, ds));
  160|   509k|          recon_tile_rect.siz.w = ojph_min(ojph_div_ceil(x1, ds),
  ------------------
  |  |   76|   509k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 405k, False: 104k]
  |  |  ------------------
  ------------------
  161|   509k|            ojph_div_ceil(sz.get_image_extent().x, ds))
  162|   509k|            - recon_tile_rect.org.x;
  163|       |
  164|   509k|          ui32 tps = 0; // number of tileparts for this tile
  165|   509k|          tile::pre_alloc(this, tile_rect, recon_tile_rect, tps);
  166|   509k|          num_tileparts += tps;
  167|   509k|        }
  168|   103k|      }
  169|       |
  170|       |      //allocate lines
  171|       |      //These lines are used by codestream to exchange data with external
  172|       |      // world
  173|  5.73k|      ui32 num_comps = sz.get_num_components();
  174|  5.73k|      allocator->pre_alloc_obj<line_buf>(num_comps);
  175|  5.73k|      allocator->pre_alloc_obj<size>(num_comps); //for *comp_size
  176|  5.73k|      allocator->pre_alloc_obj<size>(num_comps); //for *recon_comp_size
  177|  12.6k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (177:24): [True: 6.95k, False: 5.73k]
  ------------------
  178|  6.95k|        allocator->pre_alloc_data<si32>(siz.get_recon_width(i), 0);
  179|       |
  180|       |      //allocate tlm
  181|  5.73k|      if (outfile != NULL && need_tlm)
  ------------------
  |  Branch (181:11): [True: 0, False: 5.73k]
  |  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|  5.73k|      size ratio;
  193|  12.6k|      for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (193:24): [True: 6.95k, False: 5.73k]
  ------------------
  194|  6.95k|      {
  195|  6.95k|        const param_cod* cdp = cod.get_coc(c);
  196|  6.95k|        ui32 num_decomps = cdp->get_num_decompositions();
  197|  6.95k|        size log_cb = cdp->get_log_block_dims();
  198|  48.1k|        for (ui32 r = 0; r <= num_decomps; ++r)
  ------------------
  |  Branch (198:26): [True: 41.1k, False: 6.95k]
  ------------------
  199|  41.1k|        {
  200|  41.1k|          size log_PP = cdp->get_log_precinct_size(r);
  201|  41.1k|          ratio.w = ojph_max(ratio.w, log_PP.w - ojph_min(log_cb.w, log_PP.w));
  ------------------
  |  |   73|  82.3k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 9.70k, False: 31.4k]
  |  |  |  Branch (73:33): [True: 9.48k, False: 31.7k]
  |  |  |  Branch (73:46): [True: 8.14k, False: 23.3k]
  |  |  ------------------
  ------------------
  202|  41.1k|          ratio.h = ojph_max(ratio.h, log_PP.h - ojph_min(log_cb.h, log_PP.h));
  ------------------
  |  |   73|  82.3k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 7.75k, False: 33.4k]
  |  |  |  Branch (73:33): [True: 7.89k, False: 33.2k]
  |  |  |  Branch (73:46): [True: 7.23k, False: 26.2k]
  |  |  ------------------
  ------------------
  203|  41.1k|        }
  204|  6.95k|      }
  205|  5.73k|      ui32 max_ratio = ojph_max(ratio.w, ratio.h);
  ------------------
  |  |   73|  5.73k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.74k, False: 3.99k]
  |  |  ------------------
  ------------------
  206|  5.73k|      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|  5.73k|      precinct_scratch_needed_bytes =
  215|  5.73k|        4 * ((max_ratio * max_ratio * 4 + 2) / 3);
  216|       |
  217|  5.73k|      allocator->pre_alloc_obj<ui8>(precinct_scratch_needed_bytes);
  218|  5.73k|    }
_ZN4ojph5local10codestream14finalize_allocEv:
  222|  5.46k|    {
  223|  5.46k|      allocator->alloc();
  224|       |
  225|       |      //precinct scratch buffer
  226|  5.46k|      precinct_scratch =
  227|  5.46k|        allocator->post_alloc_obj<ui8>(precinct_scratch_needed_bytes);
  228|       |
  229|       |      //get tiles
  230|  5.46k|      tiles = this->allocator->post_alloc_obj<tile>((size_t)num_tiles.area());
  231|       |
  232|  5.46k|      ui32 num_tileparts = 0;
  233|  5.46k|      point index;
  234|  5.46k|      rect tile_rect;
  235|  5.46k|      ojph::param_siz sz = access_siz();
  236|   106k|      for (index.y = 0; index.y < num_tiles.h; ++index.y)
  ------------------
  |  Branch (236:25): [True: 100k, False: 5.46k]
  ------------------
  237|   100k|      {
  238|   100k|        ui32 y0 = sz.get_tile_offset().y
  239|   100k|                + index.y * sz.get_tile_size().h;
  240|   100k|        ui32 y1 = y0 + sz.get_tile_size().h; //end of tile
  241|       |
  242|   100k|        tile_rect.org.y = ojph_max(y0, sz.get_image_offset().y);
  ------------------
  |  |   73|   100k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 95.4k, False: 5.46k]
  |  |  ------------------
  ------------------
  243|   100k|        tile_rect.siz.h =
  244|   100k|          ojph_min(y1, sz.get_image_extent().y) - tile_rect.org.y;
  ------------------
  |  |   76|   100k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 95.4k, False: 5.46k]
  |  |  ------------------
  ------------------
  245|       |
  246|   100k|        ui32 offset = 0;
  247|   575k|        for (index.x = 0; index.x < num_tiles.w; ++index.x)
  ------------------
  |  Branch (247:27): [True: 474k, False: 100k]
  ------------------
  248|   474k|        {
  249|   474k|          ui32 x0 = sz.get_tile_offset().x
  250|   474k|                  + index.x * sz.get_tile_size().w;
  251|   474k|          ui32 x1 = x0 + sz.get_tile_size().w;
  252|       |
  253|   474k|          tile_rect.org.x = ojph_max(x0, sz.get_image_offset().x);
  ------------------
  |  |   73|   474k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 373k, False: 100k]
  |  |  ------------------
  ------------------
  254|   474k|          tile_rect.siz.w =
  255|   474k|            ojph_min(x1, sz.get_image_extent().x) - tile_rect.org.x;
  ------------------
  |  |   76|   474k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 373k, False: 100k]
  |  |  ------------------
  ------------------
  256|       |
  257|   474k|          ui32 tps = 0; // number of tileparts for this tile
  258|   474k|          ui32 idx = index.y * num_tiles.w + index.x;
  259|   474k|          tiles[idx].finalize_alloc(this, tile_rect, idx, offset, tps);
  260|   474k|          num_tileparts += tps;
  261|   474k|        }
  262|   100k|      }
  263|       |
  264|       |      //allocate lines
  265|       |      //These lines are used by codestream to exchange data with external
  266|       |      // world
  267|  5.46k|      this->num_comps = sz.get_num_components();
  268|  5.46k|      lines = allocator->post_alloc_obj<line_buf>(this->num_comps);
  269|  5.46k|      comp_size = allocator->post_alloc_obj<size>(this->num_comps);
  270|  5.46k|      recon_comp_size = allocator->post_alloc_obj<size>(this->num_comps);
  271|  5.46k|      employ_color_transform = cod.is_employing_color_transform();
  272|  12.3k|      for (ui32 i = 0; i < this->num_comps; ++i)
  ------------------
  |  Branch (272:24): [True: 6.83k, False: 5.46k]
  ------------------
  273|  6.83k|      {
  274|  6.83k|        comp_size[i].w = siz.get_width(i);
  275|  6.83k|        comp_size[i].h = siz.get_height(i);
  276|  6.83k|        ui32 cw = siz.get_recon_width(i);
  277|  6.83k|        recon_comp_size[i].w = cw;
  278|  6.83k|        recon_comp_size[i].h = siz.get_recon_height(i);
  279|  6.83k|        lines[i].wrap(allocator->post_alloc_data<si32>(cw, 0), cw, 0);
  280|  6.83k|      }
  281|       |
  282|  5.46k|      cur_comp = 0;
  283|  5.46k|      cur_line = 0;
  284|       |
  285|       |      //allocate tlm
  286|  5.46k|      if (outfile != NULL && need_tlm)
  ------------------
  |  Branch (286:11): [True: 0, False: 5.46k]
  |  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|  5.46k|    }
_ZN4ojph5local10codestream12read_headersEPNS_11infile_baseE:
  770|  7.38k|    {
  771|  7.38k|      ui16 marker_list[20] = { SOC, SIZ, CAP, PRF, CPF, COD, COC, QCD, QCC,
  772|  7.38k|        RGN, POC, PPM, TLM, PLM, CRG, COM, DFS, ATK, NLT, SOT };
  773|  7.38k|      find_marker(file, marker_list, 1); //find SOC
  774|  7.38k|      find_marker(file, marker_list + 1, 1); //find SIZ
  775|  7.38k|      siz.read(file);
  776|  7.38k|      int marker_idx = 0;
  777|  7.38k|      int received_markers = 0; //check that COD, & QCD received
  778|   747k|      while (true)
  ------------------
  |  Branch (778:14): [True: 746k, Folded]
  ------------------
  779|   746k|      {
  780|   746k|        marker_idx = find_marker(file, marker_list + 2, 18);
  781|   746k|        if (marker_idx == 0)
  ------------------
  |  Branch (781:13): [True: 511, False: 745k]
  ------------------
  782|    511|          cap.read(file);
  783|   745k|        else if (marker_idx == 1)
  ------------------
  |  Branch (783:18): [True: 394, False: 745k]
  ------------------
  784|       |          //Skipping PRF marker segment; this should not cause any issues
  785|    394|          skip_marker(file, "PRF", NULL, OJPH_MSG_NO_MSG, false);
  786|   745k|        else if (marker_idx == 2)
  ------------------
  |  Branch (786:18): [True: 221, False: 744k]
  ------------------
  787|       |          //Skipping CPF marker segment; this should not cause any issues
  788|    221|          skip_marker(file, "CPF", NULL, OJPH_MSG_NO_MSG, false);
  789|   744k|        else if (marker_idx == 3)
  ------------------
  |  Branch (789:18): [True: 6.85k, False: 738k]
  ------------------
  790|  6.85k|        {
  791|  6.85k|          cod.read(file);
  792|  6.85k|          received_markers |= 1;
  793|  6.85k|          ojph::param_cod c(&cod);
  794|  6.85k|          int num_qlayers = c.get_num_layers();
  795|  6.85k|          if (num_qlayers != 1)
  ------------------
  |  Branch (795:15): [True: 17, False: 6.83k]
  ------------------
  796|     17|            OJPH_ERROR(0x00030053, "The current implementation supports "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  797|  6.85k|              "1 quality layer only.  This codestream has %d quality layers",
  798|  6.85k|              num_qlayers);
  799|  6.85k|        }
  800|   738k|        else if (marker_idx == 4)
  ------------------
  |  Branch (800:18): [True: 871, False: 737k]
  ------------------
  801|    871|        {
  802|    871|          param_cod* p = cod.add_coc_object(param_cod::OJPH_COD_UNKNOWN);
  803|    871|          p->read_coc(file, siz.get_num_components(), &cod);
  804|    871|          if (p->get_comp_idx() >= siz.get_num_components())
  ------------------
  |  Branch (804:15): [True: 120, False: 751]
  ------------------
  805|    120|            OJPH_INFO(0x00030056, "The codestream carries a COC marker "
  ------------------
  |  |  285|    120|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    120|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 120, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  806|    871|              "segment for a component indexed by %d, which is more than the "
  807|    871|              "allowed index number, since the codestream has %d components",
  808|    871|              p->get_comp_idx(), num_comps);
  809|    871|          param_cod *q = cod.get_coc(p->get_comp_idx());
  810|    871|          if (p != q && p->get_comp_idx() == q->get_comp_idx())
  ------------------
  |  Branch (810:15): [True: 9, False: 862]
  |  Branch (810:25): [True: 9, False: 0]
  ------------------
  811|      9|            OJPH_ERROR(0x00030057, "The codestream has two COC marker "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  812|    871|              "segments for one component of index %d",  p->get_comp_idx());
  813|    871|        }
  814|   737k|        else if (marker_idx == 5)
  ------------------
  |  Branch (814:18): [True: 6.87k, False: 730k]
  ------------------
  815|  6.87k|        {
  816|  6.87k|          qcd.read(file);
  817|  6.87k|          received_markers |= 2;
  818|  6.87k|        }
  819|   730k|        else if (marker_idx == 6)
  ------------------
  |  Branch (819:18): [True: 285, False: 730k]
  ------------------
  820|    285|        {
  821|    285|          param_qcd* p = qcd.add_qcc_object(param_qcd::OJPH_QCD_UNKNOWN);
  822|    285|          p->read_qcc(file, siz.get_num_components());
  823|    285|          if (p->get_comp_idx() >= siz.get_num_components())
  ------------------
  |  Branch (823:15): [True: 9, False: 276]
  ------------------
  824|      9|            OJPH_ERROR(0x00030054, "The codestream carries a QCC marker "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  825|    285|              "segment for a component indexed by %d, which is more than the "
  826|    285|              "allowed index number, since the codestream has %d components",
  827|    285|              p->get_comp_idx(), num_comps);
  828|    285|          param_qcd *q = qcd.get_qcc(p->get_comp_idx());
  829|    285|          if (p != q && p->get_comp_idx() == q->get_comp_idx())
  ------------------
  |  Branch (829:15): [True: 9, False: 276]
  |  Branch (829:25): [True: 9, False: 0]
  ------------------
  830|      9|            OJPH_ERROR(0x00030055, "The codestream has two QCC marker "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  831|    285|              "segments for one component of index %d", p->get_comp_idx());
  832|    285|        }
  833|   730k|        else if (marker_idx == 7)
  ------------------
  |  Branch (833:18): [True: 453, False: 729k]
  ------------------
  834|    453|          skip_marker(file, "RGN", "RGN is not supported yet",
  835|    453|            OJPH_MSG_WARN, false);
  836|   729k|        else if (marker_idx == 8)
  ------------------
  |  Branch (836:18): [True: 609, False: 729k]
  ------------------
  837|    609|          skip_marker(file, "POC", "POC is not supported yet",
  838|    609|            OJPH_MSG_WARN, false);
  839|   729k|        else if (marker_idx == 9)
  ------------------
  |  Branch (839:18): [True: 186, False: 728k]
  ------------------
  840|    186|          skip_marker(file, "PPM", "PPM is not supported yet",
  841|    186|            OJPH_MSG_WARN, false);
  842|   728k|        else if (marker_idx == 10)
  ------------------
  |  Branch (842:18): [True: 367, False: 728k]
  ------------------
  843|       |          //Skipping TLM marker segment; this should not cause any issues
  844|    367|          skip_marker(file, "TLM", NULL, OJPH_MSG_NO_MSG, false);
  845|   728k|        else if (marker_idx == 11)
  ------------------
  |  Branch (845:18): [True: 233, False: 728k]
  ------------------
  846|       |          //Skipping PLM marker segment; this should not cause any issues
  847|    233|          skip_marker(file, "PLM", NULL, OJPH_MSG_NO_MSG, false);
  848|   728k|        else if (marker_idx == 12)
  ------------------
  |  Branch (848:18): [True: 227, False: 727k]
  ------------------
  849|       |          //Skipping CRG marker segment;
  850|    227|          skip_marker(file, "CRG", "CRG has been ignored; CRG is related to"
  851|    227|            " where the Cb and Cr colour components are co-sited or located"
  852|    227|            " with respect to the Y' luma component. Perhaps, it is better"
  853|    227|            " to get the individual components and assemble the samples"
  854|    227|            " according to your needs",
  855|    227|            OJPH_MSG_INFO, false);
  856|   727k|        else if (marker_idx == 13)
  ------------------
  |  Branch (856:18): [True: 283, False: 727k]
  ------------------
  857|    283|          skip_marker(file, "COM", NULL, OJPH_MSG_NO_MSG, false);
  858|   727k|        else if (marker_idx == 14)
  ------------------
  |  Branch (858:18): [True: 720k, False: 7.46k]
  ------------------
  859|   720k|          dfs.read(file);
  860|  7.46k|        else if (marker_idx == 15)
  ------------------
  |  Branch (860:18): [True: 435, False: 7.03k]
  ------------------
  861|    435|          atk.read(file);
  862|  7.03k|        else if (marker_idx == 16)
  ------------------
  |  Branch (862:18): [True: 935, False: 6.09k]
  ------------------
  863|    935|          nlt.read(file);
  864|  6.09k|        else if (marker_idx == 17)
  ------------------
  |  Branch (864:18): [True: 5.84k, False: 257]
  ------------------
  865|  5.84k|          break;
  866|    257|        else
  867|   740k|          OJPH_ERROR(0x00030051, "File ended before finding a tile segment");
  ------------------
  |  |  289|    257|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    257|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 257, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  868|   740k|      }
  869|       |
  870|  7.38k|      cod.update_atk(&atk);
  871|  7.38k|      siz.link(&cod);
  872|  7.38k|      if (dfs.exists())
  ------------------
  |  Branch (872:11): [True: 291, False: 7.09k]
  ------------------
  873|    291|        siz.link(&dfs);
  874|       |
  875|  7.38k|      if (received_markers != 3)
  ------------------
  |  Branch (875:11): [True: 34, False: 7.35k]
  ------------------
  876|     34|        OJPH_ERROR(0x00030052, "markers error, COD and QCD are required");
  ------------------
  |  |  289|     34|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     34|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 34, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  877|       |
  878|  7.38k|      this->infile = file;
  879|  7.38k|      planar = cod.is_employing_color_transform() ? 0 : 1;
  ------------------
  |  Branch (879:16): [True: 421, False: 6.96k]
  ------------------
  880|  7.38k|    }
_ZN4ojph5local10codestream25restrict_input_resolutionEjj:
  885|  1.48k|    {
  886|  1.48k|      if (skipped_res_for_read < skipped_res_for_recon)
  ------------------
  |  Branch (886:11): [True: 0, False: 1.48k]
  ------------------
  887|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  888|  1.48k|          "skipped_resolution for data %d must be equal or smaller than "
  889|  1.48k|          " skipped_resolution for reconstruction %d\n",
  890|  1.48k|          skipped_res_for_read, skipped_res_for_recon);
  891|  1.48k|      if (skipped_res_for_read > cod.get_num_decompositions())
  ------------------
  |  Branch (891:11): [True: 3, False: 1.48k]
  ------------------
  892|      3|        OJPH_ERROR(0x000300A2,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  893|  1.48k|          "skipped_resolution for data %d must be smaller than "
  894|  1.48k|          " the number of decomposition levels %d\n",
  895|  1.48k|          skipped_res_for_read, cod.get_num_decompositions());
  896|       |
  897|  1.48k|      this->skipped_res_for_read = skipped_res_for_read;
  898|  1.48k|      this->skipped_res_for_recon = skipped_res_for_recon;
  899|  1.48k|      siz.set_skipped_resolutions(skipped_res_for_recon);
  900|  1.48k|    }
_ZN4ojph5local10codestream17enable_resilienceEv:
  904|  7.38k|    {
  905|  7.38k|      if (infile != NULL)
  ------------------
  |  Branch (905:11): [True: 0, False: 7.38k]
  ------------------
  906|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  907|  7.38k|          " reading file headers.\n");
  908|  7.38k|      this->resilient = true;
  909|  7.38k|    }
_ZN4ojph5local10codestream4readEv:
  913|  5.73k|    {
  914|  5.73k|      this->pre_alloc();
  915|  5.73k|      this->finalize_alloc();
  916|       |
  917|   227k|      while (true)
  ------------------
  |  Branch (917:14): [True: 227k, Folded]
  ------------------
  918|   227k|      {
  919|   227k|        param_sot sot;
  920|   227k|        if (sot.read(infile, resilient))
  ------------------
  |  Branch (920:13): [True: 212k, False: 14.4k]
  ------------------
  921|   212k|        {
  922|   212k|          ui64 tile_start_location = (ui64)infile->tell();
  923|   212k|          bool skip_tile = false;
  924|       |
  925|   212k|          if (sot.get_tile_index() >= (int)num_tiles.area())
  ------------------
  |  Branch (925:15): [True: 6.88k, False: 206k]
  ------------------
  926|  6.88k|          {
  927|  6.88k|            if (resilient) {
  ------------------
  |  Branch (927:17): [True: 6.88k, False: 0]
  ------------------
  928|  6.88k|              OJPH_INFO(0x00030061, "wrong tile index")
  ------------------
  |  |  285|  6.88k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  6.88k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6.88k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  929|  6.88k|              skip_tile = true; // skip the faulty tile
  930|  6.88k|            }
  931|      0|            else
  932|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  933|  6.88k|          }
  934|       |
  935|   212k|          if (!skip_tile)
  ------------------
  |  Branch (935:15): [True: 206k, False: 6.88k]
  ------------------
  936|   206k|          {
  937|   206k|            if (sot.get_tile_part_index())
  ------------------
  |  Branch (937:17): [True: 171k, False: 34.5k]
  ------------------
  938|   171k|            { //tile part
  939|   171k|              if (sot.get_num_tile_parts() &&
  ------------------
  |  Branch (939:19): [True: 168k, False: 3.33k]
  ------------------
  940|   168k|                sot.get_tile_part_index() >= sot.get_num_tile_parts())
  ------------------
  |  Branch (940:17): [True: 5.77k, False: 162k]
  ------------------
  941|  5.77k|              {
  942|  5.77k|                if (resilient)
  ------------------
  |  Branch (942:21): [True: 5.77k, False: 0]
  ------------------
  943|  5.77k|                  OJPH_INFO(0x00030062,
  ------------------
  |  |  285|  5.77k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  5.77k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5.77k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  944|  5.77k|                    "error in tile part number, should be smaller than total"
  945|  5.77k|                    " number of tile parts")
  946|      0|                else
  947|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  948|  5.77k|                    "error in tile part number, should be smaller than total"
  949|  5.77k|                    " number of tile parts")
  950|  5.77k|              }
  951|       |
  952|   171k|              bool sod_found = false;
  953|   171k|              ui16 other_tile_part_markers[7] = { SOT, POC, PPT, PLT, COM,
  954|   171k|                NLT, SOD };
  955|   185k|              while (true)
  ------------------
  |  Branch (955:22): [True: 185k, Folded]
  ------------------
  956|   185k|              {
  957|   185k|                int marker_idx = 0;
  958|   185k|                int result = 0;
  959|   185k|                marker_idx = find_marker(infile, other_tile_part_markers+1, 6);
  960|   185k|                if (marker_idx == 0)
  ------------------
  |  Branch (960:21): [True: 511, False: 185k]
  ------------------
  961|    511|                  result = skip_marker(infile, "POC",
  962|    511|                    "POC marker segment in a tile is not supported yet",
  963|    511|                    OJPH_MSG_WARN, resilient);
  964|   185k|                else if (marker_idx == 1)
  ------------------
  |  Branch (964:26): [True: 541, False: 184k]
  ------------------
  965|    541|                  result = skip_marker(infile, "PPT",
  966|    541|                    "PPT marker segment in a tile is not supported yet",
  967|    541|                    OJPH_MSG_WARN, resilient);
  968|   184k|                else if (marker_idx == 2)
  ------------------
  |  Branch (968:26): [True: 6.21k, False: 178k]
  ------------------
  969|       |                  //Skipping PLT marker segment;this should not cause any issues
  970|  6.21k|                  result = skip_marker(infile, "PLT", NULL,
  971|  6.21k|                    OJPH_MSG_NO_MSG, resilient);
  972|   178k|                else if (marker_idx == 3)
  ------------------
  |  Branch (972:26): [True: 940, False: 177k]
  ------------------
  973|    940|                  result = skip_marker(infile, "COM", NULL,
  974|    940|                    OJPH_MSG_NO_MSG, resilient);
  975|   177k|                else if (marker_idx == 4)
  ------------------
  |  Branch (975:26): [True: 5.92k, False: 171k]
  ------------------
  976|  5.92k|                  result = skip_marker(infile, "NLT",
  977|  5.92k|                    "NLT marker in tile is not supported yet",
  978|  5.92k|                    OJPH_MSG_WARN, resilient);
  979|   171k|                else if (marker_idx == 5)
  ------------------
  |  Branch (979:26): [True: 171k, False: 340]
  ------------------
  980|   171k|                {
  981|   171k|                  sod_found = true;
  982|   171k|                  break;
  983|   171k|                }
  984|       |
  985|  14.4k|                if (marker_idx == -1) //marker not found
  ------------------
  |  Branch (985:21): [True: 340, False: 14.1k]
  ------------------
  986|    340|                {
  987|    340|                  if (resilient)
  ------------------
  |  Branch (987:23): [True: 340, False: 0]
  ------------------
  988|    340|                    OJPH_INFO(0x00030063,
  ------------------
  |  |  285|    340|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    340|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 340, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  989|    340|                      "File terminated early before start of data is found"
  990|    340|                      " for tile indexed %d and tile part %d",
  991|    340|                      sot.get_tile_index(), sot.get_tile_part_index())
  992|      0|                  else
  993|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  994|    340|                      "File terminated early before start of data is found"
  995|    340|                      " for tile indexed %d and tile part %d",
  996|    340|                      sot.get_tile_index(), sot.get_tile_part_index())
  997|    340|                  break;
  998|    340|                }
  999|  14.1k|                if (result == -1) //file terminated during marker seg. skipping
  ------------------
  |  Branch (999:21): [True: 12, False: 14.1k]
  ------------------
 1000|     12|                {
 1001|     12|                  if (resilient)
  ------------------
  |  Branch (1001:23): [True: 12, False: 0]
  ------------------
 1002|     12|                    OJPH_INFO(0x00030064,
  ------------------
  |  |  285|     12|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     12|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1003|     12|                      "File terminated during marker segment skipping")
 1004|      0|                  else
 1005|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1006|     12|                      "File terminated during marker segment skipping")
 1007|     12|                  break;
 1008|     12|                }
 1009|  14.1k|              }
 1010|   171k|              if (sod_found)
  ------------------
  |  Branch (1010:19): [True: 171k, False: 352]
  ------------------
 1011|   171k|                tiles[sot.get_tile_index()].parse_tile_header(sot, infile,
 1012|   171k|                  tile_start_location);
 1013|   171k|            }
 1014|  34.5k|            else
 1015|  34.5k|            { //first tile part
 1016|  34.5k|              bool sod_found = false;
 1017|  34.5k|              ui16 first_tile_part_markers[12] = { SOT, COD, COC, QCD, QCC, RGN,
 1018|  34.5k|                POC, PPT, PLT, COM, NLT, SOD };
 1019|  61.6k|              while (true)
  ------------------
  |  Branch (1019:22): [True: 61.6k, Folded]
  ------------------
 1020|  61.6k|              {
 1021|  61.6k|                int marker_idx = 0;
 1022|  61.6k|                int result = 0;
 1023|  61.6k|                marker_idx = find_marker(infile, first_tile_part_markers+1, 11);
 1024|  61.6k|                if (marker_idx == 0)
  ------------------
  |  Branch (1024:21): [True: 8.45k, False: 53.2k]
  ------------------
 1025|  8.45k|                  result = skip_marker(infile, "COD",
 1026|  8.45k|                    "COD marker segment in a tile is not supported yet",
 1027|  8.45k|                    OJPH_MSG_WARN, resilient);
 1028|  53.2k|                else if (marker_idx == 1)
  ------------------
  |  Branch (1028:26): [True: 672, False: 52.5k]
  ------------------
 1029|    672|                  result = skip_marker(infile, "COC",
 1030|    672|                    "COC marker segment in a tile is not supported yet",
 1031|    672|                    OJPH_MSG_WARN, resilient);
 1032|  52.5k|                else if (marker_idx == 2)
  ------------------
  |  Branch (1032:26): [True: 10.7k, False: 41.8k]
  ------------------
 1033|  10.7k|                  result = skip_marker(infile, "QCD",
 1034|  10.7k|                    "QCD marker segment in a tile is not supported yet",
 1035|  10.7k|                    OJPH_MSG_WARN, resilient);
 1036|  41.8k|                else if (marker_idx == 3)
  ------------------
  |  Branch (1036:26): [True: 711, False: 41.1k]
  ------------------
 1037|    711|                  result = skip_marker(infile, "QCC",
 1038|    711|                    "QCC marker segment in a tile is not supported yet",
 1039|    711|                    OJPH_MSG_WARN, resilient);
 1040|  41.1k|                else if (marker_idx == 4)
  ------------------
  |  Branch (1040:26): [True: 247, False: 40.8k]
  ------------------
 1041|    247|                  result = skip_marker(infile, "RGN",
 1042|    247|                    "RGN marker segment in a tile is not supported yet",
 1043|    247|                    OJPH_MSG_WARN, resilient);
 1044|  40.8k|                else if (marker_idx == 5)
  ------------------
  |  Branch (1044:26): [True: 634, False: 40.2k]
  ------------------
 1045|    634|                  result = skip_marker(infile, "POC",
 1046|    634|                    "POC marker segment in a tile is not supported yet",
 1047|    634|                    OJPH_MSG_WARN, resilient);
 1048|  40.2k|                else if (marker_idx == 6)
  ------------------
  |  Branch (1048:26): [True: 339, False: 39.9k]
  ------------------
 1049|    339|                  result = skip_marker(infile, "PPT",
 1050|    339|                    "PPT marker segment in a tile is not supported yet",
 1051|    339|                    OJPH_MSG_WARN, resilient);
 1052|  39.9k|                else if (marker_idx == 7)
  ------------------
  |  Branch (1052:26): [True: 2.42k, False: 37.4k]
  ------------------
 1053|       |                  //Skipping PLT marker segment;this should not cause any issues
 1054|  2.42k|                  result = skip_marker(infile, "PLT", NULL,
 1055|  2.42k|                    OJPH_MSG_NO_MSG, resilient);
 1056|  37.4k|                else if (marker_idx == 8)
  ------------------
  |  Branch (1056:26): [True: 1.65k, False: 35.8k]
  ------------------
 1057|  1.65k|                  result = skip_marker(infile, "COM", NULL,
 1058|  1.65k|                    OJPH_MSG_NO_MSG, resilient);
 1059|  35.8k|                else if (marker_idx == 9)
  ------------------
  |  Branch (1059:26): [True: 1.29k, False: 34.5k]
  ------------------
 1060|  1.29k|                  result = skip_marker(infile, "NLT",
 1061|  1.29k|                    "PPT marker segment in a tile is not supported yet",
 1062|  1.29k|                    OJPH_MSG_WARN, resilient);
 1063|  34.5k|                else if (marker_idx == 10)
  ------------------
  |  Branch (1063:26): [True: 34.3k, False: 226]
  ------------------
 1064|  34.3k|                {
 1065|  34.3k|                  sod_found = true;
 1066|  34.3k|                  break;
 1067|  34.3k|                }
 1068|       |
 1069|  27.3k|                if (marker_idx == -1) //marker not found
  ------------------
  |  Branch (1069:21): [True: 226, False: 27.1k]
  ------------------
 1070|    226|                {
 1071|    226|                  if (resilient)
  ------------------
  |  Branch (1071:23): [True: 226, False: 0]
  ------------------
 1072|    226|                    OJPH_INFO(0x00030065,
  ------------------
  |  |  285|    226|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    226|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 226, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1073|    226|                      "File terminated early before start of data is found"
 1074|    226|                      " for tile indexed %d and tile part %d",
 1075|    226|                      sot.get_tile_index(), sot.get_tile_part_index())
 1076|      0|                  else
 1077|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1078|    226|                      "File terminated early before start of data is found"
 1079|    226|                      " for tile indexed %d and tile part %d",
 1080|    226|                      sot.get_tile_index(), sot.get_tile_part_index())
 1081|    226|                  break;
 1082|    226|                }
 1083|  27.1k|                if (result == -1) //file terminated during marker seg. skipping
  ------------------
  |  Branch (1083:21): [True: 17, False: 27.1k]
  ------------------
 1084|     17|                {
 1085|     17|                  if (resilient)
  ------------------
  |  Branch (1085:23): [True: 17, False: 0]
  ------------------
 1086|     17|                    OJPH_INFO(0x00030066,
  ------------------
  |  |  285|     17|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     17|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 17, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1087|     17|                      "File terminated during marker segment skipping")
 1088|      0|                  else
 1089|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1090|     17|                      "File terminated during marker segment skipping")
 1091|     17|                  break;
 1092|     17|                }
 1093|  27.1k|              }
 1094|  34.5k|              if (sod_found)
  ------------------
  |  Branch (1094:19): [True: 34.3k, False: 243]
  ------------------
 1095|  34.3k|                tiles[sot.get_tile_index()].parse_tile_header(sot, infile,
 1096|  34.3k|                  tile_start_location);
 1097|  34.5k|            }
 1098|   206k|          }
 1099|   212k|        }
 1100|       |
 1101|       |        // check the next marker; either SOT or EOC,
 1102|       |        // if something is broken, just an end of file
 1103|   227k|        ui16 next_markers[2] = { SOT, EOC };
 1104|   227k|        int marker_idx = find_marker(infile, next_markers, 2);
 1105|   227k|        if (marker_idx == -1)
  ------------------
  |  Branch (1105:13): [True: 5.38k, False: 222k]
  ------------------
 1106|  5.38k|        {
 1107|  5.38k|          OJPH_INFO(0x00030067, "File terminated early");
  ------------------
  |  |  285|  5.38k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  5.38k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5.38k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1108|  5.38k|          break;
 1109|  5.38k|        }
 1110|   222k|        else if (marker_idx == 0)
  ------------------
  |  Branch (1110:18): [True: 222k, False: 15]
  ------------------
 1111|   222k|          ;
 1112|     15|        else if (marker_idx == 1)
  ------------------
  |  Branch (1112:18): [True: 15, False: 0]
  ------------------
 1113|     15|          break;
 1114|   227k|      }
 1115|  5.73k|    }
_ZN4ojph5local10codestream10set_planarEi:
 1119|  3.67k|    {
 1120|  3.67k|      this->planar = planar;
 1121|  3.67k|    }
_ZN4ojph5local10codestream5closeEv:
 1168|  5.46k|    {
 1169|  5.46k|      if (infile)
  ------------------
  |  Branch (1169:11): [True: 5.46k, False: 0]
  ------------------
 1170|  5.46k|        infile->close();
 1171|  5.46k|      if (outfile)
  ------------------
  |  Branch (1171:11): [True: 0, False: 5.46k]
  ------------------
 1172|      0|        outfile->close();
 1173|  5.46k|    }
_ZN4ojph5local10codestream4pullERj:
 1228|  2.49M|    {
 1229|  2.49M|      bool success = false;
 1230|  5.08M|      while (!success)
  ------------------
  |  Branch (1230:14): [True: 2.59M, False: 2.49M]
  ------------------
 1231|  2.59M|      {
 1232|  2.59M|        success = true;
 1233|  5.46M|        for (ui32 i = 0; i < num_tiles.w; ++i)
  ------------------
  |  Branch (1233:26): [True: 2.97M, False: 2.49M]
  ------------------
 1234|  2.97M|        {
 1235|  2.97M|          ui32 idx = i + cur_tile_row * num_tiles.w;
 1236|  2.97M|          if ((success &= tiles[idx].pull(lines + cur_comp, cur_comp)) == false)
  ------------------
  |  Branch (1236:15): [True: 102k, False: 2.87M]
  ------------------
 1237|   102k|            break;
 1238|  2.97M|        }
 1239|  2.59M|        cur_tile_row += success == false ? 1 : 0;
  ------------------
  |  Branch (1239:25): [True: 102k, False: 2.49M]
  ------------------
 1240|  2.59M|        if (cur_tile_row >= num_tiles.h)
  ------------------
  |  Branch (1240:13): [True: 3, False: 2.59M]
  ------------------
 1241|      3|          cur_tile_row = 0;
 1242|  2.59M|      }
 1243|  2.49M|      comp_num = cur_comp;
 1244|       |
 1245|  2.49M|      if (planar) //process one component at a time
  ------------------
  |  Branch (1245:11): [True: 1.74M, False: 749k]
  ------------------
 1246|  1.74M|      {
 1247|  1.74M|        if (++cur_line >= recon_comp_size[cur_comp].h)
  ------------------
  |  Branch (1247:13): [True: 5.45k, False: 1.73M]
  ------------------
 1248|  5.45k|        {
 1249|  5.45k|          cur_line = 0;
 1250|  5.45k|          cur_tile_row = 0;
 1251|  5.45k|          if (cur_comp++ >= num_comps)
  ------------------
  |  Branch (1251:15): [True: 0, False: 5.45k]
  ------------------
 1252|      0|          {
 1253|      0|            comp_num = 0;
 1254|      0|            return NULL;
 1255|      0|          }
 1256|  5.45k|        }
 1257|  1.74M|      }
 1258|   749k|      else //process all component for a line
 1259|   749k|      {
 1260|   749k|        if (++cur_comp >= num_comps)
  ------------------
  |  Branch (1260:13): [True: 747k, False: 2.52k]
  ------------------
 1261|   747k|        {
 1262|   747k|          cur_comp = 0;
 1263|   747k|          if (cur_line++ >= recon_comp_size[cur_comp].h)
  ------------------
  |  Branch (1263:15): [True: 0, False: 747k]
  ------------------
 1264|      0|          {
 1265|      0|            comp_num = 0;
 1266|      0|            return NULL;
 1267|      0|          }
 1268|   747k|        }
 1269|   749k|      }
 1270|       |
 1271|  2.49M|      return lines + comp_num;
 1272|  2.49M|    }
ojph_codestream_local.cpp:_ZN4ojph5localL11find_markerEPNS_11infile_baseEPKti:
  709|  1.23M|    {
  710|       |      //returns the marker index in char_list, or -1
  711|  76.0M|      while (!f->eof())
  ------------------
  |  Branch (711:14): [True: 76.0M, False: 6.03k]
  ------------------
  712|  76.0M|      {
  713|  76.0M|        ui8 new_char;
  714|  76.0M|        size_t num_bytes = f->read(&new_char, 1);
  715|  76.0M|        if (num_bytes != 1)
  ------------------
  |  Branch (715:13): [True: 0, False: 76.0M]
  ------------------
  716|      0|            return -1;
  717|  76.0M|        if (new_char == 0xFF)
  ------------------
  |  Branch (717:13): [True: 6.61M, False: 69.4M]
  ------------------
  718|  6.61M|        {
  719|  6.61M|          size_t num_bytes = f->read(&new_char, 1);
  720|       |
  721|  6.61M|          if (num_bytes != 1)
  ------------------
  |  Branch (721:15): [True: 341, False: 6.61M]
  ------------------
  722|    341|              return -1;
  723|       |
  724|  57.8M|          for (int i = 0; i < list_len; ++i)
  ------------------
  |  Branch (724:27): [True: 52.4M, False: 5.38M]
  ------------------
  725|  52.4M|            if (new_char == (char_list[i] & 0xFF))
  ------------------
  |  Branch (725:17): [True: 1.22M, False: 51.2M]
  ------------------
  726|  1.22M|              return i;
  727|  6.61M|        }
  728|  76.0M|      }
  729|  6.03k|      return -1;
  730|  1.23M|    }
ojph_codestream_local.cpp:_ZN4ojph5localL11skip_markerEPNS_11infile_baseEPKcS4_ib:
  736|  44.2k|    {
  737|  44.2k|      ojph_unused(marker);
  ------------------
  |  |   78|  44.2k|#define ojph_unused(x) (void)(x)
  ------------------
  738|  44.2k|      ui16 com_len;
  739|  44.2k|      if (file->read(&com_len, 2) != 2)
  ------------------
  |  Branch (739:11): [True: 56, False: 44.1k]
  ------------------
  740|     56|      {
  741|     56|        if (resilient)
  ------------------
  |  Branch (741:13): [True: 29, False: 27]
  ------------------
  742|     29|          return -1;
  743|     27|        else
  744|     27|          OJPH_ERROR(0x00030041, "error reading marker");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|     27|      }
  746|  44.2k|      com_len = swap_bytes_if_le(com_len);
  747|  44.2k|      file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
  748|  44.2k|      if (msg != NULL && msg_level != OJPH_MSG_NO_MSG)
  ------------------
  |  Branch (748:11): [True: 31.4k, False: 12.7k]
  |  Branch (748:26): [True: 31.4k, False: 0]
  ------------------
  749|  31.4k|      {
  750|  31.4k|        if (msg_level == OJPH_MSG_INFO)
  ------------------
  |  Branch (750:13): [True: 226, False: 31.2k]
  ------------------
  751|    226|        {
  752|    226|          OJPH_INFO(0x00030001, "%s", msg);
  ------------------
  |  |  285|    226|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    226|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 226, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  753|    226|        }
  754|  31.2k|        else if (msg_level == OJPH_MSG_WARN)
  ------------------
  |  Branch (754:18): [True: 31.2k, False: 0]
  ------------------
  755|  31.2k|        {
  756|  31.2k|          OJPH_WARN(0x00030001, "%s", msg);
  ------------------
  |  |  287|  31.2k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  31.2k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 31.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|  31.2k|        }
  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|  31.4k|      }
  765|  44.2k|      return 0;
  766|  44.2k|    }

_ZNK4ojph5local10codestream16get_tilepart_divEv:
  116|  1.45M|      ui32 get_tilepart_div() const { return tilepart_div; };
_ZNK4ojph5local10codestream13is_tlm_neededEv:
  117|   474k|      bool is_tlm_needed() const { return need_tlm; };
_ZNK4ojph5local10codestream9is_planarEv:
  114|  5.40k|      bool is_planar() const { return planar != 0; }
_ZN4ojph5local10codestream10access_sizEv:
   78|  11.2k|      { return ojph::param_siz(&siz); }
_ZN4ojph5local10codestream7get_sizEv:
   80|  1.48M|      { return &siz; }
_ZN4ojph5local10codestream10access_codEv:
   82|   474k|      { return ojph::param_cod(&cod); }
_ZN4ojph5local10codestream7get_codEv:
   84|   983k|      { return &cod; }
_ZN4ojph5local10codestream7get_cocEj:
   86|  21.5M|      { return cod.get_coc(comp_num); }
_ZN4ojph5local10codestream10access_qcdEv:
   88|  12.7M|      { return &qcd; }
_ZN4ojph5local10codestream10access_dfsEv:
   90|   247k|      { if (dfs.exists()) return &dfs; else return NULL; }
  ------------------
  |  Branch (90:13): [True: 247k, False: 5]
  ------------------
_ZN4ojph5local10codestream7get_nltEv:
   92|   474k|      { return &nlt; }
_ZN4ojph5local10codestream13get_allocatorEv:
   93|  35.5M|      mem_fixed_allocator* get_allocator() { return allocator; }
_ZN4ojph5local10codestream17get_elastic_allocEv:
   94|  10.6M|      mem_elastic_allocator* get_elastic_alloc() { return elastic_alloc; }
_ZN4ojph5local10codestream12is_resilientEv:
  101|  5.92M|      bool is_resilient() { return resilient; }
_ZNK4ojph5local10codestream11get_profileEv:
  115|   474k|      si32 get_profile() const { return profile; };
_ZN4ojph5local10codestream20get_precinct_scratchEv:
  122|  8.25M|      ui8* get_precinct_scratch() { return precinct_scratch; }
_ZN4ojph5local10codestream25get_skipped_res_for_reconEv:
  124|  6.13M|      { return skipped_res_for_recon; }
_ZN4ojph5local10codestream24get_skipped_res_for_readEv:
  126|  3.43M|      { return skipped_res_for_read; }

_ZNK4ojph9param_siz16get_image_extentEv:
   98|  2.14M|  {
   99|  2.14M|    return point(state->Xsiz, state->Ysiz);
  100|  2.14M|  }
_ZNK4ojph9param_siz16get_image_offsetEv:
  104|  2.13M|  {
  105|  2.13M|    return point(state->XOsiz, state->YOsiz);
  106|  2.13M|  }
_ZNK4ojph9param_siz13get_tile_sizeEv:
  110|  2.40M|  {
  111|  2.40M|    return size(state->XTsiz, state->YTsiz);
  112|  2.40M|  }
_ZNK4ojph9param_siz15get_tile_offsetEv:
  116|  1.20M|  {
  117|  1.20M|    return point(state->XTOsiz, state->YTOsiz);
  118|  1.20M|  }
_ZNK4ojph9param_siz18get_num_componentsEv:
  122|  1.53M|  {
  123|  1.53M|    return state->Csiz;
  124|  1.53M|  }
_ZNK4ojph9param_siz15get_recon_widthEj:
  146|  6.83k|  {
  147|  6.83k|    return state->get_recon_width(comp_num);
  148|  6.83k|  }
_ZNK4ojph9param_siz16get_recon_heightEj:
  152|  13.4k|  {
  153|  13.4k|    return state->get_recon_height(comp_num);
  154|  13.4k|  }
_ZNK4ojph9param_cod22get_num_decompositionsEv:
  285|  45.3k|  {
  286|  45.3k|    return state->get_num_decompositions();
  287|  45.3k|  }
_ZNK4ojph9param_cod17get_precinct_sizeEj:
  309|  33.8k|  {
  310|  33.8k|    return state->get_precinct_size(level_num);
  311|  33.8k|  }
_ZNK4ojph9param_cod21get_progression_orderEv:
  321|   474k|  {
  322|   474k|    return state->SGCod.prog_order;
  323|   474k|  }
_ZNK4ojph9param_cod14get_num_layersEv:
  345|  6.75k|  {
  346|  6.75k|    return state->SGCod.num_layers;
  347|  6.75k|  }
_ZN4ojph5local9param_siz4readEPNS_11infile_baseE:
  857|  7.38k|    {
  858|  7.38k|      if (file->read(&Lsiz, 2) != 2)
  ------------------
  |  Branch (858:11): [True: 109, False: 7.27k]
  ------------------
  859|    109|        OJPH_ERROR(0x00050041, "error reading SIZ marker");
  ------------------
  |  |  289|    109|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    109|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 109, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  860|  7.38k|      Lsiz = swap_bytes_if_le(Lsiz);
  861|  7.38k|      int num_comps = (Lsiz - 38) / 3;
  862|  7.38k|      if (Lsiz != 38 + 3 * num_comps)
  ------------------
  |  Branch (862:11): [True: 20, False: 7.36k]
  ------------------
  863|     20|        OJPH_ERROR(0x00050042, "error in SIZ marker length");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  864|  7.38k|      if (file->read(&Rsiz, 2) != 2)
  ------------------
  |  Branch (864:11): [True: 2, False: 7.38k]
  ------------------
  865|      2|        OJPH_ERROR(0x00050043, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  866|  7.38k|      Rsiz = swap_bytes_if_le(Rsiz);
  867|  7.38k|      if ((Rsiz & 0x4000) == 0)
  ------------------
  |  Branch (867:11): [True: 1, False: 7.38k]
  ------------------
  868|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  869|  7.38k|          "Rsiz bit 14 is not set (this is not a JPH file)");
  870|  7.38k|      if ((Rsiz & 0x8000) != 0 && (Rsiz & 0xD5F) != 0)
  ------------------
  |  Branch (870:11): [True: 558, False: 6.82k]
  |  Branch (870:35): [True: 530, False: 28]
  ------------------
  871|    530|        OJPH_WARN(0x00050001, "Rsiz in SIZ has unimplemented fields");
  ------------------
  |  |  287|    530|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    530|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 530, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  872|  7.38k|      if (file->read(&Xsiz, 4) != 4)
  ------------------
  |  Branch (872:11): [True: 17, False: 7.36k]
  ------------------
  873|     17|        OJPH_ERROR(0x00050045, "error reading SIZ marker");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  874|  7.38k|      Xsiz = swap_bytes_if_le(Xsiz);
  875|  7.38k|      if (file->read(&Ysiz, 4) != 4)
  ------------------
  |  Branch (875:11): [True: 7, False: 7.37k]
  ------------------
  876|      7|        OJPH_ERROR(0x00050046, "error reading SIZ 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  877|  7.38k|      Ysiz = swap_bytes_if_le(Ysiz);
  878|  7.38k|      ui32 t_XOsiz, t_YOsiz;
  879|  7.38k|      if (file->read(&t_XOsiz, 4) != 4)
  ------------------
  |  Branch (879:11): [True: 6, False: 7.37k]
  ------------------
  880|      6|        OJPH_ERROR(0x00050047, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  881|  7.38k|      if (file->read(&t_YOsiz, 4) != 4)
  ------------------
  |  Branch (881:11): [True: 3, False: 7.38k]
  ------------------
  882|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  883|  7.38k|      set_image_offset(point(
  884|  7.38k|        swap_bytes_if_le(t_XOsiz),
  885|  7.38k|        swap_bytes_if_le(t_YOsiz)));
  886|  7.38k|      ui32 t_XTsiz, t_YTsiz;
  887|  7.38k|      if (file->read(&t_XTsiz, 4) != 4)
  ------------------
  |  Branch (887:11): [True: 6, False: 7.37k]
  ------------------
  888|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  889|  7.38k|      if (file->read(&t_YTsiz, 4) != 4)
  ------------------
  |  Branch (889:11): [True: 4, False: 7.38k]
  ------------------
  890|      4|        OJPH_ERROR(0x0005004A, "error reading SIZ 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  891|  7.38k|      set_tile_size(size(
  892|  7.38k|        swap_bytes_if_le(t_XTsiz),
  893|  7.38k|        swap_bytes_if_le(t_YTsiz)));
  894|  7.38k|      ui32 t_XTOsiz, t_YTOsiz;
  895|  7.38k|      if (file->read(&t_XTOsiz, 4) != 4)
  ------------------
  |  Branch (895:11): [True: 3, False: 7.38k]
  ------------------
  896|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  897|  7.38k|      if (file->read(&t_YTOsiz, 4) != 4)
  ------------------
  |  Branch (897:11): [True: 3, False: 7.38k]
  ------------------
  898|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  899|  7.38k|      set_tile_offset(point(
  900|  7.38k|        swap_bytes_if_le(t_XTOsiz),
  901|  7.38k|        swap_bytes_if_le(t_YTOsiz)));
  902|  7.38k|      if (file->read(&Csiz, 2) != 2)
  ------------------
  |  Branch (902:11): [True: 2, False: 7.38k]
  ------------------
  903|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  904|  7.38k|      Csiz = swap_bytes_if_le(Csiz);
  905|  7.38k|      if (Csiz != num_comps)
  ------------------
  |  Branch (905:11): [True: 44, False: 7.34k]
  ------------------
  906|     44|        OJPH_ERROR(0x0005004E, "Csiz does not match the SIZ marker size");
  ------------------
  |  |  289|     44|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     44|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 44, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  907|  7.38k|      if (Csiz == 0)
  ------------------
  |  Branch (907:11): [True: 5, False: 7.38k]
  ------------------
  908|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  909|  7.38k|      set_num_components(Csiz);
  910|  36.1k|      for (int c = 0; c < Csiz; ++c)
  ------------------
  |  Branch (910:23): [True: 28.7k, False: 7.38k]
  ------------------
  911|  28.7k|      {
  912|  28.7k|        if (file->read(&cptr[c].SSiz, 1) != 1)
  ------------------
  |  Branch (912:13): [True: 7, False: 28.7k]
  ------------------
  913|      7|          OJPH_ERROR(0x00050051, "error reading SIZ 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  914|  28.7k|        if (file->read(&cptr[c].XRsiz, 1) != 1)
  ------------------
  |  Branch (914:13): [True: 5, False: 28.7k]
  ------------------
  915|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  916|  28.7k|        if (file->read(&cptr[c].YRsiz, 1) != 1)
  ------------------
  |  Branch (916:13): [True: 4, False: 28.7k]
  ------------------
  917|      4|          OJPH_ERROR(0x00050053, "error reading SIZ 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  918|  28.7k|        if ((cptr[c].SSiz & 0x7F) > 37)
  ------------------
  |  Branch (918:13): [True: 8, False: 28.7k]
  ------------------
  919|      8|          OJPH_ERROR(0x00050054, "Wrong SIZ-SSiz value of %d", cptr[c].SSiz);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  920|  28.7k|        if (cptr[c].XRsiz == 0)
  ------------------
  |  Branch (920:13): [True: 2, False: 28.7k]
  ------------------
  921|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  922|  28.7k|        if (cptr[c].YRsiz == 0)
  ------------------
  |  Branch (922:13): [True: 2, False: 28.7k]
  ------------------
  923|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  924|  28.7k|      }
  925|       |
  926|  7.38k|      ws_kern_support_needed = (Rsiz & 0x20) != 0;
  927|  7.38k|      dfs_support_needed = (Rsiz & 0x80) != 0;
  928|       |
  929|  7.38k|      check_validity();
  930|  7.38k|    }
_ZNK4ojph5local9param_siz22get_recon_downsamplingEj:
  934|   542k|    {
  935|   542k|      assert(comp_num < get_num_components());
  936|       |
  937|   542k|      point factor(1u << skipped_resolutions, 1u << skipped_resolutions);
  938|   542k|      const param_cod* cdp = cod->get_coc(comp_num);
  939|   542k|      if (dfs && cdp && cdp->is_dfs_defined()) {
  ------------------
  |  Branch (939:11): [True: 20.0k, False: 522k]
  |  Branch (939:18): [True: 20.0k, False: 0]
  |  Branch (939:25): [True: 15.1k, False: 4.90k]
  ------------------
  940|  15.1k|        const param_dfs* d = dfs->get_dfs(cdp->get_dfs_index());
  941|  15.1k|        factor = d->get_res_downsamp(skipped_resolutions);
  942|  15.1k|      }
  943|   542k|      factor.x *= (ui32)cptr[comp_num].XRsiz;
  944|   542k|      factor.y *= (ui32)cptr[comp_num].YRsiz;
  945|   542k|      return factor;
  946|   542k|    }
_ZNK4ojph5local9param_siz14get_recon_sizeEj:
  950|  40.8k|    {
  951|  40.8k|      assert(comp_num < get_num_components());
  952|       |
  953|  40.8k|      point factor = get_recon_downsampling(comp_num);
  954|  40.8k|      point r;
  955|  40.8k|      r.x = ojph_div_ceil(Xsiz, factor.x) - ojph_div_ceil(XOsiz, factor.x);
  ------------------
  |  |   70|  40.8k|#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|  40.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  956|  40.8k|      r.y = ojph_div_ceil(Ysiz, factor.y) - ojph_div_ceil(YOsiz, factor.y);
  ------------------
  |  |   70|  40.8k|#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|  40.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  957|  40.8k|      return r;
  958|  40.8k|    }
_ZN4ojph5local9param_cap4readEPNS_11infile_baseE:
  995|    511|    {
  996|    511|      if (file->read(&Lcap, 2) != 2)
  ------------------
  |  Branch (996:11): [True: 7, False: 504]
  ------------------
  997|      7|        OJPH_ERROR(0x00050061, "error reading CAP 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  998|    511|      Lcap = swap_bytes_if_le(Lcap);
  999|    511|      if (file->read(&Pcap, 4) != 4)
  ------------------
  |  Branch (999:11): [True: 7, False: 504]
  ------------------
 1000|      7|        OJPH_ERROR(0x00050062, "error reading CAP 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1001|    511|      Pcap = swap_bytes_if_le(Pcap);
 1002|    511|      ui32 count = population_count(Pcap);
 1003|    511|      if (Pcap & 0xFFFDFFFF)
  ------------------
  |  Branch (1003:11): [True: 38, False: 473]
  ------------------
 1004|     38|        OJPH_ERROR(0x00050063,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1005|    511|          "error Pcap in CAP has options that are not supported");
 1006|    511|      if ((Pcap & 0x00020000) == 0)
  ------------------
  |  Branch (1006:11): [True: 1, False: 510]
  ------------------
 1007|      1|        OJPH_ERROR(0x00050064,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1008|    511|          "error Pcap should have its 15th MSB set, Pcap^15. "
 1009|    511|          " This is not a JPH file");
 1010|    969|      for (ui32 i = 0; i < count; ++i)
  ------------------
  |  Branch (1010:24): [True: 458, False: 511]
  ------------------
 1011|    458|        if (file->read(Ccap+i, 2) != 2)
  ------------------
  |  Branch (1011:13): [True: 2, False: 456]
  ------------------
 1012|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1013|    511|      if (Lcap != 6 + 2 * count)
  ------------------
  |  Branch (1013:11): [True: 20, False: 491]
  ------------------
 1014|     20|        OJPH_ERROR(0x00050066, "error in CAP marker length");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1015|    511|    }
_ZNK4ojph5local9param_cod13is_reversibleEv:
 1027|  5.96M|    {
 1028|  5.96M|      if (SPcod.wavelet_trans <= 1)
  ------------------
  |  Branch (1028:11): [True: 5.96M, False: 7.59k]
  ------------------
 1029|  5.96M|        return get_wavelet_kern() == local::param_cod::DWT_REV53;
 1030|  7.59k|      else {
 1031|       |        assert(atk != NULL);
 1032|  7.59k|        return atk->is_reversible();
 1033|  7.59k|      }
 1034|  5.96M|    }
_ZN4ojph5local9param_cod4readEPNS_11infile_baseE:
 1149|  6.85k|    {
 1150|  6.85k|      assert(type == COD_MAIN);
 1151|       |
 1152|  6.85k|      if (file->read(&Lcod, 2) != 2)
  ------------------
  |  Branch (1152:11): [True: 3, False: 6.84k]
  ------------------
 1153|      3|        OJPH_ERROR(0x00050071, "error reading COD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1154|  6.85k|      Lcod = swap_bytes_if_le(Lcod);
 1155|  6.85k|      if (file->read(&Scod, 1) != 1)
  ------------------
  |  Branch (1155:11): [True: 2, False: 6.85k]
  ------------------
 1156|      2|        OJPH_ERROR(0x00050072, "error reading COD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1157|  6.85k|      if (file->read(&SGCod.prog_order, 1) != 1)
  ------------------
  |  Branch (1157:11): [True: 1, False: 6.85k]
  ------------------
 1158|      1|        OJPH_ERROR(0x00050073, "error reading COD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1159|  6.85k|      if (file->read(&SGCod.num_layers, 2) != 2)
  ------------------
  |  Branch (1159:11): [True: 4, False: 6.84k]
  ------------------
 1160|      4|      { OJPH_ERROR(0x00050074, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1161|  6.84k|      else
 1162|  6.84k|        SGCod.num_layers = swap_bytes_if_le(SGCod.num_layers);
 1163|  6.85k|      if (file->read(&SGCod.mc_trans, 1) != 1)
  ------------------
  |  Branch (1163:11): [True: 5, False: 6.84k]
  ------------------
 1164|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1165|  6.85k|      if (file->read(&SPcod.num_decomp, 1) != 1)
  ------------------
  |  Branch (1165:11): [True: 4, False: 6.84k]
  ------------------
 1166|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1167|  6.85k|      if (file->read(&SPcod.block_width, 1) != 1)
  ------------------
  |  Branch (1167:11): [True: 1, False: 6.85k]
  ------------------
 1168|      1|        OJPH_ERROR(0x00050077, "error reading COD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1169|  6.85k|      if (file->read(&SPcod.block_height, 1) != 1)
  ------------------
  |  Branch (1169:11): [True: 2, False: 6.85k]
  ------------------
 1170|      2|        OJPH_ERROR(0x00050078, "error reading COD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1171|  6.85k|      if (file->read(&SPcod.block_style, 1) != 1)
  ------------------
  |  Branch (1171:11): [True: 1, False: 6.85k]
  ------------------
 1172|      1|        OJPH_ERROR(0x00050079, "error reading COD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1173|  6.85k|      if (file->read(&SPcod.wavelet_trans, 1) != 1)
  ------------------
  |  Branch (1173:11): [True: 2, False: 6.85k]
  ------------------
 1174|      2|        OJPH_ERROR(0x0005007A, "error reading COD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1175|       |
 1176|  6.85k|      if (get_num_decompositions() > 32
  ------------------
  |  Branch (1176:11): [True: 29, False: 6.82k]
  ------------------
 1177|  6.82k|        || SPcod.block_width > 8
  ------------------
  |  Branch (1177:12): [True: 7, False: 6.81k]
  ------------------
 1178|  6.81k|        || SPcod.block_height > 8
  ------------------
  |  Branch (1178:12): [True: 9, False: 6.80k]
  ------------------
 1179|  6.80k|        || SPcod.block_width + SPcod.block_height > 8
  ------------------
  |  Branch (1179:12): [True: 1, False: 6.80k]
  ------------------
 1180|  6.80k|        || (SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1180:12): [True: 4, False: 6.80k]
  ------------------
 1181|  6.80k|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1181:12): [True: 7, False: 6.79k]
  ------------------
 1182|     32|        OJPH_ERROR(0x0005007D, "wrong settings in a COD-SPcod parameter");
  ------------------
  |  |  289|     32|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     32|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 32, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1183|  6.85k|      if ((SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1183:11): [True: 57, False: 6.79k]
  ------------------
 1184|  6.79k|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1184:12): [True: 0, False: 6.79k]
  ------------------
 1185|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1186|       |
 1187|  6.85k|      ui8 num_decompositions =  get_num_decompositions();
 1188|  6.85k|      if (Scod & 1) {
  ------------------
  |  Branch (1188:11): [True: 6.47k, False: 375]
  ------------------
 1189|  44.2k|        for (int i = 0; i <= num_decompositions; ++i) {
  ------------------
  |  Branch (1189:25): [True: 37.7k, False: 6.47k]
  ------------------
 1190|  37.7k|          if (file->read(&SPcod.precinct_size[i], 1) != 1)
  ------------------
  |  Branch (1190:15): [True: 9, False: 37.7k]
  ------------------
 1191|      9|            OJPH_ERROR(0x0005007B, "error reading COD segment");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1192|  37.7k|          if (i)
  ------------------
  |  Branch (1192:15): [True: 31.2k, False: 6.48k]
  ------------------
 1193|  31.2k|            if ((SPcod.precinct_size[i] & 0x0F) == 0 ||
  ------------------
  |  Branch (1193:17): [True: 6, False: 31.2k]
  ------------------
 1194|  31.2k|              (SPcod.precinct_size[i] >> 4) == 0)
  ------------------
  |  Branch (1194:15): [True: 4, False: 31.2k]
  ------------------
 1195|     10|              OJPH_ERROR(0x0005007F,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1196|  37.7k|                "Precinct width or height for resolutions other than the"
 1197|  37.7k|                " coarsest must be larger than 1; here, they are %d and %d,"
 1198|  37.7k|                " respectively.",
 1199|  37.7k|                1 << (SPcod.precinct_size[i] & 0x0F),
 1200|  37.7k|                1 << (SPcod.precinct_size[i] >> 4));
 1201|  37.7k|        }
 1202|  6.47k|      }
 1203|  6.85k|      if (Lcod != 12 + ((Scod & 1) ? 1 + SPcod.num_decomp : 0))
  ------------------
  |  Branch (1203:11): [True: 22, False: 6.83k]
  |  Branch (1203:25): [True: 6.45k, False: 394]
  ------------------
 1204|     22|        OJPH_ERROR(0x0005007C, "error in COD segment length");
  ------------------
  |  |  289|     22|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     22|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 22, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1205|  6.85k|    }
_ZN4ojph5local9param_cod8read_cocEPNS_11infile_baseEjPS1_:
 1210|    871|    {
 1211|    871|      assert(type == COC_MAIN);
 1212|    871|      assert(top_cod != NULL);
 1213|       |
 1214|    871|      this->SGCod = top_cod->SGCod;
 1215|    871|      this->top_cod = top_cod;
 1216|    871|      if (file->read(&Lcod, 2) != 2)
  ------------------
  |  Branch (1216:11): [True: 2, False: 869]
  ------------------
 1217|      2|        OJPH_ERROR(0x00050121, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|    871|      Lcod = swap_bytes_if_le(Lcod);
 1219|    871|      if (num_comps < 257) {
  ------------------
  |  Branch (1219:11): [True: 867, False: 4]
  ------------------
 1220|    867|        ui8 t;
 1221|    867|        if (file->read(&t, 1) != 1)
  ------------------
  |  Branch (1221:13): [True: 4, False: 863]
  ------------------
 1222|      4|          OJPH_ERROR(0x00050122, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1223|    867|        comp_idx = t;
 1224|    867|      }
 1225|      4|      else {
 1226|      4|        if (file->read(&comp_idx, 2) != 2)
  ------------------
  |  Branch (1226:13): [True: 1, False: 3]
  ------------------
 1227|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1228|      4|        comp_idx = swap_bytes_if_le(comp_idx);
 1229|      4|      }
 1230|    871|      if (file->read(&Scod, 1) != 1)
  ------------------
  |  Branch (1230:11): [True: 3, False: 868]
  ------------------
 1231|      3|        OJPH_ERROR(0x00050124, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1232|    871|      if (Scod & 0xF8)
  ------------------
  |  Branch (1232:11): [True: 623, False: 248]
  ------------------
 1233|    623|        OJPH_WARN(0x00050011,
  ------------------
  |  |  287|    623|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    623|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 623, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1234|    871|          "Unsupported options in Scoc field of the COC segment");
 1235|    871|      if (file->read(&SPcod.num_decomp, 1) != 1)
  ------------------
  |  Branch (1235:11): [True: 9, False: 862]
  ------------------
 1236|      9|        OJPH_ERROR(0x00050125, "error reading COC segment");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1237|    871|      if (file->read(&SPcod.block_width, 1) != 1)
  ------------------
  |  Branch (1237:11): [True: 3, False: 868]
  ------------------
 1238|      3|        OJPH_ERROR(0x00050126, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1239|    871|      if (file->read(&SPcod.block_height, 1) != 1)
  ------------------
  |  Branch (1239:11): [True: 6, False: 865]
  ------------------
 1240|      6|        OJPH_ERROR(0x00050127, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1241|    871|      if (file->read(&SPcod.block_style, 1) != 1)
  ------------------
  |  Branch (1241:11): [True: 1, False: 870]
  ------------------
 1242|      1|        OJPH_ERROR(0x00050128, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1243|    871|      if (file->read(&SPcod.wavelet_trans, 1) != 1)
  ------------------
  |  Branch (1243:11): [True: 5, False: 866]
  ------------------
 1244|      5|        OJPH_ERROR(0x00050129, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1245|       |
 1246|    871|      if (get_num_decompositions() > 32
  ------------------
  |  Branch (1246:11): [True: 37, False: 834]
  ------------------
 1247|    834|        || SPcod.block_width > 8
  ------------------
  |  Branch (1247:12): [True: 8, False: 826]
  ------------------
 1248|    826|        || SPcod.block_height > 8
  ------------------
  |  Branch (1248:12): [True: 7, False: 819]
  ------------------
 1249|    819|        || SPcod.block_width + SPcod.block_height > 8
  ------------------
  |  Branch (1249:12): [True: 1, False: 818]
  ------------------
 1250|    818|        || (SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1250:12): [True: 5, False: 813]
  ------------------
 1251|    813|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1251:12): [True: 8, False: 805]
  ------------------
 1252|     32|        OJPH_ERROR(0x0005012C, "wrong settings in a COC-SPcoc parameter");
  ------------------
  |  |  289|     32|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     32|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 32, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1253|    871|      if ((SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1253:11): [True: 66, False: 805]
  ------------------
 1254|    805|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1254:12): [True: 0, False: 805]
  ------------------
 1255|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1256|       |
 1257|    871|      ui8 num_decompositions =  get_num_decompositions();
 1258|    871|      if (Scod & 1) {
  ------------------
  |  Branch (1258:11): [True: 196, False: 675]
  ------------------
 1259|    831|        for (int i = 0; i <= num_decompositions; ++i) {
  ------------------
  |  Branch (1259:25): [True: 635, False: 196]
  ------------------
 1260|    635|          if (file->read(&SPcod.precinct_size[i], 1) != 1)
  ------------------
  |  Branch (1260:15): [True: 8, False: 627]
  ------------------
 1261|      8|            OJPH_ERROR(0x0005012A, "error reading COC 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1262|    635|          if (i)
  ------------------
  |  Branch (1262:15): [True: 432, False: 203]
  ------------------
 1263|    432|            if ((SPcod.precinct_size[i] & 0x0F) == 0 ||
  ------------------
  |  Branch (1263:17): [True: 2, False: 430]
  ------------------
 1264|    430|              (SPcod.precinct_size[i] >> 4) == 0)
  ------------------
  |  Branch (1264:15): [True: 4, False: 426]
  ------------------
 1265|      6|              OJPH_ERROR(0x0005012E,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1266|    635|                "Precinct width or height for resolutions other than the"
 1267|    635|                " coarsest must be larger than 1; here, they are %d and %d,"
 1268|    635|                " respectively.",
 1269|    635|                1 << (SPcod.precinct_size[i] & 0x0F),
 1270|    635|                1 << (SPcod.precinct_size[i] >> 4));
 1271|    635|        }
 1272|    196|      }
 1273|    871|      ui32 t = 9;
 1274|    871|      t += num_comps < 257 ? 0 : 1;
  ------------------
  |  Branch (1274:12): [True: 791, False: 80]
  ------------------
 1275|    871|      t += (Scod & 1) ? 1 + num_decompositions : 0;
  ------------------
  |  Branch (1275:12): [True: 182, False: 689]
  ------------------
 1276|    871|      if (Lcod != t)
  ------------------
  |  Branch (1276:11): [True: 19, False: 852]
  ------------------
 1277|     19|        OJPH_ERROR(0x0005012B, "error in COC segment length");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1278|    871|    }
_ZN4ojph5local9param_cod10update_atkEPNS0_9param_atkE:
 1282|  5.84k|    {
 1283|  5.84k|      assert(type == COD_MAIN);
 1284|  5.84k|      this->atk = atk->get_atk(SPcod.wavelet_trans);
 1285|  5.84k|      if (this->atk == NULL)
  ------------------
  |  Branch (1285:11): [True: 9, False: 5.83k]
  ------------------
 1286|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1287|  5.84k|          "atk = %d, but a corresponding ATK segment cannot be found.",
 1288|  5.84k|          SPcod.wavelet_trans);
 1289|  5.84k|      param_cod *p = next;
 1290|  6.50k|      while (p)
  ------------------
  |  Branch (1290:14): [True: 663, False: 5.84k]
  ------------------
 1291|    663|      {
 1292|    663|        p->atk = atk->get_atk(p->SPcod.wavelet_trans);
 1293|    663|        if (p->atk == NULL)
  ------------------
  |  Branch (1293:13): [True: 2, False: 661]
  ------------------
 1294|      2|          OJPH_ERROR(0x00050132, "A COC segment employs the DWT kernel "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1295|    663|            "atk = %d, but a corresponding ATK segment cannot be found",
 1296|    663|            SPcod.wavelet_trans);
 1297|    663|        p = p->next;
 1298|    663|      }
 1299|  5.84k|    }
_ZNK4ojph5local9param_cod7get_cocEj:
 1303|  34.9M|    {
 1304|  34.9M|      assert(this->type == COD_MAIN || this->top_cod->type == COD_MAIN);
 1305|  34.9M|      const param_cod *p, *q;
 1306|  34.9M|      if (this->type == COD_MAIN)
  ------------------
  |  Branch (1306:11): [True: 34.5M, False: 398k]
  ------------------
 1307|  34.5M|        q = p = this;
 1308|   398k|      else
 1309|   398k|        q = p = this->top_cod;
 1310|  57.3M|      while (p && p->comp_idx != comp_idx)
  ------------------
  |  Branch (1310:14): [True: 36.1M, False: 21.2M]
  |  Branch (1310:19): [True: 22.4M, False: 13.6M]
  ------------------
 1311|  22.4M|        p = p->next;
 1312|  34.9M|      return p ? p : q;
  ------------------
  |  Branch (1312:14): [True: 13.6M, False: 21.2M]
  ------------------
 1313|  34.9M|    }
_ZN4ojph5local9param_cod7get_cocEj:
 1317|  21.5M|    {
 1318|       |      // cast object to constant
 1319|  21.5M|      const param_cod* const_p = const_cast<const param_cod*>(this);
 1320|       |      // call using the constant object, then cast to non-const
 1321|  21.5M|      return const_cast<param_cod*>(const_p->get_coc(comp_idx));
 1322|  21.5M|    }
_ZN4ojph5local9param_cod14add_coc_objectEj:
 1326|    871|    {
 1327|    871|      assert(type == COD_MAIN);
 1328|    871|      param_cod *p = this;
 1329|  1.15k|      while (p->next != NULL)
  ------------------
  |  Branch (1329:14): [True: 282, False: 871]
  ------------------
 1330|    282|        p = p->next;
 1331|    871|      if (avail)
  ------------------
  |  Branch (1331:11): [True: 0, False: 871]
  ------------------
 1332|      0|      {
 1333|      0|        p->next = avail;
 1334|      0|        avail = avail->next;
 1335|      0|        p->next->init(this, (ui16)comp_idx);
 1336|      0|      }
 1337|    871|      else
 1338|    871|        p->next = new param_cod(this, (ui16)comp_idx);
 1339|    871|      return p->next;
 1340|    871|    }
_ZNK4ojph5local9param_qcd15get_irrev_deltaEPKNS0_9param_dfsEjjjj:
 1655|  2.89M|    {
 1656|  2.89M|      float arr[] = { 1.0f, 2.0f, 2.0f, 4.0f };
 1657|  2.89M|      if ((Sqcd & 0x1F) != 2)
  ------------------
  |  Branch (1657:11): [True: 52, False: 2.89M]
  ------------------
 1658|     52|        OJPH_ERROR(0x00050101, "There is something wrong in the configuration "
  ------------------
  |  |  289|     52|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     52|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 52, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1659|  2.89M|          "of the codestream; for component %d, the codestream defines an "
 1660|  2.89M|          "irreversible transform, for which the codestream provides a "
 1661|  2.89M|          "reversible (no quantization) step sizes in Sqcd/Sqcc.", comp_num);
 1662|       |
 1663|  2.89M|      ui32 idx;
 1664|  2.89M|      if (dfs != NULL && dfs->exists())
  ------------------
  |  Branch (1664:11): [True: 55.4k, False: 2.84M]
  |  Branch (1664:26): [True: 54.8k, False: 555]
  ------------------
 1665|  54.8k|        idx = dfs->get_subband_idx(num_decompositions, resolution, subband);
 1666|  2.84M|      else
 1667|  2.84M|        idx = resolution ? (resolution - 1) * 3 + subband : 0;
  ------------------
  |  Branch (1667:15): [True: 2.66M, False: 176k]
  ------------------
 1668|  2.89M|      if (idx >= num_subbands) {
  ------------------
  |  Branch (1668:11): [True: 1.94M, False: 951k]
  ------------------
 1669|  1.94M|        OJPH_INFO(0x00050102, "Trying to access quantization step size for "
  ------------------
  |  |  285|  1.94M|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  1.94M|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1.94M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1670|  1.94M|          "subband %d when the QCD/QCC marker segment specifies "
 1671|  1.94M|          "quantization step sizes for %d subbands only.  To continue "
 1672|  1.94M|          "decoding, we are using the step size for subband %d, which can "
 1673|  1.94M|          "produce incorrect results",
 1674|  1.94M|          idx + 1, num_subbands, num_subbands - 1);
 1675|  1.94M|        idx = num_subbands - 1;
 1676|  1.94M|      }
 1677|  2.89M|      int eps = SPqcd.u16[idx] >> 11;
 1678|  2.89M|      float mantissa;
 1679|  2.89M|      mantissa = (float)((SPqcd.u16[idx] & 0x7FF) | 0x800) * arr[subband];
 1680|  2.89M|      mantissa /= (float)(1 << 11);
 1681|  2.89M|      mantissa /= (float)(1u << eps);
 1682|  2.89M|      return mantissa;
 1683|  2.89M|    }
_ZNK4ojph5local9param_qcd17propose_precisionEPKNS0_9param_codE:
 1687|  12.7M|    {
 1688|  12.7M|      ui32 comp_idx = cod->get_comp_idx();
 1689|  12.7M|      ui32 precision = 0;
 1690|  12.7M|      const param_cod *main =
 1691|  12.7M|        cod->get_coc(param_cod::OJPH_COD_DEFAULT);
 1692|  12.7M|      if (main->is_employing_color_transform() && comp_idx < 3)
  ------------------
  |  Branch (1692:11): [True: 460k, False: 12.3M]
  |  Branch (1692:51): [True: 7.64k, False: 452k]
  ------------------
 1693|  7.64k|      {
 1694|  30.5k|        for (ui32 i = 0; i < 3; ++i) {
  ------------------
  |  Branch (1694:26): [True: 22.9k, False: 7.64k]
  ------------------
 1695|  22.9k|          const param_qcd* p = this->get_qcc(i);
 1696|  22.9k|          precision = ojph_max(precision, p->get_largest_Kmax());
  ------------------
  |  |   73|  22.9k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 596, False: 22.3k]
  |  |  ------------------
  ------------------
 1697|  22.9k|        }
 1698|  7.64k|      }
 1699|  12.7M|      else {
 1700|  12.7M|        precision = get_largest_Kmax();
 1701|  12.7M|      }
 1702|       |      // ``precision'' now holds the largest K_max, which excludes the sign
 1703|       |      // bit.
 1704|       |      // + 1 for the sign bit
 1705|       |      // + 1 because my block decoder/encoder does not supports up to 30
 1706|       |      //     bits (not 31), so we bump it by one more bit.
 1707|  12.7M|      return precision + 1 + 1;
 1708|  12.7M|    }
_ZNK4ojph5local9param_qcd18get_num_guard_bitsEv:
 1712|  20.5M|    {
 1713|  20.5M|      return (Sqcd >> 5);
 1714|  20.5M|    }
_ZNK4ojph5local9param_qcd8get_KmaxEPKNS0_9param_dfsEjjj:
 1719|  7.72M|    {
 1720|  7.72M|      ui32 idx;
 1721|  7.72M|      if (dfs != NULL && dfs->exists())
  ------------------
  |  Branch (1721:11): [True: 70.0k, False: 7.65M]
  |  Branch (1721:26): [True: 69.4k, False: 558]
  ------------------
 1722|  69.4k|        idx = dfs->get_subband_idx(num_decompositions, resolution, subband);
 1723|  7.65M|      else
 1724|  7.65M|        idx = resolution ? (resolution - 1) * 3 + subband : 0;
  ------------------
  |  Branch (1724:15): [True: 7.16M, False: 487k]
  ------------------
 1725|  7.72M|      if (idx >= num_subbands) {
  ------------------
  |  Branch (1725:11): [True: 4.48M, False: 3.23M]
  ------------------
 1726|  4.48M|        OJPH_INFO(0x00050111, "Trying to access quantization step size for "
  ------------------
  |  |  285|  4.48M|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  4.48M|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4.48M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1727|  4.48M|          "subband %d when the QCD/QCC marker segment specifies "
 1728|  4.48M|          "quantization step sizes for %d subbands only.  To continue "
 1729|  4.48M|          "decoding, we are using the step size for subband %d, which can "
 1730|  4.48M|          "produce incorrect results",
 1731|  4.48M|          idx + 1, num_subbands, num_subbands - 1);
 1732|  4.48M|        idx = num_subbands - 1;
 1733|  4.48M|      }
 1734|       |
 1735|  7.72M|      int irrev = Sqcd & 0x1F;
 1736|  7.72M|      ui32 num_bits = 0;
 1737|  7.72M|      if (irrev == 0) // reversible; this is (10.22) from the J2K book
  ------------------
  |  Branch (1737:11): [True: 3.98M, False: 3.73M]
  ------------------
 1738|  3.98M|      {
 1739|  3.98M|        num_bits = decode_SPqcd(SPqcd.u8[idx]);
 1740|  3.98M|        num_bits = num_bits == 0 ? 0 : num_bits - 1;
  ------------------
  |  Branch (1740:20): [True: 3.06M, False: 920k]
  ------------------
 1741|  3.98M|      }
 1742|  3.73M|      else if (irrev == 1)
  ------------------
  |  Branch (1742:16): [True: 0, False: 3.73M]
  ------------------
 1743|  3.73M|        assert(0);
 1744|  3.73M|      else if (irrev == 2) //scalar expounded
  ------------------
  |  Branch (1744:16): [True: 3.73M, False: 0]
  ------------------
 1745|  3.73M|        num_bits = (SPqcd.u16[idx] >> 11) - 1;
 1746|      0|      else
 1747|  3.73M|        assert(0);
 1748|       |
 1749|  7.72M|      return num_bits + get_num_guard_bits();
 1750|  7.72M|    }
_ZNK4ojph5local9param_qcd16get_largest_KmaxEv:
 1754|  12.8M|    {
 1755|  12.8M|      int irrev = Sqcd & 0x1F;
 1756|  12.8M|      ui32 num_bits = 0;
 1757|  12.8M|      if (irrev == 0) // reversible; this is (10.22) from the J2K book
  ------------------
  |  Branch (1757:11): [True: 6.66M, False: 6.15M]
  ------------------
 1758|  6.66M|      {
 1759|  67.4M|        for (ui32 i = 0; i < num_subbands; ++i) {
  ------------------
  |  Branch (1759:26): [True: 60.7M, False: 6.66M]
  ------------------
 1760|  60.7M|          ui32 t = decode_SPqcd(SPqcd.u8[i]);
 1761|  60.7M|          num_bits = ojph_max(num_bits, t == 0 ? 0 : t - 1);
  ------------------
  |  |   73|   121M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 48.0M, False: 12.7M]
  |  |  |  Branch (73:33): [True: 36.8M, False: 23.8M]
  |  |  |  Branch (73:46): [True: 796k, False: 11.9M]
  |  |  ------------------
  ------------------
 1762|  60.7M|        }
 1763|  6.66M|      }
 1764|  6.15M|      else if (irrev == 1)
  ------------------
  |  Branch (1764:16): [True: 0, False: 6.15M]
  ------------------
 1765|  6.15M|        assert(0);
 1766|  6.15M|      else if (irrev == 2) //scalar expounded
  ------------------
  |  Branch (1766:16): [True: 6.15M, False: 0]
  ------------------
 1767|  6.15M|      {
 1768|  43.0M|        for (ui32 i = 0; i < num_subbands; ++i) {
  ------------------
  |  Branch (1768:26): [True: 36.9M, False: 6.15M]
  ------------------
 1769|  36.9M|          ui32 t = (SPqcd.u16[i] >> 11) - 1;
 1770|  36.9M|          num_bits = ojph_max(num_bits, t);
  ------------------
  |  |   73|  36.9M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 10.2M, False: 26.6M]
  |  |  ------------------
  ------------------
 1771|  36.9M|        }
 1772|  6.15M|      }
 1773|      0|      else
 1774|  6.15M|        assert(0);
 1775|       |
 1776|  12.8M|      return num_bits + get_num_guard_bits();
 1777|  12.8M|    }
_ZN4ojph5local9param_qcd4readEPNS_11infile_baseE:
 1906|  6.87k|    {
 1907|  6.87k|      if (file->read(&Lqcd, 2) != 2)
  ------------------
  |  Branch (1907:11): [True: 14, False: 6.86k]
  ------------------
 1908|     14|        OJPH_ERROR(0x00050081, "error reading QCD marker");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1909|  6.87k|      Lqcd = swap_bytes_if_le(Lqcd);
 1910|  6.87k|      if (file->read(&Sqcd, 1) != 1)
  ------------------
  |  Branch (1910:11): [True: 6, False: 6.87k]
  ------------------
 1911|      6|        OJPH_ERROR(0x00050082, "error reading QCD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1912|  6.87k|      if ((Sqcd & 0x1F) == 0)
  ------------------
  |  Branch (1912:11): [True: 4.97k, False: 1.90k]
  ------------------
 1913|  4.97k|      {
 1914|  4.97k|        num_subbands = (Lqcd - 3);
 1915|  4.97k|        if (num_subbands == 0)
  ------------------
  |  Branch (1915:13): [True: 1, False: 4.97k]
  ------------------
 1916|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1917|  4.97k|            "quantization informtion");
 1918|  4.97k|        if (num_subbands > 97 || Lqcd != 3 + num_subbands)
  ------------------
  |  Branch (1918:13): [True: 20, False: 4.95k]
  |  Branch (1918:34): [True: 0, False: 4.95k]
  ------------------
 1919|     19|          OJPH_ERROR(0x00050083, "wrong Lqcd value of %d in QCD marker", Lqcd);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1920|  54.4k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1920:26): [True: 49.5k, False: 4.97k]
  ------------------
 1921|  49.5k|          if (file->read(&SPqcd.u8[i], 1) != 1)
  ------------------
  |  Branch (1921:15): [True: 15, False: 49.4k]
  ------------------
 1922|     15|            OJPH_ERROR(0x00050084, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1923|  4.97k|      }
 1924|  1.90k|      else if ((Sqcd & 0x1F) == 1)
  ------------------
  |  Branch (1924:16): [True: 1, False: 1.90k]
  ------------------
 1925|      1|      {
 1926|      1|        num_subbands = 0;
 1927|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1928|      1|          "Scalar derived quantization is not supported yet in QCD marker");
 1929|      1|        if (Lqcd != 5)
  ------------------
  |  Branch (1929:13): [True: 0, False: 1]
  ------------------
 1930|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1931|      1|      }
 1932|  1.90k|      else if ((Sqcd & 0x1F) == 2)
  ------------------
  |  Branch (1932:16): [True: 1.87k, False: 27]
  ------------------
 1933|  1.87k|      {
 1934|  1.87k|        num_subbands = (Lqcd - 3) / 2;
 1935|  1.87k|        if (num_subbands == 0)
  ------------------
  |  Branch (1935:13): [True: 1, False: 1.87k]
  ------------------
 1936|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1937|  1.87k|            "quantization informtion");
 1938|  1.87k|        if (num_subbands > 97 || Lqcd != 3 + 2 * num_subbands)
  ------------------
  |  Branch (1938:13): [True: 15, False: 1.86k]
  |  Branch (1938:34): [True: 5, False: 1.85k]
  ------------------
 1939|     19|          OJPH_ERROR(0x00050086, "wrong Lqcd value of %d in QCD marker", Lqcd);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1940|  12.5k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1940:26): [True: 10.7k, False: 1.87k]
  ------------------
 1941|  10.7k|        {
 1942|  10.7k|          if (file->read(&SPqcd.u16[i], 2) != 2)
  ------------------
  |  Branch (1942:15): [True: 14, False: 10.6k]
  ------------------
 1943|     14|            OJPH_ERROR(0x00050087, "error reading QCD marker");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1944|  10.7k|          SPqcd.u16[i] = swap_bytes_if_le(SPqcd.u16[i]);
 1945|  10.7k|        }
 1946|  1.87k|      }
 1947|     27|      else
 1948|     27|        OJPH_ERROR(0x00050088, "wrong Sqcd value in QCD marker");
  ------------------
  |  |  289|     27|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     27|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1949|  6.87k|    }
_ZN4ojph5local9param_qcd8read_qccEPNS_11infile_baseEj:
 1953|    285|    {
 1954|    285|      if (file->read(&Lqcd, 2) != 2)
  ------------------
  |  Branch (1954:11): [True: 4, False: 281]
  ------------------
 1955|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1956|    285|      Lqcd = swap_bytes_if_le(Lqcd);
 1957|    285|      if (num_comps < 257)
  ------------------
  |  Branch (1957:11): [True: 230, False: 55]
  ------------------
 1958|    230|      {
 1959|    230|        ui8 v;
 1960|    230|        if (file->read(&v, 1) != 1)
  ------------------
  |  Branch (1960:13): [True: 3, False: 227]
  ------------------
 1961|      3|          OJPH_ERROR(0x000500A2, "error reading QCC 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1962|    230|        comp_idx = v;
 1963|    230|      }
 1964|     55|      else
 1965|     55|      {
 1966|     55|        if (file->read(&comp_idx, 2) != 2)
  ------------------
  |  Branch (1966:13): [True: 0, False: 55]
  ------------------
 1967|      0|          OJPH_ERROR(0x000500A3, "error reading 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1968|     55|        comp_idx = swap_bytes_if_le(comp_idx);
 1969|     55|      }
 1970|    285|      if (file->read(&Sqcd, 1) != 1)
  ------------------
  |  Branch (1970:11): [True: 1, False: 284]
  ------------------
 1971|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1972|    285|      ui32 offset = num_comps < 257 ? 4 : 5;
  ------------------
  |  Branch (1972:21): [True: 226, False: 59]
  ------------------
 1973|    285|      if ((Sqcd & 0x1F) == 0)
  ------------------
  |  Branch (1973:11): [True: 143, False: 142]
  ------------------
 1974|    143|      {
 1975|    143|        num_subbands = (Lqcd - offset);
 1976|    143|        if (num_subbands == 0)
  ------------------
  |  Branch (1976:13): [True: 1, False: 142]
  ------------------
 1977|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1978|    143|            "quantization informtion");
 1979|    143|        if (num_subbands > 97 || Lqcd != offset + num_subbands)
  ------------------
  |  Branch (1979:13): [True: 19, False: 124]
  |  Branch (1979:34): [True: 0, False: 124]
  ------------------
 1980|     18|          OJPH_ERROR(0x000500A5, "wrong Lqcd value of %d in QCC marker", Lqcd);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1981|  2.37k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1981:26): [True: 2.23k, False: 143]
  ------------------
 1982|  2.23k|          if (file->read(&SPqcd.u8[i], 1) != 1)
  ------------------
  |  Branch (1982:15): [True: 14, False: 2.21k]
  ------------------
 1983|     14|            OJPH_ERROR(0x000500A6, "error reading QCC marker");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1984|    143|      }
 1985|    142|      else if ((Sqcd & 0x1F) == 1)
  ------------------
  |  Branch (1985:16): [True: 1, False: 141]
  ------------------
 1986|      1|      {
 1987|      1|        num_subbands = 0;
 1988|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1989|      1|          "Scalar derived quantization is not supported yet in QCC marker");
 1990|      1|        if (Lqcd != offset)
  ------------------
  |  Branch (1990:13): [True: 0, False: 1]
  ------------------
 1991|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1992|      1|      }
 1993|    141|      else if ((Sqcd & 0x1F) == 2)
  ------------------
  |  Branch (1993:16): [True: 124, False: 17]
  ------------------
 1994|    124|      {
 1995|    124|        num_subbands = (Lqcd - offset) / 2;
 1996|    124|        if (num_subbands == 0)
  ------------------
  |  Branch (1996:13): [True: 2, False: 122]
  ------------------
 1997|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1998|    124|            "quantization informtion");
 1999|    124|        if (num_subbands > 97 || Lqcd != offset + 2 * num_subbands)
  ------------------
  |  Branch (1999:13): [True: 17, False: 107]
  |  Branch (1999:34): [True: 5, False: 102]
  ------------------
 2000|     20|          OJPH_ERROR(0x000500A8, "wrong Lqcc 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2001|  1.78k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (2001:26): [True: 1.65k, False: 124]
  ------------------
 2002|  1.65k|        {
 2003|  1.65k|          if (file->read(&SPqcd.u16[i], 2) != 2)
  ------------------
  |  Branch (2003:15): [True: 11, False: 1.64k]
  ------------------
 2004|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2005|  1.65k|          SPqcd.u16[i] = swap_bytes_if_le(SPqcd.u16[i]);
 2006|  1.65k|        }
 2007|    124|      }
 2008|     17|      else
 2009|     17|        OJPH_ERROR(0x000500AA, "wrong Sqcc value in QCC marker");
  ------------------
  |  |  289|     17|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     17|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2010|    285|    }
_ZN4ojph5local9param_qcd7get_qccEj:
 2041|    192|    {
 2042|       |      // cast object to constant
 2043|    192|      const param_qcd* const_p = const_cast<const param_qcd*>(this);
 2044|       |      // call using the constant object, then cast to non-const
 2045|    192|      return const_cast<param_qcd*>(const_p->get_qcc(comp_idx));
 2046|    192|    }
_ZNK4ojph5local9param_qcd7get_qccEj:
 2050|  12.8M|    {
 2051|  12.8M|      assert(this->type == QCD_MAIN || this->top_qcd->type == QCD_MAIN);
 2052|  12.8M|      const param_qcd *p, *q;
 2053|  12.8M|      if (this->type == QCD_MAIN)
  ------------------
  |  Branch (2053:11): [True: 12.8M, False: 1.18k]
  ------------------
 2054|  12.8M|        q = p = this;
 2055|  1.18k|      else
 2056|  1.18k|        q = p = this->top_qcd;
 2057|  25.6M|      while (p && p->comp_idx != comp_idx)
  ------------------
  |  Branch (2057:14): [True: 12.8M, False: 12.7M]
  |  Branch (2057:19): [True: 12.8M, False: 10.9k]
  ------------------
 2058|  12.8M|        p = p->next;
 2059|  12.8M|      return p ? p : q;
  ------------------
  |  Branch (2059:14): [True: 10.9k, False: 12.7M]
  ------------------
 2060|  12.8M|    }
_ZN4ojph5local9param_qcd14add_qcc_objectEj:
 2064|    285|    {
 2065|    285|      assert(type == QCD_MAIN);
 2066|    285|      param_qcd *p = this;
 2067|    456|      while (p->next != NULL)
  ------------------
  |  Branch (2067:14): [True: 171, False: 285]
  ------------------
 2068|    171|        p = p->next;
 2069|    285|      if (avail)
  ------------------
  |  Branch (2069:11): [True: 0, False: 285]
  ------------------
 2070|      0|      {
 2071|      0|        p->next = avail;
 2072|      0|        avail = avail->next;
 2073|      0|        p->next->init(this, (ui16)comp_idx);
 2074|      0|      }
 2075|    285|      else
 2076|    285|        p->next = new param_qcd(this, (ui16)comp_idx);
 2077|    285|      return p->next;
 2078|    285|    }
_ZNK4ojph5local9param_nlt23get_nonlinear_transformEjRhRbS2_:
 2196|   501k|    {
 2197|   501k|      assert(Cnlt == special_comp_num::ALL_COMPS);
 2198|   501k|      const param_nlt* p = get_nlt_object(comp_num);
 2199|   501k|      p = (p && p->enabled) ? p : this;
  ------------------
  |  Branch (2199:12): [True: 141k, False: 360k]
  |  Branch (2199:17): [True: 141k, False: 0]
  ------------------
 2200|   501k|      if (p->enabled)
  ------------------
  |  Branch (2200:11): [True: 141k, False: 360k]
  ------------------
 2201|   141k|      {
 2202|   141k|        bit_depth = (ui8)((p->BDnlt & 0x7F) + 1);
 2203|   141k|        bit_depth = bit_depth <= 38 ? bit_depth : 38;
  ------------------
  |  Branch (2203:21): [True: 141k, False: 6]
  ------------------
 2204|   141k|        is_signed = (p->BDnlt & 0x80) == 0x80;
 2205|   141k|        nl_type = (nonlinearity)p->Tnlt;
 2206|   141k|        return true;
 2207|   141k|      }
 2208|   360k|      return false;
 2209|   501k|    }
_ZN4ojph5local9param_nlt4readEPNS_11infile_baseE:
 2241|    935|    {
 2242|    935|      ui16 buf2_len;
 2243|    935|      ui16 buf2_comp;
 2244|    935|      ui8  buf1_BDnlt;
 2245|    935|      ui8  buf1_Tnlt;
 2246|       |
 2247|    935|      if (file->read(&buf2_len, sizeof(ui16)) != sizeof(ui16))
  ------------------
  |  Branch (2247:11): [True: 5, False: 930]
  ------------------
 2248|      5|        OJPH_ERROR(0x00050141, "error reading NLT 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2249|    935|      if (file->read(&buf2_comp, sizeof(ui16)) != sizeof(ui16))
  ------------------
  |  Branch (2249:11): [True: 8, False: 927]
  ------------------
 2250|      8|        OJPH_ERROR(0x00050142, "error reading NLT marker 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2251|    935|      if (file->read(&buf1_BDnlt, sizeof(ui8)) != sizeof(ui8))
  ------------------
  |  Branch (2251:11): [True: 2, False: 933]
  ------------------
 2252|      2|        OJPH_ERROR(0x00050143, "error reading NLT marker 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2253|    935|      if (file->read(&buf1_Tnlt, sizeof(ui8)) != sizeof(ui8))
  ------------------
  |  Branch (2253:11): [True: 5, False: 930]
  ------------------
 2254|      5|        OJPH_ERROR(0x00050144, "error reading NLT 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2255|       |
 2256|    935|      ui16 length = swap_bytes_if_le(buf2_len);
 2257|    935|      if (length != 6 || (buf1_Tnlt != 3 && buf1_Tnlt != 0))
  ------------------
  |  Branch (2257:11): [True: 45, False: 890]
  |  Branch (2257:27): [True: 575, False: 315]
  |  Branch (2257:45): [True: 9, False: 566]
  ------------------
 2258|     34|        OJPH_ERROR(0x00050145, "Unsupported NLT type %d\n", buf1_Tnlt);
  ------------------
  |  |  289|     34|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     34|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 34, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2259|       |
 2260|    935|      ui16 comp = swap_bytes_if_le(buf2_comp);
 2261|    935|      param_nlt* p = get_nlt_object(comp);
 2262|    935|      if (p == NULL)
  ------------------
  |  Branch (2262:11): [True: 437, False: 498]
  ------------------
 2263|    437|        p = add_object(comp);
 2264|    935|      p->enabled = true;
 2265|    935|      p->Cnlt = comp;
 2266|    935|      p->BDnlt = buf1_BDnlt;
 2267|    935|      p->Tnlt = buf1_Tnlt;
 2268|    935|    }
_ZN4ojph5local9param_nlt14get_nlt_objectEj:
 2272|    881|    {
 2273|       |      // cast object to constant
 2274|    881|      const param_nlt* const_p = const_cast<const param_nlt*>(this);
 2275|       |      // call using the constant object, then cast to non-const
 2276|    881|      return const_cast<param_nlt*>(const_p->get_nlt_object(comp_num));
 2277|    881|    }
_ZNK4ojph5local9param_nlt14get_nlt_objectEj:
 2281|   502k|    {
 2282|   502k|      const param_nlt* p = this;
 2283|  1.01M|      while (p && p->Cnlt != comp_num)
  ------------------
  |  Branch (2283:14): [True: 649k, False: 360k]
  |  Branch (2283:19): [True: 507k, False: 141k]
  ------------------
 2284|   507k|        p = p->next;
 2285|   502k|      return p;
 2286|   502k|    }
_ZN4ojph5local9param_nlt10add_objectEj:
 2290|    437|    {
 2291|    437|      assert(comp_num != special_comp_num::ALL_COMPS);
 2292|    437|      assert(Cnlt == special_comp_num::ALL_COMPS);
 2293|    437|      param_nlt* p = this;
 2294|  1.03k|      while (p->next != NULL) {
  ------------------
  |  Branch (2294:14): [True: 597, False: 437]
  ------------------
 2295|    597|        assert(p->Cnlt != comp_num);
 2296|    597|        p = p->next;
 2297|    597|      }
 2298|    437|      if (avail)
  ------------------
  |  Branch (2298:11): [True: 0, False: 437]
  ------------------
 2299|      0|      {
 2300|      0|        p->next = avail;
 2301|      0|        avail = avail->next;
 2302|      0|        p->next->init();
 2303|      0|      }
 2304|    437|      else
 2305|    437|        p->next = new param_nlt;
 2306|    437|      p = p->next;
 2307|    437|      p->Cnlt = (ui16)comp_num;
 2308|    437|      return p;
 2309|    437|    }
_ZN4ojph5local9param_sot4readEPNS_11infile_baseEb:
 2393|   227k|    {
 2394|   227k|      if (resilient)
  ------------------
  |  Branch (2394:11): [True: 227k, False: 0]
  ------------------
 2395|   227k|      {
 2396|   227k|        if (file->read(&Lsot, 2) != 2)
  ------------------
  |  Branch (2396:13): [True: 276, False: 227k]
  ------------------
 2397|    276|        {
 2398|    276|          OJPH_INFO(0x00050091, "error reading SOT marker");
  ------------------
  |  |  285|    276|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    276|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 276, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2399|    276|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2400|    276|          return false;
 2401|    276|        }
 2402|   227k|        Lsot = swap_bytes_if_le(Lsot);
 2403|   227k|        if (Lsot != 10)
  ------------------
  |  Branch (2403:13): [True: 13.6k, False: 213k]
  ------------------
 2404|  13.6k|        {
 2405|  13.6k|          OJPH_INFO(0x00050092, "error in SOT length");
  ------------------
  |  |  285|  13.6k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  13.6k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2406|  13.6k|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2407|  13.6k|          return false;
 2408|  13.6k|        }
 2409|   213k|        if (file->read(&Isot, 2) != 2)
  ------------------
  |  Branch (2409:13): [True: 61, False: 213k]
  ------------------
 2410|     61|        {
 2411|     61|          OJPH_INFO(0x00050093, "error reading tile index");
  ------------------
  |  |  285|     61|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     61|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 61, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2412|     61|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2413|     61|          return false;
 2414|     61|        }
 2415|   213k|        Isot = swap_bytes_if_le(Isot);
 2416|   213k|        if (Isot == 0xFFFF)
  ------------------
  |  Branch (2416:13): [True: 344, False: 213k]
  ------------------
 2417|    344|        {
 2418|    344|          OJPH_INFO(0x00050094, "tile index in SOT marker cannot be 0xFFFF");
  ------------------
  |  |  285|    344|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    344|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 344, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2419|    344|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2420|    344|          return false;
 2421|    344|        }
 2422|   213k|        if (file->read(&Psot, 4) != 4)
  ------------------
  |  Branch (2422:13): [True: 93, False: 213k]
  ------------------
 2423|     93|        {
 2424|     93|          OJPH_INFO(0x00050095, "error reading SOT marker");
  ------------------
  |  |  285|     93|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     93|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 93, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2425|     93|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2426|     93|          return false;
 2427|     93|        }
 2428|   213k|        Psot = swap_bytes_if_le(Psot);
 2429|   213k|        if (file->read(&TPsot, 1) != 1)
  ------------------
  |  Branch (2429:13): [True: 14, False: 213k]
  ------------------
 2430|     14|        {
 2431|     14|          OJPH_INFO(0x00050096, "error reading SOT marker");
  ------------------
  |  |  285|     14|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     14|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2432|     14|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2433|     14|          return false;
 2434|     14|        }
 2435|   213k|        if (file->read(&TNsot, 1) != 1)
  ------------------
  |  Branch (2435:13): [True: 17, False: 212k]
  ------------------
 2436|     17|        {
 2437|     17|          OJPH_INFO(0x00050097, "error reading SOT marker");
  ------------------
  |  |  285|     17|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     17|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 17, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2438|     17|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2439|     17|          return false;
 2440|     17|        }
 2441|   213k|      }
 2442|      0|      else
 2443|      0|      {
 2444|      0|        if (file->read(&Lsot, 2) != 2)
  ------------------
  |  Branch (2444:13): [True: 0, False: 0]
  ------------------
 2445|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2446|      0|        Lsot = swap_bytes_if_le(Lsot);
 2447|      0|        if (Lsot != 10)
  ------------------
  |  Branch (2447:13): [True: 0, False: 0]
  ------------------
 2448|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2449|      0|        if (file->read(&Isot, 2) != 2)
  ------------------
  |  Branch (2449:13): [True: 0, False: 0]
  ------------------
 2450|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2451|      0|        Isot = swap_bytes_if_le(Isot);
 2452|      0|        if (Isot == 0xFFFF)
  ------------------
  |  Branch (2452:13): [True: 0, False: 0]
  ------------------
 2453|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2454|      0|        if (file->read(&Psot, 4) != 4)
  ------------------
  |  Branch (2454:13): [True: 0, False: 0]
  ------------------
 2455|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2456|      0|        Psot = swap_bytes_if_le(Psot);
 2457|      0|        if (file->read(&TPsot, 1) != 1)
  ------------------
  |  Branch (2457:13): [True: 0, False: 0]
  ------------------
 2458|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2459|      0|        if (file->read(&TNsot, 1) != 1)
  ------------------
  |  Branch (2459:13): [True: 0, False: 0]
  ------------------
 2460|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2461|      0|      }
 2462|   212k|      return true;
 2463|   227k|    }
_ZNK4ojph5local9param_dfs7get_dfsEi:
 2533|   262k|    {
 2534|   262k|      const param_dfs* p = this;
 2535|   297k|      while (p && p->Sdfs != index)
  ------------------
  |  Branch (2535:14): [True: 297k, False: 5]
  |  Branch (2535:19): [True: 34.7k, False: 262k]
  ------------------
 2536|  34.7k|        p = p->next;
 2537|   262k|      return p;
 2538|   262k|    }
_ZNK4ojph5local9param_dfs12get_dwt_typeEj:
 2542|   500k|    {
 2543|   500k|      decomp_level = ojph_min(decomp_level, Ids);
  ------------------
  |  |   76|   500k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 490k, False: 10.4k]
  |  |  ------------------
  ------------------
 2544|   500k|      ui32 d = decomp_level - 1;          // decomp_level starts from 1
 2545|   500k|      ui32 idx = d >> 2;                  // complete bytes
 2546|   500k|      ui32 bits = d & 0x3;                // bit within the bytes
 2547|   500k|      ui32 val = (Ddfs[idx] >> (6 - 2 * bits)) & 0x3;
 2548|   500k|      return (dfs_dwt_type)val;
 2549|   500k|    }
_ZNK4ojph5local9param_dfs15get_subband_idxEjjj:
 2554|   124k|    {
 2555|   124k|      assert((resolution == 0 && subband == 0) ||
 2556|   124k|              (resolution > 0 && subband > 0 && subband < 4));
 2557|       |
 2558|   124k|      ui32 ns[4] = { 0, 3, 1, 1 };
 2559|       |
 2560|   124k|      ui32 idx = 0;
 2561|   124k|      if (resolution > 0)
  ------------------
  |  Branch (2561:11): [True: 100k, False: 24.3k]
  ------------------
 2562|   100k|      {
 2563|   100k|        idx = 0;
 2564|   100k|        ui32 i = 1;
 2565|   295k|        for (; i < resolution; ++i)
  ------------------
  |  Branch (2565:16): [True: 195k, False: 100k]
  ------------------
 2566|   195k|          idx += ns[get_dwt_type(num_decompositions - i + 1)];
 2567|   100k|        dfs_dwt_type t = get_dwt_type(num_decompositions - i + 1);
 2568|   100k|        idx += subband;
 2569|   100k|        if (t == VERT_DWT && subband == 2)
  ------------------
  |  Branch (2569:13): [True: 32.7k, False: 67.2k]
  |  Branch (2569:30): [True: 32.7k, False: 0]
  ------------------
 2570|  32.7k|          --idx;
 2571|   100k|      }
 2572|       |
 2573|   124k|      return idx;
 2574|   124k|    }
_ZNK4ojph5local9param_dfs16get_res_downsampEj:
 2578|  15.1k|    {
 2579|  15.1k|      point factor(1, 1);
 2580|  15.1k|      ui32 decomp_level = 1;
 2581|  43.2k|      while (skipped_resolutions > 0)
  ------------------
  |  Branch (2581:14): [True: 28.1k, False: 15.1k]
  ------------------
 2582|  28.1k|      {
 2583|  28.1k|        param_dfs::dfs_dwt_type type = get_dwt_type(decomp_level);
 2584|  28.1k|        if (type == BIDIR_DWT)
  ------------------
  |  Branch (2584:13): [True: 4.84k, False: 23.3k]
  ------------------
 2585|  4.84k|        { factor.x *= 2; factor.y *= 2; }
 2586|  23.3k|        else if (type == HORZ_DWT)
  ------------------
  |  Branch (2586:18): [True: 1.90k, False: 21.4k]
  ------------------
 2587|  1.90k|          factor.x *= 2;
 2588|  21.4k|        else if (type == VERT_DWT)
  ------------------
  |  Branch (2588:18): [True: 8.57k, False: 12.8k]
  ------------------
 2589|  8.57k|          factor.y *= 2;
 2590|       |
 2591|  28.1k|        ++decomp_level;
 2592|  28.1k|        --skipped_resolutions;
 2593|  28.1k|      }
 2594|  15.1k|      return factor;
 2595|  15.1k|    }
_ZN4ojph5local9param_dfs4readEPNS_11infile_baseE:
 2599|  1.43M|    {
 2600|  1.43M|      if (Ldfs != 0) { // this param_dfs is used
  ------------------
  |  Branch (2600:11): [True: 719k, False: 720k]
  ------------------
 2601|   719k|        param_dfs* p = this;
 2602|  11.5G|        while (p->next != NULL)
  ------------------
  |  Branch (2602:16): [True: 11.5G, False: 719k]
  ------------------
 2603|  11.5G|          p = p->next;
 2604|   719k|        if (avail)
  ------------------
  |  Branch (2604:13): [True: 0, False: 719k]
  ------------------
 2605|      0|        {
 2606|      0|          p->next = avail;
 2607|      0|          avail = avail->next;
 2608|      0|          p->next->init();
 2609|      0|        }
 2610|   719k|        else
 2611|   719k|          p->next = new param_dfs;
 2612|   719k|        p = p->next;
 2613|   719k|        return p->read(file);
 2614|   719k|      }
 2615|       |
 2616|   720k|      if (file->read(&Ldfs, 2) != 2)
  ------------------
  |  Branch (2616:11): [True: 24, False: 720k]
  ------------------
 2617|     24|        OJPH_ERROR(0x000500D1, "error reading DFS-Ldfs 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2618|   720k|      Ldfs = swap_bytes_if_le(Ldfs);
 2619|   720k|      if (file->read(&Sdfs, 2) != 2)
  ------------------
  |  Branch (2619:11): [True: 8, False: 720k]
  ------------------
 2620|      8|        OJPH_ERROR(0x000500D2, "error reading DFS-Sdfs 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2621|   720k|      Sdfs = swap_bytes_if_le(Sdfs);
 2622|   720k|      if (Sdfs > 15)
  ------------------
  |  Branch (2622:11): [True: 43, False: 720k]
  ------------------
 2623|     43|        OJPH_ERROR(0x000500D3, "The DFS-Sdfs parameter is %d, which is "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2624|   720k|          "larger than the permissible 15", Sdfs);
 2625|   720k|      ui8 t, l_Ids = 0;
 2626|   720k|      if (file->read(&l_Ids, 1) != 1)
  ------------------
  |  Branch (2626:11): [True: 4, False: 720k]
  ------------------
 2627|      4|        OJPH_ERROR(0x000500D4, "error reading DFS-Ids 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2628|   720k|      if (l_Ids == 0)
  ------------------
  |  Branch (2628:11): [True: 10, False: 720k]
  ------------------
 2629|     10|        OJPH_ERROR(0x000500D8,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2630|   720k|          "The value of the Ids member in the DFS marker segment cannot be 0");
 2631|   720k|      constexpr int max_Ddfs = sizeof(Ddfs) * 4;
 2632|   720k|      if (l_Ids > max_Ddfs)
  ------------------
  |  Branch (2632:11): [True: 14.6k, False: 705k]
  ------------------
 2633|  14.6k|        OJPH_INFO(0x000500D5, "The DFS-Ids parameter is %d; while this is "
  ------------------
  |  |  285|  14.6k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  14.6k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 14.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2634|   720k|          "valid, the number is unnessarily large -- you do not need more "
 2635|   720k|          "than %d.  Please contact me regarding this issue.",
 2636|   720k|          l_Ids, max_Ddfs);
 2637|   720k|      Ids = l_Ids < max_Ddfs ? l_Ids : max_Ddfs;
  ------------------
  |  Branch (2637:13): [True: 705k, False: 14.7k]
  ------------------
 2638|  2.67M|      for (int i = 0; i < Ids; i += 4)
  ------------------
  |  Branch (2638:23): [True: 1.95M, False: 720k]
  ------------------
 2639|  1.95M|        if (file->read(&Ddfs[i / 4], 1) != 1)
  ------------------
  |  Branch (2639:13): [True: 18, False: 1.95M]
  ------------------
 2640|     18|          OJPH_ERROR(0x000500D6, "error reading DFS-Ddfs parameters");
  ------------------
  |  |  289|   720k|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     18|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 18, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2641|   761k|      for (int i = Ids; i < l_Ids; i += 4)
  ------------------
  |  Branch (2641:25): [True: 41.5k, False: 720k]
  ------------------
 2642|  41.5k|        if (file->read(&t, 1) != 1)
  ------------------
  |  Branch (2642:13): [True: 18, False: 41.5k]
  ------------------
 2643|     18|          OJPH_ERROR(0x000500D7, "error reading DFS-Ddfs parameters");
  ------------------
  |  |  289|   720k|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     18|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 18, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2644|   720k|      return true;
 2645|  1.43M|    }
_ZN4ojph5local9param_atk7get_atkEi:
 2657|  6.68k|    {
 2658|  6.68k|      assert(top_atk == NULL);
 2659|       |
 2660|  6.68k|      if (Latk == 0)
  ------------------
  |  Branch (2660:11): [True: 5.77k, False: 915]
  ------------------
 2661|  5.77k|      {
 2662|       |        // This atk object is not used, initialize it to either 0 (irv97)
 2663|       |        // or 1 (rev53), and use it.  If index is not 0 nor 1, then index
 2664|       |        // must have been read from file previously, otherwise it is an
 2665|       |        // error.
 2666|  5.77k|        if (index == 0) { this->init_irv97(); return this; }
  ------------------
  |  Branch (2666:13): [True: 1.36k, False: 4.40k]
  ------------------
 2667|  4.40k|        else if (index == 1) { this->init_rev53(); return this; }
  ------------------
  |  Branch (2667:18): [True: 4.40k, False: 9]
  ------------------
 2668|  5.77k|      }
 2669|       |
 2670|    924|      param_atk* p = this;
 2671|  2.32k|      while (p && p->get_index() != index)
  ------------------
  |  Branch (2671:14): [True: 1.89k, False: 429]
  |  Branch (2671:19): [True: 1.39k, False: 495]
  ------------------
 2672|  1.39k|        p = p->next;
 2673|       |
 2674|    924|      if (p == NULL && (index == 0 || index == 1))
  ------------------
  |  Branch (2674:11): [True: 429, False: 495]
  |  Branch (2674:25): [True: 87, False: 342]
  |  Branch (2674:39): [True: 160, False: 182]
  ------------------
 2675|    247|      {
 2676|       |        // The index was not found, add an atk object only if the index is
 2677|       |        // either 0 or 1
 2678|    247|        p = add_object();
 2679|    247|        if (index == 0)
  ------------------
  |  Branch (2679:13): [True: 87, False: 160]
  ------------------
 2680|     87|          p->init_irv97();
 2681|    160|        else if (index == 1)
  ------------------
  |  Branch (2681:18): [True: 160, False: 0]
  ------------------
 2682|    160|          p->init_rev53();
 2683|    247|      }
 2684|       |
 2685|    924|      return p;
 2686|  6.68k|    }
_ZN4ojph5local9param_atk16read_coefficientEPNS_11infile_baseERfRi:
 2690|  1.39k|    {
 2691|  1.39k|      int coeff_type = get_coeff_type();
 2692|  1.39k|      if (coeff_type == 0) { // 8bit
  ------------------
  |  Branch (2692:11): [True: 277, False: 1.11k]
  ------------------
 2693|    277|        ui8 v;
 2694|    277|        if (file->read(&v, 1) != 1) return false;
  ------------------
  |  Branch (2694:13): [True: 5, False: 272]
  ------------------
 2695|    272|        bytes -= 1;
 2696|    272|        K = v;
 2697|    272|      }
 2698|  1.11k|      else if (coeff_type == 1) { // 16bit
  ------------------
  |  Branch (2698:16): [True: 274, False: 845]
  ------------------
 2699|    274|        ui16 v;
 2700|    274|        if (file->read(&v, 2) != 2) return false;
  ------------------
  |  Branch (2700:13): [True: 5, False: 269]
  ------------------
 2701|    269|        bytes -= 2;
 2702|    269|        K = swap_bytes_if_le(v);
 2703|    269|      }
 2704|    845|      else if (coeff_type == 2) { // float
  ------------------
  |  Branch (2704:16): [True: 276, False: 569]
  ------------------
 2705|    276|        ui32 i;
 2706|    276|        if (file->read(&i, sizeof(ui32)) != sizeof(ui32)) return false;
  ------------------
  |  Branch (2706:13): [True: 6, False: 270]
  ------------------
 2707|    270|        bytes -= 4;
 2708|    270|        i = swap_bytes_if_le(i);
 2709|    270|        float f;
 2710|    270|        memcpy(&f, &i, sizeof(float));
 2711|    270|        K = f;
 2712|    270|      }
 2713|    569|      else if (coeff_type == 3) { // double
  ------------------
  |  Branch (2713:16): [True: 209, False: 360]
  ------------------
 2714|    209|        ui64 i;
 2715|    209|        if (file->read(&i, sizeof(ui64)) != sizeof(ui64)) return false;
  ------------------
  |  Branch (2715:13): [True: 7, False: 202]
  ------------------
 2716|    202|        bytes -= 8;
 2717|    202|        i = swap_bytes_if_le(i);
 2718|    202|        double d;
 2719|    202|        memcpy(&d, &i, sizeof(double));
 2720|    202|        K = (float)d;
 2721|    202|      }
 2722|    360|      else if (coeff_type == 4) { // 128 bit float
  ------------------
  |  Branch (2722:16): [True: 82, False: 278]
  ------------------
 2723|     82|        ui64 v, v1;
 2724|     82|        if (file->read(&v, 8) != 8) return false;
  ------------------
  |  Branch (2724:13): [True: 7, False: 75]
  ------------------
 2725|     75|        bytes -= 8;
 2726|     75|        if (file->read(&v1, 8) != 8) return false; // v1 not needed
  ------------------
  |  Branch (2726:13): [True: 5, False: 70]
  ------------------
 2727|     70|        bytes -= 8;
 2728|     70|        v = swap_bytes_if_le(v);
 2729|       |
 2730|       |        // convert the MSB of 128b float to 32b float
 2731|       |        // 32b float has 1 sign bit, 8 exponent (offset 127), 23 mantissa
 2732|       |        // 128b float has 1 sign bit, 15 exponent (offset 16383), 112 mantissa
 2733|     70|        si32 e = (si32)((v >> 48) & 0x7FFF);   // exponent
 2734|     70|        e -= 16383;
 2735|     70|        e += 127;
 2736|     70|        e = e & 0xFF;                          // removes MSBs if negative
 2737|     70|        e <<= 23;                              // move bits to their location
 2738|     70|        ui32 i = 0;
 2739|     70|        i |= ((ui32)(v >> 32) & 0x80000000); // copy sign bit
 2740|     70|        i |= (ui32)e;                        // copy exponent
 2741|     70|        i |= (ui32)((v >> 25) & 0x007FFFFF); // copy 23 mantissa
 2742|     70|        float f;
 2743|     70|        memcpy(&f, &i, sizeof(float));
 2744|     70|        K = f;
 2745|     70|      }
 2746|  1.36k|      return true;
 2747|  1.39k|    }
_ZN4ojph5local9param_atk16read_coefficientEPNS_11infile_baseERsRi:
 2752|    499|    {
 2753|    499|      int coeff_type = get_coeff_type();
 2754|    499|      if (coeff_type == 0) {
  ------------------
  |  Branch (2754:11): [True: 227, False: 272]
  ------------------
 2755|    227|        si8 v;
 2756|    227|        if (file->read(&v, 1) != 1) return false;
  ------------------
  |  Branch (2756:13): [True: 2, False: 225]
  ------------------
 2757|    225|        bytes -= 1;
 2758|    225|        K = v;
 2759|    225|      }
 2760|    272|      else if (coeff_type == 1) {
  ------------------
  |  Branch (2760:16): [True: 272, False: 0]
  ------------------
 2761|    272|        si16 v;
 2762|    272|        if (file->read(&v, 2) != 2) return false;
  ------------------
  |  Branch (2762:13): [True: 3, False: 269]
  ------------------
 2763|    269|        bytes -= 2;
 2764|    269|        K = (si16)swap_bytes_if_le((ui16)v);
 2765|    269|      }
 2766|      0|      else
 2767|      0|        return false;
 2768|    494|      return true;
 2769|    499|    }
_ZN4ojph5local9param_atk4readEPNS_11infile_baseE:
 2773|    616|    {
 2774|    616|      if (Latk != 0) // this param_atk is used
  ------------------
  |  Branch (2774:11): [True: 181, False: 435]
  ------------------
 2775|    181|        return add_object()->read(file);
 2776|       |
 2777|    435|      if (file->read(&Latk, 2) != 2)
  ------------------
  |  Branch (2777:11): [True: 3, False: 432]
  ------------------
 2778|      3|        OJPH_ERROR(0x000500E1, "error reading ATK-Latk parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2779|    435|      Latk = swap_bytes_if_le(Latk);
 2780|    435|      si32 bytes = Latk - 2;
 2781|    435|      ojph::ui16 temp_Satk;
 2782|    435|      if (file->read(&temp_Satk, 2) != 2)
  ------------------
  |  Branch (2782:11): [True: 2, False: 433]
  ------------------
 2783|      2|        OJPH_ERROR(0x000500E2, "error reading ATK-Satk parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2784|    435|      bytes -= 2;
 2785|    435|      temp_Satk = swap_bytes_if_le(temp_Satk);
 2786|    435|      int tmp_idx = temp_Satk & 0xFF;
 2787|    435|      if ((top_atk && top_atk->get_atk(tmp_idx) != NULL)
  ------------------
  |  Branch (2787:12): [True: 180, False: 255]
  |  Branch (2787:23): [True: 9, False: 171]
  ------------------
 2788|    421|        || tmp_idx == 0 || tmp_idx == 1)
  ------------------
  |  Branch (2788:12): [True: 1, False: 420]
  |  Branch (2788:28): [True: 1, False: 419]
  ------------------
 2789|     11|        OJPH_ERROR(0x000500F3, "ATK-Satk parameter sets ATK marker index to "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2790|    435|          "the illegal value of %d. ATK-Satk should be in (2-255) and, I "
 2791|    435|          "believe, must not be repeated; otherwise, it would be unclear "
 2792|    435|          "what marker segment must be employed when an index is repeated.",
 2793|    435|          tmp_idx);
 2794|    435|      Satk = temp_Satk;
 2795|    435|      if (is_m_init0() == false)  // only even-indexed is supported
  ------------------
  |  Branch (2795:11): [True: 3, False: 432]
  ------------------
 2796|      3|        OJPH_ERROR(0x000500E3, "ATK-Satk parameter sets m_init to 1, "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2797|    435|          "requiring odd-indexed subsequence in first reconstruction step, "
 2798|    435|          "which is not supported yet.");
 2799|    435|      if (is_whole_sample() == false)  // ARB filter not supported
  ------------------
  |  Branch (2799:11): [True: 6, False: 429]
  ------------------
 2800|      6|        OJPH_ERROR(0x000500E4, "ATK-Satk parameter specified ARB filter, "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2801|    435|          "which is not supported yet.");
 2802|    435|      if (is_reversible() && get_coeff_type() >= 2) // reversible & float
  ------------------
  |  Branch (2802:11): [True: 175, False: 260]
  |  Branch (2802:30): [True: 3, False: 172]
  ------------------
 2803|      3|        OJPH_ERROR(0x000500E5, "ATK-Satk parameter does not make sense. "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2804|    435|          "It employs floats with reversible filtering.");
 2805|    435|      if (is_using_ws_extension() == false)  // only sym. ext is supported
  ------------------
  |  Branch (2805:11): [True: 2, False: 433]
  ------------------
 2806|      2|        OJPH_ERROR(0x000500E6, "ATK-Satk parameter requires constant "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2807|    435|          "boundary extension, which is not supported yet.");
 2808|    435|      if (is_reversible() == false)
  ------------------
  |  Branch (2808:11): [True: 233, False: 202]
  ------------------
 2809|    233|        if (read_coefficient(file, Katk, bytes) == false)
  ------------------
  |  Branch (2809:13): [True: 19, False: 214]
  ------------------
 2810|     19|          OJPH_ERROR(0x000500E7, "error reading ATK-Katk parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2811|    435|      if (file->read(&Natk, 1) != 1)
  ------------------
  |  Branch (2811:11): [True: 13, False: 422]
  ------------------
 2812|     13|        OJPH_ERROR(0x000500E8, "error reading ATK-Natk parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2813|    435|      bytes -= 1;
 2814|    435|      if (Natk > max_steps) {
  ------------------
  |  Branch (2814:11): [True: 86, False: 349]
  ------------------
 2815|     86|        if (d != d_store) // was this allocated -- very unlikely
  ------------------
  |  Branch (2815:13): [True: 0, False: 86]
  ------------------
 2816|      0|          delete[] d;
 2817|     86|        d = new lifting_step[Natk];
 2818|     86|        max_steps = Natk;
 2819|     86|      }
 2820|       |
 2821|    435|      if (is_reversible())
  ------------------
  |  Branch (2821:11): [True: 168, False: 267]
  ------------------
 2822|    168|      {
 2823|    697|        for (int s = 0; s < Natk; ++s)
  ------------------
  |  Branch (2823:25): [True: 529, False: 168]
  ------------------
 2824|    529|        {
 2825|    529|          if (file->read(&d[s].rev.Eatk, 1) != 1)
  ------------------
  |  Branch (2825:15): [True: 11, False: 518]
  ------------------
 2826|     11|            OJPH_ERROR(0x000500E9, "error reading ATK-Eatk parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2827|    529|          bytes -= 1;
 2828|    529|          if (file->read(&d[s].rev.Batk, 2) != 2)
  ------------------
  |  Branch (2828:15): [True: 6, False: 523]
  ------------------
 2829|      6|            OJPH_ERROR(0x000500EA, "error reading ATK-Batk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2830|    529|          bytes -= 2;
 2831|    529|          d[s].rev.Batk = (si16)swap_bytes_if_le((ui16)d[s].rev.Batk);
 2832|    529|          ui8 LCatk;
 2833|    529|          if (file->read(&LCatk, 1) != 1)
  ------------------
  |  Branch (2833:15): [True: 4, False: 525]
  ------------------
 2834|      4|            OJPH_ERROR(0x000500EB, "error reading ATK-LCatk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2835|    529|          bytes -= 1;
 2836|    529|          if (LCatk == 0)
  ------------------
  |  Branch (2836:15): [True: 1, False: 528]
  ------------------
 2837|      1|            OJPH_ERROR(0x000500EC, "Encountered a ATK-LCatk value of zero; "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2838|    529|              "something is wrong.");
 2839|    529|          if (LCatk > 1)
  ------------------
  |  Branch (2839:15): [True: 8, False: 521]
  ------------------
 2840|      8|            OJPH_ERROR(0x000500ED, "ATK-LCatk value greater than 1; "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2841|    529|              "that is, a multitap filter is not supported");
 2842|    529|          if (read_coefficient(file, d[s].rev.Aatk, bytes) == false)
  ------------------
  |  Branch (2842:15): [True: 5, False: 524]
  ------------------
 2843|      5|            OJPH_ERROR(0x000500EE, "Error reding ATK-Aatk parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2844|    529|        }
 2845|    168|      }
 2846|    267|      else
 2847|    267|      {
 2848|  1.47k|        for (int s = 0; s < Natk; ++s)
  ------------------
  |  Branch (2848:25): [True: 1.20k, False: 267]
  ------------------
 2849|  1.20k|        {
 2850|  1.20k|          ui8 LCatk;
 2851|  1.20k|          if (file->read(&LCatk, 1) != 1)
  ------------------
  |  Branch (2851:15): [True: 19, False: 1.18k]
  ------------------
 2852|     19|            OJPH_ERROR(0x000500EF, "error reading ATK-LCatk parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2853|  1.20k|          bytes -= 1;
 2854|  1.20k|          if (LCatk == 0)
  ------------------
  |  Branch (2854:15): [True: 6, False: 1.20k]
  ------------------
 2855|      6|            OJPH_ERROR(0x000500F0, "Encountered a ATK-LCatk value of zero; "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2856|  1.20k|              "something is wrong.");
 2857|  1.20k|          if (LCatk > 1)
  ------------------
  |  Branch (2857:15): [True: 18, False: 1.18k]
  ------------------
 2858|     18|            OJPH_ERROR(0x000500F1, "ATK-LCatk value greater than 1; "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2859|  1.20k|              "that is, a multitap filter is not supported.");
 2860|  1.20k|          if (read_coefficient(file, d[s].irv.Aatk, bytes) == false)
  ------------------
  |  Branch (2860:15): [True: 16, False: 1.19k]
  ------------------
 2861|     16|            OJPH_ERROR(0x000500F2, "Error reding ATK-Aatk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2862|  1.20k|        }
 2863|    267|      }
 2864|    435|      if (bytes != 0)
  ------------------
  |  Branch (2864:11): [True: 21, False: 414]
  ------------------
 2865|     21|        OJPH_ERROR(0x000500F3, "The length of an ATK marker segment "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2866|    435|          "(ATK-Latk) is not correct");
 2867|       |
 2868|    435|      return true;
 2869|    616|    }
_ZN4ojph5local9param_atk10init_irv97Ev:
 2873|  1.44k|    {
 2874|  1.44k|      Satk = 0x4a00;     // illegal because ATK = 0
 2875|  1.44k|      Katk = (float)1.230174104914001;
 2876|  1.44k|      Natk = 4;
 2877|       |      // next is (A-4) in T.801 second line
 2878|  1.44k|      Latk = (ui16)(5 + Natk + sizeof(float) * (1 + Natk));
 2879|  1.44k|      d[0].irv.Aatk = (float)0.443506852043971;
 2880|  1.44k|      d[1].irv.Aatk = (float)0.882911075530934;
 2881|  1.44k|      d[2].irv.Aatk = (float)-0.052980118572961;
 2882|  1.44k|      d[3].irv.Aatk = (float)-1.586134342059924;
 2883|  1.44k|    }
_ZN4ojph5local9param_atk10init_rev53Ev:
 2887|  4.56k|    {
 2888|  4.56k|      Satk = 0x5801;     // illegal because ATK = 1
 2889|  4.56k|      Natk = 2;
 2890|       |      // next is (A-4) in T.801 fourth line
 2891|  4.56k|      Latk = (ui16)(5 + 2 * Natk + sizeof(ui8) * (Natk + Natk));
 2892|  4.56k|      d[0].rev.Aatk = 1;
 2893|  4.56k|      d[0].rev.Batk = 2;
 2894|  4.56k|      d[0].rev.Eatk = 2;
 2895|  4.56k|      d[1].rev.Aatk = -1;
 2896|  4.56k|      d[1].rev.Batk = 1;
 2897|  4.56k|      d[1].rev.Eatk = 1;
 2898|  4.56k|    }
_ZN4ojph5local9param_atk10add_objectEv:
 2902|    428|    {
 2903|    428|      assert(top_atk == NULL);
 2904|    428|      param_atk *p = this;
 2905|  1.21k|      while (p->next != NULL)
  ------------------
  |  Branch (2905:14): [True: 787, False: 428]
  ------------------
 2906|    787|        p = p->next;
 2907|    428|      if (avail)
  ------------------
  |  Branch (2907:11): [True: 0, False: 428]
  ------------------
 2908|      0|      {
 2909|      0|        p->next = avail;
 2910|      0|        avail = avail->next;
 2911|      0|      }
 2912|    428|      else
 2913|    428|        p->next = new param_atk;
 2914|    428|      p = p->next;
 2915|    428|      p->init(this);
 2916|    428|      return p;
 2917|    428|    }

_ZN4ojph5local9param_sizC2Ev:
  177|  7.38k|      param_siz() { init(); }
_ZN4ojph5local9param_sizD2Ev:
  178|  7.38k|      ~param_siz() { destroy(); }
_ZN4ojph5local9param_siz4initEv:
  181|  7.38k|      {
  182|  7.38k|        Lsiz = Csiz = 0;
  183|  7.38k|        Xsiz = Ysiz = XOsiz = YOsiz = XTsiz = YTsiz = XTOsiz = YTOsiz = 0;
  184|  7.38k|        skipped_resolutions = 0;
  185|  7.38k|        memset(store, 0, sizeof(store));
  186|  7.38k|        ws_kern_support_needed = dfs_support_needed = false;
  187|  7.38k|        cod = NULL;
  188|       |        dfs = NULL;
  189|  7.38k|        Rsiz = RSIZ_HT_FLAG;
  190|  7.38k|        cptr = store;
  191|  7.38k|        old_Csiz = sizeof(store) / sizeof(siz_comp_info);
  192|  7.38k|      }
_ZN4ojph5local9param_siz7destroyEv:
  195|  7.38k|      { if (cptr != store) { delete[] cptr; cptr = NULL; } }
  ------------------
  |  Branch (195:13): [True: 164, False: 7.22k]
  ------------------
_ZN4ojph5local9param_siz18set_num_componentsEj:
  198|  7.15k|      {
  199|  7.15k|        Csiz = (ui16)num_comps;
  200|  7.15k|        if (Csiz > old_Csiz)
  ------------------
  |  Branch (200:13): [True: 164, False: 6.98k]
  ------------------
  201|    164|        {
  202|    164|          if (cptr != store)
  ------------------
  |  Branch (202:15): [True: 0, False: 164]
  ------------------
  203|      0|            delete[] cptr;
  204|    164|          cptr = new siz_comp_info[num_comps];
  205|    164|          old_Csiz = Csiz;
  206|    164|        }
  207|  7.15k|        memset(cptr, 0, sizeof(local::siz_comp_info) * num_comps);
  208|  7.15k|      }
_ZN4ojph5local9param_siz13set_tile_sizeENS_4sizeE:
  222|  7.21k|      void set_tile_size(size s) { XTsiz = s.w; YTsiz = s.h; }
_ZN4ojph5local9param_siz16set_image_offsetENS_5pointE:
  225|  7.22k|      { XOsiz = offset.x; YOsiz = offset.y; }
_ZN4ojph5local9param_siz15set_tile_offsetENS_5pointE:
  229|  7.20k|      { XTOsiz = offset.x; YTOsiz = offset.y; }
_ZN4ojph5local9param_siz14check_validityEv:
  236|  7.12k|      {
  237|  7.12k|        if (Xsiz == 0 || Ysiz == 0 || XTsiz == 0 || YTsiz == 0)
  ------------------
  |  Branch (237:13): [True: 1, False: 7.12k]
  |  Branch (237:26): [True: 3, False: 7.12k]
  |  Branch (237:39): [True: 2, False: 7.11k]
  |  Branch (237:53): [True: 7, False: 7.11k]
  ------------------
  238|     13|          OJPH_ERROR(0x00040001,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  7.12k|            "Image extent and/or tile size cannot be zero");
  240|  7.12k|        if (XTOsiz > XOsiz || YTOsiz > YOsiz)
  ------------------
  |  Branch (240:13): [True: 46, False: 7.07k]
  |  Branch (240:31): [True: 22, False: 7.05k]
  ------------------
  241|     55|          OJPH_ERROR(0x00040002,
  ------------------
  |  |  289|     55|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     55|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 55, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|  7.12k|            "Tile offset has to be smaller than the image offset");
  243|  7.12k|        if (XTsiz + XTOsiz <= XOsiz || YTsiz + YTOsiz <= YOsiz)
  ------------------
  |  Branch (243:13): [True: 103, False: 7.02k]
  |  Branch (243:40): [True: 19, False: 7.00k]
  ------------------
  244|     54|          OJPH_ERROR(0x00040003,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  7.12k|            "The top left tile must intersect with the image");
  246|  7.12k|        if (Xsiz <= XOsiz || Ysiz <= YOsiz)
  ------------------
  |  Branch (246:13): [True: 129, False: 6.99k]
  |  Branch (246:30): [True: 17, False: 6.97k]
  ------------------
  247|     24|          OJPH_ERROR(0x00040004,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|  7.12k|            "The image extent must be larger than the image offset");
  249|  7.12k|      }
_ZNK4ojph5local9param_siz18get_num_componentsEv:
  251|   986k|      ui16 get_num_components() const { return Csiz; }
_ZNK4ojph5local9param_siz13get_bit_depthEj:
  253|   501k|      {
  254|       |        assert(comp_num < Csiz);
  255|   501k|        return (cptr[comp_num].SSiz & 0x7F) + 1u;
  256|   501k|      }
_ZNK4ojph5local9param_siz9is_signedEj:
  258|   501k|      {
  259|       |        assert(comp_num < Csiz);
  260|   501k|        return (cptr[comp_num].SSiz & 0x80) != 0;
  261|   501k|      }
_ZNK4ojph5local9param_siz16get_downsamplingEj:
  263|  1.54M|      {
  264|       |        assert(comp_num < Csiz);
  265|  1.54M|        return point(cptr[comp_num].XRsiz, cptr[comp_num].YRsiz);
  266|  1.54M|      }
_ZN4ojph5local9param_siz4linkEPKNS0_9param_codE:
  272|  5.83k|      { this->cod = cod; }
_ZN4ojph5local9param_siz4linkEPKNS0_9param_dfsE:
  275|    291|      { this->dfs = dfs; }
_ZN4ojph5local9param_siz23set_skipped_resolutionsEj:
  278|  1.48k|      { this->skipped_resolutions = skipped_resolutions; }
_ZNK4ojph5local9param_siz9get_widthEj:
  281|  6.83k|      {
  282|  6.83k|        assert(comp_num < get_num_components());
  283|  6.83k|        ui32 ds = (ui32)cptr[comp_num].XRsiz;
  284|  6.83k|        ui32 t = ojph_div_ceil(Xsiz, ds) - ojph_div_ceil(XOsiz, ds);
  ------------------
  |  |   70|  6.83k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
                      ui32 t = ojph_div_ceil(Xsiz, ds) - ojph_div_ceil(XOsiz, ds);
  ------------------
  |  |   70|  6.83k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  285|  6.83k|        return t;
  286|  6.83k|      }
_ZNK4ojph5local9param_siz10get_heightEj:
  289|  6.83k|      {
  290|  6.83k|        assert(comp_num < get_num_components());
  291|  6.83k|        ui32 ds = (ui32)cptr[comp_num].YRsiz;
  292|  6.83k|        ui32 t = ojph_div_ceil(Ysiz, ds) - ojph_div_ceil(YOsiz, ds);
  ------------------
  |  |   70|  6.83k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
                      ui32 t = ojph_div_ceil(Ysiz, ds) - ojph_div_ceil(YOsiz, ds);
  ------------------
  |  |   70|  6.83k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  293|  6.83k|        return t;
  294|  6.83k|      }
_ZNK4ojph5local9param_siz15get_recon_widthEj:
  299|  20.6k|      { return get_recon_size(comp_num).x; }
_ZNK4ojph5local9param_siz16get_recon_heightEj:
  301|  20.2k|      { return get_recon_size(comp_num).y; }
_ZN4ojph5local9cod_SPcodC2Ev:
  346|  23.8k|      cod_SPcod() {
  347|  23.8k|        num_decomp = 5;
  348|  23.8k|        block_width = 4;    // 64
  349|  23.8k|        block_height = 4;   // 64
  350|  23.8k|        block_style = 0x40; // HT mode
  351|  23.8k|        wavelet_trans = 0;  // reversible 5 / 3
  352|  23.8k|        memset(precinct_size, 0, sizeof(precinct_size));
  353|  23.8k|      }
_ZNK4ojph5local9cod_SPcod18get_log_block_dimsEv:
  363|  11.3M|      { return size(block_width + 2, block_height + 2); }
_ZNK4ojph5local9cod_SPcod21get_log_precinct_sizeEj:
  367|  14.1M|      {
  368|       |        assert(res_num <= num_decomp);
  369|  14.1M|        size ps(precinct_size[res_num] & 0xF, precinct_size[res_num] >> 4);
  370|  14.1M|        return ps;
  371|  14.1M|      }
_ZN4ojph5local9cod_SGcodC2Ev:
  377|  8.25k|      cod_SGcod() : prog_order(OJPH_PO_RPCL), num_layers(1), mc_trans(0) {}
_ZN4ojph5local9param_codC2EPS1_t:
  414|  8.25k|      { avail = NULL; init(top_cod, comp_idx); }
_ZN4ojph5local9param_codD2Ev:
  415|  8.25k|      ~param_cod() { destroy(); }
_ZN4ojph5local9param_cod7restartEv:
  419|  7.38k|      {
  420|  7.38k|        param_cod** p = &avail; // move next to the end of avail
  421|  7.38k|        while (*p != NULL)
  ------------------
  |  Branch (421:16): [True: 0, False: 7.38k]
  ------------------
  422|      0|          p = &((*p)->next);
  423|  7.38k|        *p = next;
  424|  7.38k|        this->init(top_cod, OJPH_COD_DEFAULT);
  425|  7.38k|      }
_ZNK4ojph5local9param_cod22get_num_decompositionsEv:
  505|  15.4M|      {
  506|  15.4M|        if (type == COD_MAIN)
  ------------------
  |  Branch (506:13): [True: 14.8M, False: 561k]
  ------------------
  507|  14.8M|          return SPcod.num_decomp;
  508|   561k|        else if (type == COC_MAIN)
  ------------------
  |  Branch (508:18): [True: 561k, False: 0]
  ------------------
  509|   561k|        {
  510|   561k|          if (is_dfs_defined())
  ------------------
  |  Branch (510:15): [True: 360k, False: 200k]
  ------------------
  511|   360k|            return top_cod->get_num_decompositions();
  512|   200k|          else
  513|   200k|            return SPcod.num_decomp;
  514|   561k|        }
  515|      0|        else {
  516|       |          assert(0);
  517|      0|          return 0; // just in case
  518|      0|        }
  519|  15.4M|      }
_ZNK4ojph5local9param_cod18get_log_block_dimsEv:
  527|  11.3M|      { return SPcod.get_log_block_dims(); }
_ZNK4ojph5local9param_cod16get_wavelet_kernEv:
  531|  5.96M|      { return SPcod.wavelet_trans; }
_ZNK4ojph5local9param_cod28is_employing_color_transformEv:
  538|  13.7M|      {
  539|  13.7M|        if (type == COD_MAIN || type == COD_TILE)
  ------------------
  |  Branch (539:13): [True: 13.7M, False: 0]
  |  Branch (539:33): [True: 0, False: 0]
  ------------------
  540|  13.7M|          return (SGCod.mc_trans == 1);
  541|      0|        else
  542|      0|          return top_cod->is_employing_color_transform();
  543|  13.7M|      }
_ZNK4ojph5local9param_cod17get_precinct_sizeEj:
  547|  33.8k|      {
  548|  33.8k|        size t = get_log_precinct_size(res_num);
  549|  33.8k|        return size(1 << t.w, 1 << t.h);
  550|  33.8k|      }
_ZNK4ojph5local9param_cod21get_log_precinct_sizeEj:
  554|  14.6M|      {
  555|  14.6M|        if (Scod & 1)
  ------------------
  |  Branch (555:13): [True: 14.1M, False: 455k]
  ------------------
  556|  14.1M|          return SPcod.get_log_precinct_size(res_num);
  557|   455k|        else
  558|   455k|          return size(15, 15);
  559|  14.6M|      }
_ZNK4ojph5local9param_cod19packets_may_use_sopEv:
  563|  8.25M|      {
  564|  8.25M|        if (type == COD_MAIN || type == COD_TILE)
  ------------------
  |  Branch (564:13): [True: 7.84M, False: 413k]
  |  Branch (564:33): [True: 0, False: 413k]
  ------------------
  565|  7.84M|          return (Scod & 2) == 2;
  566|   413k|        return false;
  567|  8.25M|      }
_ZNK4ojph5local9param_cod15packets_use_ephEv:
  571|  8.25M|      {
  572|  8.25M|        if (type == COD_MAIN || type == COD_TILE)
  ------------------
  |  Branch (572:13): [True: 7.84M, False: 413k]
  |  Branch (572:33): [True: 0, False: 413k]
  ------------------
  573|  7.84M|          return (Scod & 4) == 4;
  574|   413k|        return false;
  575|  8.25M|      }
_ZNK4ojph5local9param_cod28get_block_vertical_causalityEv:
  579|  5.45M|      { return (SPcod.block_style & local::param_cod::VERT_CAUSAL_MODE) != 0; }
_ZNK4ojph5local9param_cod10access_atkEv:
  609|  18.9M|      const param_atk* access_atk() const { return atk; }
_ZNK4ojph5local9param_cod14is_dfs_definedEv:
  614|  14.4M|      { return (SPcod.num_decomp & 0x80) != 0; }
_ZNK4ojph5local9param_cod13get_dfs_indexEv:
  618|   262k|      { return SPcod.num_decomp & 0xF; }
_ZNK4ojph5local9param_cod12get_comp_idxEv:
  622|  12.7M|      {
  623|       |        assert((type == COC_MAIN && comp_idx != OJPH_COD_DEFAULT) ||
  624|  12.7M|               (type == COD_MAIN && comp_idx == OJPH_COD_DEFAULT));
  625|  12.7M|        return comp_idx;
  626|  12.7M|      }
_ZN4ojph5local9param_cod4initEPS1_t:
  631|  15.6k|      {
  632|  15.6k|        type = top_cod ? COC_MAIN : COD_MAIN;
  ------------------
  |  Branch (632:16): [True: 871, False: 14.7k]
  ------------------
  633|  15.6k|        Lcod = 0;
  634|  15.6k|        Scod = 0;
  635|  15.6k|        SPcod = cod_SPcod();  // SPcod is initialized to default values
  636|  15.6k|        next = NULL;
  637|  15.6k|        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|  15.6k|        this->top_cod = top_cod;
  645|  15.6k|        this->comp_idx = comp_idx;
  646|  15.6k|      }
_ZN4ojph5local9param_cod7destroyEv:
  649|  8.25k|      void destroy() {
  650|  8.25k|        if (avail)
  ------------------
  |  Branch (650:13): [True: 0, False: 8.25k]
  ------------------
  651|      0|          delete avail;
  652|  8.25k|        if (next) {
  ------------------
  |  Branch (652:13): [True: 871, False: 7.38k]
  ------------------
  653|    871|          delete next;
  654|       |          next = NULL;
  655|    871|        }
  656|  8.25k|      }
_ZN4ojph5local9param_qcdC2EPS1_t:
  712|  7.67k|      { avail = NULL; init(top_qcd, comp_idx); }
_ZN4ojph5local9param_qcdD2Ev:
  713|  7.67k|      ~param_qcd() { destroy(); }
_ZN4ojph5local9param_qcd7restartEv:
  717|  7.38k|      {
  718|  7.38k|        param_qcd** p = &avail; // move next to the end of avail
  719|  7.38k|        while (*p != NULL)
  ------------------
  |  Branch (719:16): [True: 0, False: 7.38k]
  ------------------
  720|      0|          p = &((*p)->next);
  721|  7.38k|        *p = next;
  722|  7.38k|        this->init(top_qcd, OJPH_QCD_DEFAULT);
  723|  7.38k|      }
_ZNK4ojph5local9param_qcd12get_comp_idxEv:
  750|    429|      ui16 get_comp_idx() const { return comp_idx; }
_ZN4ojph5local9param_qcd4initEPS1_t:
  755|  15.0k|      {
  756|  15.0k|        is_init = false;
  757|  15.0k|        type = top_qcd ? QCC_MAIN : QCD_MAIN;
  ------------------
  |  Branch (757:16): [True: 285, False: 14.7k]
  ------------------
  758|  15.0k|        Lqcd = 0;
  759|  15.0k|        Sqcd = 0;
  760|  15.0k|        memset(&SPqcd, 0, sizeof(SPqcd));
  761|  15.0k|        num_subbands = 0;
  762|  15.0k|        base_delta = -1.0f;
  763|  15.0k|        qfactor = QFACTOR_UNSET;
  764|  15.0k|        ctype = comp_type::OJPH_COMP_Y;
  765|  15.0k|        sampling = ojph::point(1, 1);
  766|  15.0k|        enabled = true;
  767|       |        next = NULL;
  768|  15.0k|        this->top_qcd = top_qcd;
  769|  15.0k|        this->comp_idx = comp_idx;
  770|  15.0k|      }
_ZN4ojph5local9param_qcd7destroyEv:
  773|  7.67k|      void destroy() {
  774|  7.67k|        if (avail)
  ------------------
  |  Branch (774:13): [True: 0, False: 7.67k]
  ------------------
  775|      0|          delete avail;
  776|  7.67k|        if (next)
  ------------------
  |  Branch (776:13): [True: 285, False: 7.38k]
  ------------------
  777|    285|        {
  778|    285|          delete next;
  779|       |          next = NULL;
  780|    285|        }
  781|  7.67k|      }
_ZNK4ojph5local9param_qcd12decode_SPqcdEh:
  793|  64.7M|      { return (ui8)(v >> 3); }
_ZN4ojph5local9param_nltC2Ev:
  844|  7.82k|      param_nlt() { avail = NULL; init(); }
_ZN4ojph5local9param_nltD2Ev:
  845|  7.82k|      ~param_nlt() { destroy(); }
_ZN4ojph5local9param_nlt7restartEv:
  849|  7.38k|      {
  850|  7.38k|        param_nlt** p = &avail; // move next to the end of avail
  851|  7.38k|        while (*p != NULL)
  ------------------
  |  Branch (851:16): [True: 0, False: 7.38k]
  ------------------
  852|      0|          p = &((*p)->next);
  853|  7.38k|        *p = next;
  854|  7.38k|        this->init();
  855|  7.38k|      }
_ZN4ojph5local9param_nlt4initEv:
  867|  15.2k|      {
  868|  15.2k|        Lnlt = 6;
  869|  15.2k|        Cnlt = special_comp_num::ALL_COMPS; // default
  870|  15.2k|        BDnlt = 0;
  871|  15.2k|        Tnlt = nonlinearity::OJPH_NLT_UNDEFINED;
  872|       |        enabled = false; next = NULL;
  873|  15.2k|      }
_ZN4ojph5local9param_nlt7destroyEv:
  877|  7.82k|      {
  878|  7.82k|        if (avail)
  ------------------
  |  Branch (878:13): [True: 0, False: 7.82k]
  ------------------
  879|      0|          delete avail;
  880|  7.82k|        if (next) {
  ------------------
  |  Branch (880:13): [True: 437, False: 7.38k]
  ------------------
  881|    437|          delete next;
  882|       |          next = NULL;
  883|    437|        }
  884|  7.82k|      }
_ZN4ojph5local9param_capC2Ev:
  921|  7.38k|      {
  922|  7.38k|        memset(this, 0, sizeof(param_cap));
  923|  7.38k|        Lcap = 8;
  924|  7.38k|        Pcap = 0x00020000; //for jph, Pcap^15 must be set, the 15th MSB
  925|  7.38k|      }
_ZN4ojph5local9param_sot4initEjthh:
  967|   474k|      {
  968|   474k|        Lsot = 10;
  969|   474k|        Psot = payload_length + 12; //total = payload + SOT marker
  970|   474k|        Isot = tile_idx;
  971|   474k|        TPsot = tile_part_index;
  972|   474k|        TNsot = num_tile_parts;
  973|   474k|      }
_ZNK4ojph5local9param_sot14get_tile_indexEv:
  979|   419k|      ui16 get_tile_index() const { return Isot; }
_ZNK4ojph5local9param_sot18get_payload_lengthEv:
  980|   411k|      ui32 get_payload_length() const { return Psot > 0 ? Psot - 12 : 0; }
  ------------------
  |  Branch (980:48): [True: 33.9k, False: 377k]
  ------------------
_ZNK4ojph5local9param_sot19get_tile_part_indexEv:
  981|   580k|      ui8  get_tile_part_index() const { return TPsot; }
_ZNK4ojph5local9param_sot18get_num_tile_partsEv:
  982|   339k|      ui8  get_num_tile_parts() const { return TNsot; }
_ZN4ojph5local9param_tlmC2Ev:
 1008|  7.38k|      param_tlm() { pairs = NULL; num_pairs = 0; next_pair_index = 0; };
_ZN4ojph5local9param_dfsC2Ev:
 1041|   726k|      param_dfs() { avail = NULL; init(); }
_ZN4ojph5local9param_dfsD2Ev:
 1042|   726k|      ~param_dfs() { destroy(); }
_ZN4ojph5local9param_dfs7restartEv:
 1046|  7.38k|      {
 1047|  7.38k|        param_dfs** p = &avail; // move next to the end of avail
 1048|  7.38k|        while (*p != NULL)
  ------------------
  |  Branch (1048:16): [True: 0, False: 7.38k]
  ------------------
 1049|      0|          p = &((*p)->next);
 1050|  7.38k|        *p = next;
 1051|  7.38k|        this->init();
 1052|  7.38k|      }
_ZNK4ojph5local9param_dfs6existsEv:
 1055|   378k|      bool exists() const { return Ldfs != 0; }
_ZN4ojph5local9param_dfs4initEv:
 1069|   734k|      { Ldfs = Sdfs = Ids = 0; memset(Ddfs, 0, sizeof(Ddfs)); next = NULL; }
_ZN4ojph5local9param_dfs7destroyEv:
 1073|   726k|      {
 1074|   726k|        if (avail)
  ------------------
  |  Branch (1074:13): [True: 0, False: 726k]
  ------------------
 1075|      0|          delete avail;
 1076|   726k|        if (next) {
  ------------------
  |  Branch (1076:13): [True: 719k, False: 7.38k]
  ------------------
 1077|   719k|          delete next;
 1078|       |          next = NULL;
 1079|   719k|        }
 1080|   726k|      }
_ZN4ojph5local9param_atkC2Ev:
 1131|  7.81k|      {
 1132|  7.81k|        d = d_store;
 1133|  7.81k|        max_steps = sizeof(d_store) / sizeof(lifting_step);
 1134|       |        init(NULL);
 1135|  7.81k|      }
_ZN4ojph5local9param_atkD2Ev:
 1137|  7.81k|      {
 1138|  7.81k|        if (avail) {
  ------------------
  |  Branch (1138:13): [True: 0, False: 7.81k]
  ------------------
 1139|      0|          delete avail;
 1140|      0|          avail = NULL;
 1141|      0|        }
 1142|  7.81k|        if (next) {
  ------------------
  |  Branch (1142:13): [True: 428, False: 7.38k]
  ------------------
 1143|    428|          delete next;
 1144|    428|          next = NULL;
 1145|    428|        }
 1146|  7.81k|        if (d != NULL && d != d_store) {
  ------------------
  |  Branch (1146:13): [True: 7.81k, False: 0]
  |  Branch (1146:26): [True: 86, False: 7.72k]
  ------------------
 1147|     86|          delete[] d;
 1148|     86|          d = d_store;
 1149|     86|          max_steps = sizeof(d_store) / sizeof(lifting_step);
 1150|     86|        }
 1151|  7.81k|      }
_ZN4ojph5local9param_atk7restartEv:
 1155|  7.38k|      {
 1156|  7.38k|        assert(top_atk == NULL);
 1157|       |
 1158|  7.38k|        Latk = Satk = 0;
 1159|  7.38k|        Katk = 0.0f;
 1160|  7.38k|        Natk = 0;
 1161|  7.38k|        if (d == NULL || d == d_store) {
  ------------------
  |  Branch (1161:13): [True: 0, False: 7.38k]
  |  Branch (1161:26): [True: 7.38k, False: 0]
  ------------------
 1162|  7.38k|          d = d_store;
 1163|  7.38k|          max_steps = sizeof(d_store) / sizeof(lifting_step);
 1164|  7.38k|        }
 1165|  7.38k|        memset(d, 0, max_steps * sizeof(lifting_step));
 1166|       |
 1167|  7.38k|        param_atk** p = &avail; // move next to the end of avail
 1168|  7.38k|        while (*p != NULL)
  ------------------
  |  Branch (1168:16): [True: 0, False: 7.38k]
  ------------------
 1169|      0|          p = &((*p)->next);
 1170|  7.38k|        *p = next;
 1171|       |
 1172|       |        next = NULL;
 1173|  7.38k|      }
_ZNK4ojph5local9param_atk9get_indexEv:
 1177|  1.89k|      ui8 get_index() const { return (ui8)(Satk & 0xFF); }
_ZNK4ojph5local9param_atk14get_coeff_typeEv:
 1178|  2.07k|      int get_coeff_type() const { return (Satk >> 8) & 0x7; }
_ZNK4ojph5local9param_atk15is_whole_sampleEv:
 1179|    416|      bool is_whole_sample() const { return (Satk & 0x800) != 0; }
_ZNK4ojph5local9param_atk13is_reversibleEv:
 1180|  12.7M|      bool is_reversible() const { return (Satk & 0x1000) != 0; }
_ZNK4ojph5local9param_atk10is_m_init0Ev:
 1181|    419|      bool is_m_init0() const { return (Satk & 0x2000) == 0; }
_ZNK4ojph5local9param_atk21is_using_ws_extensionEv:
 1182|    407|      bool is_using_ws_extension() const { return (Satk & 0x4000) != 0; }
_ZNK4ojph5local9param_atk8get_stepEj:
 1185|  8.30M|      { assert(s < Natk); return d + s; }
_ZNK4ojph5local9param_atk13get_num_stepsEv:
 1186|  5.81M|      ui32 get_num_steps() const { return Natk; }
_ZNK4ojph5local9param_atk5get_KEv:
 1187|  1.32M|      float get_K() const { return Katk; }
_ZN4ojph5local9param_atk4initEPS1_:
 1192|  8.24k|      {
 1193|  8.24k|        Latk = Satk = 0;
 1194|  8.24k|        Katk = 0.0f;
 1195|  8.24k|        Natk = 0;
 1196|  8.24k|        if (d == NULL || d == d_store) {
  ------------------
  |  Branch (1196:13): [True: 0, False: 8.24k]
  |  Branch (1196:26): [True: 8.24k, False: 0]
  ------------------
 1197|  8.24k|          d = d_store;
 1198|  8.24k|          max_steps = sizeof(d_store) / sizeof(lifting_step);
 1199|  8.24k|        }
 1200|  8.24k|        memset(d, 0, max_steps * sizeof(lifting_step));
 1201|  8.24k|        next = NULL;
 1202|  8.24k|        this->top_atk = top_atk;
 1203|       |        avail = NULL;
 1204|  8.24k|      }

_ZN4ojph5local8precinct5parseEiPjPNS_21mem_elastic_allocatorERjPNS_11infile_baseEb:
  332|   396k|    {
  333|   396k|      assert(data_left > 0);
  334|   396k|      bit_read_buf bb;
  335|   396k|      bb_init(&bb, data_left, file);
  336|   396k|      if (may_use_sop)
  ------------------
  |  Branch (336:11): [True: 81.4k, False: 314k]
  ------------------
  337|  81.4k|        bb_skip_sop(&bb);
  338|       |
  339|   396k|      bool empty_packet = true;
  340|  1.06M|      for (int s = 0; s < 4; ++s)
  ------------------
  |  Branch (340:23): [True: 958k, False: 102k]
  ------------------
  341|   958k|      {
  342|   958k|        if (bands[s].empty)
  ------------------
  |  Branch (342:13): [True: 398k, False: 559k]
  ------------------
  343|   398k|          continue;
  344|       |
  345|   559k|        if (cb_idxs[s].siz.w == 0 || cb_idxs[s].siz.h == 0)
  ------------------
  |  Branch (345:13): [True: 7.28k, False: 552k]
  |  Branch (345:38): [True: 7.48k, False: 545k]
  ------------------
  346|  14.7k|          continue;
  347|       |
  348|   545k|        if (empty_packet) //one bit to check if the packet is empty
  ------------------
  |  Branch (348:13): [True: 391k, False: 153k]
  ------------------
  349|   391k|        {
  350|   391k|          ui32 bit;
  351|   391k|          bb_read_bit(&bb, bit);
  352|   391k|          if (bit == 0) //empty packet
  ------------------
  |  Branch (352:15): [True: 274k, False: 117k]
  ------------------
  353|   274k|          { bb_terminate(&bb, uses_eph); data_left = bb.bytes_left; return; }
  354|   117k|          empty_packet = false;
  355|   117k|        }
  356|       |
  357|   270k|        ui32 num_levels = 1 +
  358|   270k|          ojph_max(log2ceil(cb_idxs[s].siz.w), log2ceil(cb_idxs[s].siz.h));
  ------------------
  |  |   73|   270k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 4.55k, False: 265k]
  |  |  ------------------
  ------------------
  359|       |
  360|       |        //create quad trees for inclusion and missing msbs
  361|   270k|        tag_tree inc_tag, inc_tag_flags, mmsb_tag, mmsb_tag_flags;
  362|   270k|        inc_tag.init(scratch, lev_idx, num_levels, cb_idxs[s].siz, 0);
  363|   270k|        *inc_tag.get(0, 0, num_levels) = 0;
  364|   270k|        inc_tag_flags.init(scratch + tag_tree_size, lev_idx, num_levels,
  365|   270k|          cb_idxs[s].siz, 0);
  366|   270k|        *inc_tag_flags.get(0, 0, num_levels) = 0;
  367|   270k|        mmsb_tag.init(scratch + (tag_tree_size<<1), lev_idx, num_levels,
  368|   270k|          cb_idxs[s].siz, 0);
  369|   270k|        *mmsb_tag.get(0, 0, num_levels) = 0;
  370|   270k|        mmsb_tag_flags.init(scratch + (tag_tree_size<<1) + tag_tree_size,
  371|   270k|          lev_idx, num_levels, cb_idxs[s].siz, 0);
  372|   270k|        *mmsb_tag_flags.get(0, 0, num_levels) = 0;
  373|       |
  374|       |        //
  375|   270k|        ui32 band_width = bands[s].num_blocks.w;
  376|   270k|        ui32 width = cb_idxs[s].siz.w;
  377|   270k|        ui32 height = cb_idxs[s].siz.h;
  378|   572k|        for (ui32 y = 0; y < height; ++y)
  ------------------
  |  Branch (378:26): [True: 320k, False: 251k]
  ------------------
  379|   320k|        {
  380|   320k|          coded_cb_header *cp = bands[s].coded_cbs;
  381|   320k|          cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
  382|   744k|          for (ui32 x = 0; x < width; ++x, ++cp)
  ------------------
  |  Branch (382:28): [True: 442k, False: 302k]
  ------------------
  383|   442k|          {
  384|       |            //process inclusion
  385|   442k|            bool empty_cb = false;
  386|   836k|            for (ui32 cl = num_levels; cl > 0; --cl)
  ------------------
  |  Branch (386:40): [True: 704k, False: 132k]
  ------------------
  387|   704k|            {
  388|   704k|              ui32 cur_lev = cl - 1;
  389|   704k|              empty_cb = *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) == 1;
  390|   704k|              if (empty_cb)
  ------------------
  |  Branch (390:19): [True: 179k, False: 525k]
  ------------------
  391|   179k|                break;
  392|       |              //check received
  393|   525k|              if (*inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
  ------------------
  |  Branch (393:19): [True: 274k, False: 251k]
  ------------------
  394|   274k|              {
  395|   274k|                ui32 bit;
  396|   274k|                if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (396:21): [True: 223, False: 274k]
  ------------------
  397|    223|                { data_left = 0; throw "error reading from file p1"; }
  398|   274k|                empty_cb = (bit == 0);
  399|   274k|                *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)(1 - bit);
  400|   274k|                *inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
  401|   274k|              }
  402|   525k|              if (empty_cb)
  ------------------
  |  Branch (402:19): [True: 130k, False: 394k]
  ------------------
  403|   130k|                break;
  404|   525k|            }
  405|       |
  406|   441k|            if (empty_cb)
  ------------------
  |  Branch (406:17): [True: 309k, False: 132k]
  ------------------
  407|   309k|              continue;
  408|       |
  409|       |            //process missing msbs
  410|   132k|            ui32 mmsbs = 0;
  411|   273k|            for (ui32 levp1 = num_levels; levp1 > 0; --levp1)
  ------------------
  |  Branch (411:43): [True: 142k, False: 131k]
  ------------------
  412|   142k|            {
  413|   142k|              ui32 cur_lev = levp1 - 1;
  414|   142k|              mmsbs = *mmsb_tag.get(x>>levp1, y>>levp1, levp1);
  415|       |              //check received
  416|   142k|              if (*mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
  ------------------
  |  Branch (416:19): [True: 139k, False: 2.89k]
  ------------------
  417|   139k|              {
  418|   139k|                ui32 bit = 0;
  419|  19.0M|                while (bit == 0)
  ------------------
  |  Branch (419:24): [True: 18.9M, False: 138k]
  ------------------
  420|  18.9M|                {
  421|  18.9M|                  if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (421:23): [True: 242, False: 18.9M]
  ------------------
  422|    242|                  { data_left = 0; throw "error reading from file p2"; }
  423|  18.9M|                  mmsbs += 1 - bit;
  424|  18.9M|                }
  425|   138k|                *mmsb_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)mmsbs;
  426|   138k|                *mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
  427|   138k|              }
  428|   142k|            }
  429|       |
  430|   131k|            if (mmsbs > cp->Kmax)
  ------------------
  |  Branch (430:17): [True: 2.72k, False: 129k]
  ------------------
  431|  2.72k|              throw "error in parsing a tile header; "
  432|  2.72k|              "missing msbs are larger or equal to Kmax. The most likely "
  433|  2.72k|              "cause is a corruption in the bitstream.";
  434|   129k|            cp->missing_msbs = mmsbs;
  435|       |
  436|       |            //get number of passes
  437|   129k|            ui32 bit, num_passes = 1;
  438|   129k|            if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (438:17): [True: 204, False: 128k]
  ------------------
  439|    204|            { data_left = 0; throw "error reading from file p3"; }
  440|   128k|            if (bit)
  ------------------
  |  Branch (440:17): [True: 105k, False: 23.1k]
  ------------------
  441|   105k|            {
  442|   105k|              num_passes = 2;
  443|   105k|              if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (443:19): [True: 205, False: 105k]
  ------------------
  444|    205|              { data_left = 0; throw "error reading from file p4"; }
  445|   105k|              if (bit)
  ------------------
  |  Branch (445:19): [True: 79.7k, False: 25.6k]
  ------------------
  446|  79.7k|              {
  447|  79.7k|                if (bb_read_bits(&bb, 2, bit) == false)
  ------------------
  |  Branch (447:21): [True: 198, False: 79.5k]
  ------------------
  448|    198|                { data_left = 0; throw "error reading from file p5";  }
  449|  79.5k|                num_passes = 3 + bit;
  450|  79.5k|                if (bit == 3)
  ------------------
  |  Branch (450:21): [True: 58.1k, False: 21.3k]
  ------------------
  451|  58.1k|                {
  452|  58.1k|                  if (bb_read_bits(&bb, 5, bit) == false)
  ------------------
  |  Branch (452:23): [True: 329, False: 57.8k]
  ------------------
  453|    329|                  { data_left = 0; throw "error reading from file p6"; }
  454|  57.8k|                  num_passes = 6 + bit;
  455|  57.8k|                  if (bit == 31)
  ------------------
  |  Branch (455:23): [True: 12.4k, False: 45.3k]
  ------------------
  456|  12.4k|                  {
  457|  12.4k|                    if (bb_read_bits(&bb, 7, bit) == false)
  ------------------
  |  Branch (457:25): [True: 283, False: 12.2k]
  ------------------
  458|    283|                    { data_left = 0; throw "error reading from file p7"; }
  459|  12.2k|                    num_passes = 37 + bit;
  460|  12.2k|                  }
  461|  57.8k|                }
  462|  79.5k|              }
  463|   105k|            }
  464|   127k|            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|   127k|            ui32 num_phld_passes = (num_passes - 1) / 3;
  476|   127k|            cp->missing_msbs += num_phld_passes;
  477|       |
  478|   127k|            num_phld_passes *= 3;
  479|   127k|            cp->num_passes = num_passes - num_phld_passes;
  480|   127k|            cp->pass_length[0] = cp->pass_length[1] = 0;
  481|       |
  482|   127k|            int Lblock = 3;
  483|   127k|            bit = 1;
  484|  5.15M|            while (bit)
  ------------------
  |  Branch (484:20): [True: 5.02M, False: 127k]
  ------------------
  485|  5.02M|            {
  486|       |              // add any extra bits here
  487|  5.02M|              if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (487:19): [True: 239, False: 5.02M]
  ------------------
  488|    239|              { data_left = 0; throw "error reading from file p8"; }
  489|  5.02M|              Lblock += bit;
  490|  5.02M|            }
  491|       |
  492|   127k|            int bits = Lblock + 31 -
  493|   127k|              (int)count_leading_zeros(num_phld_passes + 1);
  494|   127k|            if (bb_read_bits(&bb, bits, bit) == false)
  ------------------
  |  Branch (494:17): [True: 308, False: 127k]
  ------------------
  495|    308|            { data_left = 0; throw "error reading from file p9"; }
  496|   127k|            if (bit < 2)
  ------------------
  |  Branch (496:17): [True: 10.5k, False: 116k]
  ------------------
  497|  10.5k|              throw "The cleanup segment of an HT codeblock cannot contain "
  498|  10.5k|                "less than 2 bytes";
  499|   116k|            if (bit >= 65535)
  ------------------
  |  Branch (499:17): [True: 2.32k, False: 114k]
  ------------------
  500|  2.32k|              throw "The cleanup segment of an HT codeblock must contain "
  501|  2.32k|                "less than 65535 bytes";
  502|   114k|            cp->pass_length[0] = bit;
  503|       |
  504|   114k|            if (cp->num_passes > 1)
  ------------------
  |  Branch (504:17): [True: 75.8k, False: 38.5k]
  ------------------
  505|  75.8k|            {
  506|       |              //bits = Lblock + 31 - count_leading_zeros(cp->num_passes - 1);
  507|       |              // The following is simpler than the above, I think?
  508|  75.8k|              bits = Lblock + (cp->num_passes > 2 ? 1 : 0);
  ------------------
  |  Branch (508:32): [True: 35.3k, False: 40.5k]
  ------------------
  509|  75.8k|              if (bb_read_bits(&bb, bits, bit) == false)
  ------------------
  |  Branch (509:19): [True: 218, False: 75.6k]
  ------------------
  510|    218|              { data_left = 0; throw "error reading from file p10"; }
  511|  75.6k|              if (bit >= 2047)
  ------------------
  |  Branch (511:19): [True: 586, False: 75.0k]
  ------------------
  512|    586|                throw "The refinement segment (SigProp and MagRep passes) of "
  513|    586|                  "an HT codeblock must contain less than 2047 bytes";
  514|  75.0k|              cp->pass_length[1] = bit;
  515|  75.0k|            }
  516|   114k|          }
  517|   320k|        }
  518|   270k|      }
  519|   102k|      if (empty_packet)
  ------------------
  |  Branch (519:11): [True: 1.41k, False: 101k]
  ------------------
  520|  1.41k|      { // all subbands are empty
  521|  1.41k|        ui32 bit = 0;
  522|  1.41k|        bb_read_bit(&bb, bit);
  523|       |        //assert(bit == 0);
  524|  1.41k|      }
  525|   102k|      bb_terminate(&bb, uses_eph);
  526|       |      //read codeblock data
  527|   426k|      for (int s = 0; s < 4; ++s)
  ------------------
  |  Branch (527:23): [True: 323k, False: 102k]
  ------------------
  528|   323k|      {
  529|   323k|        if (bands[s].empty)
  ------------------
  |  Branch (529:13): [True: 97.4k, False: 226k]
  ------------------
  530|  97.4k|          continue;
  531|       |
  532|   226k|        ui32 band_width = bands[s].num_blocks.w;
  533|   226k|        ui32 width = cb_idxs[s].siz.w;
  534|   226k|        ui32 height = cb_idxs[s].siz.h;
  535|   513k|        for (ui32 y = 0; y < height; ++y)
  ------------------
  |  Branch (535:26): [True: 286k, False: 226k]
  ------------------
  536|   286k|        {
  537|   286k|          coded_cb_header *cp = bands[s].coded_cbs;
  538|   286k|          cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
  539|   663k|          for (ui32 x = 0; x < width; ++x, ++cp)
  ------------------
  |  Branch (539:28): [True: 376k, False: 286k]
  ------------------
  540|   376k|          {
  541|   376k|            ui32 num_bytes = cp->pass_length[0] + cp->pass_length[1];
  542|   376k|            if (data_left)
  ------------------
  |  Branch (542:17): [True: 353k, False: 23.2k]
  ------------------
  543|   353k|            {
  544|   353k|              if (num_bytes)
  ------------------
  |  Branch (544:19): [True: 98.2k, False: 254k]
  ------------------
  545|  98.2k|              {
  546|  98.2k|                if (skipped)
  ------------------
  |  Branch (546:21): [True: 3.58k, False: 94.6k]
  ------------------
  547|  3.58k|                { //no need to read
  548|  3.58k|                  si64 cur_loc = file->tell();
  549|  3.58k|                  ui32 t = ojph_min(num_bytes, bb.bytes_left);
  ------------------
  |  |   76|  3.58k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 3.01k, False: 571]
  |  |  ------------------
  ------------------
  550|  3.58k|                  file->seek(t, infile_base::OJPH_SEEK_CUR);
  551|  3.58k|                  ui32 bytes_read = (ui32)(file->tell() - cur_loc);
  552|  3.58k|                  cp->pass_length[0] = cp->pass_length[1] = 0;
  553|  3.58k|                  bb.bytes_left -= bytes_read;
  554|  3.58k|                  assert(bytes_read == t || bb.bytes_left == 0);
  555|  3.58k|                }
  556|  94.6k|                else
  557|  94.6k|                {
  558|  94.6k|                  if (!bb_read_chunk(&bb, num_bytes, cp->next_coded, elastic))
  ------------------
  |  Branch (558:23): [True: 12.8k, False: 81.7k]
  ------------------
  559|  12.8k|                  {
  560|       |                    //no need to decode a broken codeblock
  561|  12.8k|                    cp->pass_length[0] = cp->pass_length[1] = 0;
  562|  12.8k|                    data_left = 0;
  563|  12.8k|                  }
  564|  94.6k|                }
  565|  98.2k|              }
  566|   353k|            }
  567|  23.2k|            else
  568|  23.2k|              cp->pass_length[0] = cp->pass_length[1] = 0;
  569|   376k|          }
  570|   286k|        }
  571|   226k|      }
  572|   102k|      data_left = bb.bytes_left;
  573|   102k|    }
ojph_precinct.cpp:_ZN4ojph5localL8log2ceilEj:
   88|   771k|    {
   89|   771k|      ui32 t = 31 - count_leading_zeros(x);
   90|   771k|      return t + (x & (x - 1) ? 1 : 0);
  ------------------
  |  Branch (90:19): [True: 5.20k, False: 766k]
  ------------------
   91|   771k|    }
_ZN4ojph5local8tag_tree4initEPhPjjNS_4sizeEi:
   61|  1.02M|      {
   62|  3.16M|        for (ui32 i = 0; i <= num_levels; ++i) //on extra level
  ------------------
  |  Branch (62:26): [True: 2.13M, False: 1.02M]
  ------------------
   63|  2.13M|          levs[i] = buf + lev_idx[i];
   64|  15.3M|        for (ui32 i = num_levels + 1; i < 16; ++i)
  ------------------
  |  Branch (64:39): [True: 14.3M, False: 1.02M]
  ------------------
   65|  14.3M|          levs[i] = (ui8*)INT_MAX; //make it crash on error
   66|  1.02M|        width = s.w;
   67|  1.02M|        height = s.h;
   68|  2.13M|        for (ui32 i = 0; i < num_levels; ++i)
  ------------------
  |  Branch (68:26): [True: 1.10M, False: 1.02M]
  ------------------
   69|  1.10M|        {
   70|  1.10M|          ui32 size = 1u << ((num_levels - 1 - i) << 1);
   71|  1.10M|          memset(levs[i], init_val, size);
   72|  1.10M|        }
   73|  1.02M|        *levs[num_levels] = 0;
   74|  1.02M|        this->num_levels = num_levels;
   75|  1.02M|      }
_ZN4ojph5local8tag_tree3getEjjj:
   78|  3.36M|      {
   79|  3.36M|        return levs[lev] + (x + y * ((width + (1 << lev) - 1) >> lev));
   80|  3.36M|      }

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

_ZN4ojph5local10resolution9pre_allocEPNS0_10codestreamERKNS_4rectES6_jj:
   62|  3.17M|    {
   63|  3.17M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   64|  3.17M|      const param_cod* cdp = codestream->get_coc(comp_num);
   65|  3.17M|      ui32 num_decomps = cdp->get_num_decompositions();
   66|  3.17M|      ui32 t = num_decomps - codestream->get_skipped_res_for_recon();
   67|  3.17M|      bool skipped_res_for_recon = res_num > t;
   68|       |
   69|  3.17M|      const param_atk* atk = cdp->access_atk();
   70|  3.17M|      param_dfs::dfs_dwt_type ds = param_dfs::BIDIR_DWT;
   71|  3.17M|      if (cdp->is_dfs_defined()) {
  ------------------
  |  Branch (71:11): [True: 94.6k, False: 3.08M]
  ------------------
   72|  94.6k|        const param_dfs* dfs = codestream->access_dfs();
   73|  94.6k|        if (dfs == NULL) {
  ------------------
  |  Branch (73:13): [True: 5, False: 94.6k]
  ------------------
   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|  94.6k|        else {
   80|  94.6k|          ui16 dfs_idx = cdp->get_dfs_index();
   81|  94.6k|          dfs = dfs->get_dfs(dfs_idx);
   82|  94.6k|          if (dfs == NULL) {
  ------------------
  |  Branch (82:15): [True: 5, False: 94.6k]
  ------------------
   83|      5|            OJPH_ERROR(0x00070002, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|      5|              "marker segments. COD/COC specifies the use of a DFS marker "
   85|      5|              "with index %d, but there are no such marker within the "
   86|      5|              "main codestream headers", dfs_idx);
   87|      5|          }
   88|  94.6k|          ds = dfs->get_dwt_type(num_decomps - res_num + 1);
   89|  94.6k|        }
   90|  94.6k|      }
   91|       |
   92|  3.17M|      ui32 transform_flags = 0;
   93|  3.17M|      if (res_num > 0)
  ------------------
  |  Branch (93:11): [True: 2.63M, False: 538k]
  ------------------
   94|  2.63M|      {
   95|  2.63M|        if (ds == param_dfs::BIDIR_DWT)
  ------------------
  |  Branch (95:13): [True: 2.56M, False: 68.6k]
  ------------------
   96|  2.56M|          transform_flags = HORZ_TRX | VERT_TRX;
   97|  68.6k|        else if (ds == param_dfs::HORZ_DWT)
  ------------------
  |  Branch (97:18): [True: 8.23k, False: 60.4k]
  ------------------
   98|  8.23k|          transform_flags = HORZ_TRX;
   99|  60.4k|        else if (ds == param_dfs::VERT_DWT)
  ------------------
  |  Branch (99:18): [True: 27.0k, False: 33.4k]
  ------------------
  100|  27.0k|          transform_flags = VERT_TRX;
  101|  2.63M|      }
  102|       |
  103|       |      //allocate resolution/subbands
  104|  3.17M|      ui32 trx0 = res_rect.org.x;
  105|  3.17M|      ui32 try0 = res_rect.org.y;
  106|  3.17M|      ui32 trx1 = res_rect.org.x + res_rect.siz.w;
  107|  3.17M|      ui32 try1 = res_rect.org.y + res_rect.siz.h;
  108|  3.17M|      allocator->pre_alloc_obj<subband>(4);
  109|  3.17M|      if (res_num > 0)
  ------------------
  |  Branch (109:11): [True: 2.63M, False: 538k]
  ------------------
  110|  2.63M|      {
  111|  2.63M|        if (ds == param_dfs::BIDIR_DWT)
  ------------------
  |  Branch (111:13): [True: 2.56M, False: 68.6k]
  ------------------
  112|  2.56M|        {
  113|  12.8M|          for (ui32 i = 0; i < 4; ++i)
  ------------------
  |  Branch (113:28): [True: 10.2M, False: 2.56M]
  ------------------
  114|  10.2M|          {
  115|  10.2M|            ui32 tbx0 = (trx0 - (i & 1) + 1) >> 1;
  116|  10.2M|            ui32 tbx1 = (trx1 - (i & 1) + 1) >> 1;
  117|  10.2M|            ui32 tby0 = (try0 - (i >> 1) + 1) >> 1;
  118|  10.2M|            ui32 tby1 = (try1 - (i >> 1) + 1) >> 1;
  119|       |
  120|  10.2M|            rect re;
  121|  10.2M|            re.org.x = tbx0;
  122|  10.2M|            re.org.y = tby0;
  123|  10.2M|            re.siz.w = tbx1 - tbx0;
  124|  10.2M|            re.siz.h = tby1 - tby0;
  125|  10.2M|            if (i == 0) {
  ------------------
  |  Branch (125:17): [True: 2.56M, False: 7.70M]
  ------------------
  126|  2.56M|              allocator->pre_alloc_obj<resolution>(1);
  127|  2.56M|              resolution::pre_alloc(codestream, re,
  128|  2.56M|                skipped_res_for_recon ? recon_res_rect : re,
  ------------------
  |  Branch (128:17): [True: 900k, False: 1.66M]
  ------------------
  129|  2.56M|                comp_num, res_num - 1);
  130|  2.56M|            }
  131|  7.70M|            else
  132|  7.70M|              subband::pre_alloc(codestream, re, comp_num, res_num,
  133|  7.70M|                                 transform_flags);
  134|  10.2M|          }
  135|  2.56M|        }
  136|  68.6k|        else if (ds == param_dfs::VERT_DWT)
  ------------------
  |  Branch (136:18): [True: 27.0k, False: 41.6k]
  ------------------
  137|  27.0k|        {
  138|  27.0k|          ui32 tby0, tby1;
  139|  27.0k|          rect re = res_rect;
  140|  27.0k|          tby0 = (try0 + 1) >> 1;
  141|  27.0k|          tby1 = (try1 + 1) >> 1;
  142|  27.0k|          re.org.y = tby0;
  143|  27.0k|          re.siz.h = tby1 - tby0;
  144|  27.0k|          allocator->pre_alloc_obj<resolution>(1);
  145|  27.0k|          resolution::pre_alloc(codestream, re,
  146|  27.0k|            skipped_res_for_recon ? recon_res_rect : re,
  ------------------
  |  Branch (146:13): [True: 9.06k, False: 17.9k]
  ------------------
  147|  27.0k|            comp_num, res_num - 1);
  148|       |
  149|  27.0k|          tby0 = try0 >> 1;
  150|  27.0k|          tby1 = try1 >> 1;
  151|  27.0k|          re.org.y = tby0;
  152|  27.0k|          re.siz.h = tby1 - tby0;
  153|  27.0k|          subband::pre_alloc(codestream, re, comp_num, res_num,
  154|  27.0k|                             transform_flags);
  155|  27.0k|        }
  156|  41.6k|        else if (ds == param_dfs::HORZ_DWT)
  ------------------
  |  Branch (156:18): [True: 8.23k, False: 33.4k]
  ------------------
  157|  8.23k|        {
  158|  8.23k|          ui32 tbx0, tbx1;
  159|  8.23k|          rect re = res_rect;
  160|  8.23k|          tbx0 = (trx0 + 1) >> 1;
  161|  8.23k|          tbx1 = (trx1 + 1) >> 1;
  162|  8.23k|          re.org.x = tbx0;
  163|  8.23k|          re.siz.w = tbx1 - tbx0;
  164|  8.23k|          allocator->pre_alloc_obj<resolution>(1);
  165|  8.23k|          resolution::pre_alloc(codestream, re,
  166|  8.23k|            skipped_res_for_recon ? recon_res_rect : re,
  ------------------
  |  Branch (166:13): [True: 1.64k, False: 6.58k]
  ------------------
  167|  8.23k|            comp_num, res_num - 1);
  168|       |
  169|  8.23k|          tbx0 = trx0 >> 1;
  170|  8.23k|          tbx1 = trx1 >> 1;
  171|  8.23k|          re.org.x = tbx0;
  172|  8.23k|          re.siz.w = tbx1 - tbx0;
  173|  8.23k|          subband::pre_alloc(codestream, re, comp_num, res_num,
  174|  8.23k|                             transform_flags);
  175|  8.23k|        }
  176|  33.4k|        else
  177|  33.4k|        {
  178|  33.4k|          assert(ds == param_dfs::NO_DWT);
  179|  33.4k|          allocator->pre_alloc_obj<resolution>(1);
  180|  33.4k|          resolution::pre_alloc(codestream, res_rect,
  181|  33.4k|            skipped_res_for_recon ? recon_res_rect : res_rect,
  ------------------
  |  Branch (181:13): [True: 12.0k, False: 21.3k]
  ------------------
  182|  33.4k|            comp_num, res_num - 1);
  183|  33.4k|        }
  184|  2.63M|      }
  185|   538k|      else
  186|   538k|        subband::pre_alloc(codestream, res_rect, comp_num, res_num,
  187|   538k|                           transform_flags);
  188|       |
  189|       |      //prealloc precincts
  190|  3.17M|      size log_PP = cdp->get_log_precinct_size(res_num);
  191|  3.17M|      size num_precincts;
  192|  3.17M|      if (trx0 != trx1 && try0 != try1)
  ------------------
  |  Branch (192:11): [True: 1.34M, False: 1.83M]
  |  Branch (192:27): [True: 936k, False: 407k]
  ------------------
  193|   936k|      {
  194|   936k|        num_precincts.w = (trx1 + (1 << log_PP.w) - 1) >> log_PP.w;
  195|   936k|        num_precincts.w -= trx0 >> log_PP.w;
  196|   936k|        num_precincts.h = (try1 + (1 << log_PP.h) - 1) >> log_PP.h;
  197|   936k|        num_precincts.h -= try0 >> log_PP.h;
  198|   936k|        allocator->pre_alloc_obj<precinct>((size_t)num_precincts.area());
  199|   936k|      }
  200|       |
  201|       |      //allocate lines
  202|  3.17M|      if (skipped_res_for_recon == false)
  ------------------
  |  Branch (202:11): [True: 2.25M, False: 923k]
  ------------------
  203|  2.25M|      {
  204|  2.25M|        ui32 num_steps = atk->get_num_steps();
  205|  2.25M|        allocator->pre_alloc_obj<line_buf>(num_steps + 2);
  206|  2.25M|        allocator->pre_alloc_obj<lifting_buf>(num_steps + 2);
  207|       |
  208|  2.25M|        const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
  209|  2.25M|        ui32 precision = qp->propose_precision(cdp);
  210|  2.25M|        const param_atk* atk = cdp->access_atk();
  211|  2.25M|        bool reversible = atk->is_reversible();
  212|       |
  213|  2.25M|        ui32 width = res_rect.siz.w + 1;
  214|  2.25M|        if (reversible)
  ------------------
  |  Branch (214:13): [True: 1.46M, False: 786k]
  ------------------
  215|  1.46M|        {
  216|  1.46M|          if (precision <= 32) {
  ------------------
  |  Branch (216:15): [True: 1.33M, False: 134k]
  ------------------
  217|  3.99M|            for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (217:30): [True: 2.65M, False: 1.33M]
  ------------------
  218|  2.65M|              allocator->pre_alloc_data<si32>(width, 1);
  219|  1.33M|            allocator->pre_alloc_data<si32>(width, 1);
  220|  1.33M|            allocator->pre_alloc_data<si32>(width, 1);
  221|  1.33M|          }
  222|   134k|          else
  223|   134k|          {
  224|   399k|            for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (224:30): [True: 264k, False: 134k]
  ------------------
  225|   264k|              allocator->pre_alloc_data<si64>(width, 1);
  226|   134k|            allocator->pre_alloc_data<si64>(width, 1);
  227|   134k|            allocator->pre_alloc_data<si64>(width, 1);
  228|   134k|          }
  229|  1.46M|        }
  230|   786k|        else {
  231|  3.88M|          for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (231:28): [True: 3.09M, False: 786k]
  ------------------
  232|  3.09M|            allocator->pre_alloc_data<float>(width, 1);
  233|   786k|          allocator->pre_alloc_data<float>(width, 1);
  234|   786k|          allocator->pre_alloc_data<float>(width, 1);
  235|   786k|        }
  236|  2.25M|      }
  237|  3.17M|    }
_ZN4ojph5local10resolution14finalize_allocEPNS0_10codestreamERKNS_4rectES6_jjNS_5pointES7_PNS0_9tile_compEPS1_:
  247|  2.95M|    {
  248|  2.95M|      mem_fixed_allocator* allocator = codestream->get_allocator();
  249|  2.95M|      elastic = codestream->get_elastic_alloc();
  250|  2.95M|      const param_cod* cdp = codestream->get_coc(comp_num);
  251|  2.95M|      ui32 t, num_decomps = cdp->get_num_decompositions();
  252|  2.95M|      t = num_decomps - codestream->get_skipped_res_for_recon();
  253|  2.95M|      skipped_res_for_recon = res_num > t;
  254|  2.95M|      t = num_decomps - codestream->get_skipped_res_for_read();
  255|  2.95M|      skipped_res_for_read = res_num > t;
  256|       |
  257|  2.95M|      this->comp_downsamp = comp_downsamp;
  258|  2.95M|      this->parent_comp = parent_tile_comp;
  259|  2.95M|      this->parent_res = parent_res;
  260|  2.95M|      this->res_rect = res_rect;
  261|  2.95M|      this->comp_num = comp_num;
  262|  2.95M|      this->res_num = res_num;
  263|  2.95M|      this->num_bytes = 0;
  264|  2.95M|      this->atk = cdp->access_atk();
  265|  2.95M|      param_dfs::dfs_dwt_type ds = param_dfs::BIDIR_DWT;
  266|  2.95M|      if (cdp->is_dfs_defined()) {
  ------------------
  |  Branch (266:11): [True: 82.9k, False: 2.87M]
  ------------------
  267|  82.9k|        const param_dfs* dfs = codestream->access_dfs();
  268|  82.9k|        if (dfs == NULL) {
  ------------------
  |  Branch (268:13): [True: 0, False: 82.9k]
  ------------------
  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|  82.9k|        else {
  275|  82.9k|          ui16 dfs_idx = cdp->get_dfs_index();
  276|  82.9k|          dfs = dfs->get_dfs(dfs_idx);
  277|  82.9k|          if (dfs == NULL) {
  ------------------
  |  Branch (277:15): [True: 0, False: 82.9k]
  ------------------
  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|  82.9k|          ui32 num_decomps = cdp->get_num_decompositions();
  284|  82.9k|          ds = dfs->get_dwt_type(num_decomps - res_num + 1);
  285|  82.9k|        }
  286|  82.9k|      }
  287|       |
  288|  2.95M|      transform_flags = 0;
  289|  2.95M|      if (res_num > 0)
  ------------------
  |  Branch (289:11): [True: 2.45M, False: 501k]
  ------------------
  290|  2.45M|      {
  291|  2.45M|        if (ds == param_dfs::BIDIR_DWT)
  ------------------
  |  Branch (291:13): [True: 2.39M, False: 59.0k]
  ------------------
  292|  2.39M|          transform_flags = HORZ_TRX | VERT_TRX;
  293|  59.0k|        else if (ds == param_dfs::HORZ_DWT)
  ------------------
  |  Branch (293:18): [True: 7.26k, False: 51.7k]
  ------------------
  294|  7.26k|          transform_flags = HORZ_TRX;
  295|  51.7k|        else if (ds == param_dfs::VERT_DWT)
  ------------------
  |  Branch (295:18): [True: 18.7k, False: 32.9k]
  ------------------
  296|  18.7k|          transform_flags = VERT_TRX;
  297|  2.45M|      }
  298|       |
  299|       |      //allocate resolution/subbands
  300|  2.95M|      ui32 trx0 = res_rect.org.x;
  301|  2.95M|      ui32 try0 = res_rect.org.y;
  302|  2.95M|      ui32 trx1 = res_rect.org.x + res_rect.siz.w;
  303|  2.95M|      ui32 try1 = res_rect.org.y + res_rect.siz.h;
  304|  2.95M|      bands = allocator->post_alloc_obj<subband>(4);
  305|  14.7M|      for (int i = 0; i < 4; ++i)
  ------------------
  |  Branch (305:23): [True: 11.8M, False: 2.95M]
  ------------------
  306|  11.8M|        new (bands + i) subband;
  307|  2.95M|      if (res_num > 0)
  ------------------
  |  Branch (307:11): [True: 2.45M, False: 501k]
  ------------------
  308|  2.45M|      {
  309|  2.45M|        if (ds == param_dfs::BIDIR_DWT)
  ------------------
  |  Branch (309:13): [True: 2.39M, False: 59.0k]
  ------------------
  310|  2.39M|        {
  311|  11.9M|          for (ui32 i = 0; i < 4; ++i)
  ------------------
  |  Branch (311:28): [True: 9.59M, False: 2.39M]
  ------------------
  312|  9.59M|          {
  313|  9.59M|            ui32 tbx0 = (trx0 - (i & 1) + 1) >> 1;
  314|  9.59M|            ui32 tbx1 = (trx1 - (i & 1) + 1) >> 1;
  315|  9.59M|            ui32 tby0 = (try0 - (i >> 1) + 1) >> 1;
  316|  9.59M|            ui32 tby1 = (try1 - (i >> 1) + 1) >> 1;
  317|       |
  318|  9.59M|            rect re;
  319|  9.59M|            re.org.x = tbx0;
  320|  9.59M|            re.org.y = tby0;
  321|  9.59M|            re.siz.w = tbx1 - tbx0;
  322|  9.59M|            re.siz.h = tby1 - tby0;
  323|  9.59M|            if (i == 0) {
  ------------------
  |  Branch (323:17): [True: 2.39M, False: 7.19M]
  ------------------
  324|  2.39M|              point next_res_downsamp;
  325|  2.39M|              next_res_downsamp.x = res_downsamp.x * 2;
  326|  2.39M|              next_res_downsamp.y = res_downsamp.y * 2;
  327|       |
  328|  2.39M|              child_res = allocator->post_alloc_obj<resolution>(1);
  329|  2.39M|              child_res->finalize_alloc(codestream, re,
  330|  2.39M|                skipped_res_for_recon ? recon_res_rect : re, comp_num,
  ------------------
  |  Branch (330:17): [True: 832k, False: 1.56M]
  ------------------
  331|  2.39M|                res_num - 1, comp_downsamp, next_res_downsamp,
  332|  2.39M|                parent_tile_comp, this);
  333|  2.39M|            }
  334|  7.19M|            else
  335|  7.19M|              bands[i].finalize_alloc(codestream, re, this, res_num, i);
  336|  9.59M|          }
  337|  2.39M|        }
  338|  59.0k|        else if (ds == param_dfs::VERT_DWT)
  ------------------
  |  Branch (338:18): [True: 18.7k, False: 40.2k]
  ------------------
  339|  18.7k|        {
  340|  18.7k|          ui32 tby0, tby1;
  341|  18.7k|          rect re = res_rect;
  342|  18.7k|          tby0 = (try0 + 1) >> 1;
  343|  18.7k|          tby1 = (try1 + 1) >> 1;
  344|  18.7k|          re.org.y = tby0;
  345|  18.7k|          re.siz.h = tby1 - tby0;
  346|       |
  347|  18.7k|          point next_res_downsamp;
  348|  18.7k|          next_res_downsamp.x = res_downsamp.x;
  349|  18.7k|          next_res_downsamp.y = res_downsamp.y * 2;
  350|  18.7k|          child_res = allocator->post_alloc_obj<resolution>(1);
  351|  18.7k|          child_res->finalize_alloc(codestream, re,
  352|  18.7k|            skipped_res_for_recon ? recon_res_rect : re, comp_num,
  ------------------
  |  Branch (352:13): [True: 8.11k, False: 10.6k]
  ------------------
  353|  18.7k|            res_num - 1, comp_downsamp, next_res_downsamp,
  354|  18.7k|            parent_tile_comp, this);
  355|       |
  356|  18.7k|          tby0 = try0 >> 1;
  357|  18.7k|          tby1 = try1 >> 1;
  358|  18.7k|          re.org.y = tby0;
  359|  18.7k|          re.siz.h = tby1 - tby0;
  360|  18.7k|          bands[2].finalize_alloc(codestream, re, this, res_num, 2);
  361|  18.7k|        }
  362|  40.2k|        else if (ds == param_dfs::HORZ_DWT)
  ------------------
  |  Branch (362:18): [True: 7.26k, False: 32.9k]
  ------------------
  363|  7.26k|        {
  364|  7.26k|          ui32 tbx0, tbx1;
  365|  7.26k|          rect re = res_rect;
  366|  7.26k|          tbx0 = (trx0 + 1) >> 1;
  367|  7.26k|          tbx1 = (trx1 + 1) >> 1;
  368|  7.26k|          re.org.x = tbx0;
  369|  7.26k|          re.siz.w = tbx1 - tbx0;
  370|       |
  371|  7.26k|          point next_res_downsamp;
  372|  7.26k|          next_res_downsamp.x = res_downsamp.x * 2;
  373|  7.26k|          next_res_downsamp.y = res_downsamp.y;
  374|  7.26k|          child_res = allocator->post_alloc_obj<resolution>(1);
  375|  7.26k|          child_res->finalize_alloc(codestream, re,
  376|  7.26k|            skipped_res_for_recon ? recon_res_rect : re, comp_num,
  ------------------
  |  Branch (376:13): [True: 1.61k, False: 5.65k]
  ------------------
  377|  7.26k|            res_num - 1, comp_downsamp, next_res_downsamp,
  378|  7.26k|            parent_tile_comp, this);
  379|       |
  380|  7.26k|          tbx0 = trx0 >> 1;
  381|  7.26k|          tbx1 = trx1 >> 1;
  382|  7.26k|          re.org.x = tbx0;
  383|  7.26k|          re.siz.w = tbx1 - tbx0;
  384|  7.26k|          bands[1].finalize_alloc(codestream, re, this, res_num, 1);
  385|  7.26k|        }
  386|  32.9k|        else
  387|  32.9k|        {
  388|  32.9k|          assert(ds == param_dfs::NO_DWT);
  389|  32.9k|          child_res = allocator->post_alloc_obj<resolution>(1);
  390|  32.9k|          child_res->finalize_alloc(codestream, res_rect,
  391|  32.9k|            skipped_res_for_recon ? recon_res_rect : res_rect, comp_num,
  ------------------
  |  Branch (391:13): [True: 11.9k, False: 21.0k]
  ------------------
  392|  32.9k|            res_num - 1, comp_downsamp, res_downsamp, parent_tile_comp, this);
  393|  32.9k|        }
  394|  2.45M|      }
  395|   501k|      else {
  396|   501k|        child_res = NULL;
  397|   501k|        bands[0].finalize_alloc(codestream, res_rect, this, res_num, 0);
  398|   501k|      }
  399|       |
  400|       |      //finalize precincts
  401|  2.95M|      log_PP = cdp->get_log_precinct_size(res_num);
  402|  2.95M|      num_precincts = size();
  403|  2.95M|      precincts = NULL;
  404|  2.95M|      if (trx0 != trx1 && try0 != try1)
  ------------------
  |  Branch (404:11): [True: 1.26M, False: 1.69M]
  |  Branch (404:27): [True: 869k, False: 391k]
  ------------------
  405|   869k|      {
  406|   869k|        num_precincts.w = (trx1 + (1 << log_PP.w) - 1) >> log_PP.w;
  407|   869k|        num_precincts.w -= trx0 >> log_PP.w;
  408|   869k|        num_precincts.h = (try1 + (1 << log_PP.h) - 1) >> log_PP.h;
  409|   869k|        num_precincts.h -= try0 >> log_PP.h;
  410|   869k|        precincts =
  411|   869k|          allocator->post_alloc_obj<precinct>((size_t)num_precincts.area());
  412|   869k|        ui64 num = num_precincts.area();
  413|  9.12M|        for (ui64 i = 0; i < num; ++i)
  ------------------
  |  Branch (413:26): [True: 8.25M, False: 869k]
  ------------------
  414|  8.25M|          precincts[i] = precinct();
  415|   869k|      }
  416|       |      // precincts will be initialized in full shortly
  417|       |
  418|  2.95M|      ui32 x_lower_bound = (trx0 >> log_PP.w) << log_PP.w;
  419|  2.95M|      ui32 y_lower_bound = (try0 >> log_PP.h) << log_PP.h;
  420|       |
  421|  2.95M|      precinct* pp = precincts;
  422|  2.95M|      point tile_top_left = parent_tile_comp->get_tile()->get_tile_rect().org;
  423|  4.66M|      for (ui32 y = 0; y < num_precincts.h; ++y)
  ------------------
  |  Branch (423:24): [True: 1.70M, False: 2.95M]
  ------------------
  424|  1.70M|      {
  425|  1.70M|        ui32 ppy0 = y_lower_bound + (y << log_PP.h);
  426|  9.96M|        for (ui32 x = 0; x < num_precincts.w; ++x, ++pp)
  ------------------
  |  Branch (426:26): [True: 8.25M, False: 1.70M]
  ------------------
  427|  8.25M|        {
  428|  8.25M|          ui32 ppx0 = x_lower_bound + (x << log_PP.w);
  429|  8.25M|          point t(res_downsamp.x * ppx0, res_downsamp.y * ppy0);
  430|  8.25M|          t.x = t.x > tile_top_left.x ? t.x : tile_top_left.x;
  ------------------
  |  Branch (430:17): [True: 6.58M, False: 1.67M]
  ------------------
  431|  8.25M|          t.y = t.y > tile_top_left.y ? t.y : tile_top_left.y;
  ------------------
  |  Branch (431:17): [True: 4.44M, False: 3.81M]
  ------------------
  432|  8.25M|          pp->img_point = t;
  433|  8.25M|          pp->bands = bands;
  434|  8.25M|          pp->may_use_sop = cdp->packets_may_use_sop();
  435|  8.25M|          pp->uses_eph = cdp->packets_use_eph();
  436|  8.25M|          pp->scratch = codestream->get_precinct_scratch();
  437|  8.25M|          pp->coded = NULL;
  438|  8.25M|        }
  439|  1.70M|      }
  440|  14.7M|      for (int i = 0; i < 4; ++i)
  ------------------
  |  Branch (440:23): [True: 11.8M, False: 2.95M]
  ------------------
  441|  11.8M|        if (bands[i].exists())
  ------------------
  |  Branch (441:13): [True: 637k, False: 11.1M]
  ------------------
  442|   637k|          bands[i].get_cb_indices(num_precincts, precincts);
  443|       |
  444|       |      // determine how to divide scratch into multiple levels of
  445|       |      // tag trees
  446|  2.95M|      size log_cb = cdp->get_log_block_dims();
  447|  2.95M|      log_PP.w -= (transform_flags & HORZ_TRX) ? 1 : 0;
  ------------------
  |  Branch (447:19): [True: 2.40M, False: 553k]
  ------------------
  448|  2.95M|      log_PP.h -= (transform_flags & VERT_TRX) ? 1 : 0;
  ------------------
  |  Branch (448:19): [True: 2.41M, False: 542k]
  ------------------
  449|  2.95M|      size ratio;
  450|  2.95M|      ratio.w = log_PP.w - ojph_min(log_cb.w, log_PP.w);
  ------------------
  |  |   76|  2.95M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 280k, False: 2.67M]
  |  |  ------------------
  ------------------
  451|  2.95M|      ratio.h = log_PP.h - ojph_min(log_cb.h, log_PP.h);
  ------------------
  |  |   76|  2.95M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 366k, False: 2.59M]
  |  |  ------------------
  ------------------
  452|  2.95M|      max_num_levels = ojph_max(ratio.w, ratio.h);
  ------------------
  |  |   73|  2.95M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 177k, False: 2.78M]
  |  |  ------------------
  ------------------
  453|  2.95M|      ui32 val = 1u << (max_num_levels << 1);
  454|  2.95M|      tag_tree_size = (int)((val * 4 + 2) / 3);
  455|  2.95M|      ++max_num_levels;
  456|  2.95M|      level_index[0] = 0;
  457|  7.90M|      for (ui32 i = 1; i <= max_num_levels; ++i, val >>= 2)
  ------------------
  |  Branch (457:24): [True: 4.94M, False: 2.95M]
  ------------------
  458|  4.94M|        level_index[i] = level_index[i - 1] + val;
  459|  2.95M|      cur_precinct_loc = point(0, 0);
  460|       |
  461|       |      //allocate lines
  462|  2.95M|      if (skipped_res_for_recon == false)
  ------------------
  |  Branch (462:11): [True: 2.10M, False: 854k]
  ------------------
  463|  2.10M|      {
  464|  2.10M|        this->atk = cdp->access_atk();
  465|  2.10M|        this->reversible = atk->is_reversible();
  466|  2.10M|        this->num_steps = atk->get_num_steps();
  467|       |        // create line buffers and lifting_bufs
  468|  2.10M|        lines = allocator->post_alloc_obj<line_buf>(num_steps + 2);
  469|  2.10M|        ssp = allocator->post_alloc_obj<lifting_buf>(num_steps + 2);
  470|  2.10M|        sig = ssp + num_steps;
  471|  2.10M|        aug = ssp + num_steps + 1;
  472|       |
  473|       |        // initiate lifting_bufs
  474|  7.80M|        for (ui32 i = 0; i < num_steps; ++i) {
  ------------------
  |  Branch (474:26): [True: 5.69M, False: 2.10M]
  ------------------
  475|  5.69M|          new (ssp + i) lifting_buf;
  476|  5.69M|          ssp[i].line = lines + i;
  477|  5.69M|        };
  478|  2.10M|        new (sig) lifting_buf;
  479|  2.10M|        sig->line = lines + num_steps;
  480|  2.10M|        new (aug) lifting_buf;
  481|  2.10M|        aug->line = lines + num_steps + 1;
  482|       |
  483|  2.10M|        const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
  484|  2.10M|        ui32 precision = qp->propose_precision(cdp);
  485|       |
  486|       |        // initiate storage of line_buf
  487|  2.10M|        ui32 width = res_rect.siz.w + 1;
  488|  2.10M|        if (this->reversible)
  ------------------
  |  Branch (488:13): [True: 1.33M, False: 772k]
  ------------------
  489|  1.33M|        {
  490|  1.33M|          if (precision <= 32)
  ------------------
  |  Branch (490:15): [True: 1.19M, False: 133k]
  ------------------
  491|  1.19M|          {
  492|  3.59M|            for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (492:30): [True: 2.39M, False: 1.19M]
  ------------------
  493|  2.39M|              ssp[i].line->wrap(
  494|  2.39M|                allocator->post_alloc_data<si32>(width, 1), width, 1);
  495|  1.19M|            sig->line->wrap(
  496|  1.19M|              allocator->post_alloc_data<si32>(width, 1), width, 1);
  497|  1.19M|            aug->line->wrap(
  498|  1.19M|              allocator->post_alloc_data<si32>(width, 1), width, 1);
  499|  1.19M|          }
  500|   133k|          else
  501|   133k|          {
  502|   397k|            for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (502:30): [True: 264k, False: 133k]
  ------------------
  503|   264k|              ssp[i].line->wrap(
  504|   264k|                allocator->post_alloc_data<si64>(width, 1), width, 1);
  505|   133k|            sig->line->wrap(
  506|   133k|              allocator->post_alloc_data<si64>(width, 1), width, 1);
  507|   133k|            aug->line->wrap(
  508|   133k|              allocator->post_alloc_data<si64>(width, 1), width, 1);
  509|   133k|          }
  510|  1.33M|        }
  511|   772k|        else
  512|   772k|        {
  513|  3.81M|            for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (513:30): [True: 3.04M, False: 772k]
  ------------------
  514|  3.04M|              ssp[i].line->wrap(
  515|  3.04M|                allocator->post_alloc_data<float>(width, 1), width, 1);
  516|   772k|            sig->line->wrap(
  517|   772k|              allocator->post_alloc_data<float>(width, 1), width, 1);
  518|   772k|            aug->line->wrap(
  519|   772k|              allocator->post_alloc_data<float>(width, 1), width, 1);
  520|   772k|        }
  521|       |
  522|  2.10M|        cur_line = 0;
  523|  2.10M|        rows_to_produce = res_rect.siz.h;
  524|  2.10M|        vert_even = (res_rect.org.y & 1) == 0;
  525|  2.10M|        horz_even = (res_rect.org.x & 1) == 0;
  526|  2.10M|      }
  527|  2.95M|    }
_ZN4ojph5local10resolution9pull_lineEv:
  714|  5.93M|    {
  715|  5.93M|      if (res_num == 0)
  ------------------
  |  Branch (715:11): [True: 430k, False: 5.50M]
  ------------------
  716|   430k|      {
  717|   430k|        assert(child_res == NULL);
  718|   430k|        return bands[0].pull_line();
  719|   430k|      }
  720|       |
  721|  5.50M|      if (skipped_res_for_recon == true)
  ------------------
  |  Branch (721:11): [True: 673k, False: 4.82M]
  ------------------
  722|   673k|        return child_res->pull_line();
  723|       |
  724|  4.82M|      ui32 width = res_rect.siz.w;
  725|  4.82M|      if (width == 0)
  ------------------
  |  Branch (725:11): [True: 81.0k, False: 4.74M]
  ------------------
  726|  81.0k|        return NULL;
  727|       |
  728|  4.74M|      if (transform_flags & VERT_TRX)
  ------------------
  |  Branch (728:11): [True: 4.40M, False: 346k]
  ------------------
  729|  4.40M|      {
  730|  4.40M|        if (reversible)
  ------------------
  |  Branch (730:13): [True: 3.28M, False: 1.12M]
  ------------------
  731|  3.28M|        {
  732|  3.28M|          if (res_rect.siz.h > 1)
  ------------------
  |  Branch (732:15): [True: 3.05M, False: 230k]
  ------------------
  733|  3.05M|          {
  734|  3.05M|            if (sig->active) {
  ------------------
  |  Branch (734:17): [True: 1.48M, False: 1.56M]
  ------------------
  735|  1.48M|              sig->active = false;
  736|  1.48M|              return sig->line;
  737|  1.56M|            };
  738|  1.56M|            for (;;)
  739|  3.17M|            {
  740|       |              //horizontal transform
  741|  3.17M|              if (cur_line < res_rect.siz.h)
  ------------------
  |  Branch (741:19): [True: 3.05M, False: 121k]
  ------------------
  742|  3.05M|              {
  743|  3.05M|                if (vert_even) { // even
  ------------------
  |  Branch (743:21): [True: 1.52M, False: 1.52M]
  ------------------
  744|  1.52M|                  if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (744:23): [True: 1.51M, False: 13.1k]
  ------------------
  745|  1.51M|                    rev_horz_syn(atk, aug->line, child_res->pull_line(),
  746|  1.51M|                      bands[1].pull_line(), width, horz_even);
  747|  13.1k|                  else
  748|  13.1k|                    memcpy(aug->line->p, child_res->pull_line()->p,
  749|  13.1k|                      (size_t)width
  750|  13.1k|                      * (aug->line->flags & line_buf::LFT_SIZE_MASK));
  751|  1.52M|                  aug->active = true;
  752|  1.52M|                  vert_even = !vert_even;
  753|  1.52M|                  ++cur_line;
  754|  1.52M|                  continue;
  755|  1.52M|                }
  756|  1.52M|                else {
  757|  1.52M|                  if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (757:23): [True: 1.50M, False: 13.1k]
  ------------------
  758|  1.50M|                    rev_horz_syn(atk, sig->line, bands[2].pull_line(),
  759|  1.50M|                      bands[3].pull_line(), width, horz_even);
  760|  13.1k|                  else
  761|  13.1k|                    memcpy(sig->line->p, bands[2].pull_line()->p,
  762|  13.1k|                      (size_t)width
  763|  13.1k|                      * (sig->line->flags & line_buf::LFT_SIZE_MASK));
  764|  1.52M|                  sig->active = true;
  765|  1.52M|                  vert_even = !vert_even;
  766|  1.52M|                  ++cur_line;
  767|  1.52M|                }
  768|  3.05M|              }
  769|       |
  770|       |              //vertical transform
  771|  4.68M|              for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (771:32): [True: 3.03M, False: 1.64M]
  ------------------
  772|  3.03M|              {
  773|  3.03M|                if (aug->active && (sig->active || ssp[i].active))
  ------------------
  |  Branch (773:21): [True: 2.79M, False: 237k]
  |  Branch (773:37): [True: 2.71M, False: 80.1k]
  |  Branch (773:52): [True: 80.1k, False: 0]
  ------------------
  774|  2.79M|                {
  775|  2.79M|                  line_buf* dp = aug->line;
  776|  2.79M|                  line_buf* sp1 = sig->active ? sig->line : ssp[i].line;
  ------------------
  |  Branch (776:35): [True: 2.71M, False: 80.1k]
  ------------------
  777|  2.79M|                  line_buf* sp2 = ssp[i].active ? ssp[i].line : sig->line;
  ------------------
  |  Branch (777:35): [True: 2.71M, False: 80.2k]
  ------------------
  778|  2.79M|                  const lifting_step* s = atk->get_step(i);
  779|  2.79M|                  rev_vert_step(s, sp1, sp2, dp, width, true);
  780|  2.79M|                }
  781|  3.03M|                lifting_buf t = *aug; *aug = ssp[i]; ssp[i] = *sig; *sig = t;
  782|  3.03M|              }
  783|       |
  784|  1.64M|              if (aug->active) {
  ------------------
  |  Branch (784:19): [True: 1.52M, False: 116k]
  ------------------
  785|  1.52M|                aug->active = false;
  786|  1.52M|                return aug->line;
  787|  1.52M|              }
  788|   116k|              if (sig->active) {
  ------------------
  |  Branch (788:19): [True: 35.9k, False: 80.2k]
  ------------------
  789|  35.9k|                sig->active = false;
  790|  35.9k|                return sig->line;
  791|  80.2k|              };
  792|  80.2k|            }
  793|  1.56M|          }
  794|   230k|          else
  795|   230k|          {
  796|   230k|            if (vert_even) {
  ------------------
  |  Branch (796:17): [True: 169k, False: 61.0k]
  ------------------
  797|   169k|              if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (797:19): [True: 168k, False: 905]
  ------------------
  798|   168k|                rev_horz_syn(atk, aug->line, child_res->pull_line(),
  799|   168k|                  bands[1].pull_line(), width, horz_even);
  800|    905|              else
  801|    905|                memcpy(aug->line->p, child_res->pull_line()->p,
  802|    905|                  (size_t)width
  803|    905|                  * (aug->line->flags & line_buf::LFT_SIZE_MASK));
  804|   169k|            }
  805|  61.0k|            else
  806|  61.0k|            {
  807|  61.0k|              if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (807:19): [True: 60.1k, False: 908]
  ------------------
  808|  60.1k|                rev_horz_syn(atk, aug->line, bands[2].pull_line(),
  809|  60.1k|                  bands[3].pull_line(), width, horz_even);
  810|    908|              else
  811|    908|                memcpy(aug->line->p, bands[2].pull_line()->p,
  812|    908|                  (size_t)width
  813|    908|                  * (aug->line->flags & line_buf::LFT_SIZE_MASK));
  814|  61.0k|              if (aug->line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (814:19): [True: 51.8k, False: 9.15k]
  ------------------
  815|  51.8k|              {
  816|  51.8k|                si32* sp = aug->line->i32;
  817|   731k|                for (ui32 i = width; i > 0; --i)
  ------------------
  |  Branch (817:38): [True: 680k, False: 51.8k]
  ------------------
  818|   680k|                  *sp++ >>= 1;
  819|  51.8k|              }
  820|  9.15k|              else
  821|  9.15k|              {
  822|  9.15k|                assert(aug->line->flags & line_buf::LFT_64BIT);
  823|  9.15k|                si64* sp = aug->line->i64;
  824|   596k|                for (ui32 i = width; i > 0; --i)
  ------------------
  |  Branch (824:38): [True: 587k, False: 9.15k]
  ------------------
  825|   587k|                  *sp++ >>= 1;
  826|  9.15k|              }
  827|  61.0k|            }
  828|   230k|            return aug->line;
  829|   230k|          }
  830|  3.28M|        }
  831|  1.12M|        else
  832|  1.12M|        {
  833|  1.12M|          if (res_rect.siz.h > 1)
  ------------------
  |  Branch (833:15): [True: 1.07M, False: 40.7k]
  ------------------
  834|  1.07M|          {
  835|  1.07M|            if (sig->active) {
  ------------------
  |  Branch (835:17): [True: 534k, False: 544k]
  ------------------
  836|   534k|              sig->active = false;
  837|   534k|              return sig->line;
  838|   544k|            };
  839|   544k|            for (;;)
  840|  1.10M|            {
  841|       |              //horizontal transform
  842|  1.10M|              if (cur_line < res_rect.siz.h)
  ------------------
  |  Branch (842:19): [True: 1.07M, False: 24.3k]
  ------------------
  843|  1.07M|              {
  844|  1.07M|                if (vert_even) { // even
  ------------------
  |  Branch (844:21): [True: 540k, False: 539k]
  ------------------
  845|   540k|                  if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (845:23): [True: 380k, False: 159k]
  ------------------
  846|   380k|                    irv_horz_syn(atk, aug->line, child_res->pull_line(),
  847|   380k|                      bands[1].pull_line(), width, horz_even);
  848|   159k|                  else
  849|   159k|                    memcpy(aug->line->f32, child_res->pull_line()->f32,
  850|   159k|                      width * sizeof(float));
  851|   540k|                  aug->active = true;
  852|   540k|                  vert_even = !vert_even;
  853|   540k|                  ++cur_line;
  854|       |
  855|   540k|                  const float K = atk->get_K();
  856|   540k|                  irv_vert_times_K(K, aug->line, width);
  857|       |
  858|   540k|                  continue;
  859|   540k|                }
  860|   539k|                else {
  861|   539k|                  if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (861:23): [True: 380k, False: 159k]
  ------------------
  862|   380k|                    irv_horz_syn(atk, sig->line, bands[2].pull_line(),
  863|   380k|                      bands[3].pull_line(), width, horz_even);
  864|   159k|                  else
  865|   159k|                    memcpy(sig->line->f32, bands[2].pull_line()->f32,
  866|   159k|                      width * sizeof(float));
  867|   539k|                  sig->active = true;
  868|   539k|                  vert_even = !vert_even;
  869|   539k|                  ++cur_line;
  870|       |
  871|   539k|                  const float K_inv = 1.0f / atk->get_K();
  872|   539k|                  irv_vert_times_K(K_inv, sig->line, width);
  873|   539k|                }
  874|  1.07M|              }
  875|       |
  876|       |              //vertical transform
  877|  2.80M|              for (ui32 i = 0; i < num_steps; ++i)
  ------------------
  |  Branch (877:32): [True: 2.24M, False: 564k]
  ------------------
  878|  2.24M|              {
  879|  2.24M|                if (aug->active && (sig->active || ssp[i].active))
  ------------------
  |  Branch (879:21): [True: 2.14M, False: 97.0k]
  |  Branch (879:37): [True: 2.12M, False: 19.3k]
  |  Branch (879:52): [True: 19.3k, False: 0]
  ------------------
  880|  2.14M|                {
  881|  2.14M|                  line_buf* dp = aug->line;
  882|  2.14M|                  line_buf* sp1 = sig->active ? sig->line : ssp[i].line;
  ------------------
  |  Branch (882:35): [True: 2.12M, False: 19.3k]
  ------------------
  883|  2.14M|                  line_buf* sp2 = ssp[i].active ? ssp[i].line : sig->line;
  ------------------
  |  Branch (883:35): [True: 2.12M, False: 19.4k]
  ------------------
  884|  2.14M|                  const lifting_step* s = atk->get_step(i);
  885|  2.14M|                  irv_vert_step(s, sp1, sp2, dp, width, true);
  886|  2.14M|                }
  887|  2.24M|                lifting_buf t = *aug; *aug = ssp[i]; ssp[i] = *sig; *sig = t;
  888|  2.24M|              }
  889|       |
  890|   564k|              if (aug->active) {
  ------------------
  |  Branch (890:19): [True: 540k, False: 24.1k]
  ------------------
  891|   540k|                aug->active = false;
  892|   540k|                return aug->line;
  893|   540k|              }
  894|  24.1k|              if (sig->active) {
  ------------------
  |  Branch (894:19): [True: 4.78k, False: 19.4k]
  ------------------
  895|  4.78k|                sig->active = false;
  896|  4.78k|                return sig->line;
  897|  19.4k|              };
  898|  19.4k|            }
  899|   544k|          }
  900|  40.7k|          else
  901|  40.7k|          {
  902|  40.7k|            if (vert_even) {
  ------------------
  |  Branch (902:17): [True: 35.2k, False: 5.45k]
  ------------------
  903|  35.2k|              if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (903:19): [True: 34.6k, False: 608]
  ------------------
  904|  34.6k|                irv_horz_syn(atk, aug->line, child_res->pull_line(),
  905|  34.6k|                  bands[1].pull_line(), width, horz_even);
  906|    608|              else
  907|    608|                memcpy(aug->line->f32, child_res->pull_line()->f32,
  908|    608|                  width * sizeof(float));
  909|  35.2k|            }
  910|  5.45k|            else
  911|  5.45k|            {
  912|  5.45k|              if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (912:19): [True: 4.85k, False: 602]
  ------------------
  913|  4.85k|                irv_horz_syn(atk, aug->line, bands[2].pull_line(),
  914|  4.85k|                  bands[3].pull_line(), width, horz_even);
  915|    602|             else
  916|    602|                memcpy(aug->line->f32, bands[2].pull_line()->f32,
  917|    602|                  width * sizeof(float));
  918|  5.45k|              float* sp = aug->line->f32;
  919|   501k|              for (ui32 i = width; i > 0; --i)
  ------------------
  |  Branch (919:36): [True: 495k, False: 5.45k]
  ------------------
  920|   495k|                *sp++ *= 0.5f;
  921|  5.45k|            }
  922|  40.7k|            return aug->line;
  923|  40.7k|          }
  924|  1.12M|        }
  925|  4.40M|      }
  926|   346k|      else
  927|   346k|      {
  928|   346k|        if (reversible)
  ------------------
  |  Branch (928:13): [True: 177k, False: 169k]
  ------------------
  929|   177k|        {
  930|   177k|          if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (930:15): [True: 22.5k, False: 155k]
  ------------------
  931|  22.5k|            rev_horz_syn(atk, aug->line, child_res->pull_line(),
  932|  22.5k|              bands[1].pull_line(), width, horz_even);
  933|   155k|          else
  934|   155k|            memcpy(aug->line->p, child_res->pull_line()->p,
  935|   155k|              (size_t)width * (aug->line->flags & line_buf::LFT_SIZE_MASK));
  936|   177k|          return aug->line;
  937|   177k|        }
  938|   169k|        else
  939|   169k|        {
  940|   169k|          if (transform_flags & HORZ_TRX)
  ------------------
  |  Branch (940:15): [True: 1.50k, False: 167k]
  ------------------
  941|  1.50k|            irv_horz_syn(atk, aug->line, child_res->pull_line(),
  942|  1.50k|              bands[1].pull_line(), width, horz_even);
  943|   167k|          else
  944|   167k|            memcpy(aug->line->f32, child_res->pull_line()->f32,
  945|   167k|              width * sizeof(float));
  946|   169k|          return aug->line;
  947|   169k|        }
  948|   346k|      }
  949|  4.74M|    }
_ZN4ojph5local10resolution21get_top_left_precinctERNS_5pointE:
  976|  2.82M|    {
  977|  2.82M|      ui32 idx = cur_precinct_loc.x + cur_precinct_loc.y * num_precincts.w;
  978|  2.82M|      if (idx < num_precincts.area())
  ------------------
  |  Branch (978:11): [True: 1.54M, False: 1.27M]
  ------------------
  979|  1.54M|      {
  980|  1.54M|        top_left = precincts[idx].img_point;
  981|  1.54M|        return true;
  982|  1.54M|      }
  983|  1.27M|      return false;
  984|  2.82M|    }
_ZN4ojph5local10resolution19parse_all_precinctsERjPNS_11infile_baseE:
 1002|  93.2k|    {
 1003|  93.2k|      precinct* p = precincts;
 1004|  93.2k|      ui32 idx = cur_precinct_loc.x + cur_precinct_loc.y * num_precincts.w;
 1005|   138k|      for (ui32 i = idx; i < num_precincts.area(); ++i)
  ------------------
  |  Branch (1005:26): [True: 46.0k, False: 92.5k]
  ------------------
 1006|  46.0k|      {
 1007|  46.0k|        if (data_left == 0)
  ------------------
  |  Branch (1007:13): [True: 707, False: 45.3k]
  ------------------
 1008|    707|          break;
 1009|  45.3k|        p[i].parse(tag_tree_size, level_index, elastic, data_left, file,
 1010|  45.3k|          skipped_res_for_read);
 1011|  45.3k|        if (++cur_precinct_loc.x >= num_precincts.w)
  ------------------
  |  Branch (1011:13): [True: 7.16k, False: 38.2k]
  ------------------
 1012|  7.16k|        {
 1013|  7.16k|          cur_precinct_loc.x = 0;
 1014|  7.16k|          ++cur_precinct_loc.y;
 1015|  7.16k|        }
 1016|  45.3k|      }
 1017|  93.2k|    }
_ZN4ojph5local10resolution18parse_one_precinctERjPNS_11infile_baseE:
 1021|   350k|    {
 1022|   350k|      ui32 idx = cur_precinct_loc.x + cur_precinct_loc.y * num_precincts.w;
 1023|   350k|      assert(idx < num_precincts.area());
 1024|       |
 1025|   350k|      if (data_left == 0)
  ------------------
  |  Branch (1025:11): [True: 0, False: 350k]
  ------------------
 1026|      0|        return;
 1027|   350k|      precinct* p = precincts + idx;
 1028|   350k|      p->parse(tag_tree_size, level_index, elastic, data_left, file,
 1029|   350k|        skipped_res_for_read);
 1030|   350k|      if (++cur_precinct_loc.x >= num_precincts.w)
  ------------------
  |  Branch (1030:11): [True: 40.5k, False: 310k]
  ------------------
 1031|  40.5k|      {
 1032|  40.5k|        cur_precinct_loc.x = 0;
 1033|  40.5k|        ++cur_precinct_loc.y;
 1034|  40.5k|      }
 1035|   350k|    }

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

_ZN4ojph5local7subband9pre_allocEPNS0_10codestreamERKNS_4rectEjjj:
   59|  8.27M|    {
   60|  8.27M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   61|       |
   62|  8.27M|      bool empty = ((band_rect.siz.w == 0) || (band_rect.siz.h == 0));
  ------------------
  |  Branch (62:21): [True: 6.28M, False: 1.99M]
  |  Branch (62:47): [True: 1.28M, False: 706k]
  ------------------
   63|  8.27M|      if (empty)
  ------------------
  |  Branch (63:11): [True: 7.57M, False: 706k]
  ------------------
   64|  7.57M|        return;
   65|       |
   66|   706k|      const param_cod* cdp = codestream->get_coc(comp_num);
   67|   706k|      size log_cb = cdp->get_log_block_dims();
   68|   706k|      size log_PP = cdp->get_log_precinct_size(res_num);
   69|       |
   70|   706k|      ui32 x_off = ((transform_flags & resolution::HORZ_TRX) ? 1 : 0);
  ------------------
  |  Branch (70:21): [True: 677k, False: 29.3k]
  ------------------
   71|   706k|      ui32 y_off = ((transform_flags & resolution::VERT_TRX) ? 1 : 0);
  ------------------
  |  Branch (71:21): [True: 678k, False: 27.9k]
  ------------------
   72|       |
   73|   706k|      ui32 xcb_prime = ojph_min(log_cb.w, log_PP.w - x_off);
  ------------------
  |  |   76|   706k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 59.6k, False: 646k]
  |  |  ------------------
  ------------------
   74|   706k|      ui32 ycb_prime = ojph_min(log_cb.h, log_PP.h - y_off);
  ------------------
  |  |   76|   706k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 65.4k, False: 641k]
  |  |  ------------------
  ------------------
   75|       |
   76|   706k|      size nominal(1 << xcb_prime, 1 << ycb_prime);
   77|       |
   78|   706k|      ui32 tbx0 = band_rect.org.x;
   79|   706k|      ui32 tby0 = band_rect.org.y;
   80|   706k|      ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
   81|   706k|      ui32 tby1 = band_rect.org.y + band_rect.siz.h;
   82|       |
   83|   706k|      size num_blocks;
   84|   706k|      num_blocks.w = (tbx1 + (1 << xcb_prime) - 1) >> xcb_prime;
   85|   706k|      num_blocks.w -= tbx0 >> xcb_prime;
   86|   706k|      num_blocks.h = (tby1 + (1 << ycb_prime) - 1) >> ycb_prime;
   87|   706k|      num_blocks.h -= tby0 >> ycb_prime;
   88|       |
   89|   706k|      allocator->pre_alloc_obj<codeblock>(num_blocks.w);
   90|       |      //allocate codeblock headers
   91|   706k|      allocator->pre_alloc_obj<coded_cb_header>((size_t)num_blocks.area());
   92|       |
   93|   706k|      const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
   94|   706k|      ui32 precision = qp->propose_precision(cdp);
   95|   706k|      const param_atk* atk = cdp->access_atk();
   96|   706k|      bool reversible = atk->is_reversible();
   97|       |
   98|  6.65M|      for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (98:24): [True: 5.95M, False: 706k]
  ------------------
   99|  5.95M|        codeblock::pre_alloc(codestream, nominal, precision);
  100|       |
  101|       |      //allocate lines
  102|   706k|      allocator->pre_alloc_obj<line_buf>(1);
  103|       |      //allocate line_buf
  104|   706k|      ui32 width = band_rect.siz.w + 1;
  105|   706k|      if (reversible)
  ------------------
  |  Branch (105:11): [True: 589k, False: 117k]
  ------------------
  106|   589k|      {
  107|   589k|        if (precision <= 32)
  ------------------
  |  Branch (107:13): [True: 513k, False: 75.7k]
  ------------------
  108|   513k|          allocator->pre_alloc_data<si32>(width, 1);
  109|  75.7k|        else
  110|  75.7k|          allocator->pre_alloc_data<si64>(width, 1);
  111|   589k|      }
  112|   117k|      else
  113|   117k|        allocator->pre_alloc_data<float>(width, 1);
  114|   706k|    }
_ZN4ojph5local7subband14finalize_allocEPNS0_10codestreamERKNS_4rectEPNS0_10resolutionEjj:
  121|  7.72M|    {
  122|  7.72M|      mem_fixed_allocator* allocator = codestream->get_allocator();
  123|  7.72M|      elastic = codestream->get_elastic_alloc();
  124|       |
  125|  7.72M|      this->res_num = res_num;
  126|  7.72M|      this->band_num = subband_num;
  127|  7.72M|      this->band_rect = band_rect;
  128|  7.72M|      this->parent = res;
  129|       |
  130|  7.72M|      ui32 comp_num = parent->get_comp_num();
  131|  7.72M|      const param_cod* cdp = codestream->get_coc(comp_num);
  132|  7.72M|      this->reversible = cdp->access_atk()->is_reversible();
  133|  7.72M|      size log_cb = cdp->get_log_block_dims();
  134|  7.72M|      log_PP = cdp->get_log_precinct_size(res_num);
  135|       |
  136|  7.72M|      ui32 x_off = ((parent->has_horz_transform()) ? 1 : 0);
  ------------------
  |  Branch (136:21): [True: 7.20M, False: 520k]
  ------------------
  137|  7.72M|      ui32 y_off = ((parent->has_vert_transform()) ? 1 : 0);
  ------------------
  |  Branch (137:21): [True: 7.21M, False: 508k]
  ------------------
  138|       |
  139|  7.72M|      xcb_prime = ojph_min(log_cb.w, log_PP.w - x_off);
  ------------------
  |  |   76|  7.72M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 636k, False: 7.08M]
  |  |  ------------------
  ------------------
  140|  7.72M|      ycb_prime = ojph_min(log_cb.h, log_PP.h - y_off);
  ------------------
  |  |   76|  7.72M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 819k, False: 6.90M]
  |  |  ------------------
  ------------------
  141|       |
  142|  7.72M|      size nominal(1 << xcb_prime, 1 << ycb_prime);
  143|       |
  144|  7.72M|      cur_cb_row = 0;
  145|  7.72M|      cur_line = 0;
  146|  7.72M|      cur_cb_height = 0;
  147|  7.72M|      const param_dfs* dfs = NULL;
  148|  7.72M|      if (cdp->is_dfs_defined()) {
  ------------------
  |  Branch (148:11): [True: 70.0k, False: 7.65M]
  ------------------
  149|  70.0k|        dfs = codestream->access_dfs();
  150|  70.0k|        if (dfs != NULL)
  ------------------
  |  Branch (150:13): [True: 70.0k, False: 0]
  ------------------
  151|  70.0k|          dfs = dfs->get_dfs(cdp->get_dfs_index());
  152|  70.0k|      }
  153|  7.72M|      const param_qcd* qcd = codestream->access_qcd()->get_qcc(comp_num);
  154|  7.72M|      ui32 num_decomps = cdp->get_num_decompositions();
  155|  7.72M|      this->K_max = qcd->get_Kmax(dfs, num_decomps, this->res_num, band_num);
  156|  7.72M|      if (!reversible)
  ------------------
  |  Branch (156:11): [True: 2.89M, False: 4.82M]
  ------------------
  157|  2.89M|      {
  158|  2.89M|        float d =
  159|  2.89M|          qcd->get_irrev_delta(dfs, num_decomps,
  160|  2.89M|            comp_num, res_num, subband_num);
  161|  2.89M|        d /= (float)(1u << (31 - this->K_max));
  162|  2.89M|        delta = d;
  163|  2.89M|        delta_inv = (1.0f/d);
  164|  2.89M|      }
  165|  7.72M|      ui32 precision = qcd->propose_precision(cdp);
  166|       |
  167|  7.72M|      this->empty = ((band_rect.siz.w == 0) || (band_rect.siz.h == 0));
  ------------------
  |  Branch (167:22): [True: 5.85M, False: 1.87M]
  |  Branch (167:48): [True: 1.23M, False: 637k]
  ------------------
  168|  7.72M|      if (this->empty)
  ------------------
  |  Branch (168:11): [True: 7.08M, False: 637k]
  ------------------
  169|  7.08M|        return;
  170|       |
  171|   637k|      ui32 tbx0 = band_rect.org.x;
  172|   637k|      ui32 tby0 = band_rect.org.y;
  173|   637k|      ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
  174|   637k|      ui32 tby1 = band_rect.org.y + band_rect.siz.h;
  175|       |
  176|   637k|      num_blocks = size();
  177|   637k|      num_blocks.w = (tbx1 + (1 << xcb_prime) - 1) >> xcb_prime;
  178|   637k|      num_blocks.w -= tbx0 >> xcb_prime;
  179|   637k|      num_blocks.h = (tby1 + (1 << ycb_prime) - 1) >> ycb_prime;
  180|   637k|      num_blocks.h -= tby0 >> ycb_prime;
  181|       |
  182|   637k|      blocks = allocator->post_alloc_obj<codeblock>(num_blocks.w);
  183|       |      //allocate codeblock headers
  184|   637k|      coded_cb_header *cp = coded_cbs =
  185|   637k|        allocator->post_alloc_obj<coded_cb_header>((size_t)num_blocks.area());
  186|   637k|      memset(coded_cbs, 0, sizeof(coded_cb_header) * (size_t)num_blocks.area());
  187|  17.7M|      for (int i = (int)num_blocks.area(); i > 0; --i, ++cp)
  ------------------
  |  Branch (187:44): [True: 17.0M, False: 637k]
  ------------------
  188|  17.0M|        cp->Kmax = K_max;
  189|       |
  190|   637k|      ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
  191|   637k|      ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
  192|       |
  193|   637k|      size cb_size;
  194|   637k|      cb_size.h = ojph_min(tby1, y_lower_bound + nominal.h) - tby0;
  ------------------
  |  |   76|   637k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 491k, False: 145k]
  |  |  ------------------
  ------------------
  195|   637k|      cur_cb_height = (si32)cb_size.h;
  196|   637k|      int line_offset = 0;
  197|  6.09M|      for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (197:24): [True: 5.45M, False: 637k]
  ------------------
  198|  5.45M|      {
  199|  5.45M|        ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
  ------------------
  |  |   73|  5.45M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 161k, False: 5.29M]
  |  |  ------------------
  ------------------
  200|  5.45M|        ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
  ------------------
  |  |   76|  5.45M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 291k, False: 5.16M]
  |  |  ------------------
  ------------------
  201|  5.45M|        cb_size.w = cbx1 - cbx0;
  202|  5.45M|        blocks[i].finalize_alloc(codestream, this, nominal, cb_size,
  203|  5.45M|                                 coded_cbs + i, K_max, line_offset,
  204|  5.45M|                                 precision, comp_num);
  205|  5.45M|        line_offset += cb_size.w;
  206|  5.45M|      }
  207|       |
  208|       |      //allocate lines
  209|   637k|      lines = allocator->post_alloc_obj<line_buf>(1);
  210|       |      //allocate line_buf
  211|   637k|      ui32 width = band_rect.siz.w + 1;
  212|   637k|      if (reversible)
  ------------------
  |  Branch (212:11): [True: 522k, False: 115k]
  ------------------
  213|   522k|      {
  214|   522k|        if (precision <= 32)
  ------------------
  |  Branch (214:13): [True: 446k, False: 75.3k]
  ------------------
  215|   446k|          lines->wrap(allocator->post_alloc_data<si32>(width, 1), width, 1);
  216|  75.3k|        else
  217|  75.3k|          lines->wrap(allocator->post_alloc_data<si64>(width, 1), width, 1);
  218|   522k|      }
  219|   115k|      else
  220|   115k|        lines->wrap(allocator->post_alloc_data<float>(width, 1), width, 1);
  221|   637k|    }
_ZN4ojph5local7subband14get_cb_indicesERKNS_4sizeEPNS0_8precinctE:
  226|   637k|    {
  227|   637k|      if (empty)
  ------------------
  |  Branch (227:11): [True: 0, False: 637k]
  ------------------
  228|      0|        return;
  229|       |
  230|   637k|      rect res_rect = parent->get_rect();
  231|   637k|      ui32 trx0 = res_rect.org.x;
  232|   637k|      ui32 try0 = res_rect.org.y;
  233|   637k|      ui32 trx1 = res_rect.org.x + res_rect.siz.w;
  234|   637k|      ui32 try1 = res_rect.org.y + res_rect.siz.h;
  235|       |
  236|   637k|      ui32 pc_lft = (res_rect.org.x >> log_PP.w) << log_PP.w;
  237|   637k|      ui32 pc_top = (res_rect.org.y >> log_PP.h) << log_PP.h;
  238|       |
  239|   637k|      ui32 pcx0, pcx1, pcy0, pcy1;
  240|   637k|      ui32 x_shift = parent->has_horz_transform() ? 1 : 0;
  ------------------
  |  Branch (240:22): [True: 609k, False: 27.7k]
  ------------------
  241|   637k|      ui32 y_shift = parent->has_vert_transform() ? 1 : 0;
  ------------------
  |  Branch (241:22): [True: 610k, False: 26.3k]
  ------------------
  242|   637k|      ui32 yb, xb, coly = 0, colx = 0;
  243|  2.47M|      for (ui32 y = 0; y < num_precincts.h; ++y)
  ------------------
  |  Branch (243:24): [True: 1.83M, False: 637k]
  ------------------
  244|  1.83M|      {
  245|  1.83M|        pcy0 = ojph_max(try0, pc_top + (y << log_PP.h));
  ------------------
  |  |   73|  1.83M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 265k, False: 1.57M]
  |  |  ------------------
  ------------------
  246|  1.83M|        pcy1 = ojph_min(try1, pc_top + ((y + 1) << log_PP.h));
  ------------------
  |  |   76|  1.83M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 584k, False: 1.25M]
  |  |  ------------------
  ------------------
  247|  1.83M|        pcy0 = (pcy0 - (band_num >> 1) + (1 << y_shift) - 1) >> y_shift;
  248|  1.83M|        pcy1 = (pcy1 - (band_num >> 1) + (1 << y_shift) - 1) >> y_shift;
  249|       |
  250|  1.83M|        precinct *p = precincts + y * num_precincts.w;
  251|  1.83M|        yb = ((pcy1 + (1<<ycb_prime) - 1) >> ycb_prime);
  252|  1.83M|        yb -= (pcy0 >> ycb_prime);
  253|  1.83M|        colx = 0;
  254|       |
  255|  18.4M|        for (ui32 x = 0; x < num_precincts.w; ++x, ++p)
  ------------------
  |  Branch (255:26): [True: 16.6M, False: 1.83M]
  ------------------
  256|  16.6M|        {
  257|  16.6M|          pcx0 = ojph_max(trx0, pc_lft + (x << log_PP.w));
  ------------------
  |  |   73|  16.6M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 622k, False: 15.9M]
  |  |  ------------------
  ------------------
  258|  16.6M|          pcx1 = ojph_min(trx1, pc_lft + ((x + 1) << log_PP.w));
  ------------------
  |  |   76|  16.6M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 1.40M, False: 15.2M]
  |  |  ------------------
  ------------------
  259|  16.6M|          pcx0 = (pcx0 - (band_num & 1) + (1 << x_shift) - 1) >> x_shift;
  260|  16.6M|          pcx1 = (pcx1 - (band_num & 1) + (1 << x_shift) - 1) >> x_shift;
  261|       |
  262|  16.6M|          rect *bp = p->cb_idxs + band_num;
  263|  16.6M|          xb = ((pcx1 + (1<<xcb_prime) - 1) >> xcb_prime);
  264|  16.6M|          xb -= (pcx0 >> xcb_prime);
  265|       |
  266|  16.6M|          bp->org.x = colx;
  267|  16.6M|          bp->org.y = coly;
  268|  16.6M|          bp->siz.w = xb;
  269|  16.6M|          bp->siz.h = yb;
  270|       |
  271|  16.6M|          colx += xb;
  272|  16.6M|        }
  273|  1.83M|        coly += yb;
  274|  1.83M|      }
  275|       |      assert(colx == num_blocks.w && coly == num_blocks.h);
  276|   637k|    }
_ZN4ojph5local7subband9pull_lineEv:
  337|  6.63M|    {
  338|  6.63M|      if (empty)
  ------------------
  |  Branch (338:11): [True: 2.53M, False: 4.09M]
  ------------------
  339|  2.53M|        return lines;
  340|       |
  341|       |      //pull from codeblocks
  342|  4.09M|      if (--cur_line <= 0)
  ------------------
  |  Branch (342:11): [True: 1.40M, False: 2.69M]
  ------------------
  343|  1.40M|      {
  344|  1.40M|        if (cur_cb_row < num_blocks.h)
  ------------------
  |  Branch (344:13): [True: 1.39M, False: 6.71k]
  ------------------
  345|  1.39M|        {
  346|  1.39M|          ui32 tbx0 = band_rect.org.x;
  347|  1.39M|          ui32 tby0 = band_rect.org.y;
  348|  1.39M|          ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
  349|  1.39M|          ui32 tby1 = band_rect.org.y + band_rect.siz.h;
  350|  1.39M|          size nominal(1 << xcb_prime, 1 << ycb_prime);
  351|       |
  352|  1.39M|          ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
  353|  1.39M|          ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
  354|  1.39M|          ui32 cby0 = ojph_max(tby0, y_lower_bound + cur_cb_row * nominal.h);
  ------------------
  |  |   73|  1.39M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 158k, False: 1.24M]
  |  |  ------------------
  ------------------
  355|  1.39M|          ui32 cby1 = ojph_min(tby1, y_lower_bound+(cur_cb_row+1)*nominal.h);
  ------------------
  |  |   76|  1.39M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 270k, False: 1.12M]
  |  |  ------------------
  ------------------
  356|       |
  357|  1.39M|          size cb_size;
  358|  1.39M|          cb_size.h = cby1 - cby0;
  359|  1.39M|          cur_line = cur_cb_height = (int)cb_size.h;
  360|  13.7M|          for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (360:28): [True: 12.3M, False: 1.39M]
  ------------------
  361|  12.3M|          {
  362|  12.3M|            ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
  ------------------
  |  |   73|  12.3M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 207k, False: 12.1M]
  |  |  ------------------
  ------------------
  363|  12.3M|            ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
  ------------------
  |  |   76|  12.3M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 901k, False: 11.4M]
  |  |  ------------------
  ------------------
  364|  12.3M|            cb_size.w = cbx1 - cbx0;
  365|  12.3M|            blocks[i].recreate(cb_size,
  366|  12.3M|                               coded_cbs + i + cur_cb_row * num_blocks.w);
  367|  12.3M|            blocks[i].decode();
  368|  12.3M|          }
  369|  1.39M|          ++cur_cb_row;
  370|  1.39M|        }
  371|  1.40M|      }
  372|       |
  373|  4.09M|      assert(cur_line >= 0);
  374|       |
  375|       |      //pull from codeblocks
  376|  42.7M|      for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (376:24): [True: 38.6M, False: 4.09M]
  ------------------
  377|  38.6M|        blocks[i].pull_line(lines + 0);
  378|       |
  379|  4.09M|      return lines;
  380|  6.63M|    }

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

_ZN4ojph5local4tile9pre_allocEPNS0_10codestreamERKNS_4rectES6_Rj:
   59|   509k|    {
   60|   509k|      mem_fixed_allocator* allocator = codestream->get_allocator();
   61|       |
   62|       |      //allocate tiles_comp
   63|   509k|      const param_siz *szp = codestream->get_siz();
   64|   509k|      ui32 num_comps = szp->get_num_components();
   65|   509k|      allocator->pre_alloc_obj<tile_comp>(num_comps);
   66|   509k|      allocator->pre_alloc_obj<rect>(num_comps); //for comp_rects
   67|   509k|      allocator->pre_alloc_obj<rect>(num_comps); //for recon_comp_rects
   68|   509k|      allocator->pre_alloc_obj<ui32>(num_comps); //for line_offsets
   69|   509k|      allocator->pre_alloc_obj<ui32>(num_comps); //for num_bits
   70|   509k|      allocator->pre_alloc_obj<bool>(num_comps); //for is_signed
   71|   509k|      allocator->pre_alloc_obj<bool>(num_comps); //for reversible
   72|   509k|      allocator->pre_alloc_obj<ui8>(num_comps);  //for nlt_type3
   73|   509k|      allocator->pre_alloc_obj<ui32>(num_comps); //for cur_line
   74|       |
   75|   509k|      {
   76|   509k|        ui32 tilepart_div = codestream->get_tilepart_div();
   77|   509k|        ui32 t = tilepart_div & OJPH_TILEPART_MASK;
   78|   509k|        if (t == OJPH_TILEPART_NO_DIVISIONS)
  ------------------
  |  Branch (78:13): [True: 509k, False: 0]
  ------------------
   79|   509k|          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|   509k|        if (num_tileparts > 255)
  ------------------
  |  Branch (99:13): [True: 0, False: 509k]
  ------------------
  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|   509k|            "cannot have more than 255 tile parts.", num_tileparts);
  102|   509k|      }
  103|       |
  104|   509k|      ui32 tx0 = tile_rect.org.x;
  105|   509k|      ui32 ty0 = tile_rect.org.y;
  106|   509k|      ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
  107|   509k|      ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
  108|   509k|      ui32 recon_tx0 = recon_tile_rect.org.x;
  109|   509k|      ui32 recon_ty0 = recon_tile_rect.org.y;
  110|   509k|      ui32 recon_tx1 = recon_tile_rect.org.x + recon_tile_rect.siz.w;
  111|   509k|      ui32 recon_ty1 = recon_tile_rect.org.y + recon_tile_rect.siz.h;
  112|       |
  113|   509k|      ui32 width = 0;
  114|   509k|      rect colour_comp_rect[3];
  115|  1.04M|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (115:24): [True: 538k, False: 509k]
  ------------------
  116|   538k|      {
  117|   538k|        point downsamp = szp->get_downsampling(i);
  118|       |
  119|   538k|        ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
  ------------------
  |  |   70|   538k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  120|   538k|        ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
  ------------------
  |  |   70|   538k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  121|   538k|        ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
  ------------------
  |  |   70|   538k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  122|   538k|        ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
  ------------------
  |  |   70|   538k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  123|   538k|        ui32 recon_tcx0 = ojph_div_ceil(recon_tx0, downsamp.x);
  ------------------
  |  |   70|   538k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  124|   538k|        ui32 recon_tcy0 = ojph_div_ceil(recon_ty0, downsamp.y);
  ------------------
  |  |   70|   538k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  125|   538k|        ui32 recon_tcx1 = ojph_div_ceil(recon_tx1, downsamp.x);
  ------------------
  |  |   70|   538k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  126|   538k|        ui32 recon_tcy1 = ojph_div_ceil(recon_ty1, downsamp.y);
  ------------------
  |  |   70|   538k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  127|       |
  128|   538k|        rect comp_rect;
  129|   538k|        comp_rect.org.x = tcx0;
  130|   538k|        comp_rect.org.y = tcy0;
  131|   538k|        comp_rect.siz.w = tcx1 - tcx0;
  132|   538k|        comp_rect.siz.h = tcy1 - tcy0;
  133|       |
  134|   538k|        if (i < 3)
  ------------------
  |  Branch (134:13): [True: 533k, False: 4.73k]
  ------------------
  135|   533k|          colour_comp_rect[i] = comp_rect;
  136|       |
  137|   538k|        rect recon_comp_rect;
  138|   538k|        recon_comp_rect.org.x = recon_tcx0;
  139|   538k|        recon_comp_rect.org.y = recon_tcy0;
  140|   538k|        recon_comp_rect.siz.w = recon_tcx1 - recon_tcx0;
  141|   538k|        recon_comp_rect.siz.h = recon_tcy1 - recon_tcy0;
  142|       |
  143|   538k|        tile_comp::pre_alloc(codestream, i, comp_rect, recon_comp_rect);
  144|   538k|        width = ojph_max(width, recon_comp_rect.siz.w);
  ------------------
  |  |   73|   538k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 6.31k, False: 532k]
  |  |  ------------------
  ------------------
  145|   538k|      }
  146|       |
  147|       |      //allocate lines
  148|   509k|      const param_cod* cdp = codestream->get_cod();
  149|   509k|      if (cdp->is_employing_color_transform())
  ------------------
  |  Branch (149:11): [True: 4.85k, False: 504k]
  ------------------
  150|  4.85k|      {
  151|  4.85k|        bool reversible[3];
  152|  19.4k|        for (ui32 i = 0; i < 3; ++i)
  ------------------
  |  Branch (152:26): [True: 14.5k, False: 4.85k]
  ------------------
  153|  14.5k|          reversible[i] = codestream->get_coc(i)->is_reversible();
  154|  4.85k|        if (reversible[0] != reversible[1] || reversible[1] != reversible[2])
  ------------------
  |  Branch (154:13): [True: 36, False: 4.82k]
  |  Branch (154:47): [True: 1, False: 4.82k]
  ------------------
  155|     37|          OJPH_ERROR(0x000300A2, "When the colour transform is employed, "
  ------------------
  |  |  289|    222|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     37|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 37, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (289:52): [True: 27, False: 10]
  |  |  |  Branch (289:52): [True: 11, False: 26]
  |  |  |  Branch (289:52): [True: 9, False: 28]
  |  |  ------------------
  ------------------
  156|  4.85k|            "all colour components must undergo either reversible or "
  157|  4.85k|            "irreversible wavelet transform; if not, then it is not clear "
  158|  4.85k|            "what colour transform should be used (reversible or "
  159|  4.85k|            "irreversible).  Here we found that the first three colour "
  160|  4.85k|            "components uses %s, %s, and %s transforms, respectively.",
  161|  4.85k|            reversible[0] ? "reversible" : "irreversible",
  162|  4.85k|            reversible[1] ? "reversible" : "irreversible",
  163|  4.85k|            reversible[2] ? "reversible" : "irreversible");
  164|       |
  165|  4.85k|        if (colour_comp_rect[0] != colour_comp_rect[1] ||
  ------------------
  |  Branch (165:13): [True: 214, False: 4.64k]
  ------------------
  166|  4.64k|          colour_comp_rect[1] != colour_comp_rect[2])
  ------------------
  |  Branch (166:11): [True: 39, False: 4.60k]
  ------------------
  167|    216|          OJPH_ERROR(0x000300A3, "When the colour transform is employed, "
  ------------------
  |  |  289|    216|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    216|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 216, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|  4.85k|            "the first three colour components must have the same rectangle; "
  169|  4.85k|            "i.e., the same origin on the canvas and the same width and "
  170|  4.85k|            "height. The first three components have the following "
  171|  4.85k|            "origin-size (x,y)-(w,h) values. Component 0 (%d,%d)-(%d,%d), "
  172|  4.85k|            "Component 1 (%d,%d)-(%d,%d), Component 2 (%d,%d)-(%d,%d)",
  173|  4.85k|            colour_comp_rect[0].org.x, colour_comp_rect[0].org.y,
  174|  4.85k|            colour_comp_rect[0].siz.w, colour_comp_rect[0].siz.h,
  175|  4.85k|            colour_comp_rect[1].org.x, colour_comp_rect[1].org.y,
  176|  4.85k|            colour_comp_rect[1].siz.w, colour_comp_rect[1].siz.h,
  177|  4.85k|            colour_comp_rect[2].org.x, colour_comp_rect[2].org.y,
  178|  4.85k|            colour_comp_rect[2].siz.w, colour_comp_rect[2].siz.h);
  179|       |
  180|  4.85k|        allocator->pre_alloc_obj<line_buf>(3);
  181|  4.85k|        if (reversible[0])
  ------------------
  |  Branch (181:13): [True: 1.06k, False: 3.78k]
  ------------------
  182|  4.27k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (182:27): [True: 3.20k, False: 1.06k]
  ------------------
  183|  3.20k|            allocator->pre_alloc_data<si32>(width, 0);
  184|  3.78k|        else
  185|  14.3k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (185:27): [True: 10.6k, False: 3.78k]
  ------------------
  186|  10.6k|            allocator->pre_alloc_data<float>(width, 0);
  187|  4.85k|      }
  188|   509k|    }
_ZN4ojph5local4tile14finalize_allocEPNS0_10codestreamERKNS_4rectEjRjS7_:
  194|   474k|    {
  195|       |      //this->parent = codestream;
  196|   474k|      mem_fixed_allocator* allocator = codestream->get_allocator();
  197|       |
  198|   474k|      sot.init(0, (ui16)tile_idx, 0, 1);
  199|   474k|      prog_order = codestream->access_cod().get_progression_order();
  200|       |
  201|       |      //allocate tiles_comp
  202|   474k|      const param_siz *szp = codestream->get_siz();
  203|   474k|      const param_nlt *nlp = codestream->get_nlt();
  204|       |
  205|   474k|      this->num_bytes = 0;
  206|   474k|      num_comps = szp->get_num_components();
  207|   474k|      skipped_res_for_read = codestream->get_skipped_res_for_read();
  208|   474k|      comps = allocator->post_alloc_obj<tile_comp>(num_comps);
  209|   474k|      comp_rects = allocator->post_alloc_obj<rect>(num_comps);
  210|   474k|      recon_comp_rects = allocator->post_alloc_obj<rect>(num_comps);
  211|   474k|      line_offsets = allocator->post_alloc_obj<ui32>(num_comps);
  212|   474k|      num_bits = allocator->post_alloc_obj<ui32>(num_comps);
  213|   474k|      is_signed = allocator->post_alloc_obj<bool>(num_comps);
  214|   474k|      reversible = allocator->post_alloc_obj<bool>(num_comps);
  215|   474k|      nlt_type3 = allocator->post_alloc_obj<ui8>(num_comps);
  216|   474k|      cur_line = allocator->post_alloc_obj<ui32>(num_comps);
  217|       |
  218|   474k|      profile = codestream->get_profile();
  219|   474k|      tilepart_div = codestream->get_tilepart_div();
  220|   474k|      need_tlm = codestream->is_tlm_needed();
  221|   474k|      {
  222|   474k|        ui32 tilepart_div = codestream->get_tilepart_div();
  223|   474k|        ui32 t = tilepart_div & OJPH_TILEPART_MASK;
  224|   474k|        if (t == OJPH_TILEPART_NO_DIVISIONS)
  ------------------
  |  Branch (224:13): [True: 474k, False: 0]
  ------------------
  225|   474k|          num_tileparts = 1; //for num_rc_bytes
  226|      0|        else if (t == OJPH_TILEPART_COMPONENTS)
  ------------------
  |  Branch (226:18): [True: 0, False: 0]
  ------------------
  227|      0|          num_tileparts = num_comps;
  228|      0|        else if (t == OJPH_TILEPART_RESOLUTIONS)
  ------------------
  |  Branch (228:18): [True: 0, False: 0]
  ------------------
  229|      0|        {
  230|      0|          ui32 max_decs = 0;
  231|      0|          for (ui32 c = 0; c < num_comps; ++c) {
  ------------------
  |  Branch (231:28): [True: 0, False: 0]
  ------------------
  232|      0|            ui32 s = codestream->get_coc(c)->get_num_decompositions();
  233|      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]
  |  |  ------------------
  ------------------
  234|      0|          }
  235|      0|          num_tileparts = 1 + max_decs;
  236|      0|        }
  237|      0|        else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
  ------------------
  |  Branch (237:18): [True: 0, False: 0]
  ------------------
  238|      0|        {
  239|      0|          num_tileparts = 0;
  240|      0|          for (ui32 c = 0; c < num_comps; ++c) {
  ------------------
  |  Branch (240:28): [True: 0, False: 0]
  ------------------
  241|      0|            ui32 s = codestream->get_coc(c)->get_num_decompositions();
  242|      0|            num_tileparts += s + 1;
  243|      0|          }
  244|      0|        }
  245|   474k|        if (num_tileparts > 255)
  ------------------
  |  Branch (245:13): [True: 0, False: 474k]
  ------------------
  246|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|   474k|          "cannot have more than 255 tile parts.", num_tileparts);
  248|   474k|      }
  249|       |
  250|   474k|      this->resilient = codestream->is_resilient();
  251|   474k|      this->tile_rect = tile_rect;
  252|       |
  253|   474k|      ui32 tx0 = tile_rect.org.x;
  254|   474k|      ui32 ty0 = tile_rect.org.y;
  255|   474k|      ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
  256|   474k|      ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
  257|       |
  258|   474k|      ui32 width = 0;
  259|   975k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (259:24): [True: 501k, False: 474k]
  ------------------
  260|   501k|      {
  261|   501k|        ui8 bd; bool is; // used for nlt_type3
  262|       |
  263|   501k|        point downsamp = szp->get_downsampling(i);
  264|   501k|        point recon_downsamp = szp->get_recon_downsampling(i);
  265|       |
  266|   501k|        ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
  ------------------
  |  |   70|   501k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  267|   501k|        ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
  ------------------
  |  |   70|   501k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  268|   501k|        ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
  ------------------
  |  |   70|   501k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  269|   501k|        ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
  ------------------
  |  |   70|   501k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  270|   501k|        ui32 recon_tcx0 = ojph_div_ceil(tx0, recon_downsamp.x);
  ------------------
  |  |   70|   501k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  271|   501k|        ui32 recon_tcy0 = ojph_div_ceil(ty0, recon_downsamp.y);
  ------------------
  |  |   70|   501k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  272|   501k|        ui32 recon_tcx1 = ojph_div_ceil(tx1, recon_downsamp.x);
  ------------------
  |  |   70|   501k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  273|   501k|        ui32 recon_tcy1 = ojph_div_ceil(ty1, recon_downsamp.y);
  ------------------
  |  |   70|   501k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  274|       |
  275|   501k|        line_offsets[i] =
  276|   501k|          recon_tcx0 - ojph_div_ceil(tx0 - offset, recon_downsamp.x);
  ------------------
  |  |   70|   501k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  277|   501k|        comp_rects[i].org.x = tcx0;
  278|   501k|        comp_rects[i].org.y = tcy0;
  279|   501k|        comp_rects[i].siz.w = tcx1 - tcx0;
  280|   501k|        comp_rects[i].siz.h = tcy1 - tcy0;
  281|   501k|        recon_comp_rects[i].org.x = recon_tcx0;
  282|   501k|        recon_comp_rects[i].org.y = recon_tcy0;
  283|   501k|        recon_comp_rects[i].siz.w = recon_tcx1 - recon_tcx0;
  284|   501k|        recon_comp_rects[i].siz.h = recon_tcy1 - recon_tcy0;
  285|       |
  286|   501k|        comps[i].finalize_alloc(codestream, this, i, comp_rects[i],
  287|   501k|          recon_comp_rects[i]);
  288|   501k|        width = ojph_max(width, recon_comp_rects[i].siz.w);
  ------------------
  |  |   73|   501k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 6.23k, False: 495k]
  |  |  ------------------
  ------------------
  289|       |
  290|   501k|        num_bits[i] = szp->get_bit_depth(i);
  291|   501k|        is_signed[i] = szp->is_signed(i);
  292|   501k|        bool result = nlp->get_nonlinear_transform(i, bd, is, nlt_type3[i]);
  293|   501k|        if (result == true && (bd != num_bits[i] || is != is_signed[i]))
  ------------------
  |  Branch (293:13): [True: 141k, False: 360k]
  |  Branch (293:32): [True: 12, False: 140k]
  |  Branch (293:53): [True: 1, False: 140k]
  ------------------
  294|     13|          OJPH_ERROR(0x000300A1, "Mismatch between Ssiz (bit_depth = %d, "
  ------------------
  |  |  289|     52|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     13|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (289:52): [True: 3, False: 10]
  |  |  |  Branch (289:52): [True: 7, False: 6]
  |  |  ------------------
  ------------------
  295|   501k|            "is_signed = %s) from SIZ marker segment, and BDnlt "
  296|   501k|            "(bit_depth = %d, is_signed = %s) from NLT marker segment, "
  297|   501k|            "for component %d", num_bits[i],
  298|   501k|            is_signed[i] ? "True" : "False", bd, is ? "True" : "False", i);
  299|   501k|        if (result == false)
  ------------------
  |  Branch (299:13): [True: 360k, False: 141k]
  ------------------
  300|   360k|          nlt_type3[i] = param_nlt::nonlinearity::OJPH_NLT_NO_NLT;
  301|   501k|        cur_line[i] = 0;
  302|   501k|        reversible[i] = codestream->get_coc(i)->is_reversible();
  303|   501k|      }
  304|       |
  305|   474k|      offset += tile_rect.siz.w;
  306|       |
  307|       |      //allocate lines
  308|   474k|      const param_cod* cdp = codestream->get_cod();
  309|   474k|      this->employ_color_transform = cdp->is_employing_color_transform();
  310|   474k|      if (this->employ_color_transform)
  ------------------
  |  Branch (310:11): [True: 4.38k, False: 469k]
  ------------------
  311|  4.38k|      {
  312|  4.38k|        num_lines = 3;
  313|  4.38k|        lines = allocator->post_alloc_obj<line_buf>(num_lines);
  314|  4.38k|        if (reversible[0])
  ------------------
  |  Branch (314:13): [True: 1.06k, False: 3.32k]
  ------------------
  315|  4.24k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (315:27): [True: 3.18k, False: 1.06k]
  ------------------
  316|  3.18k|            lines[i].wrap(
  317|  3.18k|              allocator->post_alloc_data<si32>(width, 0), width, 0);
  318|  3.32k|        else
  319|  13.2k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (319:27): [True: 9.97k, False: 3.32k]
  ------------------
  320|  9.97k|            lines[i].wrap(
  321|  9.97k|              allocator->post_alloc_data<float>(width, 0), width, 0);
  322|  4.38k|      }
  323|   469k|      else
  324|   469k|      {
  325|       |        lines = NULL;
  326|   469k|        num_lines = 0;
  327|   469k|      }
  328|   474k|      next_tile_part = 0;
  329|   474k|    }
_ZN4ojph5local4tile4pullEPNS_8line_bufEj:
  426|  2.97M|    {
  427|  2.97M|      constexpr ui8 type3 =
  428|  2.97M|        param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
  429|       |
  430|  2.97M|      assert(comp_num < num_comps);
  431|  2.97M|      if (cur_line[comp_num] >= recon_comp_rects[comp_num].siz.h)
  ------------------
  |  Branch (431:11): [True: 102k, False: 2.87M]
  ------------------
  432|   102k|        return false;
  433|       |
  434|  2.87M|      cur_line[comp_num]++;
  435|       |
  436|  2.87M|      ui32 comp_width = recon_comp_rects[comp_num].siz.w;
  437|  2.87M|      if (comp_width == 0)
  ------------------
  |  Branch (437:11): [True: 240k, False: 2.63M]
  ------------------
  438|   240k|        return true; // nothing to pull, but not an error
  439|       |
  440|  2.63M|      if (!employ_color_transform || num_comps == 1)
  ------------------
  |  Branch (440:11): [True: 2.58M, False: 45.8k]
  |  Branch (440:38): [True: 0, False: 45.8k]
  ------------------
  441|  2.58M|      {
  442|  2.58M|        line_buf *src_line = comps[comp_num].pull_line();
  443|  2.58M|        if (reversible[comp_num])
  ------------------
  |  Branch (443:13): [True: 1.78M, False: 799k]
  ------------------
  444|  1.78M|        {
  445|  1.78M|          si64 shift = (si64)1 << (num_bits[comp_num] - 1);
  446|  1.78M|          if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (446:15): [True: 198k, False: 1.58M]
  |  Branch (446:38): [True: 26.9k, False: 172k]
  ------------------
  447|  26.9k|            rev_convert_nlt_type3(src_line, 0, tgt_line,
  448|  26.9k|              line_offsets[comp_num], shift + 1, comp_width);
  449|  1.76M|          else {
  450|  1.76M|            shift = is_signed[comp_num] ? 0 : shift;
  ------------------
  |  Branch (450:21): [True: 172k, False: 1.58M]
  ------------------
  451|  1.76M|            rev_convert(src_line, 0, tgt_line,
  452|  1.76M|              line_offsets[comp_num], shift, comp_width);
  453|  1.76M|          }
  454|  1.78M|        }
  455|   799k|        else
  456|   799k|        {
  457|   799k|          if (nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (457:15): [True: 19.9k, False: 779k]
  ------------------
  458|  19.9k|            irv_convert_to_integer_nlt_type3(src_line, tgt_line,
  459|  19.9k|              line_offsets[comp_num], num_bits[comp_num],
  460|  19.9k|              is_signed[comp_num], comp_width);
  461|   779k|          else
  462|   779k|            irv_convert_to_integer(src_line, tgt_line,
  463|   779k|              line_offsets[comp_num], num_bits[comp_num],
  464|   779k|              is_signed[comp_num], comp_width);
  465|   799k|        }
  466|  2.58M|      }
  467|  45.8k|      else
  468|  45.8k|      {
  469|  45.8k|        assert(num_comps >= 3);
  470|  45.8k|        if (comp_num == 0)
  ------------------
  |  Branch (470:13): [True: 14.2k, False: 31.6k]
  ------------------
  471|  14.2k|        {
  472|  14.2k|          if (reversible[comp_num])
  ------------------
  |  Branch (472:15): [True: 5.75k, False: 8.48k]
  ------------------
  473|  5.75k|            rct_backward(comps[0].pull_line(), comps[1].pull_line(),
  474|  5.75k|              comps[2].pull_line(), lines + 0, lines + 1,
  475|  5.75k|              lines + 2, comp_width);
  476|  8.48k|          else
  477|  8.48k|            ict_backward(comps[0].pull_line()->f32, comps[1].pull_line()->f32,
  478|  8.48k|              comps[2].pull_line()->f32, lines[0].f32, lines[1].f32,
  479|  8.48k|              lines[2].f32, comp_width);
  480|  14.2k|        }
  481|  45.8k|        if (reversible[comp_num])
  ------------------
  |  Branch (481:13): [True: 10.9k, False: 34.9k]
  ------------------
  482|  10.9k|        {
  483|  10.9k|          si64 shift = (si64)1 << (num_bits[comp_num] - 1);
  484|  10.9k|          line_buf* src_line;
  485|  10.9k|          if (comp_num < 3)
  ------------------
  |  Branch (485:15): [True: 10.5k, False: 396]
  ------------------
  486|  10.5k|            src_line = lines + comp_num;
  487|    396|          else
  488|    396|            src_line = comps[comp_num].pull_line();
  489|  10.9k|          if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (489:15): [True: 730, False: 10.2k]
  |  Branch (489:38): [True: 246, False: 484]
  ------------------
  490|    246|            rev_convert_nlt_type3(src_line, 0, tgt_line,
  491|    246|              line_offsets[comp_num], shift + 1, comp_width);
  492|  10.7k|          else {
  493|  10.7k|            shift = is_signed[comp_num] ? 0 : shift;
  ------------------
  |  Branch (493:21): [True: 484, False: 10.2k]
  ------------------
  494|  10.7k|            rev_convert(src_line, 0, tgt_line,
  495|  10.7k|              line_offsets[comp_num], shift, comp_width);
  496|  10.7k|          }
  497|  10.9k|        }
  498|  34.9k|        else
  499|  34.9k|        {
  500|  34.9k|          line_buf* lbp;
  501|  34.9k|          if (comp_num < 3)
  ------------------
  |  Branch (501:15): [True: 25.4k, False: 9.46k]
  ------------------
  502|  25.4k|            lbp = lines + comp_num;
  503|  9.46k|          else
  504|  9.46k|            lbp = comps[comp_num].pull_line();
  505|  34.9k|          if (nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (505:15): [True: 4.86k, False: 30.0k]
  ------------------
  506|  4.86k|            irv_convert_to_integer_nlt_type3(lbp, tgt_line,
  507|  4.86k|              line_offsets[comp_num], num_bits[comp_num],
  508|  4.86k|              is_signed[comp_num], comp_width);
  509|  30.0k|          else
  510|  30.0k|            irv_convert_to_integer(lbp, tgt_line,
  511|  30.0k|              line_offsets[comp_num], num_bits[comp_num],
  512|  30.0k|              is_signed[comp_num], comp_width);
  513|  34.9k|        }
  514|  45.8k|      }
  515|       |
  516|  2.63M|      return true;
  517|  2.87M|    }
_ZN4ojph5local4tile17parse_tile_headerERKNS0_9param_sotEPNS_11infile_baseERKm:
  779|   205k|    {
  780|   205k|      if (sot.get_tile_part_index() != next_tile_part)
  ------------------
  |  Branch (780:11): [True: 203k, False: 1.59k]
  ------------------
  781|   203k|      {
  782|   203k|        if (resilient)
  ------------------
  |  Branch (782:13): [True: 203k, False: 0]
  ------------------
  783|   203k|          OJPH_INFO(0x00030091, "wrong tile part index")
  ------------------
  |  |  285|   203k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|   203k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 203k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  784|      0|        else
  785|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  786|   203k|      }
  787|   205k|      ++next_tile_part;
  788|       |
  789|       |      //tile_end_location used on failure
  790|   205k|      ui64 tile_end_location = tile_start_location + sot.get_payload_length();
  791|       |
  792|   205k|      ui32 data_left = sot.get_payload_length(); //bytes left to parse
  793|   205k|      data_left -= (ui32)((ui64)file->tell() - tile_start_location);
  794|       |
  795|   205k|      if (data_left == 0)
  ------------------
  |  Branch (795:11): [True: 256, False: 205k]
  ------------------
  796|    256|        return;
  797|       |
  798|   205k|      ui32 max_decompositions = 0;
  799|   423k|      for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (799:24): [True: 217k, False: 205k]
  ------------------
  800|   217k|        max_decompositions = ojph_max(max_decompositions,
  ------------------
  |  |   73|   423k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 4.23k, False: 213k]
  |  |  ------------------
  ------------------
  801|   205k|          comps[c].get_num_decompositions());
  802|       |
  803|   205k|      try
  804|   205k|      {
  805|       |        //sequence the reading of precincts according to progression order
  806|   205k|        if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
  ------------------
  |  Branch (806:13): [True: 7.80k, False: 197k]
  |  Branch (806:43): [True: 2.47k, False: 194k]
  ------------------
  807|  10.2k|        {
  808|  10.2k|          max_decompositions -= skipped_res_for_read;
  809|  69.5k|          for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (809:28): [True: 59.3k, False: 10.2k]
  ------------------
  810|   194k|            for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (810:30): [True: 134k, False: 59.3k]
  ------------------
  811|   134k|              if (data_left > 0)
  ------------------
  |  Branch (811:19): [True: 129k, False: 5.18k]
  ------------------
  812|   129k|                comps[c].parse_precincts(r, data_left, file);
  813|  10.2k|        }
  814|   194k|        else if (prog_order == OJPH_PO_RPCL)
  ------------------
  |  Branch (814:18): [True: 5.19k, False: 189k]
  ------------------
  815|  5.19k|        {
  816|  5.19k|          max_decompositions -= skipped_res_for_read;
  817|  29.2k|          for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (817:28): [True: 24.0k, False: 5.19k]
  ------------------
  818|  24.0k|          {
  819|  87.0k|            while (true)
  ------------------
  |  Branch (819:20): [True: 83.0k, Folded]
  ------------------
  820|  83.0k|            {
  821|  83.0k|              bool found = false;
  822|  83.0k|              ui32 comp_num = 0;
  823|  83.0k|              point smallest(INT_MAX, INT_MAX), cur;
  824|   206k|              for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (824:32): [True: 123k, False: 83.0k]
  ------------------
  825|   123k|              {
  826|   123k|                if (!comps[c].get_top_left_precinct(r, cur))
  ------------------
  |  Branch (826:21): [True: 40.5k, False: 83.0k]
  ------------------
  827|  40.5k|                  continue;
  828|  83.0k|                else
  829|  83.0k|                  found = true;
  830|       |
  831|  83.0k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (831:21): [True: 64.4k, False: 18.5k]
  ------------------
  832|  64.4k|                { smallest = cur; comp_num = c; }
  833|  18.5k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (833:26): [True: 17.9k, False: 522]
  |  Branch (833:49): [True: 4.70k, False: 13.2k]
  ------------------
  834|  4.70k|                { smallest = cur; comp_num = c; }
  835|  83.0k|              }
  836|  83.0k|              if (found == true && data_left > 0)
  ------------------
  |  Branch (836:19): [True: 64.0k, False: 18.9k]
  |  Branch (836:36): [True: 63.0k, False: 1.07k]
  ------------------
  837|  63.0k|                comps[comp_num].parse_one_precinct(r, data_left, file);
  838|  20.0k|              else
  839|  20.0k|                break;
  840|  83.0k|            }
  841|  24.0k|          }
  842|  5.19k|        }
  843|   189k|        else if (prog_order == OJPH_PO_PCRL)
  ------------------
  |  Branch (843:18): [True: 6.35k, False: 183k]
  ------------------
  844|  6.35k|        {
  845|  42.7k|          while (true)
  ------------------
  |  Branch (845:18): [True: 40.0k, Folded]
  ------------------
  846|  40.0k|          {
  847|  40.0k|            bool found = false;
  848|  40.0k|            ui32 comp_num = 0;
  849|  40.0k|            ui32 res_num = 0;
  850|  40.0k|            point smallest(INT_MAX, INT_MAX), cur;
  851|  81.3k|            for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (851:30): [True: 41.3k, False: 40.0k]
  ------------------
  852|  41.3k|            {
  853|   289k|              for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
  ------------------
  |  Branch (853:32): [True: 248k, False: 41.3k]
  ------------------
  854|   248k|              {
  855|   248k|                if (!comps[c].get_top_left_precinct(r, cur))
  ------------------
  |  Branch (855:21): [True: 49.0k, False: 199k]
  ------------------
  856|  49.0k|                  continue;
  857|   199k|                else
  858|   199k|                  found = true;
  859|       |
  860|   199k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (860:21): [True: 75.7k, False: 123k]
  ------------------
  861|  75.7k|                { smallest = cur; comp_num = c; res_num = r; }
  862|   123k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (862:26): [True: 110k, False: 12.5k]
  |  Branch (862:49): [True: 29.6k, False: 81.2k]
  ------------------
  863|  29.6k|                { smallest = cur; comp_num = c; res_num = r; }
  864|  93.7k|                else if (cur.y == smallest.y && cur.x == smallest.x &&
  ------------------
  |  Branch (864:26): [True: 81.2k, False: 12.5k]
  |  Branch (864:49): [True: 67.7k, False: 13.5k]
  ------------------
  865|  67.7k|                         c < comp_num)
  ------------------
  |  Branch (865:26): [True: 0, False: 67.7k]
  ------------------
  866|      0|                { smallest = cur; comp_num = c; res_num = r; }
  867|  93.7k|                else if (cur.y == smallest.y && cur.x == smallest.x &&
  ------------------
  |  Branch (867:26): [True: 81.2k, False: 12.5k]
  |  Branch (867:49): [True: 67.7k, False: 13.5k]
  ------------------
  868|  67.7k|                         c == comp_num && r < res_num)
  ------------------
  |  Branch (868:26): [True: 64.3k, False: 3.39k]
  |  Branch (868:43): [True: 0, False: 64.3k]
  ------------------
  869|      0|                { smallest = cur; comp_num = c; res_num = r; }
  870|   199k|              }
  871|  41.3k|            }
  872|  40.0k|            if (found == true && data_left > 0)
  ------------------
  |  Branch (872:17): [True: 36.6k, False: 3.33k]
  |  Branch (872:34): [True: 36.3k, False: 327]
  ------------------
  873|  36.3k|              comps[comp_num].parse_one_precinct(res_num, data_left, file);
  874|  3.66k|            else
  875|  3.66k|              break;
  876|  40.0k|          }
  877|  6.35k|        }
  878|   183k|        else if (prog_order == OJPH_PO_CPRL)
  ------------------
  |  Branch (878:18): [True: 183k, False: 247]
  ------------------
  879|   183k|        {
  880|   368k|          for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (880:28): [True: 184k, False: 183k]
  ------------------
  881|   184k|          {
  882|   436k|            while (true)
  ------------------
  |  Branch (882:20): [True: 408k, Folded]
  ------------------
  883|   408k|            {
  884|   408k|              bool found = false;
  885|   408k|              ui32 res_num = 0;
  886|   408k|              point smallest(INT_MAX, INT_MAX), cur;
  887|  2.85M|              for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (887:32): [True: 2.45M, False: 408k]
  ------------------
  888|  2.45M|              {
  889|  2.45M|                if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
  ------------------
  |  Branch (889:21): [True: 1.18M, False: 1.26M]
  ------------------
  890|  1.18M|                  continue;
  891|  1.26M|                else
  892|  1.26M|                  found = true;
  893|       |
  894|  1.26M|                if (cur.y < smallest.y)
  ------------------
  |  Branch (894:21): [True: 573k, False: 688k]
  ------------------
  895|   573k|                { smallest = cur; res_num = r; }
  896|   688k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (896:26): [True: 653k, False: 35.5k]
  |  Branch (896:49): [True: 215k, False: 437k]
  ------------------
  897|   215k|                { smallest = cur; res_num = r; }
  898|  1.26M|              }
  899|   408k|              if (found == true && data_left > 0)
  ------------------
  |  Branch (899:19): [True: 252k, False: 156k]
  |  Branch (899:36): [True: 251k, False: 859]
  ------------------
  900|   251k|                comps[c].parse_one_precinct(res_num, data_left, file);
  901|   156k|              else
  902|   156k|                break;
  903|   408k|            }
  904|   184k|          }
  905|   183k|        }
  906|    247|        else
  907|   183k|          assert(0);
  908|       |
  909|   205k|      }
  910|   205k|      catch (const char *error)
  911|   205k|      {
  912|  41.6k|        if (resilient)
  ------------------
  |  Branch (912:13): [True: 41.6k, False: 0]
  ------------------
  913|  41.6k|          OJPH_INFO(0x00030092, "%s", error)
  ------------------
  |  |  285|  41.6k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  41.6k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 41.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  914|      0|        else
  915|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  916|  41.6k|      }
  917|       |      // The decode path is meant to throw const char* only, but a nested
  918|       |      // OJPH_ERROR throws std::runtime_error and the allocators can throw
  919|       |      // std::bad_alloc.  These two handlers make sure such throws are also
  920|       |      // subject to the resilience setting, instead of unwinding past
  921|       |      // parse_tile_header.  In the non-resilient case the throw is passed on
  922|       |      // unchanged, because it has already been reported at its origin.
  923|   205k|      catch (const std::exception& error)
  924|   205k|      {
  925|      0|        if (resilient)
  ------------------
  |  Branch (925:13): [True: 0, False: 0]
  ------------------
  926|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|      0|        else
  928|      0|          throw;
  929|      0|      }
  930|   205k|      catch (...)
  931|   205k|      {
  932|      0|        if (resilient)
  ------------------
  |  Branch (932:13): [True: 0, False: 0]
  ------------------
  933|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  934|      0|        else
  935|      0|          throw;
  936|      0|      }
  937|   205k|      file->seek((si64)tile_end_location, infile_base::OJPH_SEEK_SET);
  938|   205k|    }

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

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

_ZN4ojph5local9tile_comp22get_num_decompositionsEv:
   73|   721k|      ui32 get_num_decompositions() { return num_decomps; }
_ZN4ojph5local9tile_comp8get_tileEv:
   74|  2.95M|      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|  47.9k|      dec_mel_st() : data(NULL), tmp(0), bits(0), size(0), unstuff(false),
   65|  47.9k|        k(0), num_runs(0), runs(0)
   66|  47.9k|      {}
_ZN4ojph5local10rev_structC2Ev:
  276|  27.3k|      rev_struct() : data(NULL), tmp(0), bits(0), size(0), unstuff(false)
  277|  27.3k|      {}

_ZN4ojph5local23ojph_decode_codeblock64EPhPmjjjjjjjb:
  771|  34.3k|    {
  772|       |      // static bool insufficient_precision = false;
  773|       |      // static bool modify_code = false;
  774|       |      // static bool truncate_spp_mrp = false;
  775|       |
  776|  34.3k|      if (num_passes > 1 && lengths2 == 0)
  ------------------
  |  Branch (776:11): [True: 25.0k, False: 9.37k]
  |  Branch (776:29): [True: 3.91k, False: 21.1k]
  ------------------
  777|  3.91k|      {
  778|  3.91k|        OJPH_WARN(0x00010001, "A malformed codeblock that has more than "
  ------------------
  |  |  287|  3.91k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  3.91k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3.91k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  779|  3.91k|                              "one coding pass, but zero length for "
  780|  3.91k|                              "2nd and potential 3rd pass.");
  781|  3.91k|        num_passes = 1;
  782|  3.91k|      }
  783|       |
  784|  34.3k|      if (num_passes > 3)
  ------------------
  |  Branch (784:11): [True: 0, False: 34.3k]
  ------------------
  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|  34.3k|      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|  34.3k|      if (lengths1 < 2)
  ------------------
  |  Branch (831:11): [True: 0, False: 34.3k]
  ------------------
  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|  34.3k|      int lcup, scup;
  839|  34.3k|      lcup = (int)lengths1;  // length of CUP
  840|       |      //scup is the length of MEL + VLC
  841|  34.3k|      scup = (((int)coded_data[lcup-1]) << 4) + (coded_data[lcup-2] & 0xF);
  842|  34.3k|      if (scup < 2 || scup > lcup || scup > 4079) //something is wrong
  ------------------
  |  Branch (842:11): [True: 4.03k, False: 30.3k]
  |  Branch (842:23): [True: 10.6k, False: 19.7k]
  |  Branch (842:38): [True: 399, False: 19.3k]
  ------------------
  843|  15.0k|        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|  19.3k|      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|  19.3k|      ui32 sstr = ((width + 2u) + 7u) & ~7u; // multiples of 8
  869|       |
  870|  19.3k|      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|  19.3k|      {
  880|       |        // init structures
  881|  19.3k|        dec_mel_st mel;
  882|  19.3k|        mel_init(&mel, coded_data, lcup, scup);
  883|  19.3k|        rev_struct vlc;
  884|  19.3k|        rev_init8(&vlc, coded_data, lcup, scup);
  885|       |
  886|  19.3k|        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|  19.3k|        ui64 vlc_val;
  891|  19.3k|        ui32 c_q = 0;
  892|  19.3k|        ui16 *sp = scratch;
  893|       |        //initial quad row
  894|  87.1k|        for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (894:26): [True: 67.8k, False: 19.3k]
  ------------------
  895|  67.8k|        {
  896|       |          // decode VLC
  897|       |          /////////////
  898|       |
  899|       |          // first quad
  900|  67.8k|          vlc_val = rev_fetch64(&vlc);
  901|       |
  902|       |          //decode VLC using the context c_q and the head of VLC bitstream
  903|  67.8k|          ui16 t0 = vlc_tbl0[ c_q + (vlc_val & 0x7F) ];
  904|       |
  905|       |          // if context is zero, use one MEL event
  906|  67.8k|          if (c_q == 0) //zero context
  ------------------
  |  Branch (906:15): [True: 35.2k, False: 32.6k]
  ------------------
  907|  35.2k|          {
  908|  35.2k|            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|  35.2k|            t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (913:18): [True: 21.9k, False: 13.2k]
  ------------------
  914|       |
  915|       |            // is run -1 or -2? this means a run has been consumed
  916|  35.2k|            if (run < 0) 
  ------------------
  |  Branch (916:17): [True: 32.1k, False: 3.13k]
  ------------------
  917|  32.1k|              run = mel_get_run(&mel);  // get another run
  918|  35.2k|          }
  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.8k|          sp[0] = t0;
  924|  67.8k|          x += 2;
  925|       |
  926|       |          // prepare context for the next quad; eqn. 1 in ITU T.814
  927|  67.8k|          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.8k|          vlc_val = rev_advance64(&vlc, t0 & 0x7);
  931|       |
  932|       |          //second quad
  933|  67.8k|          ui16 t1 = 0;
  934|       |
  935|       |          //decode VLC using the context c_q and the head of VLC bitstream
  936|  67.8k|          t1 = vlc_tbl0[c_q + (vlc_val & 0x7F)]; 
  937|       |
  938|       |          // if context is zero, use one MEL event
  939|  67.8k|          if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (939:15): [True: 20.6k, False: 47.1k]
  |  Branch (939:27): [True: 17.5k, False: 3.08k]
  ------------------
  940|  17.5k|          {
  941|  17.5k|            run -= 2; //subtract 2, since events number if multiplied by 2
  942|       |
  943|       |            // if event is 0, discard decoded t1
  944|  17.5k|            t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (944:18): [True: 8.30k, False: 9.26k]
  ------------------
  945|       |
  946|  17.5k|            if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (946:17): [True: 11.7k, False: 5.82k]
  ------------------
  947|  11.7k|              run = mel_get_run(&mel); // if yes, then get another run
  948|  17.5k|          }
  949|  67.8k|          t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (949:16): [True: 55.7k, False: 12.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.8k|          sp[2] = t1;
  955|  67.8k|          x += 2;
  956|       |
  957|       |          //prepare context for the next quad, eqn. 1 in ITU T.814
  958|  67.8k|          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.8k|          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.8k|          ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
  967|  67.8k|          if (uvlc_mode == 0xc0)// if both u_offset are set, get an event from
  ------------------
  |  Branch (967:15): [True: 22.6k, False: 45.2k]
  ------------------
  968|  22.6k|          {                     // the MEL run of events
  969|  22.6k|            run -= 2; //subtract 2, since events number if multiplied by 2
  970|       |
  971|  22.6k|            uvlc_mode += (run == -1) ? 0x40 : 0; // increment uvlc_mode by
  ------------------
  |  Branch (971:26): [True: 10.4k, False: 12.1k]
  ------------------
  972|       |                                                 // is 0x40
  973|       |
  974|  22.6k|            if (run < 0)//if run is consumed (run is -1 or -2), get another run
  ------------------
  |  Branch (974:17): [True: 18.0k, False: 4.54k]
  ------------------
  975|  18.0k|              run = mel_get_run(&mel);
  976|  22.6k|          }
  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.8k|          ui32 idx = uvlc_mode + (ui32)(vlc_val & 0x3F);
  984|  67.8k|          ui32 uvlc_entry = uvlc_tbl0[idx];
  985|  67.8k|          ui16 u_bias = uvlc_bias[idx];          
  986|       |          //remove total prefix length
  987|  67.8k|          vlc_val = rev_advance64(&vlc, uvlc_entry & 0x7); 
  988|  67.8k|          uvlc_entry >>= 3; 
  989|       |          //extract suffixes for quad 0 and 1
  990|  67.8k|          ui32 len = uvlc_entry & 0xF;             // suffix length for 2 quads
  991|  67.8k|          ui32 tmp = (ui32)(vlc_val&((1<<len)-1)); // suffix value for 2 quads
  992|  67.8k|          vlc_val = rev_advance64(&vlc, len);
  993|  67.8k|          uvlc_entry >>= 4;
  994|       |          // quad 0 length
  995|  67.8k|          len = uvlc_entry & 0x7; // quad 0 suffix length
  996|  67.8k|          uvlc_entry >>= 3;
  997|  67.8k|          ui16 u_q0 = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
  998|  67.8k|          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.8k|          ui16 u_ext; bool cond0, cond1;
 1002|  67.8k|          cond0 = u_q0 - (u_bias & 0x3) > 32;
 1003|  67.8k|          u_ext = (ui16)(cond0 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1003:26): [True: 369, False: 67.4k]
  ------------------
 1004|  67.8k|          vlc_val = rev_advance64(&vlc, cond0 ? 4 : 0);
  ------------------
  |  Branch (1004:41): [True: 369, False: 67.4k]
  ------------------
 1005|  67.8k|          u_q0 = (ui16)(u_q0 + (u_ext << 2));
 1006|  67.8k|          sp[1] = (ui16)(u_q0 + 1); // kappa = 1
 1007|  67.8k|          cond1 = u_q1 - (u_bias >> 2) > 32;
 1008|  67.8k|          u_ext = (ui16)(cond1 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1008:26): [True: 261, False: 67.5k]
  ------------------
 1009|  67.8k|          vlc_val = rev_advance64(&vlc, cond1 ? 4 : 0);
  ------------------
  |  Branch (1009:41): [True: 261, False: 67.5k]
  ------------------
 1010|  67.8k|          u_q1 = (ui16)(u_q1 + (u_ext << 2));
 1011|  67.8k|          sp[3] = (ui16)(u_q1 + 1); // kappa = 1
 1012|  67.8k|        }
 1013|  19.3k|        sp[0] = sp[1] = 0;
 1014|       |
 1015|       |        //non initial quad rows
 1016|   182k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1016:26): [True: 162k, False: 19.3k]
  ------------------
 1017|   162k|        {
 1018|   162k|          c_q = 0;                                // context
 1019|   162k|          ui16 *sp = scratch + (y >> 1) * sstr;   // this row of quads
 1020|       |
 1021|   440k|          for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1021:28): [True: 277k, False: 162k]
  ------------------
 1022|   277k|          {
 1023|       |            // decode VLC
 1024|       |            /////////////
 1025|       |
 1026|       |            // sigma_q (n, ne, nf)
 1027|   277k|            c_q |= ((sp[0 - (si32)sstr] & 0xA0U) << 2);
 1028|   277k|            c_q |= ((sp[2 - (si32)sstr] & 0x20U) << 4);
 1029|       |
 1030|       |            // first quad
 1031|   277k|            vlc_val = rev_fetch64(&vlc);
 1032|       |
 1033|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1034|   277k|            ui16 t0 = vlc_tbl1[ c_q + (vlc_val & 0x7F) ];
 1035|       |
 1036|       |            // if context is zero, use one MEL event
 1037|   277k|            if (c_q == 0) //zero context
  ------------------
  |  Branch (1037:17): [True: 233k, False: 43.5k]
  ------------------
 1038|   233k|            {
 1039|   233k|              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|   233k|              t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1044:20): [True: 68.0k, False: 165k]
  ------------------
 1045|       |
 1046|       |              // is run -1 or -2? this means a run has been consumed
 1047|   233k|              if (run < 0) 
  ------------------
  |  Branch (1047:19): [True: 129k, False: 104k]
  ------------------
 1048|   129k|                run = mel_get_run(&mel);  // get another run
 1049|   233k|            }
 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|   277k|            sp[0] = t0;
 1055|   277k|            x += 2;
 1056|       |
 1057|       |            // prepare context for the next quad; eqn. 2 in ITU T.814
 1058|       |            // sigma_q (w, sw)
 1059|   277k|            c_q = ((t0 & 0x40U) << 2) | ((t0 & 0x80U) << 1);
 1060|       |            // sigma_q (nw)
 1061|   277k|            c_q |= sp[0 - (si32)sstr] & 0x80;
 1062|       |            // sigma_q (n, ne, nf)
 1063|   277k|            c_q |= ((sp[2 - (si32)sstr] & 0xA0U) << 2);
 1064|   277k|            c_q |= ((sp[4 - (si32)sstr] & 0x20U) << 4);
 1065|       |
 1066|       |            //remove data from vlc stream (0 bits are removed if vlc is unused)
 1067|   277k|            vlc_val = rev_advance64(&vlc, t0 & 0x7);
 1068|       |
 1069|       |            //second quad
 1070|   277k|            ui16 t1 = 0;
 1071|       |
 1072|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1073|   277k|            t1 = vlc_tbl1[ c_q + (vlc_val & 0x7F)]; 
 1074|       |
 1075|       |            // if context is zero, use one MEL event
 1076|   277k|            if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1076:17): [True: 231k, False: 46.0k]
  |  Branch (1076:29): [True: 131k, False: 99.3k]
  ------------------
 1077|   131k|            {
 1078|   131k|              run -= 2; //subtract 2, since events number if multiplied by 2
 1079|       |
 1080|       |              // if event is 0, discard decoded t1
 1081|   131k|              t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1081:20): [True: 31.2k, False: 100k]
  ------------------
 1082|       |
 1083|   131k|              if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1083:19): [True: 58.0k, False: 73.7k]
  ------------------
 1084|  58.0k|                run = mel_get_run(&mel); // if yes, then get another run
 1085|   131k|            }
 1086|   277k|            t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1086:18): [True: 165k, False: 111k]
  ------------------
 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|   277k|            sp[2] = t1;
 1092|   277k|            x += 2;
 1093|       |
 1094|       |            // partial c_q, will be completed when we process the next quad
 1095|       |            // sigma_q (w, sw)
 1096|   277k|            c_q = ((t1 & 0x40U) << 2) | ((t1 & 0x80U) << 1);
 1097|       |            // sigma_q (nw)
 1098|   277k|            c_q |= sp[2 - (si32)sstr] & 0x80;
 1099|       |
 1100|       |            //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1101|   277k|            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|   277k|            ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1107|   277k|            ui32 uvlc_entry = uvlc_tbl1[uvlc_mode + (vlc_val & 0x3F)];
 1108|       |            //remove total prefix length
 1109|   277k|            vlc_val = rev_advance64(&vlc, uvlc_entry & 0x7);
 1110|   277k|            uvlc_entry >>= 3;
 1111|       |            //extract suffixes for quad 0 and 1
 1112|   277k|            ui32 len = uvlc_entry & 0xF;             //suffix length for 2 quads
 1113|   277k|            ui32 tmp = (ui32)(vlc_val&((1<<len)-1)); //suffix value for 2 quads
 1114|   277k|            vlc_val = rev_advance64(&vlc, len);
 1115|   277k|            uvlc_entry >>= 4;
 1116|       |            // quad 0 length
 1117|   277k|            len = uvlc_entry & 0x7; // quad 0 suffix length
 1118|   277k|            uvlc_entry >>= 3;
 1119|   277k|            ui16 u_q0 = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
 1120|   277k|            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|   277k|            ui16 u_ext; bool cond0, cond1;
 1124|   277k|            cond0 = u_q0 > 32;
 1125|   277k|            u_ext = (ui16)(cond0 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1125:28): [True: 250, False: 276k]
  ------------------
 1126|   277k|            vlc_val = rev_advance64(&vlc, cond0 ? 4 : 0);
  ------------------
  |  Branch (1126:43): [True: 250, False: 276k]
  ------------------
 1127|   277k|            u_q0 = (ui16)(u_q0 + (u_ext << 2));
 1128|   277k|            sp[1] = u_q0;
 1129|   277k|            cond1 = u_q1 > 32;
 1130|   277k|            u_ext = (ui16)(cond1 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1130:28): [True: 293, False: 276k]
  ------------------
 1131|   277k|            vlc_val = rev_advance64(&vlc, cond1 ? 4 : 0);
  ------------------
  |  Branch (1131:43): [True: 293, False: 276k]
  ------------------
 1132|   277k|            u_q1 = (ui16)(u_q1 + (u_ext << 2));
 1133|   277k|            sp[3] = u_q1;
 1134|   277k|          }
 1135|   162k|          sp[0] = sp[1] = 0;
 1136|   162k|        }
 1137|  19.3k|      }
 1138|       |
 1139|       |      // step2 we decode magsgn
 1140|  19.3k|      {
 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|  19.3k|        const int v_n_size = 512 + 4;
 1148|  19.3k|        ui64 v_n_scratch[v_n_size] = {0};  // 4+ kB
 1149|       |
 1150|  19.3k|        frwd_struct64 magsgn;
 1151|  19.3k|        frwd_init8<0xFF>(&magsgn, coded_data, lcup - scup);
 1152|       |
 1153|  19.3k|        const ui16 *sp = scratch;
 1154|  19.3k|        ui64 *vp = v_n_scratch;
 1155|  19.3k|        ui64 *dp = decoded_data;
 1156|       |
 1157|  19.3k|        ui64 prev_v_n = 0;
 1158|   110k|        for (ui32 x = 0; x < width; sp += 2, ++vp)
  ------------------
  |  Branch (1158:26): [True: 102k, False: 7.75k]
  ------------------
 1159|   102k|        {
 1160|   102k|          ui32 inf = sp[0];
 1161|   102k|          ui32 U_q = sp[1];
 1162|   102k|          if (U_q > mmsbp2)
  ------------------
  |  Branch (1162:15): [True: 2.17k, False: 100k]
  ------------------
 1163|  2.17k|            return false;
 1164|       |
 1165|   100k|          ui64 v_n;
 1166|   100k|          ui64 val = 0;
 1167|   100k|          ui32 bit = 0;
 1168|   100k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1168:15): [True: 38.1k, False: 62.4k]
  ------------------
 1169|  38.1k|          {
 1170|       |            //get 32 bits of magsgn data
 1171|  38.1k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1172|  38.1k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1173|  38.1k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1174|       |
 1175|  38.1k|            val = ms_val << 63;                           // get sign bit
 1176|  38.1k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1177|  38.1k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1178|  38.1k|            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|  38.1k|            val |= (v_n + 2) << (p - 1);
 1182|  38.1k|          }
 1183|   100k|          dp[0] = val;
 1184|       |
 1185|   100k|          v_n = 0;
 1186|   100k|          val = 0;
 1187|   100k|          bit = 1;
 1188|   100k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1188:15): [True: 50.9k, False: 49.6k]
  ------------------
 1189|  50.9k|          {
 1190|       |            //get 32 bits of magsgn data
 1191|  50.9k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1192|  50.9k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1193|  50.9k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1194|       |
 1195|  50.9k|            val = ms_val << 63;                           // get sign bit
 1196|  50.9k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1197|  50.9k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1198|  50.9k|            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|  50.9k|            val |= (v_n + 2) << (p - 1);
 1202|  50.9k|          }
 1203|   100k|          dp[stride] = val;
 1204|   100k|          vp[0] = prev_v_n | v_n;
 1205|   100k|          prev_v_n = 0;
 1206|   100k|          ++dp;
 1207|   100k|          if (++x >= width)
  ------------------
  |  Branch (1207:15): [True: 9.39k, False: 91.2k]
  ------------------
 1208|  9.39k|          { ++vp; break; }
 1209|       |
 1210|  91.2k|          val = 0;
 1211|  91.2k|          bit = 2;
 1212|  91.2k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1212:15): [True: 37.9k, False: 53.2k]
  ------------------
 1213|  37.9k|          {
 1214|       |            //get 32 bits of magsgn data
 1215|  37.9k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1216|  37.9k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1217|  37.9k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1218|       |
 1219|  37.9k|            val = ms_val << 63;                           // get sign bit
 1220|  37.9k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1221|  37.9k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1222|  37.9k|            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|  37.9k|            val |= (v_n + 2) << (p - 1);
 1226|  37.9k|          }
 1227|  91.2k|          dp[0] = val;
 1228|       |
 1229|  91.2k|          v_n = 0;
 1230|  91.2k|          val = 0;
 1231|  91.2k|          bit = 3;
 1232|  91.2k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1232:15): [True: 36.7k, False: 54.4k]
  ------------------
 1233|  36.7k|          {
 1234|       |            //get 32 bits of magsgn data
 1235|  36.7k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1236|  36.7k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1237|  36.7k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1238|       |
 1239|  36.7k|            val = ms_val << 63;                           // get sign bit
 1240|  36.7k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1241|  36.7k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1242|  36.7k|            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|  36.7k|            val |= (v_n + 2) << (p - 1);
 1246|  36.7k|          }
 1247|  91.2k|          dp[stride] = val;
 1248|  91.2k|          prev_v_n = v_n;
 1249|  91.2k|          ++dp;
 1250|  91.2k|          ++x;
 1251|  91.2k|        }
 1252|  17.1k|        vp[0] = prev_v_n;
 1253|       |
 1254|   103k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1254:26): [True: 88.9k, False: 14.7k]
  ------------------
 1255|  88.9k|        {
 1256|  88.9k|          const ui16 *sp = scratch + (y >> 1) * sstr;
 1257|  88.9k|          ui64 *vp = v_n_scratch;
 1258|  88.9k|          ui64 *dp = decoded_data + y * stride;
 1259|       |
 1260|  88.9k|          prev_v_n = 0;
 1261|   343k|          for (ui32 x = 0; x < width; sp += 2, ++vp)
  ------------------
  |  Branch (1261:28): [True: 301k, False: 41.8k]
  ------------------
 1262|   301k|          {
 1263|   301k|            ui32 inf = sp[0];
 1264|   301k|            ui32 u_q = sp[1];
 1265|       |
 1266|   301k|            ui32 gamma = inf & 0xF0; gamma &= gamma - 0x10; //is gamma_q 1?
 1267|   301k|            ui32 emax = 63 - count_leading_zeros(2 | vp[0] | vp[1]); // emax-1
 1268|   301k|            ui32 kappa = gamma ? emax : 1;
  ------------------
  |  Branch (1268:26): [True: 17.1k, False: 284k]
  ------------------
 1269|       |
 1270|   301k|            ui32 U_q = u_q + kappa;
 1271|   301k|            if (U_q > mmsbp2)
  ------------------
  |  Branch (1271:17): [True: 2.40k, False: 298k]
  ------------------
 1272|  2.40k|              return false;
 1273|       |
 1274|   298k|            ui64 v_n;
 1275|   298k|            ui64 val = 0;
 1276|   298k|            ui32 bit = 0;
 1277|   298k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1277:17): [True: 66.7k, False: 232k]
  ------------------
 1278|  66.7k|            {
 1279|       |              //get 32 bits of magsgn data
 1280|  66.7k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1281|  66.7k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1282|  66.7k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1283|       |
 1284|  66.7k|              val = ms_val << 63;                         // get sign bit
 1285|  66.7k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1286|  66.7k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1287|  66.7k|              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|  66.7k|              val |= (v_n + 2) << (p - 1);
 1291|  66.7k|            }
 1292|   298k|            dp[0] = val;
 1293|       |
 1294|   298k|            v_n = 0;
 1295|   298k|            val = 0;
 1296|   298k|            bit = 1;
 1297|   298k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1297:17): [True: 14.4k, False: 284k]
  ------------------
 1298|  14.4k|            {
 1299|       |              //get 32 bits of magsgn data
 1300|  14.4k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1301|  14.4k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1302|  14.4k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1303|       |
 1304|  14.4k|              val = ms_val << 63;                         // get sign bit
 1305|  14.4k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1306|  14.4k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1307|  14.4k|              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.4k|              val |= (v_n + 2) << (p - 1);
 1311|  14.4k|            }
 1312|   298k|            dp[stride] = val;
 1313|   298k|            vp[0] = prev_v_n | v_n;
 1314|   298k|            prev_v_n = 0;
 1315|   298k|            ++dp;
 1316|   298k|            if (++x >= width)
  ------------------
  |  Branch (1316:17): [True: 44.7k, False: 254k]
  ------------------
 1317|  44.7k|            { ++vp; break; }
 1318|       |
 1319|   254k|            val = 0;
 1320|   254k|            bit = 2;
 1321|   254k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1321:17): [True: 12.1k, False: 241k]
  ------------------
 1322|  12.1k|            {
 1323|       |              //get 32 bits of magsgn data
 1324|  12.1k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1325|  12.1k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1326|  12.1k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1327|       |
 1328|  12.1k|              val = ms_val << 63;                         // get sign bit
 1329|  12.1k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1330|  12.1k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1331|  12.1k|              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.1k|              val |= (v_n + 2) << (p - 1);
 1335|  12.1k|            }
 1336|   254k|            dp[0] = val;
 1337|       |
 1338|   254k|            v_n = 0;
 1339|   254k|            val = 0;
 1340|   254k|            bit = 3;
 1341|   254k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1341:17): [True: 11.5k, False: 242k]
  ------------------
 1342|  11.5k|            {
 1343|       |              //get 32 bits of magsgn data
 1344|  11.5k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1345|  11.5k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1346|  11.5k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1347|       |
 1348|  11.5k|              val = ms_val << 63;                         // get sign bit
 1349|  11.5k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1350|  11.5k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1351|  11.5k|              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|  11.5k|              val |= (v_n + 2) << (p - 1);
 1355|  11.5k|            }
 1356|   254k|            dp[stride] = val;
 1357|   254k|            prev_v_n = v_n;
 1358|   254k|            ++dp;
 1359|   254k|            ++x;
 1360|   254k|          }
 1361|  86.5k|          vp[0] = prev_v_n;
 1362|  86.5k|        }
 1363|  17.1k|      }
 1364|       |
 1365|  14.7k|      if (num_passes > 1)
  ------------------
  |  Branch (1365:11): [True: 12.0k, False: 2.66k]
  ------------------
 1366|  12.0k|      {
 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|  12.0k|        ui16* const sigma = scratch;
 1372|       |
 1373|  12.0k|        ui32 mstr = (width + 3u) >> 2;   // divide by 4, since each
 1374|       |                                         // ui16 contains 4 columns
 1375|  12.0k|        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|  12.0k|        {
 1381|  12.0k|          ui32 y;
 1382|  56.7k|          for (y = 0; y < height; y += 4)
  ------------------
  |  Branch (1382:23): [True: 44.7k, False: 12.0k]
  ------------------
 1383|  44.7k|          {
 1384|  44.7k|            ui16* sp = scratch + (y >> 1) * sstr;
 1385|  44.7k|            ui16* dp = sigma + (y >> 2) * mstr;
 1386|   149k|            for (ui32 x = 0; x < width; x += 4, sp += 4, ++dp) {
  ------------------
  |  Branch (1386:30): [True: 104k, False: 44.7k]
  ------------------
 1387|   104k|              ui32 t0 = 0, t1 = 0;
 1388|   104k|              t0  = ((sp[0     ] & 0x30u) >> 4)  | ((sp[0     ] & 0xC0u) >> 2);
 1389|   104k|              t0 |= ((sp[2     ] & 0x30u) << 4)  | ((sp[2     ] & 0xC0u) << 6);
 1390|   104k|              t1  = ((sp[0+sstr] & 0x30u) >> 2)  | ((sp[0+sstr] & 0xC0u)     );
 1391|   104k|              t1 |= ((sp[2+sstr] & 0x30u) << 6)  | ((sp[2+sstr] & 0xC0u) << 8);
 1392|   104k|              dp[0] = (ui16)(t0 | t1);
 1393|   104k|            }
 1394|  44.7k|            dp[0] = 0; // set an extra entry on the right with 0
 1395|  44.7k|          }
 1396|  12.0k|          {
 1397|       |            // reset one row after the codeblock
 1398|  12.0k|            ui16* dp = sigma + (y >> 2) * mstr;
 1399|  54.5k|            for (ui32 x = 0; x < width; x += 4, ++dp)
  ------------------
  |  Branch (1399:30): [True: 42.4k, False: 12.0k]
  ------------------
 1400|  42.4k|              dp[0] = 0;
 1401|  12.0k|            dp[0] = 0; // set an extra entry on the right with 0
 1402|  12.0k|          }
 1403|  12.0k|        }
 1404|       |
 1405|       |        // We perform Significance Propagation Pass here
 1406|  12.0k|        {
 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|  12.0k|          ui16 prev_row_sig[256 + 8] = {0}; // 528 Bytes
 1417|       |
 1418|  12.0k|          frwd_struct64 sigprop;
 1419|  12.0k|          frwd_init<0>(&sigprop, coded_data + lengths1, (int)lengths2);
 1420|       |
 1421|  56.7k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1421:28): [True: 44.7k, False: 12.0k]
  ------------------
 1422|  44.7k|          {
 1423|  44.7k|            ui32 pattern = 0xFFFFu; // a pattern needed samples
 1424|  44.7k|            if (height - y < 4) {
  ------------------
  |  Branch (1424:17): [True: 6.19k, False: 38.5k]
  ------------------
 1425|  6.19k|              pattern = 0x7777u;
 1426|  6.19k|              if (height - y < 3) {
  ------------------
  |  Branch (1426:19): [True: 4.52k, False: 1.66k]
  ------------------
 1427|  4.52k|                pattern = 0x3333u;
 1428|  4.52k|                if (height - y < 2)
  ------------------
  |  Branch (1428:21): [True: 1.83k, False: 2.69k]
  ------------------
 1429|  1.83k|                  pattern = 0x1111u;
 1430|  4.52k|              }
 1431|  6.19k|            }
 1432|       |
 1433|       |            // prev holds sign. info. for the previous quad, together
 1434|       |            // with the rows on top of it and below it.
 1435|  44.7k|            ui32 prev = 0;
 1436|  44.7k|            ui16 *prev_sig = prev_row_sig;
 1437|  44.7k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1438|  44.7k|            ui64 *dpp = decoded_data + y * stride;
 1439|   149k|            for (ui32 x = 0; x < width; x += 4, ++cur_sig, ++prev_sig)
  ------------------
  |  Branch (1439:30): [True: 104k, False: 44.7k]
  ------------------
 1440|   104k|            {
 1441|       |              // only rows and columns inside the stripe are included
 1442|   104k|              si32 s = (si32)x + 4 - (si32)width;
 1443|   104k|              s = ojph_max(s, 0);
  ------------------
  |  |   73|   104k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 24.2k, False: 80.4k]
  |  |  ------------------
  ------------------
 1444|   104k|              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|   104k|              ui32 ps = load_le_ui16x2(prev_sig);
 1459|   104k|              ui32 ns = load_le_ui16x2(cur_sig + mstr);
 1460|   104k|              ui32 u = (ps & 0x88888888) >> 3; // the row on top
 1461|   104k|              if (!stripe_causal)
  ------------------
  |  Branch (1461:19): [True: 97.2k, False: 7.50k]
  ------------------
 1462|  97.2k|                u |= (ns & 0x11111111) << 3;   // the row below
 1463|       |
 1464|   104k|              ui32 cs = load_le_ui16x2(cur_sig);
 1465|       |              // vertical integration
 1466|   104k|              ui32 mbr =  cs;                // this sig. info.
 1467|   104k|              mbr |= (cs & 0x77777777) << 1; //above neighbors
 1468|   104k|              mbr |= (cs & 0xEEEEEEEE) >> 1; //below neighbors
 1469|   104k|              mbr |= u;
 1470|       |              // horizontal integration
 1471|   104k|              ui32 t = mbr;
 1472|   104k|              mbr |= t << 4;      // neighbors on the left
 1473|   104k|              mbr |= t >> 4;      // neighbors on the right
 1474|   104k|              mbr |= prev >> 12;  // significance of previous group
 1475|       |
 1476|       |              // remove outside samples, and already significant samples
 1477|   104k|              mbr &= pattern;
 1478|   104k|              mbr &= ~cs;
 1479|       |
 1480|       |              // find samples that become significant during the SPP
 1481|   104k|              ui32 new_sig = mbr;
 1482|   104k|              if (new_sig)
  ------------------
  |  Branch (1482:19): [True: 64.9k, False: 39.8k]
  ------------------
 1483|  64.9k|              {
 1484|  64.9k|                ui64 cwd = frwd_fetch<0>(&sigprop);
 1485|       |
 1486|  64.9k|                ui32 cnt = 0;
 1487|  64.9k|                ui32 col_mask = 0xFu;
 1488|  64.9k|                ui32 inv_sig = ~cs & pattern;
 1489|   324k|                for (int i = 0; i < 16; i += 4, col_mask <<= 4)
  ------------------
  |  Branch (1489:33): [True: 259k, False: 64.9k]
  ------------------
 1490|   259k|                {
 1491|   259k|                  if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1491:23): [True: 70.5k, False: 189k]
  ------------------
 1492|  70.5k|                    continue;
 1493|       |
 1494|       |                  //scan one column
 1495|   189k|                  ui32 sample_mask = 0x1111u & col_mask;
 1496|   189k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1496:23): [True: 119k, False: 69.5k]
  ------------------
 1497|   119k|                  {
 1498|   119k|                    new_sig &= ~sample_mask;
 1499|   119k|                    if (cwd & 1)
  ------------------
  |  Branch (1499:25): [True: 35.4k, False: 84.1k]
  ------------------
 1500|  35.4k|                    {
 1501|  35.4k|                      ui32 t = 0x33u << i;
 1502|  35.4k|                      new_sig |= t & inv_sig;
 1503|  35.4k|                    }
 1504|   119k|                    cwd >>= 1; ++cnt;
 1505|   119k|                  }
 1506|       |
 1507|   189k|                  sample_mask <<= 1;
 1508|   189k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1508:23): [True: 122k, False: 67.0k]
  ------------------
 1509|   122k|                  {
 1510|   122k|                    new_sig &= ~sample_mask;
 1511|   122k|                    if (cwd & 1)
  ------------------
  |  Branch (1511:25): [True: 33.7k, False: 88.3k]
  ------------------
 1512|  33.7k|                    {
 1513|  33.7k|                      ui32 t = 0x76u << i;
 1514|  33.7k|                      new_sig |= t & inv_sig;
 1515|  33.7k|                    }
 1516|   122k|                    cwd >>= 1; ++cnt;
 1517|   122k|                  }
 1518|       |
 1519|   189k|                  sample_mask <<= 1;
 1520|   189k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1520:23): [True: 104k, False: 84.3k]
  ------------------
 1521|   104k|                  {
 1522|   104k|                    new_sig &= ~sample_mask;
 1523|   104k|                    if (cwd & 1)
  ------------------
  |  Branch (1523:25): [True: 36.5k, False: 68.2k]
  ------------------
 1524|  36.5k|                    {
 1525|  36.5k|                      ui32 t = 0xECu << i;
 1526|  36.5k|                      new_sig |= t & inv_sig;
 1527|  36.5k|                    }
 1528|   104k|                    cwd >>= 1; ++cnt;
 1529|   104k|                  }
 1530|       |
 1531|   189k|                  sample_mask <<= 1;
 1532|   189k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1532:23): [True: 110k, False: 78.6k]
  ------------------
 1533|   110k|                  {
 1534|   110k|                    new_sig &= ~sample_mask;
 1535|   110k|                    if (cwd & 1)
  ------------------
  |  Branch (1535:25): [True: 38.4k, False: 72.0k]
  ------------------
 1536|  38.4k|                    {
 1537|  38.4k|                      ui32 t = 0xC8u << i;
 1538|  38.4k|                      new_sig |= t & inv_sig;
 1539|  38.4k|                    }
 1540|   110k|                    cwd >>= 1; ++cnt;
 1541|   110k|                  }
 1542|   189k|                }
 1543|       |
 1544|  64.9k|                if (new_sig)
  ------------------
  |  Branch (1544:21): [True: 30.1k, False: 34.7k]
  ------------------
 1545|  30.1k|                {
 1546|       |                  // new_sig has newly-discovered sig. samples during SPP
 1547|       |                  // find the signs and update decoded_data
 1548|  30.1k|                  ui64 *dp = dpp + x;
 1549|  30.1k|                  ui64 val = 3u << (p - 2);
 1550|  30.1k|                  col_mask = 0xFu;
 1551|   150k|                  for (int i = 0; i < 4; ++i, ++dp, col_mask <<= 4)
  ------------------
  |  Branch (1551:35): [True: 120k, False: 30.1k]
  ------------------
 1552|   120k|                  {
 1553|   120k|                    if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1553:25): [True: 52.6k, False: 67.8k]
  ------------------
 1554|  52.6k|                      continue;
 1555|       |
 1556|       |                    //scan 4 signs
 1557|  67.8k|                    ui32 sample_mask = 0x1111u & col_mask;
 1558|  67.8k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1558:25): [True: 35.4k, False: 32.4k]
  ------------------
 1559|  35.4k|                    {
 1560|  35.4k|                      assert(dp[0] == 0);
 1561|  35.4k|                      dp[0] = (cwd << 63) | val;
 1562|  35.4k|                      cwd >>= 1; ++cnt;
 1563|  35.4k|                    }
 1564|       |
 1565|  67.8k|                    sample_mask += sample_mask;
 1566|  67.8k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1566:25): [True: 33.7k, False: 34.1k]
  ------------------
 1567|  33.7k|                    {
 1568|  33.7k|                      assert(dp[stride] == 0);
 1569|  33.7k|                      dp[stride] = (cwd << 63) | val;
 1570|  33.7k|                      cwd >>= 1; ++cnt;
 1571|  33.7k|                    }
 1572|       |
 1573|  67.8k|                    sample_mask += sample_mask;
 1574|  67.8k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1574:25): [True: 36.5k, False: 31.3k]
  ------------------
 1575|  36.5k|                    {
 1576|  36.5k|                      assert(dp[2 * stride] == 0);
 1577|  36.5k|                      dp[2 * stride] = (cwd << 63) | val;
 1578|  36.5k|                      cwd >>= 1; ++cnt;
 1579|  36.5k|                    }
 1580|       |
 1581|  67.8k|                    sample_mask += sample_mask;
 1582|  67.8k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1582:25): [True: 38.4k, False: 29.4k]
  ------------------
 1583|  38.4k|                    {
 1584|  38.4k|                      assert(dp[3 * stride] == 0);
 1585|  38.4k|                      dp[3 * stride] = (cwd << 63) | val;
 1586|  38.4k|                      cwd >>= 1; ++cnt;
 1587|  38.4k|                    }
 1588|  67.8k|                  }
 1589|  30.1k|                }
 1590|  64.9k|                frwd_advance(&sigprop, cnt);
 1591|  64.9k|              }
 1592|       |
 1593|   104k|              new_sig |= cs;
 1594|   104k|              *prev_sig = (ui16)(new_sig);
 1595|       |
 1596|       |              // vertical integration for the new sig. info.
 1597|   104k|              t = new_sig;
 1598|   104k|              new_sig |= (t & 0x7777) << 1; //above neighbors
 1599|   104k|              new_sig |= (t & 0xEEEE) >> 1; //below neighbors
 1600|       |              // add sig. info. from the row on top and below
 1601|   104k|              prev = new_sig | u;
 1602|       |              // we need only the bits in 0xF000
 1603|   104k|              prev &= 0xF000;
 1604|   104k|            }
 1605|  44.7k|          }
 1606|  12.0k|        }
 1607|       |
 1608|       |        // We perform Magnitude Refinement Pass here
 1609|  12.0k|        if (num_passes > 2)
  ------------------
  |  Branch (1609:13): [True: 8.00k, False: 4.07k]
  ------------------
 1610|  8.00k|        {
 1611|  8.00k|          rev_struct magref;
 1612|  8.00k|          rev_init_mrp(&magref, coded_data, (int)lengths1, (int)lengths2);
 1613|       |
 1614|  33.0k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1614:28): [True: 25.0k, False: 8.00k]
  ------------------
 1615|  25.0k|          {
 1616|  25.0k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1617|  25.0k|            ui64 *dpp = decoded_data + y * stride;
 1618|  25.0k|            ui64 half = 1ULL << (p - 2);
 1619|  62.9k|            for (ui32 i = 0; i < width; i += 8, cur_sig += 2)
  ------------------
  |  Branch (1619:30): [True: 37.9k, False: 25.0k]
  ------------------
 1620|  37.9k|            {
 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|  37.9k|              ui32 cwd = rev_fetch_mrp(&magref); // get 32 bit data
 1625|  37.9k|              ui32 sig = load_le_ui16x2(cur_sig); // 32 bits processed now
 1626|  37.9k|              ui32 col_mask = 0xFu;  // a mask for a column in sig
 1627|  37.9k|              if (sig) // if any of the 32 bits are set
  ------------------
  |  Branch (1627:19): [True: 26.2k, False: 11.6k]
  ------------------
 1628|  26.2k|              {
 1629|   236k|                for (int j = 0; j < 8; ++j) //one column at a time
  ------------------
  |  Branch (1629:33): [True: 210k, False: 26.2k]
  ------------------
 1630|   210k|                {
 1631|   210k|                  if (sig & col_mask) // lowest nibble
  ------------------
  |  Branch (1631:23): [True: 103k, False: 106k]
  ------------------
 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: 188k, False: 224k]
  ------------------
 1638|   188k|                      {
 1639|   188k|                        assert(dp[0] != 0); // decoded value cannot be zero
 1640|   188k|                        assert((dp[0] & half) == 0); // no half
 1641|   188k|                        ui64 sym = cwd & 1;          // get it value
 1642|   188k|                        sym = (1 - sym) << (p - 1); // previous center of bin
 1643|   188k|                        sym |= half;            // put half the center of bin
 1644|   188k|                        dp[0] ^= sym;    // remove old bin center and put new
 1645|   188k|                        cwd >>= 1;       // consume word
 1646|   188k|                      }
 1647|   412k|                      sample_mask += sample_mask; //next row
 1648|   412k|                      dp += stride; // next samples row
 1649|   412k|                    }
 1650|   103k|                  }
 1651|   210k|                  col_mask <<= 4; //next column
 1652|   210k|                }
 1653|  26.2k|              }
 1654|       |              // consume data according to the number of bits set
 1655|  37.9k|              rev_advance_mrp(&magref, population_count(sig));
 1656|  37.9k|            }
 1657|  25.0k|          }
 1658|  8.00k|        }
 1659|  12.0k|      }
 1660|  14.7k|      return true;
 1661|  17.1k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL8mel_initEPNS0_10dec_mel_stEPhii:
  222|  19.3k|    {
  223|  19.3k|      melp->data = bbuf + lcup - scup; // move the pointer to the start of MEL
  224|  19.3k|      melp->bits = 0;                  // 0 bits in tmp
  225|  19.3k|      melp->tmp = 0;                   //
  226|  19.3k|      melp->unstuff = false;           // no unstuffing
  227|  19.3k|      melp->size = scup - 1;           // size is the length of MEL+VLC-1
  228|  19.3k|      melp->k = 0;                     // 0 for state 
  229|  19.3k|      melp->num_runs = 0;              // num_runs is 0
  230|  19.3k|      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|  19.3k|      int num = 4 - (int)(intptr_t(melp->data) & 0x3);
  236|  71.5k|      for (int i = 0; i < num; ++i) { // this code is similar to mel_read
  ------------------
  |  Branch (236:23): [True: 52.2k, False: 19.3k]
  ------------------
  237|  52.2k|        assert(melp->unstuff == false || melp->data[0] <= 0x8F);
  238|  52.2k|        ui64 d = (melp->size > 0) ? *melp->data : 0xFF;//if buffer is consumed
  ------------------
  |  Branch (238:18): [True: 47.0k, False: 5.24k]
  ------------------
  239|       |                                                       //set data to 0xFF
  240|  52.2k|        if (melp->size == 1) d |= 0xF; //if this is MEL+VLC-1, set LSBs to 0xF
  ------------------
  |  Branch (240:13): [True: 8.13k, False: 44.1k]
  ------------------
  241|       |                                       // see the standard
  242|  52.2k|        melp->data += melp->size-- > 0; //increment if the end is not reached
  243|  52.2k|        int d_bits = 8 - melp->unstuff; //if unstuffing is needed, reduce by 1
  244|  52.2k|        melp->tmp = (melp->tmp << d_bits) | d; //store bits in tmp
  245|  52.2k|        melp->bits += d_bits;  //increment tmp by number of bits
  246|  52.2k|        melp->unstuff = ((d & 0xFF) == 0xFF); //true of next byte needs 
  247|       |                                              //unstuffing
  248|  52.2k|      }
  249|  19.3k|      melp->tmp <<= (64 - melp->bits); //push all the way up so the first bit
  250|       |                                       // is the MSB
  251|  19.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL9rev_init8EPNS0_10rev_structEPhii:
  344|  19.3k|    {
  345|       |      //first byte has only the upper 4 bits
  346|  19.3k|      vlcp->data = data + lcup - 2;
  347|       |
  348|       |      //size can not be larger than this, in fact it should be smaller
  349|  19.3k|      vlcp->size = scup - 2;
  350|       |
  351|  19.3k|      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|  19.3k|      val = (ui8)(val >> 4);
  356|  19.3k|      ui8 t = ((val & 0x7) == 0x7) ? 1 : 0; // unstuffing is needed
  ------------------
  |  Branch (356:15): [True: 4.56k, False: 14.7k]
  ------------------
  357|  19.3k|      val = (ui8)(val & (0xFU >> t)); // protect against erroneous 1 in MSB
  358|  19.3k|      vlcp->tmp = val;
  359|  19.3k|      vlcp->bits = 4 - t;
  360|  19.3k|      vlcp->unstuff = val > 0x8; //this is useful for the next byte
  361|  19.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL11mel_get_runEPNS0_10dec_mel_stE:
  261|   268k|    {
  262|   268k|      if (melp->num_runs == 0)  //if no runs, decode more bit from MEL segment
  ------------------
  |  Branch (262:11): [True: 48.7k, False: 219k]
  ------------------
  263|  48.7k|        mel_decode(melp);
  264|       |
  265|   268k|      int t = melp->runs & 0x7F; //retrieve one run
  266|   268k|      melp->runs >>= 7;  // remove the retrieved run
  267|   268k|      melp->num_runs--;
  268|   268k|      return t; // return run
  269|   268k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10mel_decodeEPNS0_10dec_mel_stE:
  171|  48.7k|    {
  172|  48.7k|      static const int mel_exp[13] = { //MEL exponents
  173|  48.7k|        0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5
  174|  48.7k|      };
  175|       |
  176|  48.7k|      if (melp->bits < 6) // if there are less than 6 bits in tmp
  ------------------
  |  Branch (176:11): [True: 8.64k, False: 40.0k]
  ------------------
  177|  8.64k|        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|   389k|      while (melp->bits >= 6 && melp->num_runs < 8)
  ------------------
  |  Branch (182:14): [True: 378k, False: 11.7k]
  |  Branch (182:33): [True: 341k, False: 36.9k]
  ------------------
  183|   341k|      {
  184|   341k|        int eval = mel_exp[melp->k]; // number of bits associated with state
  185|   341k|        int run = 0;
  186|   341k|        if (melp->tmp & (1ull<<63)) //The next bit to decode (stored in MSB)
  ------------------
  |  Branch (186:13): [True: 157k, False: 184k]
  ------------------
  187|   157k|        { //one is found
  188|   157k|          run = 1 << eval;  
  189|   157k|          run--; // consecutive runs of 0 events - 1
  190|   157k|          melp->k = melp->k + 1 < 12 ? melp->k + 1 : 12;//increment, max is 12
  ------------------
  |  Branch (190:21): [True: 144k, False: 12.1k]
  ------------------
  191|   157k|          melp->tmp <<= 1; // consume one bit from tmp
  192|   157k|          melp->bits -= 1;
  193|   157k|          run = run << 1; // a stretch of zeros not terminating in one
  194|   157k|        }
  195|   184k|        else
  196|   184k|        { //0 is found
  197|   184k|          run = (int)(melp->tmp >> (63 - eval)) & ((1 << eval) - 1);
  198|   184k|          melp->k = melp->k - 1 > 0 ? melp->k - 1 : 0; //decrement, min is 0
  ------------------
  |  Branch (198:21): [True: 32.5k, False: 151k]
  ------------------
  199|   184k|          melp->tmp <<= eval + 1; //consume eval + 1 bits (max is 6)
  200|   184k|          melp->bits -= eval + 1;
  201|   184k|          run = (run << 1) + 1; // a stretch of zeros terminating with one
  202|   184k|        }
  203|   341k|        eval = melp->num_runs * 7;           // 7 bits per run
  204|   341k|        melp->runs &= ~((ui64)0x3F << eval); // 6 bits are sufficient
  205|   341k|        melp->runs |= ((ui64)run) << eval;   // store the value in runs
  206|   341k|        melp->num_runs++;                    // increment count  
  207|   341k|      }
  208|  48.7k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL8mel_readEPNS0_10dec_mel_stE:
   94|  8.64k|    {
   95|  8.64k|      if (melp->bits > 32)  //there are enough bits in the tmp variable
  ------------------
  |  Branch (95:11): [True: 0, False: 8.64k]
  ------------------
   96|      0|        return;             // return without reading new data
   97|       |
   98|  8.64k|      ui32 val = 0xFFFFFFFF;       // feed in 0xFF if buffer is exhausted
   99|  8.64k|      if (melp->size > 4) {        // if there is data in the MEL segment
  ------------------
  |  Branch (99:11): [True: 2.39k, False: 6.25k]
  ------------------
  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|  6.25k|      else if (melp->size > 0)
  ------------------
  |  Branch (104:16): [True: 3.14k, False: 3.10k]
  ------------------
  105|  3.14k|      { // 4 or less
  106|  3.14k|        int i = 0;
  107|  5.61k|        while (melp->size > 1) {   
  ------------------
  |  Branch (107:16): [True: 2.47k, False: 3.14k]
  ------------------
  108|  2.47k|          ui32 v = *melp->data++;    // read one byte at a time
  109|  2.47k|          ui32 m = ~(0xFFu << i);    // mask of location
  110|  2.47k|          val = (val & m) | (v << i);// put one byte in its correct location
  111|  2.47k|          --melp->size;
  112|  2.47k|          i += 8;
  113|  2.47k|        }
  114|       |        // size equal to 1
  115|  3.14k|        ui32 v = *melp->data++;    // the one before the last is different 
  116|  3.14k|        v |= 0xF;                  // MEL and VLC segments can overlap
  117|  3.14k|        ui32 m = ~(0xFFu << i);
  118|  3.14k|        val = (val & m) | (v << i);
  119|  3.14k|        --melp->size;
  120|  3.14k|      }
  121|       |      
  122|       |      // next we unstuff them before adding them to the buffer
  123|  8.64k|      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.64k|      ui32 t = val & 0xFF; 
  130|  8.64k|      bool unstuff = ((val & 0xFF) == 0xFF); // true if we need unstuffing
  131|  8.64k|      bits -= unstuff; // there is one less bit in t if unstuffing is needed
  132|  8.64k|      t = t << (8 - unstuff); // move up to make room for the next byte
  133|       |
  134|       |      //this is a repeat of the above
  135|  8.64k|      t |= (val>>8) & 0xFF;
  136|  8.64k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  137|  8.64k|      bits -= unstuff;
  138|  8.64k|      t = t << (8 - unstuff);
  139|       |
  140|  8.64k|      t |= (val>>16) & 0xFF;
  141|  8.64k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  142|  8.64k|      bits -= unstuff;
  143|  8.64k|      t = t << (8 - unstuff);
  144|       |
  145|  8.64k|      t |= (val>>24) & 0xFF;
  146|  8.64k|      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.64k|      melp->tmp |= ((ui64)t) << (64 - bits - melp->bits);
  151|  8.64k|      melp->bits += bits; //increment the number of bits in tmp
  152|  8.64k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL11rev_fetch64EPNS0_10rev_structE:
  372|   344k|    {
  373|   632k|      while (vlcp->bits <= 56)
  ------------------
  |  Branch (373:14): [True: 287k, False: 344k]
  ------------------
  374|   287k|        rev_read8(vlcp); // read 8 bits, but unstuffing might reduce this
  375|   344k|      return vlcp->tmp;  // return unstuff decoded bits
  376|   344k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL9rev_read8EPNS0_10rev_structE:
  306|   287k|    {
  307|       |      // process 1 bytes
  308|   287k|      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|   287k|      if (vlcp->size > 0)  // if there are more than 3 bytes left in VLC
  ------------------
  |  Branch (314:11): [True: 99.4k, False: 187k]
  ------------------
  315|  99.4k|      {
  316|  99.4k|        val = *vlcp->data; // then read 8 bits
  317|  99.4k|        --vlcp->data;      // increment data pointer
  318|  99.4k|        --vlcp->size;      // decrement number of bytes in the buffer
  319|  99.4k|      }
  320|       |
  321|       |      // accumulate in tmp, and increment bits, check if unstuffing is needed
  322|   287k|      ui8 t = (vlcp->unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0;
  ------------------
  |  Branch (322:16): [True: 28.5k, False: 258k]
  |  Branch (322:33): [True: 3.94k, False: 24.5k]
  ------------------
  323|   287k|      val = (ui8)(val & (0xFFU >> t)); // protect against erroneous 1 in MSB
  324|   287k|      vlcp->tmp |= (ui64)val << vlcp->bits;
  325|   287k|      vlcp->bits += 8 - t;
  326|   287k|      vlcp->unstuff = val > 0x8F;
  327|   287k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL13rev_advance64EPNS0_10rev_structEj:
  386|  2.06M|    {
  387|       |      assert(num_bits <= vlcp->bits); // vlcp->tmp must have more than num_bits
  388|  2.06M|      vlcp->tmp >>= num_bits;         // remove bits
  389|  2.06M|      vlcp->bits -= num_bits;         // decrement the number of bits
  390|  2.06M|      return vlcp->tmp;
  391|  2.06M|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL12frwd_advanceEPNS0_13frwd_struct64Ej:
  707|   333k|    {
  708|       |      assert(num_bits <= msp->bits);
  709|   333k|      msp->tmp >>= num_bits;  // consume num_bits
  710|   333k|      msp->bits -= num_bits;
  711|   333k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12rev_init_mrpEPNS0_10rev_structEPhii:
  470|  8.00k|    {
  471|  8.00k|      mrp->data = data + lcup + len2 - 1;
  472|  8.00k|      mrp->size = len2;
  473|  8.00k|      mrp->unstuff = true;
  474|  8.00k|      mrp->bits = 0;
  475|  8.00k|      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|  8.00k|      int num = 1 + (int)(intptr_t(mrp->data) & 0x3);
  482|  27.5k|      for (int i = 0; i < num; ++i) {
  ------------------
  |  Branch (482:23): [True: 19.5k, False: 8.00k]
  ------------------
  483|  19.5k|        ui64 d;
  484|       |        //read a byte, 0 if no more data
  485|  19.5k|        d = (mrp->size-- > 0) ? *mrp->data-- : 0; 
  ------------------
  |  Branch (485:13): [True: 18.1k, False: 1.37k]
  ------------------
  486|       |        //check if unstuffing is needed
  487|  19.5k|        ui32 d_bits = 8 - ((mrp->unstuff && ((d & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (487:29): [True: 11.3k, False: 8.18k]
  |  Branch (487:45): [True: 2.44k, False: 8.88k]
  ------------------
  488|  19.5k|        mrp->tmp |= d << mrp->bits; // move data to vlcp->tmp
  489|  19.5k|        mrp->bits += d_bits;
  490|  19.5k|        mrp->unstuff = d > 0x8F; // for next byte
  491|  19.5k|      }
  492|  8.00k|      rev_read_mrp(mrp);
  493|  8.00k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12rev_read_mrpEPNS0_10rev_structE:
  406|  13.5k|    {
  407|       |      //process 4 bytes at a time
  408|  13.5k|      if (mrp->bits > 32)
  ------------------
  |  Branch (408:11): [True: 0, False: 13.5k]
  ------------------
  409|      0|        return;
  410|  13.5k|      ui32 val = 0;
  411|  13.5k|      if (mrp->size > 3) // If there are 3 byte or more
  ------------------
  |  Branch (411:11): [True: 8.15k, False: 5.38k]
  ------------------
  412|  8.15k|      { // (mrp->data - 3) move pointer back to read 32 bits at once
  413|  8.15k|        val = load_le_ui32(mrp->data - 3); // read 32 bits
  414|  8.15k|        mrp->data -= 4;                // move back pointer
  415|  8.15k|        mrp->size -= 4;                // reduce count
  416|  8.15k|      }
  417|  5.38k|      else if (mrp->size > 0)
  ------------------
  |  Branch (417:16): [True: 1.65k, False: 3.73k]
  ------------------
  418|  1.65k|      {
  419|  1.65k|        int i = 24;
  420|  5.47k|        while (mrp->size > 0) {   
  ------------------
  |  Branch (420:16): [True: 3.82k, False: 1.65k]
  ------------------
  421|  3.82k|          ui32 v = *mrp->data--; // read one byte at a time
  422|  3.82k|          val |= (v << i);       // put byte in its correct location
  423|  3.82k|          --mrp->size;
  424|  3.82k|          i -= 8;
  425|  3.82k|        }
  426|  1.65k|      }
  427|       |
  428|       |      //accumulate in tmp, and keep count in bits
  429|  13.5k|      ui32 bits, tmp = val >> 24;
  430|       |
  431|       |      //test if the last byte > 0x8F (unstuff must be true) and this is 0x7F
  432|  13.5k|      bits = 8 - ((mrp->unstuff && (((val >> 24) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (432:20): [True: 5.88k, False: 7.64k]
  |  Branch (432:36): [True: 2.93k, False: 2.95k]
  ------------------
  433|  13.5k|      bool unstuff = (val >> 24) > 0x8F;
  434|       |
  435|       |      //process the next byte
  436|  13.5k|      tmp |= ((val >> 16) & 0xFF) << bits;
  437|  13.5k|      bits += 8 - ((unstuff && (((val >> 16) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (437:21): [True: 4.81k, False: 8.72k]
  |  Branch (437:32): [True: 2.77k, False: 2.03k]
  ------------------
  438|  13.5k|      unstuff = ((val >> 16) & 0xFF) > 0x8F;
  439|       |
  440|  13.5k|      tmp |= ((val >> 8) & 0xFF) << bits;
  441|  13.5k|      bits += 8 - ((unstuff && (((val >> 8) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (441:21): [True: 5.12k, False: 8.41k]
  |  Branch (441:32): [True: 2.31k, False: 2.80k]
  ------------------
  442|  13.5k|      unstuff = ((val >> 8) & 0xFF) > 0x8F;
  443|       |
  444|  13.5k|      tmp |= (val & 0xFF) << bits;
  445|  13.5k|      bits += 8 - ((unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (445:21): [True: 4.12k, False: 9.41k]
  |  Branch (445:32): [True: 2.37k, False: 1.75k]
  ------------------
  446|  13.5k|      unstuff = (val & 0xFF) > 0x8F;
  447|       |
  448|  13.5k|      mrp->tmp |= (ui64)tmp << mrp->bits; // move data to mrp pointer
  449|  13.5k|      mrp->bits += bits;
  450|  13.5k|      mrp->unstuff = unstuff;             // next byte
  451|  13.5k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL13rev_fetch_mrpEPNS0_10rev_structE:
  504|  37.9k|    {
  505|  37.9k|      if (mrp->bits < 32) // if there are less than 32 bits in mrp->tmp
  ------------------
  |  Branch (505:11): [True: 5.16k, False: 32.7k]
  ------------------
  506|  5.16k|      {
  507|  5.16k|        rev_read_mrp(mrp);    // read 30-32 bits from mrp
  508|  5.16k|        if (mrp->bits < 32)   // if there is a space of 32 bits
  ------------------
  |  Branch (508:13): [True: 359, False: 4.81k]
  ------------------
  509|    359|          rev_read_mrp(mrp);  // read more
  510|  5.16k|      }
  511|  37.9k|      return (ui32)mrp->tmp;  // return the head of mrp->tmp
  512|  37.9k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL15rev_advance_mrpEPNS0_10rev_structEj:
  522|  37.9k|    {
  523|       |      assert(num_bits <= mrp->bits); // we must not consume more than mrp->bits
  524|  37.9k|      mrp->tmp >>= num_bits;  // discard the lowest num_bits bits
  525|  37.9k|      mrp->bits -= num_bits;
  526|  37.9k|      return (ui32)mrp->tmp;  // return data after consumption
  527|  37.9k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_init8ILh255EEEvPNS0_13frwd_struct64EPKhi:
  690|  19.3k|    {
  691|  19.3k|      msp->data = data;
  692|  19.3k|      msp->tmp = 0;
  693|  19.3k|      msp->bits = 0;
  694|  19.3k|      msp->unstuff = 0;
  695|  19.3k|      msp->size = size;
  696|  19.3k|      frwd_read8<X>(msp); // read 8 bits
  697|  19.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_read8ILh255EEEvPNS0_13frwd_struct64E:
  626|   224k|    {
  627|   224k|      ui8 val = X;
  628|   224k|      if (msp->size > 0) {
  ------------------
  |  Branch (628:11): [True: 103k, False: 120k]
  ------------------
  629|   103k|        val = *msp->data;  // read 8 bits
  630|   103k|        ++msp->data;      // increment pointer
  631|   103k|        --msp->size;      // reduce size
  632|   103k|      }
  633|       |
  634|       |      // unstuff and accumulate
  635|   224k|      ui8 t = msp->unstuff ? 1 : 0;
  ------------------
  |  Branch (635:15): [True: 68.6k, False: 155k]
  ------------------
  636|   224k|      val = (ui8)(val & (0xFFU >> t));
  637|   224k|      msp->unstuff = (val == 0xFF);
  638|   224k|      msp->tmp |= ((ui64)val) << msp->bits;  // move data to msp->tmp
  639|   224k|      msp->bits += 8 - t;
  640|   224k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12frwd_fetch64ILh255EEEmPNS0_13frwd_struct64E:
  743|   268k|    {
  744|   473k|      while (msp->bits <= 56)
  ------------------
  |  Branch (744:14): [True: 205k, False: 268k]
  ------------------
  745|   205k|        frwd_read8<X>(msp);
  746|   268k|      return msp->tmp;
  747|   268k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL9frwd_initILi0EEEvPNS0_13frwd_struct64EPKhi:
  654|  12.0k|    {
  655|  12.0k|      msp->data = data;
  656|  12.0k|      msp->tmp = 0;
  657|  12.0k|      msp->bits = 0;
  658|  12.0k|      msp->unstuff = 0;
  659|  12.0k|      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|  12.0k|      int num = 4 - (int)(intptr_t(msp->data) & 0x3);
  666|  40.8k|      for (int i = 0; i < num; ++i)
  ------------------
  |  Branch (666:23): [True: 28.7k, False: 12.0k]
  ------------------
  667|  28.7k|      {
  668|  28.7k|        ui64 d;
  669|       |        //read a byte if the buffer is not exhausted, otherwise set it to X
  670|  28.7k|        d = msp->size-- > 0 ? *msp->data++ : X;
  ------------------
  |  Branch (670:13): [True: 26.3k, False: 2.46k]
  ------------------
  671|  28.7k|        msp->tmp |= (d << msp->bits);      // store data in msp->tmp
  672|  28.7k|        msp->bits += 8 - msp->unstuff;     // number of bits added to msp->tmp
  673|  28.7k|        msp->unstuff = ((d & 0xFF) == 0xFF); // unstuffing for next byte
  674|  28.7k|      }
  675|  12.0k|      frwd_read<X>(msp); // read 32 bits more
  676|  12.0k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL9frwd_readILi0EEEvPNS0_13frwd_struct64E:
  562|  29.3k|    {
  563|  29.3k|      assert(msp->bits <= 32); // assert that there is a space for 32 bits
  564|       |
  565|  29.3k|      ui32 val = 0;
  566|  29.3k|      if (msp->size > 3) {
  ------------------
  |  Branch (566:11): [True: 15.1k, False: 14.2k]
  ------------------
  567|  15.1k|        val = load_le_ui32(msp->data); // read 32 bits
  568|  15.1k|        msp->data += 4;           // increment pointer
  569|  15.1k|        msp->size -= 4;           // reduce size
  570|  15.1k|      }
  571|  14.2k|      else if (msp->size > 0)
  ------------------
  |  Branch (571:16): [True: 4.95k, False: 9.30k]
  ------------------
  572|  4.95k|      {
  573|  4.95k|        int i = 0;
  574|  4.95k|        val = X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (574:15): [Folded, False: 4.95k]
  ------------------
  575|  14.0k|        while (msp->size > 0) {   
  ------------------
  |  Branch (575:16): [True: 9.13k, False: 4.95k]
  ------------------
  576|  9.13k|          ui32 v = *msp->data++;    // read one byte at a time
  577|  9.13k|          ui32 m = ~(0xFFu << i);    // mask of location
  578|  9.13k|          val = (val & m) | (v << i);// put one byte in its correct location
  579|  9.13k|          --msp->size;
  580|  9.13k|          i += 8;          
  581|  9.13k|        }
  582|  4.95k|      }
  583|  9.30k|      else
  584|  9.30k|        val = X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (584:15): [Folded, False: 9.30k]
  ------------------
  585|       |
  586|       |      // we accumulate in t and keep a count of the number of bits in bits
  587|  29.3k|      ui32 bits = 8 - msp->unstuff;        
  588|  29.3k|      ui32 t = val & 0xFF;
  589|  29.3k|      bool unstuff = ((val & 0xFF) == 0xFF);  // Do we need unstuffing next?
  590|       |
  591|  29.3k|      t |= ((val >> 8) & 0xFF) << bits;
  592|  29.3k|      bits += 8 - unstuff;
  593|  29.3k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  594|       |
  595|  29.3k|      t |= ((val >> 16) & 0xFF) << bits;
  596|  29.3k|      bits += 8 - unstuff;
  597|  29.3k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  598|       |
  599|  29.3k|      t |= ((val >> 24) & 0xFF) << bits;
  600|  29.3k|      bits += 8 - unstuff;
  601|  29.3k|      msp->unstuff = (((val >> 24) & 0xFF) == 0xFF); // for next byte
  602|       |
  603|  29.3k|      msp->tmp |= ((ui64)t) << msp->bits;  // move data to msp->tmp
  604|  29.3k|      msp->bits += bits;
  605|  29.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_fetchILi0EEEjPNS0_13frwd_struct64E:
  723|  64.9k|    {
  724|  64.9k|      if (msp->bits < 32)
  ------------------
  |  Branch (724:11): [True: 16.7k, False: 48.1k]
  ------------------
  725|  16.7k|      {
  726|  16.7k|        frwd_read<X>(msp);
  727|  16.7k|        if (msp->bits < 32) //need to test
  ------------------
  |  Branch (727:13): [True: 524, False: 16.2k]
  ------------------
  728|    524|          frwd_read<X>(msp);
  729|  16.7k|      }
  730|  64.9k|      return (ui32)msp->tmp;
  731|  64.9k|    }

_ZN4ojph5local26ojph_decode_codeblock_avx2EPhPjjjjjjjjb:
 1824|  47.3k|    {
 1825|  47.3k|      static bool insufficient_precision = false;
 1826|  47.3k|      static bool modify_code = false;
 1827|  47.3k|      static bool truncate_spp_mrp = false;
 1828|       |
 1829|  47.3k|      if (num_passes > 1 && lengths2 == 0)
  ------------------
  |  Branch (1829:11): [True: 35.1k, False: 12.2k]
  |  Branch (1829:29): [True: 7.70k, False: 27.4k]
  ------------------
 1830|  7.70k|      {
 1831|  7.70k|        OJPH_WARN(0x00010001, "A malformed codeblock that has more than "
  ------------------
  |  |  287|  7.70k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  7.70k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7.70k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1832|  7.70k|                              "one coding pass, but zero length for "
 1833|  7.70k|                              "2nd and potential 3rd pass.");
 1834|  7.70k|        num_passes = 1;
 1835|  7.70k|      }
 1836|       |
 1837|  47.3k|      if (num_passes > 3)
  ------------------
  |  Branch (1837:11): [True: 0, False: 47.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|  47.3k|      if (missing_msbs > 30) // p < 0
  ------------------
  |  Branch (1845:11): [True: 824, False: 46.5k]
  ------------------
 1846|    824|      {
 1847|    824|        if (insufficient_precision == false)
  ------------------
  |  Branch (1847:13): [True: 1, False: 823]
  ------------------
 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|    824|        return false;
 1855|    824|      }
 1856|  46.5k|      else if (missing_msbs == 30) // p == 0
  ------------------
  |  Branch (1856:16): [True: 231, False: 46.3k]
  ------------------
 1857|    231|      { // not enough precision to decode and set the bin center to 1
 1858|    231|        if (modify_code == false) {
  ------------------
  |  Branch (1858:13): [True: 1, False: 230]
  ------------------
 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|    231|         return false;         // 32 bits are not enough to decode this
 1866|    231|       }
 1867|  46.3k|      else if (missing_msbs == 29) // if p is 1, then num_passes must be 1
  ------------------
  |  Branch (1867:16): [True: 1.04k, False: 45.2k]
  ------------------
 1868|  1.04k|      {
 1869|  1.04k|        if (num_passes > 1) {
  ------------------
  |  Branch (1869:13): [True: 363, False: 686]
  ------------------
 1870|    363|          num_passes = 1;
 1871|    363|          if (truncate_spp_mrp == false) {
  ------------------
  |  Branch (1871:15): [True: 1, False: 362]
  ------------------
 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|    363|        }
 1879|  1.04k|      }
 1880|  46.3k|      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|  46.3k|      if (lengths1 < 2)
  ------------------
  |  Branch (1884:11): [True: 0, False: 46.3k]
  ------------------
 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|  46.3k|      int lcup, scup;
 1892|  46.3k|      lcup = (int)lengths1;  // length of CUP
 1893|       |      //scup is the length of MEL + VLC
 1894|  46.3k|      scup = (((int)coded_data[lcup-1]) << 4) + (coded_data[lcup-2] & 0xF);
 1895|  46.3k|      if (scup < 2 || scup > lcup || scup > 4079) //something is wrong
  ------------------
  |  Branch (1895:11): [True: 3.12k, False: 43.1k]
  |  Branch (1895:23): [True: 14.3k, False: 28.8k]
  |  Branch (1895:38): [True: 214, False: 28.6k]
  ------------------
 1896|  17.7k|        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.6k|      ui32 sstr = ((width + 2u) + 7u) & ~7u; // multiples of 8
 1920|       |
 1921|       |#ifdef __MINGW64__
 1922|       |      ui16 scratch[8 * 513] = {0};
 1923|       |#else
 1924|  28.6k|      ui16 scratch[8 * 513];
 1925|  28.6k|      ui32 quad_rows = (height + 1u) >> 1;
 1926|  28.6k|      size_t scratch_zero = (size_t)(quad_rows + 1) * sstr;
 1927|  28.6k|      if (scratch_zero > 8 * 513) scratch_zero = 8 * 513;
  ------------------
  |  Branch (1927:11): [True: 0, False: 28.6k]
  ------------------
 1928|  28.6k|      memset(scratch, 0, scratch_zero * sizeof(ui16));
 1929|  28.6k|#endif
 1930|       |
 1931|  28.6k|      assert((stride & 0x3) == 0);
 1932|       |
 1933|  28.6k|      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.6k|      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.6k|      if (mmsbp2 >= 16)
  ------------------
  |  Branch (1952:11): [True: 3.09k, False: 25.5k]
  ------------------
 1953|  3.09k|      {
 1954|  3.09k|        if (!decode_cb_step2_32bit(scratch, decoded_data, coded_data,
  ------------------
  |  Branch (1954:13): [True: 907, False: 2.18k]
  ------------------
 1955|  3.09k|                                   width, height, stride, sstr, p, mmsbp2,
 1956|  3.09k|                                   lcup, scup))
 1957|    907|          return false;
 1958|  3.09k|      }
 1959|  25.5k|      else {
 1960|  25.5k|        if (!decode_cb_step2_16bit(scratch, decoded_data, coded_data,
  ------------------
  |  Branch (1960:13): [True: 8.38k, False: 17.1k]
  ------------------
 1961|  25.5k|                                   width, height, stride, sstr, p, mmsbp2,
 1962|  25.5k|                                   lcup, scup))
 1963|  8.38k|          return false;
 1964|  25.5k|      }
 1965|       |
 1966|  19.3k|      if (num_passes > 1)
  ------------------
  |  Branch (1966:11): [True: 14.8k, False: 4.43k]
  ------------------
 1967|  14.8k|        decode_cb_spp_mrp(scratch, decoded_data, coded_data, width, height,
 1968|  14.8k|                          stride, sstr, p, num_passes, lengths1, lengths2,
 1969|  14.8k|                          stripe_causal);
 1970|       |
 1971|  19.3k|      return true;
 1972|  28.6k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL19decode_cb_step1_vlcEPtPhiijjj:
 1571|  28.6k|    {
 1572|       |        // init structures
 1573|  28.6k|        dec_mel_st mel;
 1574|  28.6k|        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.6k|        const ui32 vlc_cap = 4096;
 1580|  28.6k|        ui8 vlc_buf[vlc_cap + 72];
 1581|  28.6k|        ui32 vlc_limit = destuff_vlc(coded_data, lcup, scup,
 1582|  28.6k|                                     vlc_buf, vlc_cap);
 1583|  28.6k|        ui32 vlc_off = 0;
 1584|  28.6k|        ui32 vlc_bits = 0;
 1585|       |
 1586|  28.6k|        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.6k|        ui64 vlc_val = 0;
 1591|  28.6k|        ui32 c_q = 0;
 1592|  28.6k|        ui16 *sp = scratch;
 1593|       |        //initial quad row
 1594|   127k|        for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1594:26): [True: 99.0k, False: 28.6k]
  ------------------
 1595|  99.0k|        {
 1596|       |          // decode VLC
 1597|       |          /////////////
 1598|       |
 1599|       |          // first quad
 1600|  99.0k|          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|  99.0k|          ui16 t0 = vlc_tbl0[ c_q + (vlc_val & 0x7F) ];
 1604|       |
 1605|       |          // if context is zero, use one MEL event
 1606|  99.0k|          if (c_q == 0) //zero context
  ------------------
  |  Branch (1606:15): [True: 59.7k, False: 39.2k]
  ------------------
 1607|  59.7k|          {
 1608|  59.7k|            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|  59.7k|            t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1613:18): [True: 33.5k, False: 26.2k]
  ------------------
 1614|       |
 1615|       |            // is run -1 or -2? this means a run has been consumed
 1616|  59.7k|            if (run < 0)
  ------------------
  |  Branch (1616:17): [True: 52.6k, False: 7.11k]
  ------------------
 1617|  52.6k|              run = mel_get_run(&mel);  // get another run
 1618|  59.7k|          }
 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|  99.0k|          sp[0] = t0;
 1624|  99.0k|          x += 2;
 1625|       |
 1626|       |          // prepare context for the next quad; eqn. 1 in ITU T.814
 1627|  99.0k|          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|  99.0k|          dconsume(vlc_val, vlc_bits, t0 & 0x7u);
 1631|       |
 1632|       |          //second quad
 1633|  99.0k|          ui16 t1 = 0;
 1634|       |
 1635|       |          //decode VLC using the context c_q and the head of VLC bitstream
 1636|  99.0k|          t1 = vlc_tbl0[c_q + (vlc_val & 0x7F)];
 1637|       |
 1638|       |          // if context is zero, use one MEL event
 1639|  99.0k|          if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1639:15): [True: 35.7k, False: 63.3k]
  |  Branch (1639:27): [True: 30.5k, False: 5.20k]
  ------------------
 1640|  30.5k|          {
 1641|  30.5k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1642|       |
 1643|       |            // if event is 0, discard decoded t1
 1644|  30.5k|            t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1644:18): [True: 11.4k, False: 19.0k]
  ------------------
 1645|       |
 1646|  30.5k|            if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1646:17): [True: 17.3k, False: 13.2k]
  ------------------
 1647|  17.3k|              run = mel_get_run(&mel); // if yes, then get another run
 1648|  30.5k|          }
 1649|  99.0k|          t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1649:16): [True: 80.9k, False: 18.1k]
  ------------------
 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|  99.0k|          sp[2] = t1;
 1655|  99.0k|          x += 2;
 1656|       |
 1657|       |          //prepare context for the next quad, eqn. 1 in ITU T.814
 1658|  99.0k|          c_q = ((t1 & 0x10U) << 3) | ((t1 & 0xE0U) << 2);
 1659|       |
 1660|       |          //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1661|  99.0k|          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|  99.0k|          ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1667|  99.0k|          if (uvlc_mode == 0xc0)// if both u_offset are set, get an event from
  ------------------
  |  Branch (1667:15): [True: 25.6k, False: 73.4k]
  ------------------
 1668|  25.6k|          {                     // the MEL run of events
 1669|  25.6k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1670|       |
 1671|  25.6k|            uvlc_mode += (run == -1) ? 0x40 : 0; // increment uvlc_mode by
  ------------------
  |  Branch (1671:26): [True: 12.0k, False: 13.5k]
  ------------------
 1672|       |                                                 // is 0x40
 1673|       |
 1674|  25.6k|            if (run < 0)//if run is consumed (run is -1 or -2), get another run
  ------------------
  |  Branch (1674:17): [True: 21.0k, False: 4.55k]
  ------------------
 1675|  21.0k|              run = mel_get_run(&mel);
 1676|  25.6k|          }
 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|  99.0k|          ui32 uvlc_entry = uvlc_tbl0[uvlc_mode + (vlc_val & 0x3F)];
 1684|       |          //remove total prefix length
 1685|  99.0k|          dconsume(vlc_val, vlc_bits, uvlc_entry & 0x7u);
 1686|  99.0k|          uvlc_entry >>= 3;
 1687|       |          //extract suffixes for quad 0 and 1
 1688|  99.0k|          ui32 len = uvlc_entry & 0xF;           //suffix length for 2 quads
 1689|  99.0k|          ui32 tmp = (ui32)vlc_val & ((1u << len) - 1); //suffix value, 2 quads
 1690|  99.0k|          dconsume(vlc_val, vlc_bits, len);
 1691|  99.0k|          uvlc_entry >>= 4;
 1692|       |          // quad 0 length
 1693|  99.0k|          len = uvlc_entry & 0x7; // quad 0 suffix length
 1694|  99.0k|          uvlc_entry >>= 3;
 1695|  99.0k|          ui16 u_q = (ui16)(1 + (uvlc_entry&7) + (tmp&~(0xFFU<<len))); //kap. 1
 1696|  99.0k|          sp[1] = u_q;
 1697|  99.0k|          u_q = (ui16)(1 + (uvlc_entry >> 3) + (tmp >> len));  //kappa == 1
 1698|  99.0k|          sp[3] = u_q;
 1699|  99.0k|        }
 1700|  28.6k|        sp[0] = sp[1] = 0;
 1701|       |
 1702|       |        //non initial quad rows
 1703|   265k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1703:26): [True: 237k, False: 28.6k]
  ------------------
 1704|   237k|        {
 1705|   237k|          c_q = 0;                                // context
 1706|   237k|          ui16 *sp = scratch + (y >> 1) * sstr;   // this row of quads
 1707|       |
 1708|   684k|          for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1708:28): [True: 447k, False: 237k]
  ------------------
 1709|   447k|          {
 1710|       |            // decode VLC
 1711|       |            /////////////
 1712|       |
 1713|       |            // sigma_q (n, ne, nf)
 1714|   447k|            c_q |= ((sp[0 - (si32)sstr] & 0xA0U) << 2);
 1715|   447k|            c_q |= ((sp[2 - (si32)sstr] & 0x20U) << 4);
 1716|       |
 1717|       |            // first quad
 1718|   447k|            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|   447k|            ui16 t0 = vlc_tbl1[ c_q + (vlc_val & 0x7F) ];
 1722|       |
 1723|       |            // if context is zero, use one MEL event
 1724|   447k|            if (c_q == 0) //zero context
  ------------------
  |  Branch (1724:17): [True: 387k, False: 59.6k]
  ------------------
 1725|   387k|            {
 1726|   387k|              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|   387k|              t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1731:20): [True: 117k, False: 270k]
  ------------------
 1732|       |
 1733|       |              // is run -1 or -2? this means a run has been consumed
 1734|   387k|              if (run < 0)
  ------------------
  |  Branch (1734:19): [True: 211k, False: 175k]
  ------------------
 1735|   211k|                run = mel_get_run(&mel);  // get another run
 1736|   387k|            }
 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|   447k|            sp[0] = t0;
 1742|   447k|            x += 2;
 1743|       |
 1744|       |            // prepare context for the next quad; eqn. 2 in ITU T.814
 1745|       |            // sigma_q (w, sw)
 1746|   447k|            c_q = ((t0 & 0x40U) << 2) | ((t0 & 0x80U) << 1);
 1747|       |            // sigma_q (nw)
 1748|   447k|            c_q |= sp[0 - (si32)sstr] & 0x80;
 1749|       |            // sigma_q (n, ne, nf)
 1750|   447k|            c_q |= ((sp[2 - (si32)sstr] & 0xA0U) << 2);
 1751|   447k|            c_q |= ((sp[4 - (si32)sstr] & 0x20U) << 4);
 1752|       |
 1753|       |            //remove data from vlc stream (0 bits are removed if vlc is unused)
 1754|   447k|            dconsume(vlc_val, vlc_bits, t0 & 0x7u);
 1755|       |
 1756|       |            //second quad
 1757|   447k|            ui16 t1 = 0;
 1758|       |
 1759|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1760|   447k|            t1 = vlc_tbl1[ c_q + (vlc_val & 0x7F)];
 1761|       |
 1762|       |            // if context is zero, use one MEL event
 1763|   447k|            if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1763:17): [True: 383k, False: 63.9k]
  |  Branch (1763:29): [True: 249k, False: 134k]
  ------------------
 1764|   249k|            {
 1765|   249k|              run -= 2; //subtract 2, since events number if multiplied by 2
 1766|       |
 1767|       |              // if event is 0, discard decoded t1
 1768|   249k|              t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1768:20): [True: 69.1k, False: 180k]
  ------------------
 1769|       |
 1770|   249k|              if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1770:19): [True: 117k, False: 132k]
  ------------------
 1771|   117k|                run = mel_get_run(&mel); // if yes, then get another run
 1772|   249k|            }
 1773|   447k|            t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1773:18): [True: 296k, False: 151k]
  ------------------
 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|   447k|            sp[2] = t1;
 1779|   447k|            x += 2;
 1780|       |
 1781|       |            // partial c_q, will be completed when we process the next quad
 1782|       |            // sigma_q (w, sw)
 1783|   447k|            c_q = ((t1 & 0x40U) << 2) | ((t1 & 0x80U) << 1);
 1784|       |            // sigma_q (nw)
 1785|   447k|            c_q |= sp[2 - (si32)sstr] & 0x80;
 1786|       |
 1787|       |            //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1788|   447k|            dconsume(vlc_val, vlc_bits, t1 & 0x7u);
 1789|       |
 1790|       |            // decode u using wide UVLC table
 1791|       |            /////////////
 1792|   447k|            ui32 uvlc_mode = (((t0 >> 3) & 1u) | (((t1 >> 3) & 1u) << 1));
 1793|   447k|            ui32 uvlc_entry =
 1794|   447k|              uvlc_tbl1_wide[(uvlc_mode << 10) | (vlc_val & 0x3FF)];
 1795|   447k|            ui32 total_bits = uvlc_entry & 0x1F;
 1796|   447k|            if (total_bits < 0x1F) {
  ------------------
  |  Branch (1796:17): [True: 446k, False: 1.14k]
  ------------------
 1797|   446k|              sp[1] = (ui16)((uvlc_entry >> 5) & 0xFF);
 1798|   446k|              sp[3] = (ui16)((uvlc_entry >> 13) & 0xFF);
 1799|   446k|              dconsume(vlc_val, vlc_bits, total_bits);
 1800|   446k|            } else {
 1801|  1.14k|              uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1802|  1.14k|              uvlc_entry = uvlc_tbl1[uvlc_mode + (vlc_val & 0x3F)];
 1803|  1.14k|              dconsume(vlc_val, vlc_bits, uvlc_entry & 0x7u);
 1804|  1.14k|              uvlc_entry >>= 3;
 1805|  1.14k|              ui32 len = uvlc_entry & 0xF;
 1806|  1.14k|              ui32 tmp = (ui32)vlc_val & ((1u << len) - 1);
 1807|  1.14k|              dconsume(vlc_val, vlc_bits, len);
 1808|  1.14k|              uvlc_entry >>= 4;
 1809|  1.14k|              len = uvlc_entry & 0x7;
 1810|  1.14k|              uvlc_entry >>= 3;
 1811|  1.14k|              sp[1] = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
 1812|  1.14k|              sp[3] = (ui16)((uvlc_entry >> 3) + (tmp >> len));
 1813|  1.14k|            }
 1814|   447k|          }
 1815|   237k|          sp[0] = sp[1] = 0;
 1816|   237k|        }
 1817|  28.6k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8mel_initEPNS0_10dec_mel_stEPhii:
  226|  28.6k|    {
  227|  28.6k|      melp->data = bbuf + lcup - scup; // move the pointer to the start of MEL
  228|  28.6k|      melp->bits = 0;                  // 0 bits in tmp
  229|  28.6k|      melp->tmp = 0;                   //
  230|  28.6k|      melp->unstuff = false;           // no unstuffing
  231|  28.6k|      melp->size = scup - 1;           // size is the length of MEL+VLC-1
  232|  28.6k|      melp->k = 0;                     // 0 for state
  233|  28.6k|      melp->num_runs = 0;              // num_runs is 0
  234|  28.6k|      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.6k|      int num = 4 - (int)(intptr_t(melp->data) & 0x3);
  240|   101k|      for (int i = 0; i < num; ++i) { // this code is similar to mel_read
  ------------------
  |  Branch (240:23): [True: 72.9k, False: 28.6k]
  ------------------
  241|  72.9k|        assert(melp->unstuff == false || melp->data[0] <= 0x8F);
  242|  72.9k|        ui64 d = (melp->size > 0) ? *melp->data : 0xFF;//if buffer is consumed
  ------------------
  |  Branch (242:18): [True: 62.1k, False: 10.8k]
  ------------------
  243|       |                                                       //set data to 0xFF
  244|  72.9k|        if (melp->size == 1) d |= 0xF; //if this is MEL+VLC-1, set LSBs to 0xF
  ------------------
  |  Branch (244:13): [True: 11.8k, False: 61.1k]
  ------------------
  245|       |                                       // see the standard
  246|  72.9k|        melp->data += melp->size-- > 0; //increment if the end is not reached
  247|  72.9k|        int d_bits = 8 - melp->unstuff; //if unstuffing is needed, reduce by 1
  248|  72.9k|        melp->tmp = (melp->tmp << d_bits) | d; //store bits in tmp
  249|  72.9k|        melp->bits += d_bits;  //increment tmp by number of bits
  250|  72.9k|        melp->unstuff = ((d & 0xFF) == 0xFF); //true of next byte needs
  251|       |                                              //unstuffing
  252|  72.9k|      }
  253|  28.6k|      melp->tmp <<= (64 - melp->bits); //push all the way up so the first bit
  254|       |                                       // is the MSB
  255|  28.6k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11destuff_vlcEPKhiiPhj:
  588|  28.6k|    {
  589|  28.6k|      const ui8* p = data + lcup - 2;
  590|  28.6k|      ui32 d = *p; // first byte, only the upper 4 bits are used
  591|  28.6k|      ui64 acc = d >> 4;
  592|  28.6k|      ui32 nb = 4 - ((acc & 7) == 7); // check standard
  593|  28.6k|      bool unstuff = (d | 0xF) > 0x8F;
  594|  28.6k|      return destuff_rev(p - 1, scup - 2, unstuff, acc, nb, dst, cap);
  595|  28.6k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11destuff_revEPKhibmjPhj:
  488|  38.2k|    {
  489|  38.2k|      ui8* o = dst;
  490|  38.2k|      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.2k|      if (size > 0 && o < o_end)
  ------------------
  |  Branch (495:11): [True: 33.3k, False: 4.94k]
  |  Branch (495:23): [True: 33.3k, False: 0]
  ------------------
  496|  33.3k|      {
  497|  33.3k|        ui32 d = *p--;
  498|  33.3k|        --size;
  499|  33.3k|        acc |= (ui64)d << nb;
  500|  33.3k|        nb += 8 - ((unstuff && ((d & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (500:21): [True: 22.9k, False: 10.3k]
  |  Branch (500:32): [True: 1.92k, False: 21.0k]
  ------------------
  501|  33.3k|        unstuff = d > 0x8F;
  502|  33.3k|        if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (502:13): [True: 31.9k, False: 1.37k]
  ------------------
  503|  33.3k|      }
  504|       |
  505|       |      // fast path; 16 source bytes at a time when none needs unstuffing
  506|   131k|      while (size >= 16 && o + 24 <= o_end)
  ------------------
  |  Branch (506:14): [True: 93.4k, False: 37.9k]
  |  Branch (506:28): [True: 93.1k, False: 292]
  ------------------
  507|  93.1k|      {
  508|  93.1k|        __m128i v = _mm_loadu_si128((const __m128i*)(p - 15));
  509|  93.1k|        __m128i nx = _mm_loadu_si128((const __m128i*)(p - 14));
  510|  93.1k|        __m128i is7f = _mm_cmpeq_epi8(
  511|  93.1k|            _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|  93.1k|        __m128i le8f = _mm_cmpeq_epi8(
  514|  93.1k|            _mm_subs_epu8(nx, _mm_set1_epi8((char)0x8F)),
  515|  93.1k|            _mm_setzero_si128());
  516|  93.1k|        __m128i stuff = _mm_andnot_si128(le8f, is7f);
  517|  93.1k|        if (!_mm_testz_si128(stuff, stuff))
  ------------------
  |  Branch (517:13): [True: 51.7k, False: 41.4k]
  ------------------
  518|  51.7k|        { // process these 16 bytes one at a time
  519|   879k|          for (int i = 0; i < 16; ++i) {
  ------------------
  |  Branch (519:27): [True: 827k, False: 51.7k]
  ------------------
  520|   827k|            ui32 d = *p--;
  521|   827k|            acc |= (ui64)d << nb;
  522|   827k|            nb += 8 - ((unstuff && ((d & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (522:25): [True: 327k, False: 500k]
  |  Branch (522:36): [True: 222k, False: 104k]
  ------------------
  523|   827k|            unstuff = d > 0x8F;
  524|   827k|            if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (524:17): [True: 797k, False: 30.2k]
  ------------------
  525|   827k|          }
  526|  51.7k|          size -= 16;
  527|  51.7k|          continue;
  528|  51.7k|        }
  529|  41.4k|        __m128i r = _mm_shuffle_epi8(v,
  530|  41.4k|            _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7,
  531|  41.4k|                         8, 9, 10, 11, 12, 13, 14, 15)); // reverse bytes
  532|  41.4k|#ifdef OJPH_ARCH_X86_64
  533|  41.4k|        ui64 v0 = (ui64)_mm_cvtsi128_si64(r);
  534|  41.4k|        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|  41.4k|        ui64 w0 = acc | (v0 << nb);
  542|  41.4k|        ui64 w1 = (v1 << nb) | (nb ? (v0 >> (64 - nb)) : 0);
  ------------------
  |  Branch (542:33): [True: 32.8k, False: 8.59k]
  ------------------
  543|  41.4k|        memcpy(o, &w0, 8);
  544|  41.4k|        memcpy(o + 8, &w1, 8);
  545|  41.4k|        acc = nb ? (v1 >> (64 - nb)) : 0;
  ------------------
  |  Branch (545:15): [True: 32.8k, False: 8.59k]
  ------------------
  546|  41.4k|        o += 16;
  547|  41.4k|        p -= 16;
  548|  41.4k|        size -= 16;
  549|  41.4k|        unstuff = p[1] > 0x8F;
  550|  41.4k|      }
  551|       |      // tail; one byte at a time
  552|   214k|      while (size > 0 && o < o_end)
  ------------------
  |  Branch (552:14): [True: 176k, False: 37.9k]
  |  Branch (552:26): [True: 175k, False: 292]
  ------------------
  553|   175k|      {
  554|   175k|        ui32 d = *p--;
  555|   175k|        --size;
  556|   175k|        acc |= (ui64)d << nb;
  557|   175k|        nb += 8 - ((unstuff && ((d & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (557:21): [True: 51.0k, False: 124k]
  |  Branch (557:32): [True: 11.0k, False: 39.9k]
  ------------------
  558|   175k|        unstuff = d > 0x8F;
  559|   175k|        if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (559:13): [True: 174k, False: 1.44k]
  ------------------
  560|   175k|      }
  561|       |      // the bits above nb are already 0 = fill; pad with zero bytes
  562|  38.2k|      *o = (ui8)acc;
  563|  38.2k|      __m256i z = _mm256_setzero_si256();
  564|  38.2k|      _mm256_storeu_si256((__m256i*)(o + 1), z);
  565|  38.2k|      _mm256_storeu_si256((__m256i*)(o + 33), z);
  566|  38.2k|      return (ui32)(o - dst) + 1;
  567|  38.2k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11mel_get_runEPNS0_10dec_mel_stE:
  265|   448k|    {
  266|   448k|      if (melp->num_runs == 0)  //if no runs, decode more bit from MEL segment
  ------------------
  |  Branch (266:11): [True: 80.7k, False: 367k]
  ------------------
  267|  80.7k|        mel_decode(melp);
  268|       |
  269|   448k|      int t = melp->runs & 0x7F; //retrieve one run
  270|   448k|      melp->runs >>= 7;  // remove the retrieved run
  271|   448k|      melp->num_runs--;
  272|   448k|      return t; // return run
  273|   448k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL10mel_decodeEPNS0_10dec_mel_stE:
  175|  80.7k|    {
  176|  80.7k|      static const int mel_exp[13] = { //MEL exponents
  177|  80.7k|        0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5
  178|  80.7k|      };
  179|       |
  180|  80.7k|      if (melp->bits < 6) // if there are less than 6 bits in tmp
  ------------------
  |  Branch (180:11): [True: 15.9k, False: 64.8k]
  ------------------
  181|  15.9k|        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|   647k|      while (melp->bits >= 6 && melp->num_runs < 8)
  ------------------
  |  Branch (186:14): [True: 626k, False: 20.4k]
  |  Branch (186:33): [True: 566k, False: 60.3k]
  ------------------
  187|   566k|      {
  188|   566k|        int eval = mel_exp[melp->k]; // number of bits associated with state
  189|   566k|        int run = 0;
  190|   566k|        if (melp->tmp & (1ull<<63)) //The next bit to decode (stored in MSB)
  ------------------
  |  Branch (190:13): [True: 268k, False: 298k]
  ------------------
  191|   268k|        { //one is found
  192|   268k|          run = 1 << eval;
  193|   268k|          run--; // consecutive runs of 0 events - 1
  194|   268k|          melp->k = melp->k + 1 < 12 ? melp->k + 1 : 12;//increment, max is 12
  ------------------
  |  Branch (194:21): [True: 246k, False: 22.2k]
  ------------------
  195|   268k|          melp->tmp <<= 1; // consume one bit from tmp
  196|   268k|          melp->bits -= 1;
  197|   268k|          run = run << 1; // a stretch of zeros not terminating in one
  198|   268k|        }
  199|   298k|        else
  200|   298k|        { //0 is found
  201|   298k|          run = (int)(melp->tmp >> (63 - eval)) & ((1 << eval) - 1);
  202|   298k|          melp->k = melp->k - 1 > 0 ? melp->k - 1 : 0; //decrement, min is 0
  ------------------
  |  Branch (202:21): [True: 63.8k, False: 234k]
  ------------------
  203|   298k|          melp->tmp <<= eval + 1; //consume eval + 1 bits (max is 6)
  204|   298k|          melp->bits -= eval + 1;
  205|   298k|          run = (run << 1) + 1; // a stretch of zeros terminating with one
  206|   298k|        }
  207|   566k|        eval = melp->num_runs * 7;           // 7 bits per run
  208|   566k|        melp->runs &= ~((ui64)0x3F << eval); // 6 bits are sufficient
  209|   566k|        melp->runs |= ((ui64)run) << eval;   // store the value in runs
  210|   566k|        melp->num_runs++;                    // increment count
  211|   566k|      }
  212|  80.7k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8mel_readEPNS0_10dec_mel_stE:
   98|  15.9k|    {
   99|  15.9k|      if (melp->bits > 32)  //there are enough bits in the tmp variable
  ------------------
  |  Branch (99:11): [True: 0, False: 15.9k]
  ------------------
  100|      0|        return;             // return without reading new data
  101|       |
  102|  15.9k|      ui32 val = 0xFFFFFFFF;       // feed in 0xFF if buffer is exhausted
  103|  15.9k|      if (melp->size > 4) {        // if there is data in the MEL segment
  ------------------
  |  Branch (103:11): [True: 5.90k, False: 9.99k]
  ------------------
  104|  5.90k|        memcpy(&val, melp->data, 4);  // read 32 bits from MEL data
  105|  5.90k|        melp->data += 4;           // advance pointer
  106|  5.90k|        melp->size -= 4;           // reduce counter
  107|  5.90k|      }
  108|  9.99k|      else if (melp->size > 0)
  ------------------
  |  Branch (108:16): [True: 6.65k, False: 3.34k]
  ------------------
  109|  6.65k|      { // 4 or less
  110|  6.65k|        int i = 0;
  111|  12.9k|        while (melp->size > 1) {
  ------------------
  |  Branch (111:16): [True: 6.28k, False: 6.65k]
  ------------------
  112|  6.28k|          ui32 v = *melp->data++;    // read one byte at a time
  113|  6.28k|          ui32 m = ~(0xFFu << i);    // mask of location
  114|  6.28k|          val = (val & m) | (v << i);// put one byte in its correct location
  115|  6.28k|          --melp->size;
  116|  6.28k|          i += 8;
  117|  6.28k|        }
  118|       |        // size equal to 1
  119|  6.65k|        ui32 v = *melp->data++;    // the one before the last is different
  120|  6.65k|        v |= 0xF;                  // MEL and VLC segments can overlap
  121|  6.65k|        ui32 m = ~(0xFFu << i);
  122|  6.65k|        val = (val & m) | (v << i);
  123|  6.65k|        --melp->size;
  124|  6.65k|      }
  125|       |
  126|       |      // next we unstuff them before adding them to the buffer
  127|  15.9k|      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|  15.9k|      ui32 t = val & 0xFF;
  134|  15.9k|      bool unstuff = ((val & 0xFF) == 0xFF); // true if we need unstuffing
  135|  15.9k|      bits -= unstuff; // there is one less bit in t if unstuffing is needed
  136|  15.9k|      t = t << (8 - unstuff); // move up to make room for the next byte
  137|       |
  138|       |      //this is a repeat of the above
  139|  15.9k|      t |= (val>>8) & 0xFF;
  140|  15.9k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  141|  15.9k|      bits -= unstuff;
  142|  15.9k|      t = t << (8 - unstuff);
  143|       |
  144|  15.9k|      t |= (val>>16) & 0xFF;
  145|  15.9k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  146|  15.9k|      bits -= unstuff;
  147|  15.9k|      t = t << (8 - unstuff);
  148|       |
  149|  15.9k|      t |= (val>>24) & 0xFF;
  150|  15.9k|      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|  15.9k|      melp->tmp |= ((ui64)t) << (64 - bits - melp->bits);
  155|  15.9k|      melp->bits += bits; //increment the number of bits in tmp
  156|  15.9k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL7drefillERmRjS2_PKhj:
  432|   546k|    {
  433|   546k|      ui64 v;
  434|   546k|      ui32 o = off < limit ? off : limit;
  ------------------
  |  Branch (434:16): [True: 96.9k, False: 449k]
  ------------------
  435|   546k|      memcpy(&v, dbuf + o, 8);
  436|   546k|      val |= v << bits;
  437|   546k|      off += (63 - bits) >> 3;
  438|   546k|      bits |= 56;
  439|   546k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8dconsumeERmRjj:
  450|  1.73M|    {
  451|  1.73M|      val >>= num_bits;
  452|  1.73M|      bits -= num_bits;
  453|  1.73M|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL21decode_cb_step2_32bitEPtPjPhjjjjjjii:
 1045|  3.09k|    {
 1046|  3.09k|        const int v_n_size = 512 + 16;
 1047|       |#ifdef __MINGW64__
 1048|       |        ui32 v_n_scratch[2 * v_n_size] = {0};
 1049|       |#else
 1050|  3.09k|        ui32 v_n_scratch[2 * v_n_size];
 1051|  3.09k|        memset(v_n_scratch + (width >> 1) + 2, 0, 14 * sizeof(ui32));
 1052|  3.09k|#endif
 1053|       |
 1054|       |        // maximum consumable MagSgn bits: 4096 samples x (mmsbp2 <= 32) bits
 1055|  3.09k|        const ui32 dbuf_cap = 4096 * 32 / 8;
 1056|  3.09k|        ui8 dbuf[dbuf_cap + 72];
 1057|  3.09k|        ui32 limit = destuff_frwd<0xFF>(coded_data, lcup - scup, dbuf, dbuf_cap);
 1058|  3.09k|        ui32 pos = 0;
 1059|       |
 1060|  3.09k|        const __m256i avx_mmsbp2 = _mm256_set1_epi32((int)mmsbp2);
 1061|       |
 1062|  3.09k|        {
 1063|  3.09k|          ui16 *sp = scratch;
 1064|  3.09k|          ui32 *vp = v_n_scratch;
 1065|  3.09k|          ui32 *dp = decoded_data;
 1066|  3.09k|          vp[0] = 2; // for easy calculation of emax
 1067|       |
 1068|  15.2k|          for (ui32 x = 0; x < width; x += 4, sp += 4, vp += 2, dp += 4)
  ------------------
  |  Branch (1068:28): [True: 12.4k, False: 2.75k]
  ------------------
 1069|  12.4k|          {
 1070|  12.4k|            __m128i vn = _mm_set1_epi32(2);
 1071|       |
 1072|  12.4k|            __m256i inf_u_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)sp));
 1073|  12.4k|            inf_u_q = _mm256_permutevar8x32_epi32(inf_u_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1074|       |
 1075|  12.4k|            __m256i U_q = _mm256_srli_epi32(inf_u_q, 16);
 1076|  12.4k|            __m256i w = _mm256_cmpgt_epi32(U_q, avx_mmsbp2);
 1077|  12.4k|            if (!_mm256_testz_si256(w, w)) {
  ------------------
  |  Branch (1077:17): [True: 335, False: 12.1k]
  ------------------
 1078|    335|                return false;
 1079|    335|            }
 1080|       |
 1081|  12.1k|            __m256i row = decode_two_quad32_avx2(inf_u_q, U_q, dbuf, limit, pos, p, vn);
 1082|  12.1k|            row = _mm256_permutevar8x32_epi32(row, _mm256_setr_epi32(0, 2, 4, 6, 1, 3, 5, 7));
 1083|  12.1k|            _mm_store_si128((__m128i*)dp, _mm256_castsi256_si128(row));
 1084|  12.1k|            _mm_store_si128((__m128i*)(dp + stride), _mm256_extracti128_si256(row, 0x1));
 1085|       |
 1086|  12.1k|            __m128i w0 = _mm_cvtsi32_si128(*(int const*)vp);
 1087|  12.1k|            w0 = _mm_or_si128(w0, vn);
 1088|  12.1k|            _mm_storeu_si128((__m128i*)vp, w0);
 1089|  12.1k|          }
 1090|  3.09k|        }
 1091|       |
 1092|  15.5k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1092:26): [True: 13.3k, False: 2.18k]
  ------------------
 1093|  13.3k|        {
 1094|  13.3k|          {
 1095|       |            // perform 31 - count_leading_zeros(*vp) here
 1096|  13.3k|            ui32 *vp = v_n_scratch;
 1097|  13.3k|            ui16* sp = scratch + (y >> 1) * sstr;
 1098|       |
 1099|  13.3k|            const __m256i avx_31 = _mm256_set1_epi32(31);
 1100|  13.3k|            const __m256i avx_f0 = _mm256_set1_epi32(0xF0);
 1101|  13.3k|            const __m256i avx_1 = _mm256_set1_epi32(1);
 1102|  13.3k|            const __m256i avx_0 = _mm256_setzero_si256();
 1103|       |
 1104|  28.7k|            for (ui32 x = 0; x <= width; x += 16, vp += 8, sp += 16) {
  ------------------
  |  Branch (1104:30): [True: 15.9k, False: 12.7k]
  ------------------
 1105|  15.9k|              __m256i v = _mm256_loadu_si256((__m256i*)vp);
 1106|  15.9k|              __m256i v_p1 = _mm256_loadu_si256((__m256i*)(vp + 1));
 1107|  15.9k|              v = _mm256_or_si256(v, v_p1);
 1108|  15.9k|              v = avx2_lzcnt_epi32(v);
 1109|  15.9k|              v = _mm256_sub_epi32(avx_31, v);
 1110|       |
 1111|  15.9k|              __m256i inf_u_q = _mm256_loadu_si256((__m256i*)sp);
 1112|  15.9k|              __m256i gamma = _mm256_and_si256(inf_u_q, avx_f0);
 1113|  15.9k|              __m256i w0 = _mm256_sub_epi32(gamma, avx_1);
 1114|  15.9k|              gamma = _mm256_and_si256(gamma, w0);
 1115|  15.9k|              gamma = _mm256_cmpeq_epi32(gamma, avx_0);
 1116|       |
 1117|  15.9k|              v = _mm256_andnot_si256(gamma, v);
 1118|  15.9k|              v = _mm256_max_epi32(v, avx_1);
 1119|       |
 1120|  15.9k|              inf_u_q = _mm256_srli_epi32(inf_u_q, 16);
 1121|  15.9k|              v = _mm256_add_epi32(inf_u_q, v);
 1122|       |
 1123|  15.9k|              w0 = _mm256_cmpgt_epi32(v, avx_mmsbp2);
 1124|  15.9k|              if (!_mm256_testz_si256(w0, w0)) {
  ------------------
  |  Branch (1124:19): [True: 572, False: 15.4k]
  ------------------
 1125|    572|                  return false;
 1126|    572|              }
 1127|       |
 1128|  15.4k|              _mm256_storeu_si256((__m256i*)(vp + v_n_size), v);
 1129|  15.4k|            }
 1130|  13.3k|          }
 1131|       |
 1132|  12.7k|          ui32 *vp = v_n_scratch;
 1133|  12.7k|          ui16 *sp = scratch + (y >> 1) * sstr;
 1134|  12.7k|          ui32 *dp = decoded_data + y * stride;
 1135|  12.7k|          vp[0] = 2; // for easy calculation of emax
 1136|       |
 1137|  46.6k|          for (ui32 x = 0; x < width; x += 4, sp += 4, vp += 2, dp += 4) {
  ------------------
  |  Branch (1137:28): [True: 33.8k, False: 12.7k]
  ------------------
 1138|       |            //process two quads
 1139|  33.8k|            __m128i vn = _mm_set1_epi32(2);
 1140|       |
 1141|  33.8k|            __m256i inf_u_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)sp));
 1142|  33.8k|            inf_u_q = _mm256_permutevar8x32_epi32(inf_u_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1143|       |
 1144|  33.8k|            __m256i U_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)(vp + v_n_size)));
 1145|  33.8k|            U_q = _mm256_permutevar8x32_epi32(U_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1146|       |
 1147|  33.8k|            __m256i row = decode_two_quad32_avx2(inf_u_q, U_q, dbuf, limit, pos, p, vn);
 1148|  33.8k|            row = _mm256_permutevar8x32_epi32(row, _mm256_setr_epi32(0, 2, 4, 6, 1, 3, 5, 7));
 1149|  33.8k|            _mm_store_si128((__m128i*)dp, _mm256_castsi256_si128(row));
 1150|  33.8k|            _mm_store_si128((__m128i*)(dp + stride), _mm256_extracti128_si256(row, 0x1));
 1151|       |
 1152|  33.8k|            __m128i w0 = _mm_cvtsi32_si128(*(int const*)vp);
 1153|  33.8k|            w0 = _mm_or_si128(w0, vn);
 1154|  33.8k|            _mm_storeu_si128((__m128i*)vp, w0);
 1155|  33.8k|          }
 1156|  12.7k|        }
 1157|  2.18k|        return true;
 1158|  2.75k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL12destuff_frwdILi255EEEjPKhiPhj:
  305|  28.6k|    {
  306|  28.6k|      if (size < 0)
  ------------------
  |  Branch (306:11): [True: 0, False: 28.6k]
  ------------------
  307|      0|        size = 0;
  308|  28.6k|      ui8* o = dst;
  309|  28.6k|      ui8* o_end = dst + cap;
  310|  28.6k|      const ui8* s = src;
  311|  28.6k|      const ui8* s_end = src + size;
  312|  28.6k|      ui64 acc = 0;       // partial output byte, low nb bits are valid
  313|  28.6k|      ui32 nb = 0;        // number of valid bits in acc; always < 8
  314|  28.6k|      bool prev_ff = false;
  315|       |
  316|       |      // fast path; 16 source bytes at a time when they contain no 0xFF
  317|   263k|      while (s + 16 <= s_end && o + 24 <= o_end)
  ------------------
  |  Branch (317:14): [True: 235k, False: 28.3k]
  |  Branch (317:33): [True: 234k, False: 297]
  ------------------
  318|   234k|      {
  319|   234k|        __m128i v = _mm_loadu_si128((const __m128i*)s);
  320|   234k|        int ff = _mm_movemask_epi8(_mm_cmpeq_epi8(v, _mm_set1_epi8(-1)));
  321|   234k|        if (ff != 0 || prev_ff)
  ------------------
  |  Branch (321:13): [True: 163k, False: 71.4k]
  |  Branch (321:24): [True: 3.34k, False: 68.1k]
  ------------------
  322|   166k|        { // process these 16 bytes one at a time
  323|  2.83M|          for (int i = 0; i < 16; ++i) {
  ------------------
  |  Branch (323:27): [True: 2.66M, False: 166k]
  ------------------
  324|  2.66M|            ui8 b = *s++;
  325|  2.66M|            acc |= (ui64)b << nb;
  326|  2.66M|            nb += prev_ff ? 7u : 8u;
  ------------------
  |  Branch (326:19): [True: 513k, False: 2.15M]
  ------------------
  327|  2.66M|            prev_ff = (b == 0xFFu);
  328|  2.66M|            if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (328:17): [True: 2.59M, False: 67.5k]
  ------------------
  329|  2.66M|          }
  330|   166k|          continue;
  331|   166k|        }
  332|  68.1k|        ui64 v0, v1;
  333|  68.1k|        memcpy(&v0, s, 8);
  334|  68.1k|        memcpy(&v1, s + 8, 8);
  335|  68.1k|        ui64 w0 = acc | (v0 << nb);
  336|  68.1k|        ui64 w1 = (v1 << nb) | (nb ? (v0 >> (64 - nb)) : 0);
  ------------------
  |  Branch (336:33): [True: 57.0k, False: 11.1k]
  ------------------
  337|  68.1k|        memcpy(o, &w0, 8);
  338|  68.1k|        memcpy(o + 8, &w1, 8);
  339|  68.1k|        acc = nb ? (v1 >> (64 - nb)) : 0;
  ------------------
  |  Branch (339:15): [True: 57.0k, False: 11.1k]
  ------------------
  340|  68.1k|        o += 16;
  341|  68.1k|        s += 16;
  342|  68.1k|      }
  343|       |      // tail; one byte at a time
  344|   135k|      while (s < s_end && o < o_end)
  ------------------
  |  Branch (344:14): [True: 106k, False: 28.3k]
  |  Branch (344:27): [True: 106k, False: 297]
  ------------------
  345|   106k|      {
  346|   106k|        ui8 b = *s++;
  347|   106k|        acc |= (ui64)b << nb;
  348|   106k|        nb += prev_ff ? 7u : 8u;
  ------------------
  |  Branch (348:15): [True: 9.00k, False: 97.5k]
  ------------------
  349|   106k|        prev_ff = (b == 0xFFu);
  350|   106k|        if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (350:13): [True: 104k, False: 2.30k]
  ------------------
  351|   106k|      }
  352|       |      // fill the bits above nb with X, and pad with X bytes
  353|  28.6k|      ui32 fill = (X == 0xFF) ? (0xFFu << nb) : 0;
  ------------------
  |  Branch (353:19): [True: 28.6k, Folded]
  ------------------
  354|  28.6k|      *o = (ui8)((ui32)acc | fill);
  355|  28.6k|      __m256i pad = _mm256_set1_epi8((char)X);
  356|  28.6k|      _mm256_storeu_si256((__m256i*)(o + 1), pad);
  357|  28.6k|      _mm256_storeu_si256((__m256i*)(o + 33), pad);
  358|  28.6k|      return (ui32)(o - dst) + 1;
  359|  28.6k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL22decode_two_quad32_avx2EDv4_xS1_PKhjRjjRDv2_x:
  633|  46.0k|                                   ui32 p, __m128i& vn) {
  634|  46.0k|        __m256i row = _mm256_setzero_si256();
  635|       |
  636|       |        // we keeps e_k, e_1, and rho in w2
  637|  46.0k|        __m256i flags = _mm256_and_si256(inf_u_q, _mm256_set_epi32(0x8880, 0x4440, 0x2220, 0x1110, 0x8880, 0x4440, 0x2220, 0x1110));
  638|  46.0k|        __m256i insig = _mm256_cmpeq_epi32(flags, _mm256_setzero_si256());
  639|       |
  640|  46.0k|        if ((uint32_t)_mm256_movemask_epi8(insig) != (uint32_t)0xFFFFFFFF) //are all insignificant?
  ------------------
  |  Branch (640:13): [True: 28.2k, False: 17.8k]
  ------------------
  641|  28.2k|        {
  642|  28.2k|            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|  28.2k|            __m256i m_n;
  650|  28.2k|            __m256i w0 = _mm256_srli_epi32(flags, 15); // e_k
  651|  28.2k|            m_n = _mm256_sub_epi32(U_q, w0);
  652|  28.2k|            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|  28.2k|            __m256i inc_sum = m_n; // inclusive scan
  657|  28.2k|            inc_sum = _mm256_add_epi32(inc_sum, _mm256_bslli_epi128(inc_sum, 4));
  658|  28.2k|            inc_sum = _mm256_add_epi32(inc_sum, _mm256_bslli_epi128(inc_sum, 8));
  659|  28.2k|            ui32 total_mn1 = (ui32)_mm256_extract_epi16(inc_sum, 6);
  660|  28.2k|            ui32 total_mn2 = (ui32)_mm256_extract_epi16(inc_sum, 14);
  661|       |
  662|  28.2k|            __m128i ms_vec0 = dfetch(dbuf, limit, pos);
  663|  28.2k|            __m128i ms_vec1 = dfetch(dbuf, limit, pos + total_mn1);
  664|  28.2k|            pos += total_mn1 + total_mn2;
  665|       |
  666|  28.2k|            __m256i ms_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ms_vec0), ms_vec1, 0x1);
  667|       |
  668|  28.2k|            __m256i ex_sum = _mm256_bslli_epi128(inc_sum, 4); // exclusive scan
  669|       |
  670|       |            // find the starting byte and starting bit
  671|  28.2k|            __m256i byte_idx = _mm256_srli_epi32(ex_sum, 3);
  672|  28.2k|            __m256i bit_idx = _mm256_and_si256(ex_sum, _mm256_set1_epi32(7));
  673|  28.2k|            byte_idx = _mm256_shuffle_epi8(byte_idx,
  674|  28.2k|                _mm256_set_epi32(0x0C0C0C0C, 0x08080808, 0x04040404, 0x00000000, 0x0C0C0C0C, 0x08080808, 0x04040404, 0x00000000));
  675|  28.2k|            byte_idx = _mm256_add_epi32(byte_idx, _mm256_set1_epi32(0x03020100));
  676|  28.2k|            __m256i d0 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  677|  28.2k|            byte_idx = _mm256_add_epi32(byte_idx, _mm256_set1_epi32(0x01010101));
  678|  28.2k|            __m256i d1 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  679|       |
  680|       |            // shift samples values to correct location
  681|  28.2k|            bit_idx = _mm256_or_si256(bit_idx, _mm256_slli_epi32(bit_idx, 16));
  682|       |
  683|  28.2k|            __m128i a = _mm_set_epi8(1, 3, 7, 15, 31, 63, 127, -1, 1, 3, 7, 15, 31, 63, 127, -1);
  684|  28.2k|            __m256i aa = _mm256_inserti128_si256(_mm256_castsi128_si256(a), a, 0x1);
  685|       |
  686|  28.2k|            __m256i bit_shift = _mm256_shuffle_epi8(aa, bit_idx);
  687|  28.2k|            bit_shift = _mm256_add_epi16(bit_shift, _mm256_set1_epi16(0x0101));
  688|  28.2k|            d0 = _mm256_mullo_epi16(d0, bit_shift);
  689|  28.2k|            d0 = _mm256_srli_epi16(d0, 8); // we should have 8 bits in the LSB
  690|  28.2k|            d1 = _mm256_mullo_epi16(d1, bit_shift);
  691|  28.2k|            d1 = _mm256_and_si256(d1, _mm256_set1_epi32((si32)0xFF00FF00)); // 8 in MSB
  692|  28.2k|            d0 = _mm256_or_si256(d0, d1);
  693|       |
  694|       |            // find location of e_k and mask
  695|  28.2k|            __m256i shift;
  696|  28.2k|            __m256i ones = _mm256_set1_epi32(1);
  697|  28.2k|            __m256i twos = _mm256_set1_epi32(2);
  698|  28.2k|            __m256i U_q_m1 = _mm256_sub_epi32(U_q, ones);
  699|  28.2k|            U_q_m1 = _mm256_and_si256(U_q_m1, _mm256_set_epi32(0, 0, 0, 0x1F, 0, 0, 0, 0x1F));
  700|  28.2k|            U_q_m1 = _mm256_shuffle_epi32(U_q_m1, 0);
  701|  28.2k|            w0 = _mm256_sub_epi32(twos, w0);
  702|  28.2k|            shift = _mm256_sllv_epi32(w0, U_q_m1); // U_q_m1 must be no more than 31
  703|  28.2k|            ms_vec = _mm256_and_si256(d0, _mm256_sub_epi32(shift, ones));
  704|       |
  705|       |            // next e_1
  706|  28.2k|            w0 = _mm256_and_si256(flags, _mm256_set1_epi32(0x800));
  707|  28.2k|            w0 = _mm256_cmpeq_epi32(w0, _mm256_setzero_si256());
  708|  28.2k|            w0 = _mm256_andnot_si256(w0, shift);  // e_1 in correct position
  709|  28.2k|            ms_vec = _mm256_or_si256(ms_vec, w0); // e_1
  710|  28.2k|            w0 = _mm256_slli_epi32(ms_vec, 31);   // sign
  711|  28.2k|            ms_vec = _mm256_or_si256(ms_vec, ones); // bin center
  712|  28.2k|            __m256i tvn = ms_vec;
  713|  28.2k|            ms_vec = _mm256_add_epi32(ms_vec, twos);// + 2
  714|  28.2k|            ms_vec = _mm256_slli_epi32(ms_vec, (si32)p - 1);
  715|  28.2k|            ms_vec = _mm256_or_si256(ms_vec, w0); // sign
  716|  28.2k|            row = _mm256_andnot_si256(insig, ms_vec); // significant only
  717|       |
  718|  28.2k|            ms_vec = _mm256_andnot_si256(insig, tvn); // significant only
  719|       |
  720|  28.2k|            tvn = _mm256_shuffle_epi8(ms_vec, _mm256_set_epi32(-1, 0x0F0E0D0C, 0x07060504, -1, -1, -1, 0x0F0E0D0C, 0x07060504));
  721|       |
  722|  28.2k|            vn = _mm_or_si128(vn, _mm256_castsi256_si128(tvn));
  723|       |            vn = _mm_or_si128(vn, _mm256_extracti128_si256(tvn, 0x1));
  724|  28.2k|        }
  725|  46.0k|        return row;
  726|  46.0k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL6dfetchEPKhjj:
  377|   218k|    {
  378|   218k|      ui32 off = pos >> 3;
  379|   218k|      off = off < limit ? off : limit;
  ------------------
  |  Branch (379:13): [True: 173k, False: 45.0k]
  ------------------
  380|   218k|      const ui8* p = dbuf + off;
  381|   218k|      __m128i v = _mm_loadu_si128((const __m128i*)p);
  382|   218k|      __m128i w = _mm_loadu_si128((const __m128i*)(p + 8));
  383|   218k|      int k = (int)(pos & 7);
  384|   218k|      __m128i r = _mm_srl_epi64(v, _mm_cvtsi32_si128(k));
  385|   218k|      __m128i c = _mm_sll_epi64(w, _mm_cvtsi32_si128(64 - k));
  386|   218k|      return _mm_or_si128(r, c);
  387|   218k|    }
_ZN4ojph5local16avx2_lzcnt_epi32EDv4_x:
  870|   151k|    inline __m256i avx2_lzcnt_epi32(__m256i v) {
  871|       |        // prevent value from being rounded up to the next power of two
  872|   151k|        v = _mm256_andnot_si256(_mm256_srli_epi32(v, 8), v);  // keep 8 MSB
  873|       |
  874|   151k|        v = _mm256_castps_si256(_mm256_cvtepi32_ps(v));    // convert an integer to float
  875|   151k|        v = _mm256_srli_epi32(v, 23);                   // shift down the exponent
  876|   151k|        v = _mm256_subs_epu16(_mm256_set1_epi32(158), v);  // undo bias
  877|   151k|        v = _mm256_min_epi16(v, _mm256_set1_epi32(32));    // clamp at 32
  878|       |
  879|   151k|        return v;
  880|   151k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL21decode_cb_step2_16bitEPtPjPhjjjjjjii:
  913|  25.5k|    {
  914|       |        // reduce bitplane by 16 because we now have 16 bits instead of 32
  915|  25.5k|        p -= 16;
  916|       |
  917|  25.5k|        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.5k|        ui16 v_n_scratch[v_n_size];
  923|  25.5k|        memset(v_n_scratch + (width >> 1) + 4, 0, 8 * sizeof(ui16));
  924|  25.5k|        ui32 v_n_scratch_32[v_n_size];
  925|  25.5k|#endif
  926|       |
  927|       |        // maximum consumable MagSgn bits: 4096 samples x (mmsbp2 < 16) bits
  928|  25.5k|        const ui32 dbuf_cap = 4096 * 15 / 8;
  929|  25.5k|        ui8 dbuf[dbuf_cap + 72];
  930|  25.5k|        ui32 limit = destuff_frwd<0xFF>(coded_data, lcup - scup, dbuf, dbuf_cap);
  931|  25.5k|        ui32 pos = 0;
  932|       |
  933|  25.5k|        {
  934|  25.5k|          ui16 *sp = scratch;
  935|  25.5k|          ui16 *vp = v_n_scratch;
  936|  25.5k|          ui32 *dp = decoded_data;
  937|  25.5k|          vp[0] = 2; // for easy calculation of emax
  938|       |
  939|  59.6k|          for (ui32 x = 0; x < width; x += 8, sp += 8, vp += 4, dp += 8) {
  ------------------
  |  Branch (939:28): [True: 39.3k, False: 20.2k]
  ------------------
  940|       |              ////process four quads
  941|  39.3k|              __m128i inf_u_q = _mm_loadu_si128((__m128i*)sp);
  942|  39.3k|              __m128i U_q = _mm_srli_epi32(inf_u_q, 16);
  943|  39.3k|              __m128i w = _mm_cmpgt_epi32(U_q, _mm_set1_epi32((int)mmsbp2));
  944|  39.3k|              if (!_mm_testz_si128(w, w)) {
  ------------------
  |  Branch (944:19): [True: 5.25k, False: 34.0k]
  ------------------
  945|  5.25k|                  return false;
  946|  5.25k|              }
  947|       |
  948|  34.0k|              __m128i vn = _mm_set1_epi16(2);
  949|  34.0k|              __m256i row = decode_four_quad16(inf_u_q, U_q, dbuf, limit, pos, p, vn);
  950|       |
  951|  34.0k|              w = _mm_cvtsi32_si128(*(unsigned short const*)(vp));
  952|  34.0k|              _mm_storeu_si128((__m128i*)vp, _mm_or_si128(w, vn));
  953|       |
  954|  34.0k|              __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|  34.0k|              __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|  34.0k|              _mm256_storeu_si256((__m256i*)dp, w0);
  958|  34.0k|              _mm256_storeu_si256((__m256i*)(dp + stride), w1);
  959|  34.0k|          }
  960|  25.5k|        }
  961|       |
  962|   134k|        for (ui32 y = 2; y < height; y += 2) {
  ------------------
  |  Branch (962:26): [True: 117k, False: 17.1k]
  ------------------
  963|   117k|          {
  964|       |            // perform 15 - count_leading_zeros(*vp) here
  965|   117k|            ui16 *vp = v_n_scratch;
  966|   117k|            ui32 *vp_32 = v_n_scratch_32;
  967|       |
  968|   117k|            ui16* sp = scratch + (y >> 1) * sstr;
  969|   117k|            const __m256i avx_mmsbp2 = _mm256_set1_epi32((int)mmsbp2);
  970|   117k|            const __m256i avx_31 = _mm256_set1_epi32(31);
  971|   117k|            const __m256i avx_f0 = _mm256_set1_epi32(0xF0);
  972|   117k|            const __m256i avx_1 = _mm256_set1_epi32(1);
  973|   117k|            const __m256i avx_0 = _mm256_setzero_si256();
  974|       |
  975|   250k|            for (ui32 x = 0; x <= width; x += 16, vp += 8, sp += 16, vp_32 += 8) {
  ------------------
  |  Branch (975:30): [True: 135k, False: 114k]
  ------------------
  976|   135k|              __m128i v = _mm_loadu_si128((__m128i*)vp);
  977|   135k|              __m128i v_p1 = _mm_loadu_si128((__m128i*)(vp + 1));
  978|   135k|              v = _mm_or_si128(v, v_p1);
  979|       |
  980|   135k|              __m256i v_avx = _mm256_cvtepu16_epi32(v);
  981|   135k|              v_avx = avx2_lzcnt_epi32(v_avx);
  982|   135k|              v_avx = _mm256_sub_epi32(avx_31, v_avx);
  983|       |
  984|   135k|              __m256i inf_u_q = _mm256_loadu_si256((__m256i*)sp);
  985|   135k|              __m256i gamma = _mm256_and_si256(inf_u_q, avx_f0);
  986|   135k|              __m256i w0 = _mm256_sub_epi32(gamma, avx_1);
  987|   135k|              gamma = _mm256_and_si256(gamma, w0);
  988|   135k|              gamma = _mm256_cmpeq_epi32(gamma, avx_0);
  989|       |
  990|   135k|              v_avx = _mm256_andnot_si256(gamma, v_avx);
  991|   135k|              v_avx = _mm256_max_epi32(v_avx, avx_1);
  992|       |
  993|   135k|              inf_u_q = _mm256_srli_epi32(inf_u_q, 16);
  994|   135k|              v_avx = _mm256_add_epi32(inf_u_q, v_avx);
  995|       |
  996|   135k|              w0 = _mm256_cmpgt_epi32(v_avx, avx_mmsbp2);
  997|   135k|              if (!_mm256_testz_si256(w0, w0)) {
  ------------------
  |  Branch (997:19): [True: 3.13k, False: 132k]
  ------------------
  998|  3.13k|                  return false;
  999|  3.13k|              }
 1000|       |
 1001|   132k|              _mm256_storeu_si256((__m256i*)vp_32, v_avx);
 1002|   132k|            }
 1003|   117k|          }
 1004|       |
 1005|   114k|          ui16 *vp = v_n_scratch;
 1006|   114k|          ui32* vp_32 = v_n_scratch_32;
 1007|   114k|          ui16 *sp = scratch + (y >> 1) * sstr;
 1008|   114k|          ui32 *dp = decoded_data + y * stride;
 1009|   114k|          vp[0] = 2; // for easy calculation of emax
 1010|       |
 1011|   261k|          for (ui32 x = 0; x < width; x += 8, sp += 8, vp += 4, dp += 8, vp_32 += 4) {
  ------------------
  |  Branch (1011:28): [True: 146k, False: 114k]
  ------------------
 1012|       |            ////process four quads
 1013|   146k|              __m128i inf_u_q = _mm_loadu_si128((__m128i*)sp);
 1014|   146k|              __m128i U_q = _mm_loadu_si128((__m128i*)vp_32);
 1015|       |
 1016|   146k|            __m128i vn = _mm_set1_epi16(2);
 1017|   146k|            __m256i row = decode_four_quad16(inf_u_q, U_q, dbuf, limit, pos, p, vn);
 1018|       |
 1019|   146k|            __m128i w = _mm_cvtsi32_si128(*(unsigned short const*)(vp));
 1020|   146k|            _mm_storeu_si128((__m128i*)vp, _mm_or_si128(w, vn));
 1021|       |
 1022|   146k|            __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|   146k|            __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|   146k|            _mm256_storeu_si256((__m256i*)dp, w0);
 1026|   146k|            _mm256_storeu_si256((__m256i*)(dp + stride), w1);
 1027|   146k|          }
 1028|   114k|        }
 1029|  17.1k|        return true;
 1030|  20.2k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL18decode_four_quad16EDv2_xS1_PKhjRjjRS1_:
  743|   180k|                               ui32 p, __m128i& vn) {
  744|       |
  745|   180k|        __m256i w0;     // workers
  746|   180k|        __m256i insig;  // lanes hold FF's if samples are insignificant
  747|   180k|        __m256i flags;  // lanes hold e_k, e_1, and rho
  748|       |
  749|   180k|        __m256i row = _mm256_setzero_si256();
  750|   180k|        __m128i ddd = _mm_shuffle_epi8(inf_u_q,
  751|   180k|            _mm_set_epi16(0x0d0c, 0x0d0c, 0x0908, 0x908, 0x0504, 0x0504, 0x0100, 0x0100));
  752|   180k|        w0 = _mm256_permutevar8x32_epi32(_mm256_castsi128_si256(ddd),
  753|   180k|            _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3));
  754|       |        // we keeps e_k, e_1, and rho in w2
  755|   180k|        flags = _mm256_and_si256(w0,
  756|   180k|            _mm256_set_epi16((si16)0x8880, 0x4440, 0x2220, 0x1110,
  757|   180k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110,
  758|   180k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110,
  759|   180k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110));
  760|   180k|        insig = _mm256_cmpeq_epi16(flags, _mm256_setzero_si256());
  761|   180k|        if ((uint32_t)_mm256_movemask_epi8(insig) != (uint32_t)0xFFFFFFFF) //are all insignificant?
  ------------------
  |  Branch (761:13): [True: 80.9k, False: 99.8k]
  ------------------
  762|  80.9k|        {
  763|  80.9k|            ddd = _mm_or_si128(_mm_bslli_si128(U_q, 2), U_q);
  764|  80.9k|            __m256i U_q_avx = _mm256_permutevar8x32_epi32(_mm256_castsi128_si256(ddd),
  765|  80.9k|                _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3));
  766|  80.9k|            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|  80.9k|            __m256i m_n;
  774|  80.9k|            w0 = _mm256_srli_epi16(flags, 15); // e_k
  775|  80.9k|            m_n = _mm256_sub_epi16(U_q_avx, w0);
  776|  80.9k|            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|  80.9k|            __m256i inc_sum = m_n; // inclusive scan
  781|  80.9k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 2));
  782|  80.9k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 4));
  783|  80.9k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 8));
  784|  80.9k|            ui32 total_mn1 = (ui32)_mm256_extract_epi16(inc_sum, 7);
  785|  80.9k|            ui32 total_mn2 = (ui32)_mm256_extract_epi16(inc_sum, 15);
  786|  80.9k|            __m256i ex_sum = _mm256_bslli_epi128(inc_sum, 2); // exclusive scan
  787|       |
  788|  80.9k|            __m128i ms_vec0 = dfetch(dbuf, limit, pos);
  789|  80.9k|            __m128i ms_vec1 = dfetch(dbuf, limit, pos + total_mn1);
  790|  80.9k|            pos += total_mn1 + total_mn2;
  791|       |
  792|  80.9k|            __m256i ms_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ms_vec0), ms_vec1, 0x1);
  793|       |
  794|       |            // find the starting byte and starting bit
  795|  80.9k|            __m256i byte_idx = _mm256_srli_epi16(ex_sum, 3);
  796|  80.9k|            __m256i bit_idx = _mm256_and_si256(ex_sum, _mm256_set1_epi16(7));
  797|  80.9k|            byte_idx = _mm256_shuffle_epi8(byte_idx,
  798|  80.9k|                _mm256_set_epi16(0x0E0E, 0x0C0C, 0x0A0A, 0x0808,
  799|  80.9k|                    0x0606, 0x0404, 0x0202, 0x0000, 0x0E0E, 0x0C0C, 0x0A0A, 0x0808,
  800|  80.9k|                    0x0606, 0x0404, 0x0202, 0x0000));
  801|  80.9k|            byte_idx = _mm256_add_epi16(byte_idx, _mm256_set1_epi16(0x0100));
  802|  80.9k|            __m256i d0 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  803|  80.9k|            byte_idx = _mm256_add_epi16(byte_idx, _mm256_set1_epi16(0x0101));
  804|  80.9k|            __m256i d1 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  805|       |
  806|       |            // shift samples values to correct location
  807|  80.9k|            __m256i bit_shift = _mm256_shuffle_epi8(
  808|  80.9k|                _mm256_set_epi8(1, 3, 7, 15, 31, 63, 127, -1,
  809|  80.9k|                    1, 3, 7, 15, 31, 63, 127, -1, 1, 3, 7, 15, 31, 63, 127, -1,
  810|  80.9k|                    1, 3, 7, 15, 31, 63, 127, -1), bit_idx);
  811|  80.9k|            bit_shift = _mm256_add_epi16(bit_shift, _mm256_set1_epi16(0x0101));
  812|  80.9k|            d0 = _mm256_mullo_epi16(d0, bit_shift);
  813|  80.9k|            d0 = _mm256_srli_epi16(d0, 8); // we should have 8 bits in the LSB
  814|  80.9k|            d1 = _mm256_mullo_epi16(d1, bit_shift);
  815|  80.9k|            d1 = _mm256_and_si256(d1, _mm256_set1_epi16((si16)0xFF00)); // 8 in MSB
  816|  80.9k|            d0 = _mm256_or_si256(d0, d1);
  817|       |
  818|       |            // find location of e_k and mask
  819|  80.9k|            __m256i shift;
  820|  80.9k|            __m256i ones = _mm256_set1_epi16(1);
  821|  80.9k|            __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|  80.9k|            __m256i kq = _mm256_sub_epi16(U_q_avx, ones);
  829|  80.9k|            __m256i idx = _mm256_or_si256(kq,
  830|  80.9k|                _mm256_slli_epi16(_mm256_sub_epi16(kq,
  831|  80.9k|                                            _mm256_set1_epi16(8)), 8));
  832|  80.9k|            const __m256i pow2_tbl = _mm256_setr_epi8(
  833|  80.9k|                1, 2, 4, 8, 16, 32, 64, (char)128, 0, 0, 0, 0, 0, 0, 0, 0,
  834|  80.9k|                1, 2, 4, 8, 16, 32, 64, (char)128, 0, 0, 0, 0, 0, 0, 0, 0);
  835|  80.9k|            __m256i pow2 = _mm256_shuffle_epi8(pow2_tbl, idx);
  836|  80.9k|            w0 = _mm256_sub_epi16(twos, w0);
  837|  80.9k|            shift = _mm256_mullo_epi16(w0, pow2);
  838|  80.9k|            ms_vec = _mm256_and_si256(d0, _mm256_sub_epi16(shift, ones));
  839|       |
  840|       |            // next e_1
  841|  80.9k|            w0 = _mm256_and_si256(flags, _mm256_set1_epi16(0x800));
  842|  80.9k|            w0 = _mm256_cmpeq_epi16(w0, _mm256_setzero_si256());
  843|  80.9k|            w0 = _mm256_andnot_si256(w0, shift);  // e_1 in correct position
  844|  80.9k|            ms_vec = _mm256_or_si256(ms_vec, w0); // e_1
  845|  80.9k|            w0 = _mm256_slli_epi16(ms_vec, 15);   // sign
  846|  80.9k|            ms_vec = _mm256_or_si256(ms_vec, ones); // bin center
  847|  80.9k|            __m256i tvn = ms_vec;
  848|  80.9k|            ms_vec = _mm256_add_epi16(ms_vec, twos);// + 2
  849|  80.9k|            ms_vec = _mm256_slli_epi16(ms_vec, (si32)p - 1);
  850|  80.9k|            ms_vec = _mm256_or_si256(ms_vec, w0); // sign
  851|  80.9k|            row = _mm256_andnot_si256(insig, ms_vec); // significant only
  852|       |
  853|  80.9k|            ms_vec = _mm256_andnot_si256(insig, tvn); // significant only
  854|       |
  855|  80.9k|            __m256i ms_vec_shuffle1 = _mm256_shuffle_epi8(ms_vec,
  856|  80.9k|                _mm256_set_epi16(-1, -1, -1, -1, 0x0706, 0x0302, -1, -1,
  857|  80.9k|                                 -1, -1, -1, -1, -1, -1, 0x0706, 0x0302));
  858|  80.9k|            __m256i ms_vec_shuffle2 = _mm256_shuffle_epi8(ms_vec,
  859|  80.9k|                _mm256_set_epi16(-1, -1, -1, 0x0F0E, 0x0B0A, -1, -1, -1,
  860|  80.9k|                                 -1, -1, -1, -1, -1, 0x0F0E, 0x0B0A, -1));
  861|  80.9k|            ms_vec = _mm256_or_si256(ms_vec_shuffle1, ms_vec_shuffle2);
  862|       |
  863|  80.9k|            vn = _mm_or_si128(vn, _mm256_castsi256_si128(ms_vec));
  864|       |            vn = _mm_or_si128(vn, _mm256_extracti128_si256(ms_vec, 0x1));
  865|  80.9k|        }
  866|   180k|        return row;
  867|   180k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL17decode_cb_spp_mrpEPtPjPhjjjjjjjjb:
 1172|  14.8k|    {
 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.8k|        ui16* const sigma = scratch;
 1178|       |
 1179|  14.8k|        ui32 mstr = (width + 3u) >> 2;   // divide by 4, since each
 1180|       |                                         // ui16 contains 4 columns
 1181|  14.8k|        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.8k|        {
 1187|  14.8k|          ui32 y;
 1188|       |
 1189|  14.8k|          const __m128i mask_3 = _mm_set1_epi32(0x30);
 1190|  14.8k|          const __m128i mask_C = _mm_set1_epi32(0xC0);
 1191|  14.8k|          const __m128i shuffle_mask = _mm_set_epi32(-1, -1, -1, 0x0C080400);
 1192|  74.1k|          for (y = 0; y < height; y += 4)
  ------------------
  |  Branch (1192:23): [True: 59.2k, False: 14.8k]
  ------------------
 1193|  59.2k|          {
 1194|  59.2k|            ui16* sp = scratch + (y >> 1) * sstr;
 1195|  59.2k|            ui16* dp = sigma + (y >> 2) * mstr;
 1196|   138k|            for (ui32 x = 0; x < width; x += 8, sp += 8, dp += 2)
  ------------------
  |  Branch (1196:30): [True: 79.1k, False: 59.2k]
  ------------------
 1197|  79.1k|            {
 1198|  79.1k|              __m128i s0, s1, u3, uC, t0, t1;
 1199|       |
 1200|  79.1k|              s0 = _mm_loadu_si128((__m128i*)(sp));
 1201|  79.1k|              u3 = _mm_and_si128(s0, mask_3);
 1202|  79.1k|              u3 = _mm_srli_epi32(u3, 4);
 1203|  79.1k|              uC = _mm_and_si128(s0, mask_C);
 1204|  79.1k|              uC = _mm_srli_epi32(uC, 2);
 1205|  79.1k|              t0 = _mm_or_si128(u3, uC);
 1206|       |
 1207|  79.1k|              s1 = _mm_loadu_si128((__m128i*)(sp + sstr));
 1208|  79.1k|              u3 = _mm_and_si128(s1, mask_3);
 1209|  79.1k|              u3 = _mm_srli_epi32(u3, 2);
 1210|  79.1k|              uC = _mm_and_si128(s1, mask_C);
 1211|  79.1k|              t1 = _mm_or_si128(u3, uC);
 1212|       |
 1213|  79.1k|              __m128i r = _mm_or_si128(t0, t1);
 1214|  79.1k|              r = _mm_shuffle_epi8(r, shuffle_mask);
 1215|       |
 1216|  79.1k|              ui32 t = (ui32)_mm_extract_epi32(r, 0);
 1217|  79.1k|              memcpy(dp, &t, 4);
 1218|  79.1k|            }
 1219|  59.2k|            dp[0] = 0; // set an extra entry on the right with 0
 1220|  59.2k|          }
 1221|  14.8k|          {
 1222|       |            // reset one row after the codeblock
 1223|  14.8k|            ui16* dp = sigma + (y >> 2) * mstr;
 1224|  14.8k|            __m128i zero = _mm_setzero_si128();
 1225|  30.9k|            for (ui32 x = 0; x < width; x += 32, dp += 8)
  ------------------
  |  Branch (1225:30): [True: 16.0k, False: 14.8k]
  ------------------
 1226|  16.0k|              _mm_storeu_si128((__m128i*)dp, zero);
 1227|  14.8k|            dp[0] = 0; // set an extra entry on the right with 0
 1228|  14.8k|          }
 1229|  14.8k|        }
 1230|       |
 1231|       |        // We perform Significance Propagation Pass here
 1232|  14.8k|        {
 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.8k|          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.8k|          const ui32 spp_cap = 4096 * 2 / 8;
 1247|  14.8k|          ui8 spp_buf[spp_cap + 72];
 1248|  14.8k|          ui32 spp_limit = destuff_frwd<0>(coded_data + lengths1,
 1249|  14.8k|                                           (int)lengths2, spp_buf, spp_cap);
 1250|  14.8k|          ui32 spp_pos = 0;
 1251|       |
 1252|  74.1k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1252:28): [True: 59.2k, False: 14.8k]
  ------------------
 1253|  59.2k|          {
 1254|  59.2k|            ui32 pattern = 0xFFFFu; // a pattern needed samples
 1255|  59.2k|            if (height - y < 4) {
  ------------------
  |  Branch (1255:17): [True: 8.94k, False: 50.3k]
  ------------------
 1256|  8.94k|              pattern = 0x7777u;
 1257|  8.94k|              if (height - y < 3) {
  ------------------
  |  Branch (1257:19): [True: 7.09k, False: 1.85k]
  ------------------
 1258|  7.09k|                pattern = 0x3333u;
 1259|  7.09k|                if (height - y < 2)
  ------------------
  |  Branch (1259:21): [True: 2.65k, False: 4.43k]
  ------------------
 1260|  2.65k|                  pattern = 0x1111u;
 1261|  7.09k|              }
 1262|  8.94k|            }
 1263|       |
 1264|       |            // prev holds sign. info. for the previous quad, together
 1265|       |            // with the rows on top of it and below it.
 1266|  59.2k|            ui32 prev = 0;
 1267|  59.2k|            ui16 *prev_sig = prev_row_sig;
 1268|  59.2k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1269|  59.2k|            ui32 *dpp = decoded_data + y * stride;
 1270|   179k|            for (ui32 x = 0; x < width; x += 4, dpp += 4, ++cur_sig, ++prev_sig)
  ------------------
  |  Branch (1270:30): [True: 119k, False: 59.2k]
  ------------------
 1271|   119k|            {
 1272|       |              // only rows and columns inside the stripe are included
 1273|   119k|              si32 s = (si32)x + 4 - (si32)width;
 1274|   119k|              s = ojph_max(s, 0);
  ------------------
  |  |   73|   119k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 38.5k, False: 81.4k]
  |  |  ------------------
  ------------------
 1275|   119k|              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|   119k|              ui32 ps, ns, cs;
 1290|   119k|              memcpy(&ps, prev_sig, 4);
 1291|   119k|              memcpy(&ns, cur_sig + mstr, 4);
 1292|   119k|              ui32 u = (ps & 0x88888888) >> 3; // the row on top
 1293|   119k|              if (!stripe_causal)
  ------------------
  |  Branch (1293:19): [True: 115k, False: 4.68k]
  ------------------
 1294|   115k|                u |= (ns & 0x11111111) << 3;   // the row below
 1295|       |
 1296|   119k|              memcpy(&cs, cur_sig, 4);
 1297|       |              // vertical integration
 1298|   119k|              ui32 mbr =  cs;                // this sig. info.
 1299|   119k|              mbr |= (cs & 0x77777777) << 1; //above neighbors
 1300|   119k|              mbr |= (cs & 0xEEEEEEEE) >> 1; //below neighbors
 1301|   119k|              mbr |= u;
 1302|       |              // horizontal integration
 1303|   119k|              ui32 t = mbr;
 1304|   119k|              mbr |= t << 4;      // neighbors on the left
 1305|   119k|              mbr |= t >> 4;      // neighbors on the right
 1306|   119k|              mbr |= prev >> 12;  // significance of previous group
 1307|       |
 1308|       |              // remove outside samples, and already significant samples
 1309|   119k|              mbr &= pattern;
 1310|   119k|              mbr &= ~cs;
 1311|       |
 1312|       |              // find samples that become significant during the SPP
 1313|   119k|              ui32 new_sig = mbr;
 1314|   119k|              if (new_sig)
  ------------------
  |  Branch (1314:19): [True: 76.8k, False: 43.1k]
  ------------------
 1315|  76.8k|              {
 1316|  76.8k|                ui64 cwd = dfetch64(spp_buf, spp_limit, spp_pos);
 1317|       |
 1318|  76.8k|                ui32 cnt = 0;
 1319|  76.8k|                ui32 col_mask = 0xFu;
 1320|  76.8k|                ui32 inv_sig = ~cs & pattern;
 1321|   384k|                for (int i = 0; i < 16; i += 4, col_mask <<= 4)
  ------------------
  |  Branch (1321:33): [True: 307k, False: 76.8k]
  ------------------
 1322|   307k|                {
 1323|   307k|                  if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1323:23): [True: 97.5k, False: 209k]
  ------------------
 1324|  97.5k|                    continue;
 1325|       |
 1326|       |                  //scan one column
 1327|   209k|                  ui32 sample_mask = 0x1111u & col_mask;
 1328|   209k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1328:23): [True: 127k, False: 81.9k]
  ------------------
 1329|   127k|                  {
 1330|   127k|                    new_sig &= ~sample_mask;
 1331|   127k|                    if (cwd & 1)
  ------------------
  |  Branch (1331:25): [True: 28.3k, False: 99.6k]
  ------------------
 1332|  28.3k|                    {
 1333|  28.3k|                      ui32 t = 0x33u << i;
 1334|  28.3k|                      new_sig |= t & inv_sig;
 1335|  28.3k|                    }
 1336|   127k|                    cwd >>= 1; ++cnt;
 1337|   127k|                  }
 1338|       |
 1339|   209k|                  sample_mask <<= 1;
 1340|   209k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1340:23): [True: 140k, False: 69.5k]
  ------------------
 1341|   140k|                  {
 1342|   140k|                    new_sig &= ~sample_mask;
 1343|   140k|                    if (cwd & 1)
  ------------------
  |  Branch (1343:25): [True: 26.9k, False: 113k]
  ------------------
 1344|  26.9k|                    {
 1345|  26.9k|                      ui32 t = 0x76u << i;
 1346|  26.9k|                      new_sig |= t & inv_sig;
 1347|  26.9k|                    }
 1348|   140k|                    cwd >>= 1; ++cnt;
 1349|   140k|                  }
 1350|       |
 1351|   209k|                  sample_mask <<= 1;
 1352|   209k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1352:23): [True: 99.7k, False: 110k]
  ------------------
 1353|  99.7k|                  {
 1354|  99.7k|                    new_sig &= ~sample_mask;
 1355|  99.7k|                    if (cwd & 1)
  ------------------
  |  Branch (1355:25): [True: 23.8k, False: 75.9k]
  ------------------
 1356|  23.8k|                    {
 1357|  23.8k|                      ui32 t = 0xECu << i;
 1358|  23.8k|                      new_sig |= t & inv_sig;
 1359|  23.8k|                    }
 1360|  99.7k|                    cwd >>= 1; ++cnt;
 1361|  99.7k|                  }
 1362|       |
 1363|   209k|                  sample_mask <<= 1;
 1364|   209k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1364:23): [True: 129k, False: 80.3k]
  ------------------
 1365|   129k|                  {
 1366|   129k|                    new_sig &= ~sample_mask;
 1367|   129k|                    if (cwd & 1)
  ------------------
  |  Branch (1367:25): [True: 29.5k, False: 100k]
  ------------------
 1368|  29.5k|                    {
 1369|  29.5k|                      ui32 t = 0xC8u << i;
 1370|  29.5k|                      new_sig |= t & inv_sig;
 1371|  29.5k|                    }
 1372|   129k|                    cwd >>= 1; ++cnt;
 1373|   129k|                  }
 1374|   209k|                }
 1375|       |
 1376|  76.8k|                if (new_sig)
  ------------------
  |  Branch (1376:21): [True: 30.7k, False: 46.1k]
  ------------------
 1377|  30.7k|                {
 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|  30.7k|                  __m128i new_sig_vec = _mm_set1_epi16((si16)new_sig);
 1384|  30.7k|                  new_sig_vec = _mm_shuffle_epi8(new_sig_vec,
 1385|  30.7k|                    _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1386|  30.7k|                  new_sig_vec = _mm_and_si128(new_sig_vec,
 1387|  30.7k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1388|  30.7k|                  new_sig_vec = _mm_cmpeq_epi8(new_sig_vec,
 1389|  30.7k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1390|       |
 1391|       |                  // find cumulative sums
 1392|       |                  // to find which bit in cwd we should extract
 1393|  30.7k|                  __m128i inc_sum = new_sig_vec; // inclusive scan
 1394|  30.7k|                  inc_sum = _mm_abs_epi8(inc_sum); // cvrt to 0 or 1
 1395|  30.7k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 1));
 1396|  30.7k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 2));
 1397|  30.7k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 4));
 1398|  30.7k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 8));
 1399|  30.7k|                  cnt += (ui32)_mm_extract_epi16(inc_sum, 7) >> 8;
 1400|       |                  // exclusive scan
 1401|  30.7k|                  __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|  30.7k|                  __m128i cwd_vec = _mm_set1_epi16((si16)cwd);
 1406|  30.7k|                  cwd_vec = _mm_shuffle_epi8(cwd_vec,
 1407|  30.7k|                    _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1408|  30.7k|                  cwd_vec = _mm_and_si128(cwd_vec,
 1409|  30.7k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1410|  30.7k|                  cwd_vec = _mm_cmpeq_epi8(cwd_vec,
 1411|  30.7k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1412|  30.7k|                  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|  30.7k|                  __m128i v = _mm_shuffle_epi8(cwd_vec, ex_sum);
 1417|       |
 1418|       |                  // load data and set spp coefficients
 1419|  30.7k|                  __m128i m =
 1420|  30.7k|                    _mm_set_epi8(-1,-1,-1,12,-1,-1,-1,8,-1,-1,-1,4,-1,-1,-1,0);
 1421|  30.7k|                  __m128i val = _mm_set1_epi32(3 << (p - 2));
 1422|  30.7k|                  ui32 *dp = dpp;
 1423|   153k|                  for (int c = 0; c < 4; ++ c) {
  ------------------
  |  Branch (1423:35): [True: 122k, False: 30.7k]
  ------------------
 1424|   122k|                    __m128i s0, s0_ns, s0_val;
 1425|       |                    // load coefficients
 1426|   122k|                    s0 = _mm_load_si128((__m128i*)dp);
 1427|       |
 1428|       |                    // epi32 is -1 only for coefficient that
 1429|       |                    // are changed during the SPP
 1430|   122k|                    s0_ns = _mm_shuffle_epi8(new_sig_vec, m);
 1431|   122k|                    s0_ns = _mm_cmpeq_epi32(s0_ns, _mm_set1_epi32(0xFF));
 1432|       |
 1433|       |                    // obtain sign for coefficients in SPP
 1434|   122k|                    s0_val = _mm_shuffle_epi8(v, m);
 1435|   122k|                    s0_val = _mm_slli_epi32(s0_val, 31);
 1436|   122k|                    s0_val = _mm_or_si128(s0_val, val);
 1437|   122k|                    s0_val = _mm_and_si128(s0_val, s0_ns);
 1438|       |
 1439|       |                    // update vector
 1440|   122k|                    s0 = _mm_or_si128(s0, s0_val);
 1441|       |                    // store coefficients
 1442|   122k|                    _mm_store_si128((__m128i*)dp, s0);
 1443|       |                    // prepare for next row
 1444|   122k|                    dp += stride;
 1445|   122k|                    m = _mm_add_epi32(m, _mm_set1_epi32(1));
 1446|   122k|                  }
 1447|  30.7k|                }
 1448|  76.8k|                spp_pos += cnt;
 1449|  76.8k|              }
 1450|       |
 1451|   119k|              new_sig |= cs;
 1452|   119k|              *prev_sig = (ui16)(new_sig);
 1453|       |
 1454|       |              // vertical integration for the new sig. info.
 1455|   119k|              t = new_sig;
 1456|   119k|              new_sig |= (t & 0x7777) << 1; //above neighbors
 1457|   119k|              new_sig |= (t & 0xEEEE) >> 1; //below neighbors
 1458|       |              // add sig. info. from the row on top and below
 1459|   119k|              prev = new_sig | u;
 1460|       |              // we need only the bits in 0xF000
 1461|   119k|              prev &= 0xF000;
 1462|   119k|            }
 1463|  59.2k|          }
 1464|  14.8k|        }
 1465|       |
 1466|       |        // We perform Magnitude Refinement Pass here
 1467|  14.8k|        if (num_passes > 2)
  ------------------
  |  Branch (1467:13): [True: 9.63k, False: 5.25k]
  ------------------
 1468|  9.63k|        {
 1469|       |          // de-stuff the MRP segment; consumption is at most 1 bit per
 1470|       |          // sample = 512 bytes, so 1024 bytes always suffice
 1471|  9.63k|          const ui32 mrp_cap = 1024;
 1472|  9.63k|          ui8 mrp_buf[mrp_cap + 72];
 1473|  9.63k|          ui32 mrp_limit = destuff_mrp(coded_data, (int)lengths1,
 1474|  9.63k|                                       (int)lengths2, mrp_buf, mrp_cap);
 1475|  9.63k|          ui32 mrp_pos = 0;
 1476|       |
 1477|  41.3k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1477:28): [True: 31.7k, False: 9.63k]
  ------------------
 1478|  31.7k|          {
 1479|  31.7k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1480|  31.7k|            ui32 *dpp = decoded_data + y * stride;
 1481|  91.0k|            for (ui32 i = 0; i < width; i += 4, dpp += 4)
  ------------------
  |  Branch (1481:30): [True: 59.3k, False: 31.7k]
  ------------------
 1482|  59.3k|            {
 1483|       |              //Process one entry from sigma array at a time
 1484|       |              // Each nibble (4 bits) in the sigma array represents 4 rows,
 1485|  59.3k|              ui64 cwd = dfetch64(mrp_buf, mrp_limit, mrp_pos);
 1486|  59.3k|              ui16 sig = *cur_sig++; // 16 bit that will be processed now
 1487|  59.3k|              int total_bits = 0;
 1488|  59.3k|              if (sig) // if any of the 32 bits are set
  ------------------
  |  Branch (1488:19): [True: 38.5k, False: 20.8k]
  ------------------
 1489|  38.5k|              {
 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|  38.5k|                __m128i sig_vec = _mm_set1_epi16((si16)sig);
 1495|  38.5k|                sig_vec = _mm_shuffle_epi8(sig_vec,
 1496|  38.5k|                  _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1497|  38.5k|                sig_vec = _mm_and_si128(sig_vec,
 1498|  38.5k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1499|  38.5k|                sig_vec = _mm_cmpeq_epi8(sig_vec,
 1500|  38.5k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1501|  38.5k|                sig_vec = _mm_abs_epi8(sig_vec);
 1502|       |
 1503|       |                // find cumulative sums
 1504|       |                // to find which bit in cwd we should extract
 1505|  38.5k|                __m128i inc_sum = sig_vec; // inclusive scan
 1506|  38.5k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 1));
 1507|  38.5k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 2));
 1508|  38.5k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 4));
 1509|  38.5k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 8));
 1510|  38.5k|                total_bits = _mm_extract_epi16(inc_sum, 7) >> 8;
 1511|  38.5k|                __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|  38.5k|                __m128i cwd_vec = _mm_set1_epi16((si16)cwd);
 1519|  38.5k|                cwd_vec = _mm_shuffle_epi8(cwd_vec,
 1520|  38.5k|                  _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1521|  38.5k|                cwd_vec = _mm_and_si128(cwd_vec,
 1522|  38.5k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1523|  38.5k|                cwd_vec = _mm_cmpeq_epi8(cwd_vec,
 1524|  38.5k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1525|  38.5k|                cwd_vec = _mm_add_epi8(cwd_vec, _mm_set1_epi8(1));
 1526|  38.5k|                cwd_vec = _mm_add_epi8(cwd_vec, cwd_vec);
 1527|  38.5k|                cwd_vec = _mm_or_si128(cwd_vec, _mm_set1_epi8(1));
 1528|       |
 1529|       |                // load data and insert the mrp bit
 1530|  38.5k|                __m128i m =
 1531|  38.5k|                  _mm_set_epi8(-1,-1,-1,12,-1,-1,-1,8,-1,-1,-1,4,-1,-1,-1,0);
 1532|  38.5k|                ui32 *dp = dpp;
 1533|   192k|                for (int c = 0; c < 4; ++c) {
  ------------------
  |  Branch (1533:33): [True: 154k, False: 38.5k]
  ------------------
 1534|   154k|                  __m128i s0, s0_sig, s0_idx, s0_val;
 1535|       |                  // load coefficients
 1536|   154k|                  s0 = _mm_load_si128((__m128i*)dp);
 1537|       |                  // find significant samples in this row
 1538|   154k|                  s0_sig = _mm_shuffle_epi8(sig_vec, m);
 1539|   154k|                  s0_sig = _mm_cmpeq_epi8(s0_sig, _mm_setzero_si128());
 1540|       |                  // get MRP bit index, and MRP pattern
 1541|   154k|                  s0_idx = _mm_shuffle_epi8(ex_sum, m);
 1542|   154k|                  s0_val = _mm_shuffle_epi8(cwd_vec, s0_idx);
 1543|       |                  // keep data from significant samples only
 1544|   154k|                  s0_val = _mm_andnot_si128(s0_sig, s0_val);
 1545|       |                  // move mrp bits to correct position, and employ
 1546|   154k|                  s0_val = _mm_slli_epi32(s0_val, (si32)p - 2);
 1547|   154k|                  s0 = _mm_xor_si128(s0, s0_val);
 1548|       |                  // store coefficients
 1549|   154k|                  _mm_store_si128((__m128i*)dp, s0);
 1550|       |                  // prepare for next row
 1551|   154k|                  dp += stride;
 1552|   154k|                  m = _mm_add_epi32(m, _mm_set1_epi32(1));
 1553|   154k|                }
 1554|  38.5k|              }
 1555|       |              // consume data according to the number of bits set
 1556|  59.3k|              mrp_pos += (ui32)total_bits;
 1557|  59.3k|            }
 1558|  31.7k|          }
 1559|  9.63k|        }
 1560|  14.8k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL12destuff_frwdILi0EEEjPKhiPhj:
  305|  14.8k|    {
  306|  14.8k|      if (size < 0)
  ------------------
  |  Branch (306:11): [True: 0, False: 14.8k]
  ------------------
  307|      0|        size = 0;
  308|  14.8k|      ui8* o = dst;
  309|  14.8k|      ui8* o_end = dst + cap;
  310|  14.8k|      const ui8* s = src;
  311|  14.8k|      const ui8* s_end = src + size;
  312|  14.8k|      ui64 acc = 0;       // partial output byte, low nb bits are valid
  313|  14.8k|      ui32 nb = 0;        // number of valid bits in acc; always < 8
  314|  14.8k|      bool prev_ff = false;
  315|       |
  316|       |      // fast path; 16 source bytes at a time when they contain no 0xFF
  317|  62.7k|      while (s + 16 <= s_end && o + 24 <= o_end)
  ------------------
  |  Branch (317:14): [True: 48.1k, False: 14.5k]
  |  Branch (317:33): [True: 47.8k, False: 292]
  ------------------
  318|  47.8k|      {
  319|  47.8k|        __m128i v = _mm_loadu_si128((const __m128i*)s);
  320|  47.8k|        int ff = _mm_movemask_epi8(_mm_cmpeq_epi8(v, _mm_set1_epi8(-1)));
  321|  47.8k|        if (ff != 0 || prev_ff)
  ------------------
  |  Branch (321:13): [True: 34.7k, False: 13.1k]
  |  Branch (321:24): [True: 986, False: 12.1k]
  ------------------
  322|  35.7k|        { // process these 16 bytes one at a time
  323|   607k|          for (int i = 0; i < 16; ++i) {
  ------------------
  |  Branch (323:27): [True: 571k, False: 35.7k]
  ------------------
  324|   571k|            ui8 b = *s++;
  325|   571k|            acc |= (ui64)b << nb;
  326|   571k|            nb += prev_ff ? 7u : 8u;
  ------------------
  |  Branch (326:19): [True: 184k, False: 387k]
  ------------------
  327|   571k|            prev_ff = (b == 0xFFu);
  328|   571k|            if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (328:17): [True: 544k, False: 27.1k]
  ------------------
  329|   571k|          }
  330|  35.7k|          continue;
  331|  35.7k|        }
  332|  12.1k|        ui64 v0, v1;
  333|  12.1k|        memcpy(&v0, s, 8);
  334|  12.1k|        memcpy(&v1, s + 8, 8);
  335|  12.1k|        ui64 w0 = acc | (v0 << nb);
  336|  12.1k|        ui64 w1 = (v1 << nb) | (nb ? (v0 >> (64 - nb)) : 0);
  ------------------
  |  Branch (336:33): [True: 7.73k, False: 4.41k]
  ------------------
  337|  12.1k|        memcpy(o, &w0, 8);
  338|  12.1k|        memcpy(o + 8, &w1, 8);
  339|  12.1k|        acc = nb ? (v1 >> (64 - nb)) : 0;
  ------------------
  |  Branch (339:15): [True: 7.73k, False: 4.41k]
  ------------------
  340|  12.1k|        o += 16;
  341|  12.1k|        s += 16;
  342|  12.1k|      }
  343|       |      // tail; one byte at a time
  344|   137k|      while (s < s_end && o < o_end)
  ------------------
  |  Branch (344:14): [True: 122k, False: 14.5k]
  |  Branch (344:27): [True: 122k, False: 292]
  ------------------
  345|   122k|      {
  346|   122k|        ui8 b = *s++;
  347|   122k|        acc |= (ui64)b << nb;
  348|   122k|        nb += prev_ff ? 7u : 8u;
  ------------------
  |  Branch (348:15): [True: 19.9k, False: 102k]
  ------------------
  349|   122k|        prev_ff = (b == 0xFFu);
  350|   122k|        if (nb >= 8) { *o++ = (ui8)acc; acc >>= 8; nb -= 8; }
  ------------------
  |  Branch (350:13): [True: 117k, False: 4.95k]
  ------------------
  351|   122k|      }
  352|       |      // fill the bits above nb with X, and pad with X bytes
  353|  14.8k|      ui32 fill = (X == 0xFF) ? (0xFFu << nb) : 0;
  ------------------
  |  Branch (353:19): [Folded, False: 14.8k]
  ------------------
  354|  14.8k|      *o = (ui8)((ui32)acc | fill);
  355|  14.8k|      __m256i pad = _mm256_set1_epi8((char)X);
  356|  14.8k|      _mm256_storeu_si256((__m256i*)(o + 1), pad);
  357|  14.8k|      _mm256_storeu_si256((__m256i*)(o + 33), pad);
  358|  14.8k|      return (ui32)(o - dst) + 1;
  359|  14.8k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8dfetch64EPKhjj:
  402|   136k|    {
  403|   136k|      ui32 off = pos >> 3;
  404|   136k|      off = off < limit ? off : limit;
  ------------------
  |  Branch (404:13): [True: 110k, False: 25.8k]
  ------------------
  405|   136k|      ui64 v;
  406|   136k|      memcpy(&v, dbuf + off, 8);
  407|   136k|      return v >> (pos & 7);
  408|   136k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11destuff_mrpEPKhiiPhj:
  615|  9.63k|    {
  616|  9.63k|      return destuff_rev(data + lcup + len2 - 1, len2, true, 0, 0,
  617|  9.63k|                         dst, cap);
  618|  9.63k|    }

_ZN4ojph5local31initialize_block_encoder_tablesEv:
  258|  5.45M|    bool initialize_block_encoder_tables() {
  259|  5.45M|      static bool tables_initialized = false;
  260|  5.45M|      static std::once_flag tables_initialized_flag;
  261|  5.45M|      std::call_once(tables_initialized_flag, []() {
  262|  5.45M|        memset(vlc_tbl0, 0, 2048 * sizeof(ui16));
  263|  5.45M|        memset(vlc_tbl1, 0, 2048 * sizeof(ui16));
  264|  5.45M|        tables_initialized = vlc_init_tables();
  265|  5.45M|        tables_initialized = tables_initialized && uvlc_init_tables();
  266|  5.45M|      });
  267|  5.45M|      return tables_initialized;
  268|  5.45M|    }
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.45M|    bool initialize_block_encoder_tables_avx2() {
  287|  5.45M|      static bool tables_initialized = false;
  288|  5.45M|      static std::once_flag tables_initialized_flag;
  289|  5.45M|      std::call_once(tables_initialized_flag, []() {
  290|  5.45M|        memset(vlc_tbl0, 0, 2048 * sizeof(ui32));
  291|  5.45M|        memset(vlc_tbl1, 0, 2048 * sizeof(ui32));
  292|  5.45M|        tables_initialized = vlc_init_tables();
  293|  5.45M|        tables_initialized = tables_initialized && uvlc_init_tables();
  294|  5.45M|        uvlc_init_pair_tables();
  295|  5.45M|      });
  296|  5.45M|      return tables_initialized;
  297|  5.45M|    }
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|   102k|  {
  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|   102k|  }
ojph_codestream_local.cpp:_ZN4ojphL16swap_bytes_if_leEt:
  416|  44.1k|  {
  417|  44.1k|    if (is_machine_little_endian)
  ------------------
  |  Branch (417:9): [True: 44.1k, Folded]
  ------------------
  418|  44.1k|      return (ui16)((t << 8) | (t >> 8));
  419|      0|    else
  420|      0|      return t;
  421|  44.1k|  }
_ZN4ojph17calc_aligned_sizeINS_5local4tileELj8EEEmm:
  361|  11.2k|  size_t calc_aligned_size(size_t size) {
  362|  11.2k|    size = size * sizeof(T) + N - 1;
  363|  11.2k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  11.2k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  11.2k|    return size;
  366|  11.2k|  }
ojph_codestream_local.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  68.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|  68.5k|  }
_ZN4ojph17calc_aligned_sizeINS_8line_bufELj8EEEmm:
  361|  5.71M|  size_t calc_aligned_size(size_t size) {
  362|  5.71M|    size = size * sizeof(T) + N - 1;
  363|  5.71M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  5.71M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  5.71M|    return size;
  366|  5.71M|  }
_ZN4ojph17calc_aligned_sizeINS_4sizeELj8EEEmm:
  361|  21.7k|  size_t calc_aligned_size(size_t size) {
  362|  21.7k|    size = size * sizeof(T) + N - 1;
  363|  21.7k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  21.7k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  21.7k|    return size;
  366|  21.7k|  }
_ZN4ojph17calc_aligned_sizeIiLj64EEEmm:
  361|  11.0M|  size_t calc_aligned_size(size_t size) {
  362|  11.0M|    size = size * sizeof(T) + N - 1;
  363|  11.0M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  11.0M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  11.0M|    return size;
  366|  11.0M|  }
_ZN4ojph17calc_aligned_sizeIhLj8EEEmm:
  361|   994k|  size_t calc_aligned_size(size_t size) {
  362|   994k|    size = size * sizeof(T) + N - 1;
  363|   994k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|   994k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|   994k|    return size;
  366|   994k|  }
_ZN4ojph9align_ptrIhLj8EEEPT_S2_:
  371|   479k|  inline T *align_ptr(T *ptr) {
  372|   479k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|   479k|    p += N - 1;
  374|   479k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|   479k|    return reinterpret_cast<T *>(p);
  376|   479k|  }
_ZN4ojph9align_ptrINS_5local4tileELj8EEEPT_S4_:
  371|  5.46k|  inline T *align_ptr(T *ptr) {
  372|  5.46k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  5.46k|    p += N - 1;
  374|  5.46k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  5.46k|    return reinterpret_cast<T *>(p);
  376|  5.46k|  }
_ZN4ojph9align_ptrINS_8line_bufELj8EEEPT_S3_:
  371|  2.75M|  inline T *align_ptr(T *ptr) {
  372|  2.75M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  2.75M|    p += N - 1;
  374|  2.75M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  2.75M|    return reinterpret_cast<T *>(p);
  376|  2.75M|  }
_ZN4ojph9align_ptrINS_4sizeELj8EEEPT_S3_:
  371|  10.8k|  inline T *align_ptr(T *ptr) {
  372|  10.8k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  10.8k|    p += N - 1;
  374|  10.8k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  10.8k|    return reinterpret_cast<T *>(p);
  376|  10.8k|  }
_ZN4ojph9align_ptrIiLj64EEEPT_S2_:
  371|  5.24M|  inline T *align_ptr(T *ptr) {
  372|  5.24M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  5.24M|    p += N - 1;
  374|  5.24M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  5.24M|    return reinterpret_cast<T *>(p);
  376|  5.24M|  }
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.48M|  {
  417|  2.48M|    if (is_machine_little_endian)
  ------------------
  |  Branch (417:9): [True: 2.48M, Folded]
  ------------------
  418|  2.48M|      return (ui16)((t << 8) | (t >> 8));
  419|      0|    else
  420|      0|      return t;
  421|  2.48M|  }
ojph_params.cpp:_ZN4ojphL16swap_bytes_if_leEj:
  439|   272k|  {
  440|   272k|    if (is_machine_little_endian)
  ------------------
  |  Branch (440:9): [True: 272k, Folded]
  ------------------
  441|   272k|    {
  442|   272k|      ui32 u = swap_bytes_if_le((ui16)(t & 0xFFFFu));
  443|   272k|      u <<= 16;
  444|   272k|      u |= swap_bytes_if_le((ui16)(t >> 16));
  445|   272k|      return u;
  446|   272k|    }
  447|      0|    else
  448|      0|      return t;
  449|   272k|  }
ojph_params.cpp:_ZN4ojphL16population_countEj:
  187|    497|  {
  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|    497|  }
ojph_params.cpp:_ZN4ojphL16swap_bytes_if_leEm:
  453|    272|  {
  454|    272|    if (is_machine_little_endian)
  ------------------
  |  Branch (454:9): [True: 272, Folded]
  ------------------
  455|    272|    {
  456|    272|      ui64 u =
  457|    272|        swap_bytes_if_le((ui32)(t & 0xFFFFFFFFu));
  458|    272|      u <<= 32;
  459|    272|      u |= swap_bytes_if_le((ui32)(t >> 32));
  460|    272|      return u;
  461|    272|    }
  462|      0|    else
  463|      0|      return t;
  464|    272|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|  13.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|  13.1M|  }
_ZN4ojph17calc_aligned_sizeINS_5local9tile_compELj8EEEmm:
  361|   984k|  size_t calc_aligned_size(size_t size) {
  362|   984k|    size = size * sizeof(T) + N - 1;
  363|   984k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|   984k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|   984k|    return size;
  366|   984k|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  8.89M|  {
  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|  8.89M|  }
_ZN4ojph17calc_aligned_sizeINS_4rectELj8EEEmm:
  361|  1.96M|  size_t calc_aligned_size(size_t size) {
  362|  1.96M|    size = size * sizeof(T) + N - 1;
  363|  1.96M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  1.96M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  1.96M|    return size;
  366|  1.96M|  }
_ZN4ojph17calc_aligned_sizeIjLj8EEEmm:
  361|  2.95M|  size_t calc_aligned_size(size_t size) {
  362|  2.95M|    size = size * sizeof(T) + N - 1;
  363|  2.95M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  2.95M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  2.95M|    return size;
  366|  2.95M|  }
_ZN4ojph17calc_aligned_sizeIbLj8EEEmm:
  361|  1.96M|  size_t calc_aligned_size(size_t size) {
  362|  1.96M|    size = size * sizeof(T) + N - 1;
  363|  1.96M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  1.96M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  1.96M|    return size;
  366|  1.96M|  }
_ZN4ojph17calc_aligned_sizeIfLj64EEEmm:
  361|  9.50M|  size_t calc_aligned_size(size_t size) {
  362|  9.50M|    size = size * sizeof(T) + N - 1;
  363|  9.50M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  9.50M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  9.50M|    return size;
  366|  9.50M|  }
_ZN4ojph9align_ptrINS_5local9tile_compELj8EEEPT_S4_:
  371|   474k|  inline T *align_ptr(T *ptr) {
  372|   474k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|   474k|    p += N - 1;
  374|   474k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|   474k|    return reinterpret_cast<T *>(p);
  376|   474k|  }
_ZN4ojph9align_ptrINS_4rectELj8EEEPT_S3_:
  371|   948k|  inline T *align_ptr(T *ptr) {
  372|   948k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|   948k|    p += N - 1;
  374|   948k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|   948k|    return reinterpret_cast<T *>(p);
  376|   948k|  }
_ZN4ojph9align_ptrIjLj8EEEPT_S2_:
  371|  1.42M|  inline T *align_ptr(T *ptr) {
  372|  1.42M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  1.42M|    p += N - 1;
  374|  1.42M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  1.42M|    return reinterpret_cast<T *>(p);
  376|  1.42M|  }
_ZN4ojph9align_ptrIbLj8EEEPT_S2_:
  371|   948k|  inline T *align_ptr(T *ptr) {
  372|   948k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|   948k|    p += N - 1;
  374|   948k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|   948k|    return reinterpret_cast<T *>(p);
  376|   948k|  }
_ZN4ojph9align_ptrIfLj64EEEPT_S2_:
  371|  4.71M|  inline T *align_ptr(T *ptr) {
  372|  4.71M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  4.71M|    p += N - 1;
  374|  4.71M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  4.71M|    return reinterpret_cast<T *>(p);
  376|  4.71M|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|  1.54M|  {
  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|  1.54M|  }
_ZN4ojph17calc_aligned_sizeINS_5local10resolutionELj8EEEmm:
  361|  6.13M|  size_t calc_aligned_size(size_t size) {
  362|  6.13M|    size = size * sizeof(T) + N - 1;
  363|  6.13M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  6.13M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  6.13M|    return size;
  366|  6.13M|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  1.04M|  {
  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|  1.04M|  }
_ZN4ojph9align_ptrINS_5local10resolutionELj8EEEPT_S4_:
  371|  2.95M|  inline T *align_ptr(T *ptr) {
  372|  2.95M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  2.95M|    p += N - 1;
  374|  2.95M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  2.95M|    return reinterpret_cast<T *>(p);
  376|  2.95M|  }
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|  62.5M|  {
  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|  62.5M|  }
_ZN4ojph17calc_aligned_sizeINS_5local7subbandELj8EEEmm:
  361|  6.13M|  size_t calc_aligned_size(size_t size) {
  362|  6.13M|    size = size * sizeof(T) + N - 1;
  363|  6.13M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  6.13M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  6.13M|    return size;
  366|  6.13M|  }
ojph_resolution.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  42.1M|  {
  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|  42.1M|  }
_ZN4ojph17calc_aligned_sizeINS_5local8precinctELj8EEEmm:
  361|  1.80M|  size_t calc_aligned_size(size_t size) {
  362|  1.80M|    size = size * sizeof(T) + N - 1;
  363|  1.80M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  1.80M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  1.80M|    return size;
  366|  1.80M|  }
_ZN4ojph17calc_aligned_sizeINS_11lifting_bufELj8EEEmm:
  361|  4.35M|  size_t calc_aligned_size(size_t size) {
  362|  4.35M|    size = size * sizeof(T) + N - 1;
  363|  4.35M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  4.35M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  4.35M|    return size;
  366|  4.35M|  }
_ZN4ojph17calc_aligned_sizeIlLj64EEEmm:
  361|  1.21M|  size_t calc_aligned_size(size_t size) {
  362|  1.21M|    size = size * sizeof(T) + N - 1;
  363|  1.21M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  1.21M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  1.21M|    return size;
  366|  1.21M|  }
_ZN4ojph9align_ptrINS_5local7subbandELj8EEEPT_S4_:
  371|  2.95M|  inline T *align_ptr(T *ptr) {
  372|  2.95M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  2.95M|    p += N - 1;
  374|  2.95M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  2.95M|    return reinterpret_cast<T *>(p);
  376|  2.95M|  }
_ZN4ojph9align_ptrINS_5local8precinctELj8EEEPT_S4_:
  371|   869k|  inline T *align_ptr(T *ptr) {
  372|   869k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|   869k|    p += N - 1;
  374|   869k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|   869k|    return reinterpret_cast<T *>(p);
  376|   869k|  }
_ZN4ojph9align_ptrINS_11lifting_bufELj8EEEPT_S3_:
  371|  2.10M|  inline T *align_ptr(T *ptr) {
  372|  2.10M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  2.10M|    p += N - 1;
  374|  2.10M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  2.10M|    return reinterpret_cast<T *>(p);
  376|  2.10M|  }
_ZN4ojph9align_ptrIlLj64EEEPT_S2_:
  371|   606k|  inline T *align_ptr(T *ptr) {
  372|   606k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|   606k|    p += N - 1;
  374|   606k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|   606k|    return reinterpret_cast<T *>(p);
  376|   606k|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|  7.92M|  {
  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|  7.92M|  }
_ZN4ojph17calc_aligned_sizeINS_5local9codeblockELj8EEEmm:
  361|  1.34M|  size_t calc_aligned_size(size_t size) {
  362|  1.34M|    size = size * sizeof(T) + N - 1;
  363|  1.34M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  1.34M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  1.34M|    return size;
  366|  1.34M|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  5.37M|  {
  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|  5.37M|  }
_ZN4ojph17calc_aligned_sizeINS_5local15coded_cb_headerELj8EEEmm:
  361|  1.34M|  size_t calc_aligned_size(size_t size) {
  362|  1.34M|    size = size * sizeof(T) + N - 1;
  363|  1.34M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  1.34M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  1.34M|    return size;
  366|  1.34M|  }
_ZN4ojph9align_ptrINS_5local9codeblockELj8EEEPT_S4_:
  371|   637k|  inline T *align_ptr(T *ptr) {
  372|   637k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|   637k|    p += N - 1;
  374|   637k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|   637k|    return reinterpret_cast<T *>(p);
  376|   637k|  }
_ZN4ojph9align_ptrINS_5local15coded_cb_headerELj8EEEPT_S4_:
  371|   637k|  inline T *align_ptr(T *ptr) {
  372|   637k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|   637k|    p += N - 1;
  374|   637k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|   637k|    return reinterpret_cast<T *>(p);
  376|   637k|  }
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|  16.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|  16.8M|  }
_ZN4ojph17calc_aligned_sizeIjLj64EEEmm:
  361|  6.91M|  size_t calc_aligned_size(size_t size) {
  362|  6.91M|    size = size * sizeof(T) + N - 1;
  363|  6.91M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  6.91M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  6.91M|    return size;
  366|  6.91M|  }
ojph_codeblock.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|  11.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|  11.4M|  }
_ZN4ojph17calc_aligned_sizeImLj64EEEmm:
  361|  4.49M|  size_t calc_aligned_size(size_t size) {
  362|  4.49M|    size = size * sizeof(T) + N - 1;
  363|  4.49M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  364|  4.49M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  365|  4.49M|    return size;
  366|  4.49M|  }
_ZN4ojph9align_ptrIjLj64EEEPT_S2_:
  371|  3.22M|  inline T *align_ptr(T *ptr) {
  372|  3.22M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  3.22M|    p += N - 1;
  374|  3.22M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  3.22M|    return reinterpret_cast<T *>(p);
  376|  3.22M|  }
_ZN4ojph9align_ptrImLj64EEEPT_S2_:
  371|  2.23M|  inline T *align_ptr(T *ptr) {
  372|  2.23M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  373|  2.23M|    p += N - 1;
  374|  2.23M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  375|  2.23M|    return reinterpret_cast<T *>(p);
  376|  2.23M|  }
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|   895k|  {
  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|   895k|  }
ojph_precinct.cpp:_ZN4ojphL16swap_bytes_if_leEt:
  416|  1.26k|  {
  417|  1.26k|    if (is_machine_little_endian)
  ------------------
  |  Branch (417:9): [True: 1.26k, Folded]
  ------------------
  418|  1.26k|      return (ui16)((t << 8) | (t >> 8));
  419|      0|    else
  420|      0|      return t;
  421|  1.26k|  }
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|  25.6k|  {
  472|  25.6k|    if (is_machine_little_endian) {
  ------------------
  |  Branch (472:9): [True: 25.6k, Folded]
  ------------------
  473|  25.6k|      ui32 val;
  474|  25.6k|      std::memcpy(&val, p, sizeof(val));
  475|  25.6k|      return val;
  476|  25.6k|    }
  477|      0|    else
  478|      0|      return (ui32)p[0] | ((ui32)p[1] << 8)
  479|      0|        | ((ui32)p[2] << 16) | ((ui32)p[3] << 24);
  480|  25.6k|  }
ojph_block_decoder64.cpp:_ZN4ojphL19count_leading_zerosEm:
  236|   301k|  {
  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|   301k|  }
ojph_block_decoder64.cpp:_ZN4ojphL14load_le_ui16x2EPKt:
  487|   352k|  {
  488|   352k|    if (is_machine_little_endian) {
  ------------------
  |  Branch (488:9): [True: 352k, Folded]
  ------------------
  489|   352k|      ui32 val;
  490|   352k|      std::memcpy(&val, p, sizeof(val));
  491|   352k|      return val;
  492|   352k|    }
  493|      0|    else
  494|      0|      return (ui32)p[0] | ((ui32)p[1] << 16);
  495|   352k|  }
ojph_block_decoder64.cpp:_ZN4ojphL16population_countEj:
  187|  37.9k|  {
  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|  37.9k|  }
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|   141M|    explicit size(ui32 w = 0, ui32 h = 0) : w(w), h(h) {}
_ZNK4ojph4size4areaEv:
   53|  8.48M|    ui64 area() const { return (ui64)w * (ui64)h; }
_ZN4ojph5pointC2Ejj:
   59|  97.9M|    explicit point(ui32 x = 0, ui32 y = 0) : x(x), y(y) {}
_ZNK4ojph4recteqERKS0_:
   69|  9.46k|    bool operator==(const rect& a) const {
   70|  9.46k|      return a.org.x == org.x && a.org.y == org.y
  ------------------
  |  Branch (70:14): [True: 9.34k, False: 122]
  |  Branch (70:34): [True: 9.30k, False: 35]
  ------------------
   71|  9.30k|        && a.siz.w == siz.w && a.siz.h == siz.h;
  ------------------
  |  Branch (71:12): [True: 9.27k, False: 36]
  |  Branch (71:32): [True: 9.24k, False: 23]
  ------------------
   72|  9.46k|    }
_ZNK4ojph4rectneERKS0_:
   75|  9.46k|    { return !(a == *this); }

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

_ZN4ojph19mem_fixed_allocatorC2Ev:
   62|  7.38k|    {
   63|       |      store = NULL; allocated_data = 0;
   64|  7.38k|      restart();
   65|  7.38k|    }
_ZN4ojph19mem_fixed_allocatorD2Ev:
   67|  7.38k|    {
   68|  7.38k|      if (store) free(store);
  ------------------
  |  Branch (68:11): [True: 5.46k, False: 1.91k]
  ------------------
   69|  7.38k|    }
_ZN4ojph19mem_fixed_allocator5allocEv:
   84|  5.46k|    {
   85|  5.46k|      assert(preallocation);
   86|  5.46k|      if (size_data + size_obj > allocated_data)
  ------------------
  |  Branch (86:11): [True: 5.46k, False: 0]
  ------------------
   87|  5.46k|      {
   88|       |        // We should be here once only, because, in subsequent, calls we
   89|       |        // should have size_data + size_obj <= allocated_data
   90|  5.46k|        free(store);
   91|  5.46k|        allocated_data = size_data + size_obj;
   92|  5.46k|        allocated_data = allocated_data + (allocated_data + 19) / 20; // 5%
   93|  5.46k|        store = malloc(allocated_data);
   94|  5.46k|        if (store == NULL)
  ------------------
  |  Branch (94:13): [True: 0, False: 5.46k]
  ------------------
   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|  5.46k|      }
   97|  5.46k|      avail_obj = store;
   98|  5.46k|      avail_data = (ui8*)store + size_obj;
   99|  5.46k|      avail_size_obj = size_obj;
  100|  5.46k|      avail_size_data = size_data;
  101|  5.46k|      preallocation = false;
  102|  5.46k|    }
_ZN4ojph19mem_fixed_allocator7restartEv:
  105|  14.7k|    {
  106|       |      avail_obj = avail_data = NULL;
  107|  14.7k|      avail_size_obj = avail_size_data = size_obj = size_data = 0;
  108|  14.7k|      preallocation = true;
  109|  14.7k|    }
_ZN4ojph11lifting_bufC2Ev:
  195|  9.90M|    lifting_buf() { line = NULL;  active = false; }
_ZN4ojph11coded_listsC2Ej:
  204|  94.6k|    {
  205|       |      next_list = NULL;
  206|  94.6k|      avail_size = buf_size = size;
  207|  94.6k|      this->buf = (ui8*)this + sizeof(coded_lists);
  208|  94.6k|    }
_ZN4ojph21mem_elastic_allocatorC2Ej:
  225|  7.38k|    : chunk_size(chunk_size)
  226|  7.38k|    { cur_store = store = avail = NULL; total_allocated = 0; }
_ZN4ojph21mem_elastic_allocatorD2Ev:
  229|  7.38k|    {
  230|  11.1k|      while (store) { // stores in use
  ------------------
  |  Branch (230:14): [True: 3.80k, False: 7.38k]
  ------------------
  231|  3.80k|        stores_list* t = store->next_store;
  232|  3.80k|        free(store);
  233|  3.80k|        store = t;
  234|  3.80k|      }
  235|  7.38k|      while (avail) { // available stores
  ------------------
  |  Branch (235:14): [True: 0, False: 7.38k]
  ------------------
  236|      0|        stores_list* t = avail->next_store;
  237|      0|        free(avail);
  238|      0|        avail = t;
  239|      0|      }
  240|  7.38k|    }
_ZN4ojph21mem_elastic_allocator11stores_list18stores_list_size16Ev:
  253|  7.60k|      {
  254|  7.60k|        return (ui32) ((sizeof (stores_list) + 15u) & ~15u);
  255|  7.60k|      }
_ZN4ojph21mem_elastic_allocator11stores_listC2Ej:
  257|  3.80k|      {
  258|       |        this->next_store = NULL;
  259|  3.80k|        this->orig_size = this->available = available_bytes;
  260|  3.80k|        this->orig_data = this->data = (ui8*)this + stores_list_size16();
  261|  3.80k|      }
_ZN4ojph21mem_elastic_allocator11stores_list16eval_store_bytesEj:
  269|  3.80k|      { // calculates how many bytes need to be allocated
  270|  3.80k|        return available_bytes + stores_list_size16();
  271|  3.80k|      }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local4tileEEEvm:
   79|  5.73k|    {
   80|  5.73k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  5.73k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local4tileELi8EEEvmjRm:
  128|  5.73k|    {
  129|  5.73k|      assert(preallocation);
  130|  5.73k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  5.73k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  5.73k|      total += 2*N - 1;
  133|       |
  134|  5.73k|      sz += total;
  135|  5.73k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_8line_bufEEEvm:
   79|  2.96M|    {
   80|  2.96M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  2.96M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_8line_bufELi8EEEvmjRm:
  128|  2.96M|    {
  129|  2.96M|      assert(preallocation);
  130|  2.96M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  2.96M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  2.96M|      total += 2*N - 1;
  133|       |
  134|  2.96M|      sz += total;
  135|  2.96M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_4sizeEEEvm:
   79|  10.9k|    {
   80|  10.9k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  10.9k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_4sizeELi8EEEvmjRm:
  128|  10.9k|    {
  129|  10.9k|      assert(preallocation);
  130|  10.9k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  10.9k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  10.9k|      total += 2*N - 1;
  133|       |
  134|  10.9k|      sz += total;
  135|  10.9k|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIiEEvmj:
   73|  5.84M|    {
   74|  5.84M|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|  5.84M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIiLi64EEEvmjRm:
  128|  5.84M|    {
  129|  5.84M|      assert(preallocation);
  130|  5.84M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  5.84M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  5.84M|      total += 2*N - 1;
  133|       |
  134|  5.84M|      sz += total;
  135|  5.84M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objIhEEvm:
   79|   515k|    {
   80|   515k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   515k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIhLi8EEEvmjRm:
  128|   515k|    {
  129|   515k|      assert(preallocation);
  130|   515k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   515k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   515k|      total += 2*N - 1;
  133|       |
  134|   515k|      sz += total;
  135|   515k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objIhEEPT_m:
  120|   479k|    {
  121|   479k|      return post_alloc_local<T, object_alignment>
  122|   479k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   479k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIhLi8EEEPT_mjRmRPv:
  140|   479k|    {
  141|   479k|      assert(!preallocation);
  142|   479k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   479k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   479k|      total += 2*N - 1;
  145|       |
  146|   479k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   479k|      avail_p = (ui8*)avail_p + total;
  148|   479k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   479k|      return p;
  151|   479k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local4tileEEEPT_m:
  120|  5.46k|    {
  121|  5.46k|      return post_alloc_local<T, object_alignment>
  122|  5.46k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  5.46k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local4tileELi8EEEPT_mjRmRPv:
  140|  5.46k|    {
  141|  5.46k|      assert(!preallocation);
  142|  5.46k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  5.46k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  5.46k|      total += 2*N - 1;
  145|       |
  146|  5.46k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  5.46k|      avail_p = (ui8*)avail_p + total;
  148|  5.46k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  5.46k|      return p;
  151|  5.46k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_8line_bufEEEPT_m:
  120|  2.75M|    {
  121|  2.75M|      return post_alloc_local<T, object_alignment>
  122|  2.75M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  2.75M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_8line_bufELi8EEEPT_mjRmRPv:
  140|  2.75M|    {
  141|  2.75M|      assert(!preallocation);
  142|  2.75M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  2.75M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  2.75M|      total += 2*N - 1;
  145|       |
  146|  2.75M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  2.75M|      avail_p = (ui8*)avail_p + total;
  148|  2.75M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  2.75M|      return p;
  151|  2.75M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_4sizeEEEPT_m:
  120|  10.8k|    {
  121|  10.8k|      return post_alloc_local<T, object_alignment>
  122|  10.8k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  10.8k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_4sizeELi8EEEPT_mjRmRPv:
  140|  10.8k|    {
  141|  10.8k|      assert(!preallocation);
  142|  10.8k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  10.8k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  10.8k|      total += 2*N - 1;
  145|       |
  146|  10.8k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  10.8k|      avail_p = (ui8*)avail_p + total;
  148|  10.8k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  10.8k|      return p;
  151|  10.8k|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIiEEPT_mj:
  113|  5.24M|    {
  114|  5.24M|      return post_alloc_local<T, byte_alignment>
  115|  5.24M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  5.24M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIiLi64EEEPT_mjRmRPv:
  140|  5.24M|    {
  141|  5.24M|      assert(!preallocation);
  142|  5.24M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  5.24M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  5.24M|      total += 2*N - 1;
  145|       |
  146|  5.24M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  5.24M|      avail_p = (ui8*)avail_p + total;
  148|  5.24M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  5.24M|      return p;
  151|  5.24M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local9tile_compEEEvm:
   79|   509k|    {
   80|   509k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   509k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local9tile_compELi8EEEvmjRm:
  128|   509k|    {
  129|   509k|      assert(preallocation);
  130|   509k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   509k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   509k|      total += 2*N - 1;
  133|       |
  134|   509k|      sz += total;
  135|   509k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_4rectEEEvm:
   79|  1.01M|    {
   80|  1.01M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  1.01M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_4rectELi8EEEvmjRm:
  128|  1.01M|    {
  129|  1.01M|      assert(preallocation);
  130|  1.01M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.01M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.01M|      total += 2*N - 1;
  133|       |
  134|  1.01M|      sz += total;
  135|  1.01M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objIjEEvm:
   79|  1.52M|    {
   80|  1.52M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  1.52M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIjLi8EEEvmjRm:
  128|  1.52M|    {
  129|  1.52M|      assert(preallocation);
  130|  1.52M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.52M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.52M|      total += 2*N - 1;
  133|       |
  134|  1.52M|      sz += total;
  135|  1.52M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objIbEEvm:
   79|  1.01M|    {
   80|  1.01M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  1.01M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIbLi8EEEvmjRm:
  128|  1.01M|    {
  129|  1.01M|      assert(preallocation);
  130|  1.01M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.01M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.01M|      total += 2*N - 1;
  133|       |
  134|  1.01M|      sz += total;
  135|  1.01M|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIfEEvmj:
   73|  4.79M|    {
   74|  4.79M|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|  4.79M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIfLi64EEEvmjRm:
  128|  4.79M|    {
  129|  4.79M|      assert(preallocation);
  130|  4.79M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  4.79M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  4.79M|      total += 2*N - 1;
  133|       |
  134|  4.79M|      sz += total;
  135|  4.79M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local9tile_compEEEPT_m:
  120|   474k|    {
  121|   474k|      return post_alloc_local<T, object_alignment>
  122|   474k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   474k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local9tile_compELi8EEEPT_mjRmRPv:
  140|   474k|    {
  141|   474k|      assert(!preallocation);
  142|   474k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   474k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   474k|      total += 2*N - 1;
  145|       |
  146|   474k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   474k|      avail_p = (ui8*)avail_p + total;
  148|   474k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   474k|      return p;
  151|   474k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_4rectEEEPT_m:
  120|   948k|    {
  121|   948k|      return post_alloc_local<T, object_alignment>
  122|   948k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   948k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_4rectELi8EEEPT_mjRmRPv:
  140|   948k|    {
  141|   948k|      assert(!preallocation);
  142|   948k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   948k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   948k|      total += 2*N - 1;
  145|       |
  146|   948k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   948k|      avail_p = (ui8*)avail_p + total;
  148|   948k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   948k|      return p;
  151|   948k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objIjEEPT_m:
  120|  1.42M|    {
  121|  1.42M|      return post_alloc_local<T, object_alignment>
  122|  1.42M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  1.42M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIjLi8EEEPT_mjRmRPv:
  140|  1.42M|    {
  141|  1.42M|      assert(!preallocation);
  142|  1.42M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  1.42M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  1.42M|      total += 2*N - 1;
  145|       |
  146|  1.42M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  1.42M|      avail_p = (ui8*)avail_p + total;
  148|  1.42M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  1.42M|      return p;
  151|  1.42M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objIbEEPT_m:
  120|   948k|    {
  121|   948k|      return post_alloc_local<T, object_alignment>
  122|   948k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   948k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIbLi8EEEPT_mjRmRPv:
  140|   948k|    {
  141|   948k|      assert(!preallocation);
  142|   948k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   948k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   948k|      total += 2*N - 1;
  145|       |
  146|   948k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   948k|      avail_p = (ui8*)avail_p + total;
  148|   948k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   948k|      return p;
  151|   948k|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIfEEPT_mj:
  113|  4.71M|    {
  114|  4.71M|      return post_alloc_local<T, byte_alignment>
  115|  4.71M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  4.71M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIfLi64EEEPT_mjRmRPv:
  140|  4.71M|    {
  141|  4.71M|      assert(!preallocation);
  142|  4.71M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  4.71M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  4.71M|      total += 2*N - 1;
  145|       |
  146|  4.71M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  4.71M|      avail_p = (ui8*)avail_p + total;
  148|  4.71M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  4.71M|      return p;
  151|  4.71M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local10resolutionEEEvm:
   79|  3.17M|    {
   80|  3.17M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  3.17M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local10resolutionELi8EEEvmjRm:
  128|  3.17M|    {
  129|  3.17M|      assert(preallocation);
  130|  3.17M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  3.17M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  3.17M|      total += 2*N - 1;
  133|       |
  134|  3.17M|      sz += total;
  135|  3.17M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local10resolutionEEEPT_m:
  120|  2.95M|    {
  121|  2.95M|      return post_alloc_local<T, object_alignment>
  122|  2.95M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  2.95M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local10resolutionELi8EEEPT_mjRmRPv:
  140|  2.95M|    {
  141|  2.95M|      assert(!preallocation);
  142|  2.95M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  2.95M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  2.95M|      total += 2*N - 1;
  145|       |
  146|  2.95M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  2.95M|      avail_p = (ui8*)avail_p + total;
  148|  2.95M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  2.95M|      return p;
  151|  2.95M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local7subbandEEEvm:
   79|  3.17M|    {
   80|  3.17M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  3.17M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local7subbandELi8EEEvmjRm:
  128|  3.17M|    {
  129|  3.17M|      assert(preallocation);
  130|  3.17M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  3.17M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  3.17M|      total += 2*N - 1;
  133|       |
  134|  3.17M|      sz += total;
  135|  3.17M|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local8precinctEEEvm:
   79|   936k|    {
   80|   936k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   936k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local8precinctELi8EEEvmjRm:
  128|   936k|    {
  129|   936k|      assert(preallocation);
  130|   936k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   936k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   936k|      total += 2*N - 1;
  133|       |
  134|   936k|      sz += total;
  135|   936k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_11lifting_bufEEEvm:
   79|  2.25M|    {
   80|  2.25M|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  2.25M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_11lifting_bufELi8EEEvmjRm:
  128|  2.25M|    {
  129|  2.25M|      assert(preallocation);
  130|  2.25M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  2.25M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  2.25M|      total += 2*N - 1;
  133|       |
  134|  2.25M|      sz += total;
  135|  2.25M|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIlEEvmj:
   73|   608k|    {
   74|   608k|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|   608k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIlLi64EEEvmjRm:
  128|   608k|    {
  129|   608k|      assert(preallocation);
  130|   608k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   608k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   608k|      total += 2*N - 1;
  133|       |
  134|   608k|      sz += total;
  135|   608k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local7subbandEEEPT_m:
  120|  2.95M|    {
  121|  2.95M|      return post_alloc_local<T, object_alignment>
  122|  2.95M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  2.95M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local7subbandELi8EEEPT_mjRmRPv:
  140|  2.95M|    {
  141|  2.95M|      assert(!preallocation);
  142|  2.95M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  2.95M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  2.95M|      total += 2*N - 1;
  145|       |
  146|  2.95M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  2.95M|      avail_p = (ui8*)avail_p + total;
  148|  2.95M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  2.95M|      return p;
  151|  2.95M|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local8precinctEEEPT_m:
  120|   869k|    {
  121|   869k|      return post_alloc_local<T, object_alignment>
  122|   869k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   869k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local8precinctELi8EEEPT_mjRmRPv:
  140|   869k|    {
  141|   869k|      assert(!preallocation);
  142|   869k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   869k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   869k|      total += 2*N - 1;
  145|       |
  146|   869k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   869k|      avail_p = (ui8*)avail_p + total;
  148|   869k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   869k|      return p;
  151|   869k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_11lifting_bufEEEPT_m:
  120|  2.10M|    {
  121|  2.10M|      return post_alloc_local<T, object_alignment>
  122|  2.10M|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  2.10M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_11lifting_bufELi8EEEPT_mjRmRPv:
  140|  2.10M|    {
  141|  2.10M|      assert(!preallocation);
  142|  2.10M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  2.10M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  2.10M|      total += 2*N - 1;
  145|       |
  146|  2.10M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  2.10M|      avail_p = (ui8*)avail_p + total;
  148|  2.10M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  2.10M|      return p;
  151|  2.10M|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIlEEPT_mj:
  113|   606k|    {
  114|   606k|      return post_alloc_local<T, byte_alignment>
  115|   606k|        (num_ele, pre_size, avail_size_data, avail_data);
  116|   606k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIlLi64EEEPT_mjRmRPv:
  140|   606k|    {
  141|   606k|      assert(!preallocation);
  142|   606k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   606k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   606k|      total += 2*N - 1;
  145|       |
  146|   606k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   606k|      avail_p = (ui8*)avail_p + total;
  148|   606k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   606k|      return p;
  151|   606k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local9codeblockEEEvm:
   79|   706k|    {
   80|   706k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   706k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local9codeblockELi8EEEvmjRm:
  128|   706k|    {
  129|   706k|      assert(preallocation);
  130|   706k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   706k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   706k|      total += 2*N - 1;
  133|       |
  134|   706k|      sz += total;
  135|   706k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local15coded_cb_headerEEEvm:
   79|   706k|    {
   80|   706k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   706k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local15coded_cb_headerELi8EEEvmjRm:
  128|   706k|    {
  129|   706k|      assert(preallocation);
  130|   706k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   706k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   706k|      total += 2*N - 1;
  133|       |
  134|   706k|      sz += total;
  135|   706k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local9codeblockEEEPT_m:
  120|   637k|    {
  121|   637k|      return post_alloc_local<T, object_alignment>
  122|   637k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   637k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local9codeblockELi8EEEPT_mjRmRPv:
  140|   637k|    {
  141|   637k|      assert(!preallocation);
  142|   637k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   637k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   637k|      total += 2*N - 1;
  145|       |
  146|   637k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   637k|      avail_p = (ui8*)avail_p + total;
  148|   637k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   637k|      return p;
  151|   637k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local15coded_cb_headerEEEPT_m:
  120|   637k|    {
  121|   637k|      return post_alloc_local<T, object_alignment>
  122|   637k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   637k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local15coded_cb_headerELi8EEEPT_mjRmRPv:
  140|   637k|    {
  141|   637k|      assert(!preallocation);
  142|   637k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   637k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   637k|      total += 2*N - 1;
  145|       |
  146|   637k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   637k|      avail_p = (ui8*)avail_p + total;
  148|   637k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   637k|      return p;
  151|   637k|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIjEEvmj:
   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_localIjLi64EEEvmjRm:
  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_allocator14pre_alloc_dataImEEvmj:
   73|  2.25M|    {
   74|  2.25M|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|  2.25M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localImLi64EEEvmjRm:
  128|  2.25M|    {
  129|  2.25M|      assert(preallocation);
  130|  2.25M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  2.25M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  2.25M|      total += 2*N - 1;
  133|       |
  134|  2.25M|      sz += total;
  135|  2.25M|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIjEEPT_mj:
  113|  3.22M|    {
  114|  3.22M|      return post_alloc_local<T, byte_alignment>
  115|  3.22M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  3.22M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIjLi64EEEPT_mjRmRPv:
  140|  3.22M|    {
  141|  3.22M|      assert(!preallocation);
  142|  3.22M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  3.22M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  3.22M|      total += 2*N - 1;
  145|       |
  146|  3.22M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  3.22M|      avail_p = (ui8*)avail_p + total;
  148|  3.22M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  3.22M|      return p;
  151|  3.22M|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataImEEPT_mj:
  113|  2.23M|    {
  114|  2.23M|      return post_alloc_local<T, byte_alignment>
  115|  2.23M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  2.23M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localImLi64EEEPT_mjRmRPv:
  140|  2.23M|    {
  141|  2.23M|      assert(!preallocation);
  142|  2.23M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  2.23M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  2.23M|      total += 2*N - 1;
  145|       |
  146|  2.23M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  2.23M|      avail_p = (ui8*)avail_p + total;
  148|  2.23M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  2.23M|      return p;
  151|  2.23M|    }

_ZN4ojph9param_sizC2EPNS_5local9param_sizE:
   71|  22.4k|    param_siz(local::param_siz *p) : state(p) {}
_ZN4ojph9param_codC2EPNS_5local9param_codE:
  122|   486k|    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|  32.7M|  {
  301|       |    assert(cpu_level_initialized);
  302|  32.7M|    return cpu_level;
  303|  32.7M|  }

_ZN4ojph10mem_infile4openEPKhm:
  338|  7.38k|  {
  339|       |    assert(this->data == NULL);
  340|  7.38k|    cur_ptr = this->data = data;
  341|  7.38k|    this->size = size;
  342|  7.38k|  }
_ZN4ojph10mem_infile4readEPvm:
  346|  92.8M|  {
  347|  92.8M|    std::ptrdiff_t bytes_left = (data + this->size) - cur_ptr;
  348|  92.8M|    if (bytes_left > 0)
  ------------------
  |  Branch (348:9): [True: 92.8M, False: 21.9k]
  ------------------
  349|  92.8M|    {
  350|  92.8M|      size_t bytes_to_read = ojph_min(size, (size_t)bytes_left);
  ------------------
  |  |   76|  92.8M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 92.7M, False: 27.3k]
  |  |  ------------------
  ------------------
  351|  92.8M|      memcpy(ptr, cur_ptr, bytes_to_read);
  352|  92.8M|      cur_ptr += bytes_to_read;
  353|  92.8M|      return bytes_to_read;
  354|  92.8M|    }
  355|  21.9k|    else
  356|  21.9k|      return 0;
  357|  92.8M|  }
_ZN4ojph10mem_infile4seekElNS_11infile_base4seekE:
  361|   331k|  {
  362|   331k|    int result = -1;
  363|   331k|    if (origin == OJPH_SEEK_SET)
  ------------------
  |  Branch (363:9): [True: 205k, False: 126k]
  ------------------
  364|   205k|    {
  365|   205k|      if (offset >= 0 && (size_t)offset <= size)
  ------------------
  |  Branch (365:11): [True: 205k, False: 0]
  |  Branch (365:26): [True: 196k, False: 8.97k]
  ------------------
  366|   196k|      {
  367|   196k|        cur_ptr = data + offset;
  368|   196k|        result = 0;
  369|   196k|      }
  370|   205k|    }
  371|   126k|    else if (origin == OJPH_SEEK_CUR)
  ------------------
  |  Branch (371:14): [True: 126k, False: 0]
  ------------------
  372|   126k|    {
  373|   126k|      si64 bytes_off = (si64)(cur_ptr - data) + offset;
  374|   126k|      if (bytes_off >= 0 && (size_t)bytes_off <= size)
  ------------------
  |  Branch (374:11): [True: 126k, False: 0]
  |  Branch (374:29): [True: 106k, False: 19.5k]
  ------------------
  375|   106k|      {
  376|   106k|        cur_ptr = data + bytes_off;
  377|   106k|        result = 0;
  378|   106k|      }
  379|   126k|    }
  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|   331k|    return result;
  392|   331k|  }

_ZN4ojph8line_buf4wrapIiEEvPT_mj:
   55|  5.24M|  {
   56|  5.24M|    this->i32 = buffer;
   57|  5.24M|    this->size = num_ele;
   58|  5.24M|    this->pre_size = pre_size;
   59|  5.24M|    this->flags = LFT_32BIT | LFT_INTEGER;
   60|  5.24M|  }
_ZN4ojph8line_buf4wrapIfEEvPT_mj:
   65|  4.71M|  {
   66|  4.71M|    this->f32 = buffer;
   67|  4.71M|    this->size = num_ele;
   68|  4.71M|    this->pre_size = pre_size;
   69|  4.71M|    this->flags = LFT_32BIT;
   70|  4.71M|  }
_ZN4ojph8line_buf4wrapIlEEvPT_mj:
   75|   606k|  {
   76|   606k|    this->i64 = buffer;
   77|   606k|    this->size = num_ele;
   78|   606k|    this->pre_size = pre_size;
   79|   606k|    this->flags = LFT_64BIT | LFT_INTEGER;
   80|   606k|  }
_ZN4ojph21mem_elastic_allocator8allocateEPPNS0_11stores_listEj:
   94|  3.80k|  {
   95|  3.80k|    ui32 bytes = ojph_max(extended_bytes, chunk_size);
  ------------------
  |  |   73|  3.80k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 0, False: 3.80k]
  |  |  ------------------
  ------------------
   96|  3.80k|    if (avail != NULL && avail->orig_size >= bytes)
  ------------------
  |  Branch (96:9): [True: 0, False: 3.80k]
  |  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.80k|    else
  104|  3.80k|    {
  105|  3.80k|      ui32 store_bytes = stores_list::eval_store_bytes(bytes);
  106|  3.80k|      *list = (stores_list*) malloc(store_bytes);
  107|  3.80k|      total_allocated += store_bytes;
  108|  3.80k|      return new (*list) stores_list(bytes);
  109|  3.80k|    }
  110|  3.80k|  }
_ZN4ojph21mem_elastic_allocator10get_bufferEjRPNS_11coded_listsE:
  114|  94.6k|  {
  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|  94.6k|    ui32 raw = needed_bytes + (ui32)sizeof (coded_lists);
  118|  94.6k|    ui32 extended_bytes = (raw + 15u) & ~15u;
  119|       |
  120|  94.6k|    if (store == NULL)
  ------------------
  |  Branch (120:9): [True: 3.39k, False: 91.2k]
  ------------------
  121|  3.39k|      cur_store = store = allocate(&store, extended_bytes);
  122|  91.2k|    else if (cur_store->available < extended_bytes)
  ------------------
  |  Branch (122:14): [True: 405, False: 90.8k]
  ------------------
  123|    405|      cur_store = allocate(&cur_store->next_store, extended_bytes);
  124|       |
  125|  94.6k|    p = new (cur_store->data) coded_lists(needed_bytes);
  126|       |
  127|       |    assert(cur_store->available >= extended_bytes);
  128|  94.6k|    cur_store->available -= extended_bytes;
  129|  94.6k|    cur_store->data += extended_bytes;
  130|  94.6k|  }
_ZN4ojph21mem_elastic_allocator7restartEv:
  134|  7.38k|  {
  135|       |    // move to the end of avail
  136|  7.38k|    stores_list** p = &avail;
  137|  7.38k|    while (*p != NULL)
  ------------------
  |  Branch (137:12): [True: 0, False: 7.38k]
  ------------------
  138|      0|      p = &((*p)->next_store);
  139|  7.38k|    *p = store;
  140|       |    cur_store = store = NULL;
  141|  7.38k|  }

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

_ZN4ojph5local31init_colour_transform_functionsEv:
  110|  7.38k|    {
  111|  7.38k|      static std::once_flag colour_transform_functions_init_flag;
  112|  7.38k|      std::call_once(colour_transform_functions_init_flag, []() {
  113|  7.38k|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  114|       |
  115|  7.38k|        rev_convert = gen_rev_convert;
  116|  7.38k|        rev_convert_nlt_type3 = gen_rev_convert_nlt_type3;
  117|  7.38k|        irv_convert_to_integer = gen_irv_convert_to_integer;
  118|  7.38k|        irv_convert_to_float = gen_irv_convert_to_float;
  119|  7.38k|        irv_convert_to_integer_nlt_type3 = gen_irv_convert_to_integer_nlt_type3;
  120|  7.38k|        irv_convert_to_float_nlt_type3 = gen_irv_convert_to_float_nlt_type3;
  121|  7.38k|        rct_forward = gen_rct_forward;
  122|  7.38k|        rct_backward = gen_rct_backward;
  123|  7.38k|        ict_forward = gen_ict_forward;
  124|  7.38k|        ict_backward = gen_ict_backward;
  125|       |
  126|  7.38k|  #ifndef OJPH_DISABLE_SIMD
  127|       |
  128|  7.38k|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  129|       |
  130|  7.38k|      #ifndef OJPH_DISABLE_SSE
  131|  7.38k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  132|  7.38k|        {
  133|  7.38k|          ict_forward = sse_ict_forward;
  134|  7.38k|          ict_backward = sse_ict_backward;
  135|  7.38k|        }
  136|  7.38k|      #endif // !OJPH_DISABLE_SSE
  137|       |
  138|  7.38k|      #ifndef OJPH_DISABLE_SSE2
  139|  7.38k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2)
  140|  7.38k|        {
  141|  7.38k|          rev_convert = sse2_rev_convert;
  142|  7.38k|          rev_convert_nlt_type3 = sse2_rev_convert_nlt_type3;
  143|  7.38k|          irv_convert_to_integer = sse2_irv_convert_to_integer;
  144|  7.38k|          irv_convert_to_float = sse2_irv_convert_to_float;
  145|  7.38k|          irv_convert_to_integer_nlt_type3 =
  146|  7.38k|            sse2_irv_convert_to_integer_nlt_type3;
  147|  7.38k|          irv_convert_to_float_nlt_type3 =
  148|  7.38k|            sse2_irv_convert_to_float_nlt_type3;
  149|  7.38k|          rct_forward = sse2_rct_forward;
  150|  7.38k|          rct_backward = sse2_rct_backward;
  151|  7.38k|        }
  152|  7.38k|      #endif // !OJPH_DISABLE_SSE2
  153|       |
  154|  7.38k|      #ifndef OJPH_DISABLE_AVX
  155|  7.38k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  156|  7.38k|        {
  157|  7.38k|          ict_forward = avx_ict_forward;
  158|  7.38k|          ict_backward = avx_ict_backward;
  159|  7.38k|        }
  160|  7.38k|      #endif // !OJPH_DISABLE_AVX
  161|       |
  162|  7.38k|      #ifndef OJPH_DISABLE_AVX2
  163|  7.38k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2)
  164|  7.38k|        {
  165|  7.38k|          rev_convert = avx2_rev_convert;
  166|  7.38k|          rev_convert_nlt_type3 = avx2_rev_convert_nlt_type3;
  167|  7.38k|          irv_convert_to_integer = avx2_irv_convert_to_integer;
  168|  7.38k|          irv_convert_to_float = avx2_irv_convert_to_float;
  169|  7.38k|          irv_convert_to_integer_nlt_type3 =
  170|  7.38k|            avx2_irv_convert_to_integer_nlt_type3;
  171|  7.38k|          irv_convert_to_float_nlt_type3 =
  172|  7.38k|            avx2_irv_convert_to_float_nlt_type3;
  173|  7.38k|          rct_forward = avx2_rct_forward;
  174|  7.38k|          rct_backward = avx2_rct_backward;
  175|  7.38k|        }
  176|  7.38k|      #endif // !OJPH_DISABLE_AVX2
  177|       |
  178|       |    #elif defined(OJPH_ARCH_ARM)
  179|       |
  180|       |    #elif defined(OJPH_ARCH_PPC64LE)
  181|       |
  182|       |        if (get_cpu_ext_level() >= PPC_CPU_EXT_LEVEL_ARCH_2_07)
  183|       |        {
  184|       |          // 128-bit VSX kernels; see ojph_simd_vsx.h
  185|       |          rev_convert = vsx_rev_convert;
  186|       |          rev_convert_nlt_type3 = vsx_rev_convert_nlt_type3;
  187|       |          irv_convert_to_integer = vsx_irv_convert_to_integer;
  188|       |          irv_convert_to_float = vsx_irv_convert_to_float;
  189|       |          irv_convert_to_integer_nlt_type3 =
  190|       |            vsx_irv_convert_to_integer_nlt_type3;
  191|       |          irv_convert_to_float_nlt_type3 =
  192|       |            vsx_irv_convert_to_float_nlt_type3;
  193|       |          rct_forward = vsx_rct_forward;
  194|       |          rct_backward = vsx_rct_backward;
  195|       |          ict_forward = vsx_ict_forward;
  196|       |          ict_backward = vsx_ict_backward;
  197|       |        }
  198|       |
  199|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  200|       |
  201|  7.38k|  #endif // !OJPH_DISABLE_SIMD
  202|       |
  203|       |#else // OJPH_ENABLE_WASM_SIMD
  204|       |
  205|       |        rev_convert = wasm_rev_convert;
  206|       |        rev_convert_nlt_type3 = wasm_rev_convert_nlt_type3;
  207|       |        irv_convert_to_integer = wasm_irv_convert_to_integer;
  208|       |        irv_convert_to_float = wasm_irv_convert_to_float;
  209|       |        irv_convert_to_integer_nlt_type3 = wasm_irv_convert_to_integer_nlt_type3;
  210|       |        irv_convert_to_float_nlt_type3 = wasm_irv_convert_to_float_nlt_type3;
  211|       |        rct_forward = wasm_rct_forward;
  212|       |        rct_backward = wasm_rct_backward;
  213|       |        ict_forward = wasm_ict_forward;
  214|       |        ict_backward = wasm_ict_backward;
  215|       |
  216|       |#endif // !OJPH_ENABLE_WASM_SIMD
  217|  7.38k|      });
  218|  7.38k|    }
ojph_colour.cpp:_ZZN4ojph5local31init_colour_transform_functionsEvENK3$_0clEv:
  112|      1|      std::call_once(colour_transform_functions_init_flag, []() {
  113|      1|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  114|       |
  115|      1|        rev_convert = gen_rev_convert;
  116|      1|        rev_convert_nlt_type3 = gen_rev_convert_nlt_type3;
  117|      1|        irv_convert_to_integer = gen_irv_convert_to_integer;
  118|      1|        irv_convert_to_float = gen_irv_convert_to_float;
  119|      1|        irv_convert_to_integer_nlt_type3 = gen_irv_convert_to_integer_nlt_type3;
  120|      1|        irv_convert_to_float_nlt_type3 = gen_irv_convert_to_float_nlt_type3;
  121|      1|        rct_forward = gen_rct_forward;
  122|      1|        rct_backward = gen_rct_backward;
  123|      1|        ict_forward = gen_ict_forward;
  124|      1|        ict_backward = gen_ict_backward;
  125|       |
  126|      1|  #ifndef OJPH_DISABLE_SIMD
  127|       |
  128|      1|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  129|       |
  130|      1|      #ifndef OJPH_DISABLE_SSE
  131|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  ------------------
  |  Branch (131:13): [True: 1, False: 0]
  ------------------
  132|      1|        {
  133|      1|          ict_forward = sse_ict_forward;
  134|      1|          ict_backward = sse_ict_backward;
  135|      1|        }
  136|      1|      #endif // !OJPH_DISABLE_SSE
  137|       |
  138|      1|      #ifndef OJPH_DISABLE_SSE2
  139|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2)
  ------------------
  |  Branch (139:13): [True: 1, False: 0]
  ------------------
  140|      1|        {
  141|      1|          rev_convert = sse2_rev_convert;
  142|      1|          rev_convert_nlt_type3 = sse2_rev_convert_nlt_type3;
  143|      1|          irv_convert_to_integer = sse2_irv_convert_to_integer;
  144|      1|          irv_convert_to_float = sse2_irv_convert_to_float;
  145|      1|          irv_convert_to_integer_nlt_type3 =
  146|      1|            sse2_irv_convert_to_integer_nlt_type3;
  147|      1|          irv_convert_to_float_nlt_type3 =
  148|      1|            sse2_irv_convert_to_float_nlt_type3;
  149|      1|          rct_forward = sse2_rct_forward;
  150|      1|          rct_backward = sse2_rct_backward;
  151|      1|        }
  152|      1|      #endif // !OJPH_DISABLE_SSE2
  153|       |
  154|      1|      #ifndef OJPH_DISABLE_AVX
  155|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  ------------------
  |  Branch (155:13): [True: 1, False: 0]
  ------------------
  156|      1|        {
  157|      1|          ict_forward = avx_ict_forward;
  158|      1|          ict_backward = avx_ict_backward;
  159|      1|        }
  160|      1|      #endif // !OJPH_DISABLE_AVX
  161|       |
  162|      1|      #ifndef OJPH_DISABLE_AVX2
  163|      1|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2)
  ------------------
  |  Branch (163:13): [True: 1, False: 0]
  ------------------
  164|      1|        {
  165|      1|          rev_convert = avx2_rev_convert;
  166|      1|          rev_convert_nlt_type3 = avx2_rev_convert_nlt_type3;
  167|      1|          irv_convert_to_integer = avx2_irv_convert_to_integer;
  168|      1|          irv_convert_to_float = avx2_irv_convert_to_float;
  169|      1|          irv_convert_to_integer_nlt_type3 =
  170|      1|            avx2_irv_convert_to_integer_nlt_type3;
  171|      1|          irv_convert_to_float_nlt_type3 =
  172|      1|            avx2_irv_convert_to_float_nlt_type3;
  173|      1|          rct_forward = avx2_rct_forward;
  174|      1|          rct_backward = avx2_rct_backward;
  175|      1|        }
  176|      1|      #endif // !OJPH_DISABLE_AVX2
  177|       |
  178|       |    #elif defined(OJPH_ARCH_ARM)
  179|       |
  180|       |    #elif defined(OJPH_ARCH_PPC64LE)
  181|       |
  182|       |        if (get_cpu_ext_level() >= PPC_CPU_EXT_LEVEL_ARCH_2_07)
  183|       |        {
  184|       |          // 128-bit VSX kernels; see ojph_simd_vsx.h
  185|       |          rev_convert = vsx_rev_convert;
  186|       |          rev_convert_nlt_type3 = vsx_rev_convert_nlt_type3;
  187|       |          irv_convert_to_integer = vsx_irv_convert_to_integer;
  188|       |          irv_convert_to_float = vsx_irv_convert_to_float;
  189|       |          irv_convert_to_integer_nlt_type3 =
  190|       |            vsx_irv_convert_to_integer_nlt_type3;
  191|       |          irv_convert_to_float_nlt_type3 =
  192|       |            vsx_irv_convert_to_float_nlt_type3;
  193|       |          rct_forward = vsx_rct_forward;
  194|       |          rct_backward = vsx_rct_backward;
  195|       |          ict_forward = vsx_ict_forward;
  196|       |          ict_backward = vsx_ict_backward;
  197|       |        }
  198|       |
  199|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  200|       |
  201|      1|  #endif // !OJPH_DISABLE_SIMD
  202|       |
  203|       |#else // OJPH_ENABLE_WASM_SIMD
  204|       |
  205|       |        rev_convert = wasm_rev_convert;
  206|       |        rev_convert_nlt_type3 = wasm_rev_convert_nlt_type3;
  207|       |        irv_convert_to_integer = wasm_irv_convert_to_integer;
  208|       |        irv_convert_to_float = wasm_irv_convert_to_float;
  209|       |        irv_convert_to_integer_nlt_type3 = wasm_irv_convert_to_integer_nlt_type3;
  210|       |        irv_convert_to_float_nlt_type3 = wasm_irv_convert_to_float_nlt_type3;
  211|       |        rct_forward = wasm_rct_forward;
  212|       |        rct_backward = wasm_rct_backward;
  213|       |        ict_forward = wasm_ict_forward;
  214|       |        ict_backward = wasm_ict_backward;
  215|       |
  216|       |#endif // !OJPH_ENABLE_WASM_SIMD
  217|      1|      });

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

_ZN4ojph5local16avx2_rev_convertEPKNS_8line_bufEjPS1_jlj:
   72|  1.77M|    {
   73|  1.77M|      if (src_line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (73:11): [True: 1.39M, False: 378k]
  ------------------
   74|  1.39M|      {
   75|  1.39M|        if (dst_line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (75:13): [True: 1.39M, False: 0]
  ------------------
   76|  1.39M|        {
   77|  1.39M|          const si32 *sp = src_line->i32 + src_line_offset;
   78|  1.39M|          si32 *dp = dst_line->i32 + dst_line_offset;
   79|  1.39M|          __m256i sh = _mm256_set1_epi32((si32)shift);
   80|  11.0M|          for (int i = (width + 7) >> 3; i > 0; --i, sp+=8, dp+=8)
  ------------------
  |  Branch (80:42): [True: 9.68M, False: 1.39M]
  ------------------
   81|  9.68M|          {
   82|  9.68M|            __m256i s = _mm256_loadu_si256((__m256i*)sp);
   83|  9.68M|            s = _mm256_add_epi32(s, sh);
   84|  9.68M|            _mm256_storeu_si256((__m256i*)dp, s);
   85|  9.68M|          }
   86|  1.39M|        }
   87|      0|        else
   88|      0|        {
   89|      0|          const si32 *sp = src_line->i32 + src_line_offset;
   90|      0|          si64 *dp = dst_line->i64 + dst_line_offset;
   91|      0|          __m256i sh = _mm256_set1_epi64x(shift);
   92|      0|          for (int i = (width + 7) >> 3; i > 0; --i, sp+=8, dp+=8)
  ------------------
  |  Branch (92:42): [True: 0, False: 0]
  ------------------
   93|      0|          {
   94|      0|            __m256i s, t;
   95|      0|            s = _mm256_loadu_si256((__m256i*)sp);
   96|       |
   97|      0|            t = _mm256_cvtepi32_epi64(_mm256_extracti128_si256(s, 0));
   98|      0|            t = _mm256_add_epi64(t, sh);
   99|      0|            _mm256_storeu_si256((__m256i*)dp, t);
  100|       |
  101|      0|            t = _mm256_cvtepi32_epi64(_mm256_extracti128_si256(s, 1));
  102|      0|            t = _mm256_add_epi64(t, sh);
  103|      0|            _mm256_storeu_si256((__m256i*)dp + 1, t);
  104|      0|          }
  105|      0|        }
  106|  1.39M|      }
  107|   378k|      else
  108|   378k|      {
  109|   378k|        assert(src_line->flags | line_buf::LFT_64BIT);
  110|   378k|        assert(dst_line->flags | line_buf::LFT_32BIT);
  111|   378k|        const si64 *sp = src_line->i64 + src_line_offset;
  112|   378k|        si32 *dp = dst_line->i32 + dst_line_offset;
  113|   378k|        __m256i low_bits = _mm256_set_epi64x(0, (si64)ULLONG_MAX,
  114|   378k|                                             0, (si64)ULLONG_MAX);
  115|   378k|        __m256i sh = _mm256_set1_epi64x(shift);
  116|  5.64M|        for (int i = (width + 7) >> 3; i > 0; --i, sp+=8, dp+=8)
  ------------------
  |  Branch (116:40): [True: 5.26M, False: 378k]
  ------------------
  117|  5.26M|        {
  118|  5.26M|          __m256i s, t;
  119|  5.26M|          s = _mm256_loadu_si256((__m256i*)sp);
  120|  5.26M|          s = _mm256_add_epi64(s, sh);
  121|       |
  122|  5.26M|          t = _mm256_shuffle_epi32(s, _MM_SHUFFLE(0, 0, 2, 0));
  123|  5.26M|          t = _mm256_and_si256(low_bits, t);
  124|       |
  125|  5.26M|          s = _mm256_loadu_si256((__m256i*)sp + 1);
  126|  5.26M|          s = _mm256_add_epi64(s, sh);
  127|       |
  128|  5.26M|          s = _mm256_shuffle_epi32(s, _MM_SHUFFLE(2, 0, 0, 0));
  129|  5.26M|          s = _mm256_andnot_si256(low_bits, s);
  130|       |
  131|  5.26M|          t = _mm256_or_si256(s, t);
  132|       |          t = _mm256_permute4x64_epi64(t, _MM_SHUFFLE(3, 1, 2, 0));
  133|  5.26M|          _mm256_storeu_si256((__m256i*)dp, t);
  134|  5.26M|        }
  135|   378k|      }
  136|  1.77M|    }
_ZN4ojph5local26avx2_rev_convert_nlt_type3EPKNS_8line_bufEjPS1_jlj:
  144|  27.1k|    {
  145|  27.1k|      if (src_line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (145:11): [True: 26.3k, False: 804]
  ------------------
  146|  26.3k|      {
  147|  26.3k|        if (dst_line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (147:13): [True: 26.3k, False: 0]
  ------------------
  148|  26.3k|        {
  149|  26.3k|          const si32 *sp = src_line->i32 + src_line_offset;
  150|  26.3k|          si32 *dp = dst_line->i32 + dst_line_offset;
  151|  26.3k|          __m256i sh = _mm256_set1_epi32((si32)(-shift));
  152|  26.3k|          __m256i zero = _mm256_setzero_si256();
  153|  56.9k|          for (int i = (width + 7) >> 3; i > 0; --i, sp += 8, dp += 8)
  ------------------
  |  Branch (153:42): [True: 30.5k, False: 26.3k]
  ------------------
  154|  30.5k|          {
  155|  30.5k|            __m256i s = _mm256_loadu_si256((__m256i*)sp);
  156|  30.5k|            __m256i c = _mm256_cmpgt_epi32(zero, s);  // 0xFFFFFFFF for -ve val
  157|  30.5k|            __m256i v_m_sh = _mm256_sub_epi32(sh, s); // - shift - value
  158|  30.5k|            v_m_sh = _mm256_and_si256(c, v_m_sh);     // keep only -shift-val
  159|  30.5k|            s = _mm256_andnot_si256(c, s);            // keep only +ve or 0
  160|  30.5k|            s = _mm256_or_si256(s, v_m_sh);           // combine
  161|  30.5k|            _mm256_storeu_si256((__m256i*)dp, s);
  162|  30.5k|          }
  163|  26.3k|        }
  164|      0|        else
  165|      0|        {
  166|      0|          const si32 *sp = src_line->i32 + src_line_offset;
  167|      0|          si64 *dp = dst_line->i64 + dst_line_offset;
  168|      0|          __m256i sh = _mm256_set1_epi64x(-shift);
  169|      0|          __m256i zero = _mm256_setzero_si256();
  170|      0|          for (int i = (width + 7) >> 3; i > 0; --i, sp += 8, dp += 8)
  ------------------
  |  Branch (170:42): [True: 0, False: 0]
  ------------------
  171|      0|          {
  172|      0|            __m256i s, t, u0, u1, c, v_m_sh;
  173|      0|            s = _mm256_loadu_si256((__m256i*)sp);
  174|       |
  175|      0|            t = _mm256_cmpgt_epi32(zero, s);      // find -ve 32bit -1
  176|      0|            u0 = _mm256_unpacklo_epi32(s, t);     // correct 64bit data
  177|      0|            c = _mm256_unpacklo_epi32(t, t);      // 64bit -1 for -ve value
  178|       |
  179|      0|            v_m_sh = _mm256_sub_epi64(sh, u0);    // - shift - value
  180|      0|            v_m_sh = _mm256_and_si256(c, v_m_sh); // keep only - shift - value
  181|      0|            u0 = _mm256_andnot_si256(c, u0);      // keep only +ve or 0
  182|      0|            u0 = _mm256_or_si256(u0, v_m_sh);     // combine
  183|       |
  184|      0|            u1 = _mm256_unpackhi_epi32(s, t);     // correct 64bit data
  185|      0|            c = _mm256_unpackhi_epi32(t, t);      // 64bit -1 for -ve value
  186|       |
  187|      0|            v_m_sh = _mm256_sub_epi64(sh, u1);    // - shift - value
  188|      0|            v_m_sh = _mm256_and_si256(c, v_m_sh); // keep only - shift - value
  189|      0|            u1 = _mm256_andnot_si256(c, u1);      // keep only +ve or 0
  190|      0|            u1 = _mm256_or_si256(u1, v_m_sh);     // combine
  191|       |
  192|      0|            t = _mm256_permute2x128_si256(u0, u1, (2 << 4) | 0);
  193|      0|            _mm256_storeu_si256((__m256i*)dp, t);
  194|       |
  195|      0|            t = _mm256_permute2x128_si256(u0, u1, (3 << 4) | 1);
  196|      0|            _mm256_storeu_si256((__m256i*)dp + 1, t);
  197|      0|          }
  198|      0|        }
  199|  26.3k|      }
  200|    804|      else
  201|    804|      {
  202|    804|        assert(src_line->flags | line_buf::LFT_64BIT);
  203|    804|        assert(dst_line->flags | line_buf::LFT_32BIT);
  204|    804|        const si64 *sp = src_line->i64 + src_line_offset;
  205|    804|        si32 *dp = dst_line->i32 + dst_line_offset;
  206|    804|        __m256i sh = _mm256_set1_epi64x(-shift);
  207|    804|        __m256i zero = _mm256_setzero_si256();
  208|    804|        __m256i half_mask = _mm256_set_epi64x(0, (si64)ULLONG_MAX,
  209|    804|                                              0, (si64)ULLONG_MAX);
  210|  38.0k|        for (int i = (width + 7) >> 3; i > 0; --i, sp += 8, dp += 8)
  ------------------
  |  Branch (210:40): [True: 37.2k, False: 804]
  ------------------
  211|  37.2k|        {
  212|       |          // s for source, t for target, p for positive, n for negative,
  213|       |          // m for mask, and tm for temp
  214|  37.2k|          __m256i s, t, p, n, m, tm;
  215|  37.2k|          s = _mm256_loadu_si256((__m256i*)sp);
  216|       |
  217|  37.2k|          m = _mm256_cmpgt_epi64(zero, s);    // 64b -1 for -ve value
  218|  37.2k|          tm = _mm256_sub_epi64(sh, s);       // - shift - value
  219|  37.2k|          n = _mm256_and_si256(m, tm);        // -ve
  220|  37.2k|          p = _mm256_andnot_si256(m, s);      // +ve
  221|  37.2k|          tm = _mm256_or_si256(n, p);
  222|  37.2k|          tm = _mm256_shuffle_epi32(tm, _MM_SHUFFLE(0, 0, 2, 0));
  223|  37.2k|          t = _mm256_and_si256(half_mask, tm);
  224|       |
  225|  37.2k|          s = _mm256_loadu_si256((__m256i*)sp + 1);
  226|  37.2k|          m = _mm256_cmpgt_epi64(zero, s);    // 64b -1 for -ve value
  227|  37.2k|          tm = _mm256_sub_epi64(sh, s);       // - shift - value
  228|  37.2k|          n = _mm256_and_si256(m, tm);        // -ve
  229|  37.2k|          p = _mm256_andnot_si256(m, s);      // +ve
  230|  37.2k|          tm = _mm256_or_si256(n, p);
  231|  37.2k|          tm = _mm256_shuffle_epi32(tm, _MM_SHUFFLE(2, 0, 0, 0));
  232|  37.2k|          tm = _mm256_andnot_si256(half_mask, tm);
  233|       |
  234|  37.2k|          t = _mm256_or_si256(t, tm);
  235|       |          t = _mm256_permute4x64_epi64(t, _MM_SHUFFLE(3, 1, 2, 0));
  236|  37.2k|           _mm256_storeu_si256((__m256i*)dp, t);
  237|  37.2k|        }
  238|    804|      }
  239|  27.1k|    }
_ZN4ojph5local27avx2_irv_convert_to_integerEPKNS_8line_bufEPS1_jjbj:
  336|   809k|    {
  337|   809k|      local_avx2_irv_convert_to_integer<false>(src_line, dst_line, 
  338|   809k|        dst_line_offset, bit_depth, is_signed, width);
  339|   809k|    }
_ZN4ojph5local37avx2_irv_convert_to_integer_nlt_type3EPKNS_8line_bufEPS1_jjbj:
  345|  24.7k|    {
  346|  24.7k|      local_avx2_irv_convert_to_integer<true>(src_line, dst_line, 
  347|  24.7k|        dst_line_offset, bit_depth, is_signed, width);
  348|  24.7k|    }
_ZN4ojph5local17avx2_rct_backwardEPKNS_8line_bufES3_S3_PS1_S4_S4_j:
  515|  5.75k|    {
  516|  5.75k|      assert((y->flags  & line_buf::LFT_INTEGER) &&
  517|  5.75k|             (cb->flags & line_buf::LFT_INTEGER) &&
  518|  5.75k|             (cr->flags & line_buf::LFT_INTEGER) &&
  519|  5.75k|             (r->flags  & line_buf::LFT_INTEGER) &&
  520|  5.75k|             (g->flags  & line_buf::LFT_INTEGER) &&
  521|  5.75k|             (b->flags  & line_buf::LFT_INTEGER));
  522|       |
  523|  5.75k|      if (y->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (523:11): [True: 4.63k, False: 1.12k]
  ------------------
  524|  4.63k|      {
  525|  4.63k|        assert((y->flags  & line_buf::LFT_32BIT) &&
  526|  4.63k|               (cb->flags & line_buf::LFT_32BIT) &&
  527|  4.63k|               (cr->flags & line_buf::LFT_32BIT) &&
  528|  4.63k|               (r->flags  & line_buf::LFT_32BIT) &&
  529|  4.63k|               (g->flags  & line_buf::LFT_32BIT) &&
  530|  4.63k|               (b->flags  & line_buf::LFT_32BIT));
  531|  4.63k|        const si32 *yp = y->i32, *cbp = cb->i32, *crp = cr->i32;
  532|  4.63k|        si32 *rp = r->i32, *gp = g->i32, *bp = b->i32;
  533|  12.2k|        for (int i = (repeat + 7) >> 3; i > 0; --i)
  ------------------
  |  Branch (533:41): [True: 7.62k, False: 4.63k]
  ------------------
  534|  7.62k|        {
  535|  7.62k|          __m256i my  = _mm256_load_si256((__m256i*)yp);
  536|  7.62k|          __m256i mcb = _mm256_load_si256((__m256i*)cbp);
  537|  7.62k|          __m256i mcr = _mm256_load_si256((__m256i*)crp);
  538|       |
  539|  7.62k|          __m256i t = _mm256_add_epi32(mcb, mcr);
  540|  7.62k|          t = _mm256_sub_epi32(my, _mm256_srai_epi32(t, 2));
  541|  7.62k|          _mm256_store_si256((__m256i*)gp, t);
  542|  7.62k|          __m256i u = _mm256_add_epi32(mcb, t);
  543|  7.62k|          _mm256_store_si256((__m256i*)bp, u);
  544|  7.62k|          u = _mm256_add_epi32(mcr, t);
  545|  7.62k|          _mm256_store_si256((__m256i*)rp, u);
  546|       |
  547|  7.62k|          yp += 8; cbp += 8; crp += 8;
  548|  7.62k|          rp += 8; gp += 8; bp += 8;
  549|  7.62k|        }
  550|  4.63k|      }
  551|  1.12k|      else
  552|  1.12k|      {
  553|  1.12k|        assert((y->flags  & line_buf::LFT_64BIT) &&
  554|  1.12k|               (cb->flags & line_buf::LFT_64BIT) &&
  555|  1.12k|               (cr->flags & line_buf::LFT_64BIT) &&
  556|  1.12k|               (r->flags  & line_buf::LFT_32BIT) &&
  557|  1.12k|               (g->flags  & line_buf::LFT_32BIT) &&
  558|  1.12k|               (b->flags  & line_buf::LFT_32BIT));
  559|  1.12k|        __m256i v2 = _mm256_set1_epi64x(1ULL << (63 - 2));
  560|  1.12k|        __m256i low_bits = _mm256_set_epi64x(0, (si64)ULLONG_MAX,
  561|  1.12k|                                             0, (si64)ULLONG_MAX);
  562|  1.12k|        const si64 *yp = y->i64, *cbp = cb->i64, *crp = cr->i64;
  563|  1.12k|        si32 *rp = r->i32, *gp = g->i32, *bp = b->i32;
  564|  3.34k|        for (int i = (repeat + 7) >> 3; i > 0; --i)
  ------------------
  |  Branch (564:41): [True: 2.21k, False: 1.12k]
  ------------------
  565|  2.21k|        {
  566|  2.21k|          __m256i my, mcb, mcr, tr, tg, tb;
  567|  2.21k|          my  = _mm256_load_si256((__m256i*)yp);
  568|  2.21k|          mcb = _mm256_load_si256((__m256i*)cbp);
  569|  2.21k|          mcr = _mm256_load_si256((__m256i*)crp);
  570|       |
  571|  2.21k|          tg = _mm256_add_epi64(mcb, mcr);
  572|  2.21k|          tg = _mm256_sub_epi64(my, avx2_mm256_srai_epi64(tg, 2, v2));
  573|  2.21k|          tb = _mm256_add_epi64(mcb, tg);
  574|  2.21k|          tr = _mm256_add_epi64(mcr, tg);
  575|       |
  576|  2.21k|          __m256i mr, mg, mb;
  577|  2.21k|          mr = _mm256_shuffle_epi32(tr, _MM_SHUFFLE(0, 0, 2, 0));
  578|  2.21k|          mr = _mm256_and_si256(low_bits, mr);
  579|  2.21k|          mg = _mm256_shuffle_epi32(tg, _MM_SHUFFLE(0, 0, 2, 0));
  580|  2.21k|          mg = _mm256_and_si256(low_bits, mg);
  581|  2.21k|          mb = _mm256_shuffle_epi32(tb, _MM_SHUFFLE(0, 0, 2, 0));
  582|  2.21k|          mb = _mm256_and_si256(low_bits, mb);
  583|       |
  584|  2.21k|          yp += 4; cbp += 4; crp += 4;
  585|       |
  586|  2.21k|          my  = _mm256_load_si256((__m256i*)yp);
  587|  2.21k|          mcb = _mm256_load_si256((__m256i*)cbp);
  588|  2.21k|          mcr = _mm256_load_si256((__m256i*)crp);
  589|       |
  590|  2.21k|          tg = _mm256_add_epi64(mcb, mcr);
  591|  2.21k|          tg = _mm256_sub_epi64(my, avx2_mm256_srai_epi64(tg, 2, v2));
  592|  2.21k|          tb = _mm256_add_epi64(mcb, tg);
  593|  2.21k|          tr = _mm256_add_epi64(mcr, tg);
  594|       |
  595|  2.21k|          tr = _mm256_shuffle_epi32(tr, _MM_SHUFFLE(2, 0, 0, 0));
  596|  2.21k|          tr = _mm256_andnot_si256(low_bits, tr);
  597|  2.21k|          mr = _mm256_or_si256(mr, tr);
  598|  2.21k|          mr = _mm256_permute4x64_epi64(mr, _MM_SHUFFLE(3, 1, 2, 0));
  599|       |
  600|  2.21k|          tg = _mm256_shuffle_epi32(tg, _MM_SHUFFLE(2, 0, 0, 0));
  601|  2.21k|          tg = _mm256_andnot_si256(low_bits, tg);
  602|  2.21k|          mg = _mm256_or_si256(mg, tg);
  603|  2.21k|          mg = _mm256_permute4x64_epi64(mg, _MM_SHUFFLE(3, 1, 2, 0));
  604|       |
  605|  2.21k|          tb = _mm256_shuffle_epi32(tb, _MM_SHUFFLE(2, 0, 0, 0));
  606|  2.21k|          tb = _mm256_andnot_si256(low_bits, tb);
  607|  2.21k|          mb = _mm256_or_si256(mb, tb);
  608|  2.21k|          mb = _mm256_permute4x64_epi64(mb, _MM_SHUFFLE(3, 1, 2, 0));
  609|       |
  610|  2.21k|          _mm256_store_si256((__m256i*)rp, mr);
  611|  2.21k|          _mm256_store_si256((__m256i*)gp, mg);
  612|  2.21k|          _mm256_store_si256((__m256i*)bp, mb);
  613|       |
  614|  2.21k|          yp += 4; cbp += 4; crp += 4;
  615|  2.21k|          rp += 8; gp += 8; bp += 8;
  616|  2.21k|        }
  617|  1.12k|      }
  618|  5.75k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL21avx2_mm256_srai_epi64EDv4_xiS1_:
   57|  4.43k|    {
   58|       |      // note than m must be obtained using
   59|       |      // __m256i m = _mm256_set1_epi64x(1ULL << (63 - amt));
   60|  4.43k|      __m256i x = _mm256_srli_epi64(a, amt);
   61|  4.43k|      x = _mm256_xor_si256(x, m);
   62|  4.43k|      __m256i result = _mm256_sub_epi64(x, m);
   63|  4.43k|      return result;
   64|  4.43k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL33local_avx2_irv_convert_to_integerILb0EEEvPKNS_8line_bufEPS2_jjbj:
  273|   809k|    {
  274|   809k|      assert((src_line->flags & line_buf::LFT_32BIT) &&
  275|   809k|             (src_line->flags & line_buf::LFT_INTEGER) == 0 &&
  276|   809k|             (dst_line->flags & line_buf::LFT_32BIT) &&
  277|   809k|             (dst_line->flags & line_buf::LFT_INTEGER));
  278|       |
  279|   809k|      assert(bit_depth <= 32);
  280|   809k|      const float* sp = src_line->f32;
  281|   809k|      si32* dp = dst_line->i32 + dst_line_offset;
  282|       |      // There is the possibility that converting to integer will
  283|       |      // exceed the dynamic range of 32bit integer; therefore, care must be
  284|       |      // exercised.
  285|       |      // We look if the floating point number is outside the half-closed
  286|       |      // interval [-0.5f, 0.5f). If so, we limit the resulting integer
  287|       |      // to the maximum/minimum that number supports.
  288|   809k|      si32 neg_limit = (si32)INT_MIN >> (32 - bit_depth);
  289|   809k|      __m256 mul = _mm256_set1_ps((float)(1ull << bit_depth));
  290|   809k|      __m256 fl_up_lim = _mm256_set1_ps(-(float)neg_limit);  // val < upper
  291|   809k|      __m256 fl_low_lim = _mm256_set1_ps((float)neg_limit);  // val >= lower
  292|   809k|      __m256i s32_up_lim = _mm256_set1_epi32(INT_MAX >> (32 - bit_depth));
  293|   809k|      __m256i s32_low_lim = _mm256_set1_epi32(INT_MIN >> (32 - bit_depth));
  294|       |
  295|   809k|      if (is_signed)
  ------------------
  |  Branch (295:11): [True: 7.43k, False: 802k]
  ------------------
  296|  7.43k|      {
  297|  7.43k|        __m256i zero = _mm256_setzero_si256();
  298|  7.43k|        __m256i bias = 
  299|  7.43k|          _mm256_set1_epi32(-(si32)((1ULL << (bit_depth - 1)) + 1));
  300|   161k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (300:34): [True: 154k, False: 7.43k]
  ------------------
  301|   154k|          __m256 t = _mm256_loadu_ps(sp);
  302|   154k|          t = _mm256_mul_ps(t, mul);
  303|   154k|          __m256i u = _mm256_cvtps_epi32(t);
  304|   154k|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  305|   154k|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  306|   154k|          if (NLT_TYPE3)
  ------------------
  |  Branch (306:15): [Folded, False: 154k]
  ------------------
  307|      0|          {
  308|      0|            __m256i c = _mm256_cmpgt_epi32(zero, u); // 0xFFFFFFFF for -ve val
  309|      0|            __m256i neg = _mm256_sub_epi32(bias, u); // -bias -value
  310|      0|            neg = _mm256_and_si256(c, neg);          // keep only - bias - val
  311|      0|            u = _mm256_andnot_si256(c, u);           // keep only +ve or 0
  312|      0|            u = _mm256_or_si256(neg, u);             // combine
  313|      0|          }
  314|   154k|          _mm256_storeu_si256((__m256i*)dp, u);
  315|   154k|        }
  316|  7.43k|      }
  317|   802k|      else
  318|   802k|      {
  319|   802k|        __m256i half = _mm256_set1_epi32((si32)(1ULL << (bit_depth - 1)));
  320|  3.79M|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (320:34): [True: 2.98M, False: 802k]
  ------------------
  321|  2.98M|          __m256 t = _mm256_loadu_ps(sp);
  322|  2.98M|          t = _mm256_mul_ps(t, mul);
  323|  2.98M|          __m256i u = _mm256_cvtps_epi32(t);
  324|  2.98M|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  325|  2.98M|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  326|  2.98M|          u = _mm256_add_epi32(u, half);
  327|  2.98M|          _mm256_storeu_si256((__m256i*)dp, u);
  328|  2.98M|        }
  329|   802k|      }
  330|   809k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL23ojph_mm256_max_ge_epi32EDv4_xS1_Dv8_fS2_:
  244|  3.19M|    {
  245|       |      // We must use _CMP_NLT_UQ or _CMP_GE_OQ, _CMP_GE_OS, or _CMP_NLT_US
  246|       |      // It is not clear to me which to use
  247|       |      __m256 ct = _mm256_cmp_ps(x, y, _CMP_NLT_UQ); // 0xFFFFFFFF for x >= y
  248|  3.19M|      __m256i c = _mm256_castps_si256(ct);   // does not generate any code
  249|  3.19M|      __m256i d = _mm256_and_si256(c, a);    // keep only a, where x >= y
  250|  3.19M|      __m256i e = _mm256_andnot_si256(c, b); // keep only b, where x <  y
  251|  3.19M|      return _mm256_or_si256(d, e);          // combine
  252|  3.19M|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL23ojph_mm256_min_lt_epi32EDv4_xS1_Dv8_fS2_:
  257|  3.19M|    {
  258|       |      // We must use _CMP_LT_OQ or _CMP_NGE_UQ, _CMP_LT_OS, or _CMP_NGE_US
  259|       |      // It is not clear to me which to use
  260|       |      __m256 ct = _mm256_cmp_ps(x, y, _CMP_NGE_UQ); // 0xFFFFFFFF for x < y
  261|  3.19M|      __m256i c = _mm256_castps_si256(ct);   // does not generate any code
  262|  3.19M|      __m256i d = _mm256_and_si256(c, a);    // keep only a, where x <  y
  263|  3.19M|      __m256i e = _mm256_andnot_si256(c, b); // keep only b, where x >= y
  264|  3.19M|      return _mm256_or_si256(d, e);          // combine
  265|  3.19M|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL33local_avx2_irv_convert_to_integerILb1EEEvPKNS_8line_bufEPS2_jjbj:
  273|  24.7k|    {
  274|  24.7k|      assert((src_line->flags & line_buf::LFT_32BIT) &&
  275|  24.7k|             (src_line->flags & line_buf::LFT_INTEGER) == 0 &&
  276|  24.7k|             (dst_line->flags & line_buf::LFT_32BIT) &&
  277|  24.7k|             (dst_line->flags & line_buf::LFT_INTEGER));
  278|       |
  279|  24.7k|      assert(bit_depth <= 32);
  280|  24.7k|      const float* sp = src_line->f32;
  281|  24.7k|      si32* dp = dst_line->i32 + dst_line_offset;
  282|       |      // There is the possibility that converting to integer will
  283|       |      // exceed the dynamic range of 32bit integer; therefore, care must be
  284|       |      // exercised.
  285|       |      // We look if the floating point number is outside the half-closed
  286|       |      // interval [-0.5f, 0.5f). If so, we limit the resulting integer
  287|       |      // to the maximum/minimum that number supports.
  288|  24.7k|      si32 neg_limit = (si32)INT_MIN >> (32 - bit_depth);
  289|  24.7k|      __m256 mul = _mm256_set1_ps((float)(1ull << bit_depth));
  290|  24.7k|      __m256 fl_up_lim = _mm256_set1_ps(-(float)neg_limit);  // val < upper
  291|  24.7k|      __m256 fl_low_lim = _mm256_set1_ps((float)neg_limit);  // val >= lower
  292|  24.7k|      __m256i s32_up_lim = _mm256_set1_epi32(INT_MAX >> (32 - bit_depth));
  293|  24.7k|      __m256i s32_low_lim = _mm256_set1_epi32(INT_MIN >> (32 - bit_depth));
  294|       |
  295|  24.7k|      if (is_signed)
  ------------------
  |  Branch (295:11): [True: 18.8k, False: 5.95k]
  ------------------
  296|  18.8k|      {
  297|  18.8k|        __m256i zero = _mm256_setzero_si256();
  298|  18.8k|        __m256i bias = 
  299|  18.8k|          _mm256_set1_epi32(-(si32)((1ULL << (bit_depth - 1)) + 1));
  300|  62.9k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (300:34): [True: 44.1k, False: 18.8k]
  ------------------
  301|  44.1k|          __m256 t = _mm256_loadu_ps(sp);
  302|  44.1k|          t = _mm256_mul_ps(t, mul);
  303|  44.1k|          __m256i u = _mm256_cvtps_epi32(t);
  304|  44.1k|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  305|  44.1k|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  306|  44.1k|          if (NLT_TYPE3)
  ------------------
  |  Branch (306:15): [True: 44.1k, Folded]
  ------------------
  307|  44.1k|          {
  308|  44.1k|            __m256i c = _mm256_cmpgt_epi32(zero, u); // 0xFFFFFFFF for -ve val
  309|  44.1k|            __m256i neg = _mm256_sub_epi32(bias, u); // -bias -value
  310|  44.1k|            neg = _mm256_and_si256(c, neg);          // keep only - bias - val
  311|  44.1k|            u = _mm256_andnot_si256(c, u);           // keep only +ve or 0
  312|  44.1k|            u = _mm256_or_si256(neg, u);             // combine
  313|  44.1k|          }
  314|  44.1k|          _mm256_storeu_si256((__m256i*)dp, u);
  315|  44.1k|        }
  316|  18.8k|      }
  317|  5.95k|      else
  318|  5.95k|      {
  319|  5.95k|        __m256i half = _mm256_set1_epi32((si32)(1ULL << (bit_depth - 1)));
  320|  15.9k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (320:34): [True: 9.98k, False: 5.95k]
  ------------------
  321|  9.98k|          __m256 t = _mm256_loadu_ps(sp);
  322|  9.98k|          t = _mm256_mul_ps(t, mul);
  323|  9.98k|          __m256i u = _mm256_cvtps_epi32(t);
  324|  9.98k|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  325|  9.98k|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  326|  9.98k|          u = _mm256_add_epi32(u, half);
  327|  9.98k|          _mm256_storeu_si256((__m256i*)dp, u);
  328|  9.98k|        }
  329|  5.95k|      }
  330|  24.7k|    }

_ZN4ojph5local32init_wavelet_transform_functionsEv:
   99|  7.38k|    {
  100|  7.38k|      static std::once_flag wavelet_transform_functions_init_flag;
  101|  7.38k|      std::call_once(wavelet_transform_functions_init_flag, [](){
  102|  7.38k|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  103|       |
  104|  7.38k|        rev_vert_step             = gen_rev_vert_step;
  105|  7.38k|        rev_horz_ana              = gen_rev_horz_ana;
  106|  7.38k|        rev_horz_syn              = gen_rev_horz_syn;
  107|       |
  108|  7.38k|        irv_vert_step             = gen_irv_vert_step;
  109|  7.38k|        irv_vert_times_K          = gen_irv_vert_times_K;
  110|  7.38k|        irv_horz_ana              = gen_irv_horz_ana;
  111|  7.38k|        irv_horz_syn              = gen_irv_horz_syn;
  112|       |
  113|  7.38k|  #ifndef OJPH_DISABLE_SIMD
  114|       |
  115|  7.38k|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  116|       |
  117|  7.38k|      #ifndef OJPH_DISABLE_SSE
  118|  7.38k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  119|  7.38k|        {
  120|  7.38k|          irv_vert_step             = sse_irv_vert_step;
  121|  7.38k|          irv_vert_times_K          = sse_irv_vert_times_K;
  122|  7.38k|          irv_horz_ana              = sse_irv_horz_ana;
  123|  7.38k|          irv_horz_syn              = sse_irv_horz_syn;
  124|  7.38k|        }
  125|  7.38k|      #endif // !OJPH_DISABLE_SSE
  126|       |
  127|  7.38k|      #ifndef OJPH_DISABLE_SSE2
  128|  7.38k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2)
  129|  7.38k|        {
  130|  7.38k|          rev_vert_step             = sse2_rev_vert_step;
  131|  7.38k|          rev_horz_ana              = sse2_rev_horz_ana;
  132|  7.38k|          rev_horz_syn              = sse2_rev_horz_syn;
  133|  7.38k|        }
  134|  7.38k|      #endif // !OJPH_DISABLE_SSE2
  135|       |
  136|  7.38k|      #ifndef OJPH_DISABLE_AVX
  137|  7.38k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  138|  7.38k|        {
  139|  7.38k|          irv_vert_step             = avx_irv_vert_step;
  140|  7.38k|          irv_vert_times_K          = avx_irv_vert_times_K;
  141|  7.38k|          irv_horz_ana              = avx_irv_horz_ana;      
  142|  7.38k|          irv_horz_syn              = avx_irv_horz_syn;
  143|  7.38k|        }
  144|  7.38k|      #endif // !OJPH_DISABLE_AVX
  145|       |
  146|  7.38k|      #ifndef OJPH_DISABLE_AVX2
  147|  7.38k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2)
  148|  7.38k|        {
  149|  7.38k|          rev_vert_step             = avx2_rev_vert_step;
  150|  7.38k|          rev_horz_ana              = avx2_rev_horz_ana;
  151|  7.38k|          rev_horz_syn              = avx2_rev_horz_syn;
  152|  7.38k|        }
  153|  7.38k|      #endif // !OJPH_DISABLE_AVX2
  154|       |
  155|  7.38k|      #if (defined(OJPH_ARCH_X86_64) && !defined(OJPH_DISABLE_AVX512))
  156|  7.38k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX512)
  157|  7.38k|        {
  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|  7.38k|          irv_vert_step             = avx512_irv_vert_step;
  163|  7.38k|          irv_vert_times_K          = avx512_irv_vert_times_K;
  164|  7.38k|          irv_horz_ana              = avx512_irv_horz_ana;
  165|  7.38k|          irv_horz_syn              = avx512_irv_horz_syn;
  166|  7.38k|        }
  167|  7.38k|      #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|  7.38k|  #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|  7.38k|      });
  201|  7.38k|    }
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|  2.14M|    {
  105|  2.14M|      float a = s->irv.Aatk;
  106|  2.14M|      if (synthesis)
  ------------------
  |  Branch (106:11): [True: 2.14M, False: 0]
  ------------------
  107|  2.14M|        a = -a;
  108|       |
  109|  2.14M|      __m256 factor = _mm256_set1_ps(a);
  110|       |
  111|  2.14M|      float* dst = aug->f32;
  112|  2.14M|      const float* src1 = sig->f32, * src2 = other->f32;
  113|  2.14M|      int i = (int)repeat;
  114|  9.72M|      for ( ; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (114:15): [True: 7.58M, False: 2.14M]
  ------------------
  115|  7.58M|      {
  116|  7.58M|        __m256 s1 = _mm256_load_ps(src1);
  117|  7.58M|        __m256 s2 = _mm256_load_ps(src2);
  118|  7.58M|        __m256 d = _mm256_load_ps(dst);
  119|  7.58M|        d = _mm256_add_ps(d, _mm256_mul_ps(factor, _mm256_add_ps(s1, s2)));
  120|  7.58M|        _mm256_store_ps(dst, d);
  121|  7.58M|      }
  122|  2.14M|    }
_ZN4ojph5local20avx_irv_vert_times_KEfPKNS_8line_bufEj:
  126|  1.07M|    {
  127|  1.07M|      avx_multiply_const(aug->f32, K, (int)repeat);
  128|  1.07M|    }
_ZN4ojph5local16avx_irv_horz_synEPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
  212|   801k|    {
  213|   801k|      if (width > 1)
  ------------------
  |  Branch (213:11): [True: 244k, False: 557k]
  ------------------
  214|   244k|      {
  215|   244k|        bool ev = even;
  216|   244k|        float* oth = hsrc->f32, * aug = lsrc->f32;
  217|   244k|        ui32 aug_width = (width + (even ? 1 : 0)) >> 1;  // low pass
  ------------------
  |  Branch (217:36): [True: 178k, False: 65.7k]
  ------------------
  218|   244k|        ui32 oth_width = (width + (even ? 0 : 1)) >> 1;  // high pass
  ------------------
  |  Branch (218:36): [True: 178k, False: 65.7k]
  ------------------
  219|       |
  220|   244k|        { // multiply by K or 1/K
  221|   244k|          float K = atk->get_K();
  222|   244k|          float K_inv = 1.0f / K;
  223|   244k|          avx_multiply_const(aug, K, (int)aug_width);
  224|   244k|          avx_multiply_const(oth, K_inv, (int)oth_width);
  225|   244k|        }
  226|       |
  227|       |        // the actual horizontal transform
  228|   244k|        ui32 num_steps = atk->get_num_steps();
  229|  1.18M|        for (ui32 j = 0; j < num_steps; ++j)
  ------------------
  |  Branch (229:26): [True: 944k, False: 244k]
  ------------------
  230|   944k|        {
  231|   944k|          const lifting_step* s = atk->get_step(j);
  232|   944k|          const float a = s->irv.Aatk;
  233|       |
  234|       |          // extension
  235|   944k|          oth[-1] = oth[0];
  236|   944k|          oth[oth_width] = oth[oth_width - 1];
  237|       |          // lifting step
  238|   944k|          const float* sp = oth;
  239|   944k|          float* dp = aug;
  240|   944k|          int i = (int)aug_width;
  241|   944k|          __m256 f = _mm256_set1_ps(a);
  242|   944k|          if (ev)
  ------------------
  |  Branch (242:15): [True: 472k, False: 472k]
  ------------------
  243|   472k|          {
  244|  3.86M|            for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (244:20): [True: 3.39M, False: 472k]
  ------------------
  245|  3.39M|            {
  246|  3.39M|              __m256 m = _mm256_load_ps(sp);
  247|  3.39M|              __m256 n = _mm256_loadu_ps(sp - 1);
  248|  3.39M|              __m256 p = _mm256_load_ps(dp);
  249|  3.39M|              p = _mm256_sub_ps(p, _mm256_mul_ps(f, _mm256_add_ps(m, n)));
  250|  3.39M|              _mm256_store_ps(dp, p);
  251|  3.39M|            }
  252|   472k|          }
  253|   472k|          else
  254|   472k|          {
  255|  3.79M|            for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (255:20): [True: 3.32M, False: 472k]
  ------------------
  256|  3.32M|            {
  257|  3.32M|              __m256 m = _mm256_load_ps(sp);
  258|  3.32M|              __m256 n = _mm256_loadu_ps(sp + 1);
  259|  3.32M|              __m256 p = _mm256_load_ps(dp);
  260|  3.32M|              p = _mm256_sub_ps(p, _mm256_mul_ps(f, _mm256_add_ps(m, n)));
  261|  3.32M|              _mm256_store_ps(dp, p);
  262|  3.32M|            }
  263|   472k|          }
  264|       |
  265|       |          // swap buffers
  266|   944k|          float* t = aug; aug = oth; oth = t;
  267|   944k|          ev = !ev;
  268|   944k|          ui32 w = aug_width; aug_width = oth_width; oth_width = w;
  269|   944k|        }
  270|       |
  271|       |        // combine both lsrc and hsrc into dst
  272|   244k|        {
  273|   244k|          float* dp = dst->f32;
  274|   244k|          float* spl = even ? lsrc->f32 : hsrc->f32;
  ------------------
  |  Branch (274:24): [True: 178k, False: 65.7k]
  ------------------
  275|   244k|          float* sph = even ? hsrc->f32 : lsrc->f32;
  ------------------
  |  Branch (275:24): [True: 178k, False: 65.7k]
  ------------------
  276|   244k|          int w = (int)width;
  277|   244k|          avx_interleave32(dp, spl, sph, w);
  278|   244k|        }
  279|   244k|      }
  280|   557k|      else {
  281|   557k|        if (even)
  ------------------
  |  Branch (281:13): [True: 514k, False: 42.9k]
  ------------------
  282|   514k|          dst->f32[0] = lsrc->f32[0];
  283|  42.9k|        else
  284|  42.9k|          dst->f32[0] = hsrc->f32[0] * 0.5f;
  285|   557k|      }
  286|   801k|    }
ojph_transform_avx.cpp:_ZN4ojph5localL18avx_multiply_constEPffi:
   57|  1.56M|    {
   58|  1.56M|      __m256 factor = _mm256_set1_ps(f);
   59|  8.75M|      for (; width > 0; width -= 8, p += 8)
  ------------------
  |  Branch (59:14): [True: 7.18M, False: 1.56M]
  ------------------
   60|  7.18M|      {
   61|  7.18M|        __m256 s = _mm256_load_ps(p);
   62|  7.18M|        _mm256_store_ps(p, _mm256_mul_ps(factor, s));
   63|  7.18M|      }
   64|  1.56M|    }
ojph_transform_avx.cpp:_ZN4ojph5localL16avx_interleave32EPfS1_S1_i:
   86|   244k|    {
   87|  1.95M|      for (; width > 0; width -= 16, dp += 16, spl += 8, sph += 8)
  ------------------
  |  Branch (87:14): [True: 1.70M, False: 244k]
  ------------------
   88|  1.70M|      {
   89|  1.70M|        __m256 a = _mm256_load_ps(spl);
   90|  1.70M|        __m256 b = _mm256_load_ps(sph);
   91|  1.70M|        __m256 c = _mm256_unpacklo_ps(a, b);
   92|  1.70M|        __m256 d = _mm256_unpackhi_ps(a, b);
   93|  1.70M|        __m256 e = _mm256_permute2f128_ps(c, d, (2 << 4) | (0));
   94|       |        __m256 f = _mm256_permute2f128_ps(c, d, (3 << 4) | (1));
   95|  1.70M|        _mm256_store_ps(dp, e);
   96|  1.70M|        _mm256_store_ps(dp + 8, f);
   97|  1.70M|      }
   98|   244k|    }

_ZN4ojph5local18avx2_rev_vert_stepEPKNS0_12lifting_stepEPKNS_8line_bufES6_S6_jb:
  390|  2.79M|    {
  391|  2.79M|      if (((sig != NULL) && (sig->flags & line_buf::LFT_32BIT)) ||
  ------------------
  |  Branch (391:12): [True: 2.79M, False: 0]
  |  Branch (391:29): [True: 2.09M, False: 707k]
  ------------------
  392|   707k|          ((aug != NULL) && (aug->flags & line_buf::LFT_32BIT)) ||
  ------------------
  |  Branch (392:12): [True: 707k, False: 0]
  |  Branch (392:29): [True: 0, False: 707k]
  ------------------
  393|   707k|          ((other != NULL) && (other->flags & line_buf::LFT_32BIT)))
  ------------------
  |  Branch (393:12): [True: 707k, False: 0]
  |  Branch (393:31): [True: 0, False: 707k]
  ------------------
  394|  2.09M|      {
  395|  2.09M|        assert((sig == NULL || sig->flags & line_buf::LFT_32BIT) &&
  396|  2.09M|               (other == NULL || other->flags & line_buf::LFT_32BIT) &&
  397|  2.09M|               (aug == NULL || aug->flags & line_buf::LFT_32BIT));
  398|  2.09M|        avx2_rev_vert_step32(s, sig, other, aug, repeat, synthesis);
  399|  2.09M|      }
  400|   707k|      else
  401|   707k|      {
  402|       |        assert((sig == NULL || sig->flags & line_buf::LFT_64BIT) &&
  403|   707k|               (other == NULL || other->flags & line_buf::LFT_64BIT) &&
  404|   707k|               (aug == NULL || aug->flags & line_buf::LFT_64BIT));
  405|   707k|        avx2_rev_vert_step64(s, sig, other, aug, repeat, synthesis);
  406|   707k|      }
  407|  2.79M|    }
_ZN4ojph5local17avx2_rev_horz_synEPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
 1067|  3.27M|    {
 1068|  3.27M|      if (dst->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (1068:11): [True: 2.54M, False: 726k]
  ------------------
 1069|  2.54M|      {
 1070|  2.54M|        assert((lsrc == NULL || lsrc->flags & line_buf::LFT_32BIT) &&
 1071|  2.54M|               (hsrc == NULL || hsrc->flags & line_buf::LFT_32BIT));
 1072|  2.54M|        avx2_rev_horz_syn32(atk, dst, lsrc, hsrc, width, even);
 1073|  2.54M|      }
 1074|   726k|      else
 1075|   726k|      {
 1076|       |        assert((dst == NULL || dst->flags & line_buf::LFT_64BIT) &&
 1077|   726k|               (lsrc == NULL || lsrc->flags & line_buf::LFT_64BIT) &&
 1078|   726k|               (hsrc == NULL || hsrc->flags & line_buf::LFT_64BIT));
 1079|   726k|        avx2_rev_horz_syn64(atk, dst, lsrc, hsrc, width, even);
 1080|   726k|      }
 1081|  3.27M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL20avx2_rev_vert_step32EPKNS0_12lifting_stepEPKNS_8line_bufES6_S6_jb:
  150|  2.09M|    {
  151|  2.09M|      const si32 a = s->rev.Aatk;
  152|  2.09M|      const si32 b = s->rev.Batk;
  153|  2.09M|      const ui8 e = s->rev.Eatk;
  154|  2.09M|      __m256i va = _mm256_set1_epi32(a);
  155|  2.09M|      __m256i vb = _mm256_set1_epi32(b);
  156|       |
  157|  2.09M|      si32* dst = aug->i32;
  158|  2.09M|      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.09M|      if (a == 1)
  ------------------
  |  Branch (162:11): [True: 1.04M, False: 1.04M]
  ------------------
  163|  1.04M|      { // 5/3 update and any case with a == 1
  164|  1.04M|        int i = (int)repeat;
  165|  1.04M|        if (synthesis)
  ------------------
  |  Branch (165:13): [True: 1.04M, False: 0]
  ------------------
  166|  7.35M|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (166:18): [True: 6.31M, False: 1.04M]
  ------------------
  167|  6.31M|          {
  168|  6.31M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  169|  6.31M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  170|  6.31M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  171|  6.31M|            __m256i t = _mm256_add_epi32(s1, s2);
  172|  6.31M|            __m256i v = _mm256_add_epi32(vb, t);
  173|  6.31M|            __m256i w = _mm256_srai_epi32(v, e);
  174|  6.31M|            d = _mm256_sub_epi32(d, w);
  175|  6.31M|            _mm256_store_si256((__m256i*)dst, d);
  176|  6.31M|          }
  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.04M|      }
  190|  1.04M|      else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (190:16): [True: 1.04M, False: 0]
  |  Branch (190:27): [True: 1.04M, False: 0]
  |  Branch (190:37): [True: 1.04M, False: 0]
  ------------------
  191|  1.04M|      { // 5/3 predict
  192|  1.04M|        int i = (int)repeat;
  193|  1.04M|        if (synthesis)
  ------------------
  |  Branch (193:13): [True: 1.04M, False: 0]
  ------------------
  194|  7.33M|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (194:18): [True: 6.29M, False: 1.04M]
  ------------------
  195|  6.29M|          {
  196|  6.29M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  197|  6.29M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  198|  6.29M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  199|  6.29M|            __m256i t = _mm256_add_epi32(s1, s2);
  200|  6.29M|            __m256i w = _mm256_srai_epi32(t, e);
  201|  6.29M|            d = _mm256_add_epi32(d, w);
  202|  6.29M|            _mm256_store_si256((__m256i*)dst, d);
  203|  6.29M|          }
  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.04M|      }
  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.09M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL20avx2_rev_vert_step64EPKNS0_12lifting_stepEPKNS_8line_bufES6_S6_jb:
  280|   707k|    {
  281|   707k|      const si32 a = s->rev.Aatk;
  282|   707k|      const si32 b = s->rev.Batk;
  283|   707k|      const ui8 e = s->rev.Eatk;
  284|   707k|      __m256i vb = _mm256_set1_epi64x(b);
  285|   707k|      __m256i ve = _mm256_set1_epi64x(1LL << (63 - e));
  286|       |
  287|   707k|      si64* dst = aug->i64;
  288|   707k|      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|   707k|      if (a == 1)
  ------------------
  |  Branch (292:11): [True: 355k, False: 352k]
  ------------------
  293|   355k|      { // 5/3 update and any case with a == 1
  294|   355k|        int i = (int)repeat;
  295|   355k|        if (synthesis)
  ------------------
  |  Branch (295:13): [True: 355k, False: 0]
  ------------------
  296|  7.01M|          for (; i > 0; i -= 4, dst += 4, src1 += 4, src2 += 4)
  ------------------
  |  Branch (296:18): [True: 6.66M, False: 355k]
  ------------------
  297|  6.66M|          {
  298|  6.66M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  299|  6.66M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  300|  6.66M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  301|  6.66M|            __m256i t = _mm256_add_epi64(s1, s2);
  302|  6.66M|            __m256i v = _mm256_add_epi64(vb, t);
  303|  6.66M|            __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  304|  6.66M|            d = _mm256_sub_epi64(d, w);
  305|  6.66M|            _mm256_store_si256((__m256i*)dst, d);
  306|  6.66M|          }
  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|   355k|      }
  320|   352k|      else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (320:16): [True: 352k, False: 0]
  |  Branch (320:27): [True: 352k, False: 0]
  |  Branch (320:37): [True: 352k, False: 0]
  ------------------
  321|   352k|      { // 5/3 predict
  322|   352k|        int i = (int)repeat;
  323|   352k|        if (synthesis)
  ------------------
  |  Branch (323:13): [True: 352k, False: 0]
  ------------------
  324|  6.99M|          for (; i > 0; i -= 4, dst += 4, src1 += 4, src2 += 4)
  ------------------
  |  Branch (324:18): [True: 6.64M, False: 352k]
  ------------------
  325|  6.64M|          {
  326|  6.64M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  327|  6.64M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  328|  6.64M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  329|  6.64M|            __m256i t = _mm256_add_epi64(s1, s2);
  330|  6.64M|            __m256i w = avx2_mm256_srai_epi64(t, e, ve);
  331|  6.64M|            d = _mm256_add_epi64(d, w);
  332|  6.64M|            _mm256_store_si256((__m256i*)dst, d);
  333|  6.64M|          }
  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|   352k|      }
  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|   707k|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL21avx2_mm256_srai_epi64EDv4_xiS1_:
   61|  26.9M|    {
   62|       |      // note than m must be obtained using
   63|       |      // __m256i m = _mm256_set1_epi64x(1ULL << (63 - amt));
   64|  26.9M|      __m256i x = _mm256_srli_epi64(a, amt);
   65|  26.9M|      x = _mm256_xor_si256(x, m);
   66|  26.9M|      __m256i result = _mm256_sub_epi64(x, m);
   67|  26.9M|      return result;
   68|  26.9M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL19avx2_rev_horz_syn32EPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
  751|  2.54M|    {
  752|  2.54M|      if (width > 1)
  ------------------
  |  Branch (752:11): [True: 771k, False: 1.77M]
  ------------------
  753|   771k|      {
  754|   771k|        bool ev = even;
  755|   771k|        si32* oth = hsrc->i32, * aug = lsrc->i32;
  756|   771k|        ui32 aug_width = (width + (even ? 1 : 0)) >> 1;  // low pass
  ------------------
  |  Branch (756:36): [True: 677k, False: 94.0k]
  ------------------
  757|   771k|        ui32 oth_width = (width + (even ? 0 : 1)) >> 1;  // high pass
  ------------------
  |  Branch (757:36): [True: 677k, False: 94.0k]
  ------------------
  758|   771k|        ui32 num_steps = atk->get_num_steps();
  759|  2.30M|        for (ui32 j = 0; j < num_steps; ++j)
  ------------------
  |  Branch (759:26): [True: 1.53M, False: 771k]
  ------------------
  760|  1.53M|        {
  761|  1.53M|          const lifting_step* s = atk->get_step(j);
  762|  1.53M|          const si32 a = s->rev.Aatk;
  763|  1.53M|          const si32 b = s->rev.Batk;
  764|  1.53M|          const ui8 e  = s->rev.Eatk;
  765|  1.53M|          __m256i va = _mm256_set1_epi32(a);
  766|  1.53M|          __m256i vb = _mm256_set1_epi32(b);
  767|       |
  768|       |          // extension
  769|  1.53M|          oth[-1] = oth[0];
  770|  1.53M|          oth[oth_width] = oth[oth_width - 1];
  771|       |          // lifting step
  772|  1.53M|          const si32* sp = oth;
  773|  1.53M|          si32* dp = aug;
  774|  1.53M|          if (a == 1)
  ------------------
  |  Branch (774:15): [True: 769k, False: 769k]
  ------------------
  775|   769k|          { // 5/3 update and any case with a == 1
  776|   769k|            int i = (int)aug_width;
  777|   769k|            if (ev)
  ------------------
  |  Branch (777:17): [True: 675k, False: 93.6k]
  ------------------
  778|   675k|            {
  779|  5.92M|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (779:22): [True: 5.24M, False: 675k]
  ------------------
  780|  5.24M|              {
  781|  5.24M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  782|  5.24M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  783|  5.24M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  784|  5.24M|                __m256i t = _mm256_add_epi32(s1, s2);
  785|  5.24M|                __m256i v = _mm256_add_epi32(vb, t);
  786|  5.24M|                __m256i w = _mm256_srai_epi32(v, e);
  787|  5.24M|                d = _mm256_sub_epi32(d, w);
  788|  5.24M|                _mm256_store_si256((__m256i*)dp, d);
  789|  5.24M|              }
  790|   675k|            }
  791|  93.6k|            else
  792|  93.6k|            {
  793|   748k|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (793:22): [True: 654k, False: 93.6k]
  ------------------
  794|   654k|              {
  795|   654k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  796|   654k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  797|   654k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  798|   654k|                __m256i t = _mm256_add_epi32(s1, s2);
  799|   654k|                __m256i v = _mm256_add_epi32(vb, t);
  800|   654k|                __m256i w = _mm256_srai_epi32(v, e);
  801|   654k|                d = _mm256_sub_epi32(d, w);
  802|   654k|                _mm256_store_si256((__m256i*)dp, d);
  803|   654k|              }
  804|  93.6k|            }
  805|   769k|          }
  806|   769k|          else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (806:20): [True: 769k, False: 0]
  |  Branch (806:31): [True: 769k, False: 0]
  |  Branch (806:41): [True: 769k, False: 0]
  ------------------
  807|   769k|          {  // 5/3 predict
  808|   769k|            int i = (int)aug_width;
  809|   769k|            if (ev)
  ------------------
  |  Branch (809:17): [True: 93.6k, False: 675k]
  ------------------
  810|   749k|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (810:22): [True: 656k, False: 93.6k]
  ------------------
  811|   656k|              {
  812|   656k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  813|   656k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  814|   656k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  815|   656k|                __m256i t = _mm256_add_epi32(s1, s2);
  816|   656k|                __m256i w = _mm256_srai_epi32(t, e);
  817|   656k|                d = _mm256_add_epi32(d, w);
  818|   656k|                _mm256_store_si256((__m256i*)dp, d);
  819|   656k|              }
  820|   675k|            else
  821|  5.80M|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (821:22): [True: 5.12M, False: 675k]
  ------------------
  822|  5.12M|              {
  823|  5.12M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  824|  5.12M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  825|  5.12M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  826|  5.12M|                __m256i t = _mm256_add_epi32(s1, s2);
  827|  5.12M|                __m256i w = _mm256_srai_epi32(t, e);
  828|  5.12M|                d = _mm256_add_epi32(d, w);
  829|  5.12M|                _mm256_store_si256((__m256i*)dp, d);
  830|  5.12M|              }
  831|   769k|          }
  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.53M|          si32* t = aug; aug = oth; oth = t;
  893|  1.53M|          ev = !ev;
  894|  1.53M|          ui32 w = aug_width; aug_width = oth_width; oth_width = w;
  895|  1.53M|        }
  896|       |
  897|       |        // combine both lsrc and hsrc into dst
  898|   771k|        {
  899|   771k|          float* dp  = dst->f32;
  900|   771k|          float* spl = even ? lsrc->f32 : hsrc->f32;
  ------------------
  |  Branch (900:24): [True: 677k, False: 94.0k]
  ------------------
  901|   771k|          float* sph = even ? hsrc->f32 : lsrc->f32;
  ------------------
  |  Branch (901:24): [True: 677k, False: 94.0k]
  ------------------
  902|   771k|          int w = (int)width;
  903|   771k|          avx2_interleave32(dp, spl, sph, w);
  904|   771k|        }
  905|   771k|      }
  906|  1.77M|      else {
  907|  1.77M|        if (even)
  ------------------
  |  Branch (907:13): [True: 1.71M, False: 66.2k]
  ------------------
  908|  1.71M|          dst->i32[0] = lsrc->i32[0];
  909|  66.2k|        else
  910|  66.2k|          dst->i32[0] = hsrc->i32[0] >> 1;
  911|  1.77M|      }
  912|  2.54M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL17avx2_interleave32EPfS1_S1_i:
   90|   771k|    {
   91|  6.68M|      for (; width > 0; width -= 16, dp += 16, spl += 8, sph += 8)
  ------------------
  |  Branch (91:14): [True: 5.91M, False: 771k]
  ------------------
   92|  5.91M|      {
   93|  5.91M|        __m256 a = _mm256_load_ps(spl);
   94|  5.91M|        __m256 b = _mm256_load_ps(sph);
   95|  5.91M|        __m256 c = _mm256_unpacklo_ps(a, b);
   96|  5.91M|        __m256 d = _mm256_unpackhi_ps(a, b);
   97|  5.91M|        __m256 e = _mm256_permute2f128_ps(c, d, (2 << 4) | (0));
   98|       |        __m256 f = _mm256_permute2f128_ps(c, d, (3 << 4) | (1));
   99|  5.91M|        _mm256_store_ps(dp, e);
  100|  5.91M|        _mm256_store_ps(dp + 8, f);
  101|  5.91M|      }
  102|   771k|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL19avx2_rev_horz_syn64EPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
  919|   726k|    {
  920|   726k|      if (width > 1)
  ------------------
  |  Branch (920:11): [True: 441k, False: 284k]
  ------------------
  921|   441k|      {
  922|   441k|        bool ev = even;
  923|   441k|        si64* oth = hsrc->i64, * aug = lsrc->i64;
  924|   441k|        ui32 aug_width = (width + (even ? 1 : 0)) >> 1;  // low pass
  ------------------
  |  Branch (924:36): [True: 385k, False: 55.9k]
  ------------------
  925|   441k|        ui32 oth_width = (width + (even ? 0 : 1)) >> 1;  // high pass
  ------------------
  |  Branch (925:36): [True: 385k, False: 55.9k]
  ------------------
  926|   441k|        ui32 num_steps = atk->get_num_steps();
  927|  1.32M|        for (ui32 j = 0; j < num_steps; ++j)
  ------------------
  |  Branch (927:26): [True: 882k, False: 441k]
  ------------------
  928|   882k|        {
  929|   882k|          const lifting_step* s = atk->get_step(j);
  930|   882k|          const si32 a = s->rev.Aatk;
  931|   882k|          const si32 b = s->rev.Batk;
  932|   882k|          const ui8 e  = s->rev.Eatk;
  933|   882k|          __m256i vb = _mm256_set1_epi64x(b);
  934|   882k|          __m256i ve = _mm256_set1_epi64x(1LL << (63 - e));
  935|       |
  936|       |          // extension
  937|   882k|          oth[-1] = oth[0];
  938|   882k|          oth[oth_width] = oth[oth_width - 1];
  939|       |          // lifting step
  940|   882k|          const si64* sp = oth;
  941|   882k|          si64* dp = aug;
  942|   882k|          if (a == 1)
  ------------------
  |  Branch (942:15): [True: 441k, False: 441k]
  ------------------
  943|   441k|          { // 5/3 update and any case with a == 1
  944|   441k|            int i = (int)aug_width;
  945|   441k|            if (ev)
  ------------------
  |  Branch (945:17): [True: 385k, False: 55.7k]
  ------------------
  946|   385k|            {
  947|  6.54M|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (947:22): [True: 6.15M, False: 385k]
  ------------------
  948|  6.15M|              {
  949|  6.15M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  950|  6.15M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  951|  6.15M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  952|  6.15M|                __m256i t = _mm256_add_epi64(s1, s2);
  953|  6.15M|                __m256i v = _mm256_add_epi64(vb, t);
  954|  6.15M|                __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  955|  6.15M|                d = _mm256_sub_epi64(d, w);
  956|  6.15M|                _mm256_store_si256((__m256i*)dp, d);
  957|  6.15M|              }
  958|   385k|            }
  959|  55.7k|            else
  960|  55.7k|            {
  961|   809k|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (961:22): [True: 754k, False: 55.7k]
  ------------------
  962|   754k|              {
  963|   754k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  964|   754k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  965|   754k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  966|   754k|                __m256i t = _mm256_add_epi64(s1, s2);
  967|   754k|                __m256i v = _mm256_add_epi64(vb, t);
  968|   754k|                __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  969|   754k|                d = _mm256_sub_epi64(d, w);
  970|   754k|                _mm256_store_si256((__m256i*)dp, d);
  971|   754k|              }
  972|  55.7k|            }
  973|   441k|          }
  974|   441k|          else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (974:20): [True: 441k, False: 0]
  |  Branch (974:31): [True: 441k, False: 0]
  |  Branch (974:41): [True: 441k, False: 0]
  ------------------
  975|   441k|          {  // 5/3 predict
  976|   441k|            int i = (int)aug_width;
  977|   441k|            if (ev)
  ------------------
  |  Branch (977:17): [True: 55.7k, False: 385k]
  ------------------
  978|   812k|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (978:22): [True: 756k, False: 55.7k]
  ------------------
  979|   756k|              {
  980|   756k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  981|   756k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  982|   756k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  983|   756k|                __m256i t = _mm256_add_epi64(s1, s2);
  984|   756k|                __m256i w = avx2_mm256_srai_epi64(t, e, ve);
  985|   756k|                d = _mm256_add_epi64(d, w);
  986|   756k|                _mm256_store_si256((__m256i*)dp, d);
  987|   756k|              }
  988|   385k|            else
  989|  6.40M|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (989:22): [True: 6.02M, False: 385k]
  ------------------
  990|  6.02M|              {
  991|  6.02M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  992|  6.02M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  993|  6.02M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  994|  6.02M|                __m256i t = _mm256_add_epi64(s1, s2);
  995|  6.02M|                __m256i w = avx2_mm256_srai_epi64(t, e, ve);
  996|  6.02M|                d = _mm256_add_epi64(d, w);
  997|  6.02M|                _mm256_store_si256((__m256i*)dp, d);
  998|  6.02M|              }
  999|   441k|          }
 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|   882k|          si64* t = aug; aug = oth; oth = t;
 1042|   882k|          ev = !ev;
 1043|   882k|          ui32 w = aug_width; aug_width = oth_width; oth_width = w;
 1044|   882k|        }
 1045|       |
 1046|       |        // combine both lsrc and hsrc into dst
 1047|   441k|        {
 1048|   441k|          void* dp = dst->p;
 1049|   441k|          const void* spl = even ? lsrc->p : hsrc->p;
  ------------------
  |  Branch (1049:29): [True: 385k, False: 55.9k]
  ------------------
 1050|   441k|          const void* sph = even ? hsrc->p : lsrc->p;
  ------------------
  |  Branch (1050:29): [True: 385k, False: 55.9k]
  ------------------
 1051|   441k|          int w = (int)width;
 1052|   441k|          avx2_interleave64(dp, spl, sph, w);
 1053|   441k|        }
 1054|   441k|      }
 1055|   284k|      else {
 1056|   284k|        if (even)
  ------------------
  |  Branch (1056:13): [True: 274k, False: 10.5k]
  ------------------
 1057|   274k|          dst->i64[0] = lsrc->i64[0];
 1058|  10.5k|        else
 1059|  10.5k|          dst->i64[0] = hsrc->i64[0] >> 1;
 1060|   284k|      }
 1061|   726k|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL17avx2_interleave64EPvPKvS3_i:
  128|   441k|    {
  129|  7.35M|      for (; width > 0; width -= 8,
  ------------------
  |  Branch (129:14): [True: 6.91M, False: 441k]
  ------------------
  130|  6.91M|             dp = (char*)dp + 64,
  131|  6.91M|             spl = (const char*)spl + 32,
  132|  6.91M|             sph = (const char*)sph + 32)
  133|  6.91M|      {
  134|  6.91M|        __m256i a = _mm256_load_si256((const __m256i*)spl);
  135|  6.91M|        __m256i b = _mm256_load_si256((const __m256i*)sph);
  136|  6.91M|        __m256i c = _mm256_unpacklo_epi64(a, b);
  137|  6.91M|        __m256i d = _mm256_unpackhi_epi64(a, b);
  138|  6.91M|        __m256i e = _mm256_permute2f128_si256(c, d, (2 << 4) | (0));
  139|       |        __m256i f = _mm256_permute2f128_si256(c, d, (3 << 4) | (1));
  140|  6.91M|        _mm256_store_si256((__m256i*)dp, e);
  141|  6.91M|        _mm256_store_si256((__m256i*)((char*)dp + 32), f);
  142|  6.91M|      }
  143|   441k|    }

