LLVMFuzzerTestOneInput:
   51|  6.11k|{
   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|  6.11k|  if (Size < 3)
  ------------------
  |  Branch (56:7): [True: 2, False: 6.10k]
  ------------------
   57|      2|    return 0;
   58|       |
   59|  6.10k|  uint8_t opts = Data[0];
   60|  6.10k|  uint8_t skip_res = Data[1] & 0x07;
   61|  6.10k|  Data += 2;
   62|  6.10k|  Size -= 2;
   63|       |
   64|  6.10k|  bool force_planar = (opts & 0x02) != 0;
   65|  6.10k|  bool force_interleaved = (opts & 0x04) != 0;
   66|       |
   67|  6.10k|  try
   68|  6.10k|  {
   69|  6.10k|    ojph::mem_infile infile;
   70|  6.10k|    infile.open(reinterpret_cast<const ojph::ui8 *>(Data), Size);
   71|       |
   72|  6.10k|    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|  6.10k|    cs.enable_resilience();
   77|       |
   78|  6.10k|    cs.read_headers(&infile);
   79|       |
   80|       |    // Guard against inputs that cause excessive decoding work.
   81|  6.10k|    {
   82|  6.10k|      ojph::param_siz siz = cs.access_siz();
   83|  6.10k|      ojph::point extent = siz.get_image_extent();
   84|  6.10k|      ojph::point offset = siz.get_image_offset();
   85|  6.10k|      ojph::ui64 w = extent.x - offset.x;
   86|  6.10k|      ojph::ui64 h = extent.y - offset.y;
   87|  6.10k|      if (w * h * siz.get_num_components() > 65536)
  ------------------
  |  Branch (87:11): [True: 53, False: 6.05k]
  ------------------
   88|     53|      {
   89|     53|        cs.close();
   90|     53|        return 0;
   91|     53|      }
   92|       |
   93|  6.05k|      ojph::param_cod cod = cs.access_cod();
   94|  6.05k|      if (cod.get_num_decompositions() > 5)
  ------------------
  |  Branch (94:11): [True: 1, False: 6.05k]
  ------------------
   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|  32.6k|      for (ojph::ui32 lev = 0; lev <= cod.get_num_decompositions(); ++lev)
  ------------------
  |  Branch (102:32): [True: 26.5k, False: 6.04k]
  ------------------
  103|  26.5k|      {
  104|  26.5k|        ojph::size psiz = cod.get_precinct_size(lev);
  105|  26.5k|        if (psiz.w > 256 || psiz.h > 256)
  ------------------
  |  Branch (105:13): [True: 6, False: 26.5k]
  |  Branch (105:29): [True: 1, False: 26.5k]
  ------------------
  106|      7|        {
  107|      7|          cs.close();
  108|      7|          return 0;
  109|      7|        }
  110|  26.5k|      }
  111|  6.05k|    }
  112|       |
  113|  6.04k|    if (skip_res > 0)
  ------------------
  |  Branch (113:9): [True: 1.47k, False: 4.57k]
  ------------------
  114|  1.47k|      cs.restrict_input_resolution(skip_res, skip_res);
  115|       |
  116|  6.04k|    if (force_planar)
  ------------------
  |  Branch (116:9): [True: 2.23k, False: 3.81k]
  ------------------
  117|  2.23k|      cs.set_planar(true);
  118|  3.81k|    else if (force_interleaved)
  ------------------
  |  Branch (118:14): [True: 603, False: 3.21k]
  ------------------
  119|    603|      cs.set_planar(false);
  120|       |
  121|  6.04k|    cs.create();
  122|       |
  123|  6.04k|    ojph::param_siz siz = cs.access_siz();
  124|       |
  125|       |    // Second guard: cap reconstructed dimensions after create().
  126|  6.04k|    {
  127|  6.04k|      ojph::ui64 total_recon = 0;
  128|  10.7k|      for (ojph::ui32 c = 0; c < siz.get_num_components(); ++c)
  ------------------
  |  Branch (128:30): [True: 4.66k, False: 6.04k]
  ------------------
  129|  4.66k|        total_recon += (ojph::ui64)siz.get_recon_width(c)
  130|  4.66k|                     * (ojph::ui64)siz.get_recon_height(c);
  131|  6.04k|      if (total_recon > 65536)
  ------------------
  |  Branch (131:11): [True: 0, False: 6.04k]
  ------------------
  132|      0|      {
  133|      0|        cs.close();
  134|      0|        return 0;
  135|      0|      }
  136|  6.04k|    }
  137|       |
  138|       |    // Time budget: abort if decoding takes too long.
  139|  6.04k|    struct timespec start_ts;
  140|  6.04k|    clock_gettime(CLOCK_MONOTONIC, &start_ts);
  141|  6.04k|    ojph::ui32 pull_count = 0;
  142|  6.04k|    const ojph::ui32 MAX_SECONDS = 10;
  143|  6.04k|    bool timed_out = false;
  144|       |
  145|  6.04k|    if (cs.is_planar())
  ------------------
  |  Branch (145:9): [True: 3.59k, False: 2.45k]
  ------------------
  146|  3.59k|    {
  147|  7.54k|      for (ojph::ui32 c = 0; c < siz.get_num_components() && !timed_out; ++c)
  ------------------
  |  Branch (147:30): [True: 3.95k, False: 3.59k]
  |  Branch (147:62): [True: 3.95k, False: 0]
  ------------------
  148|  3.95k|      {
  149|  3.95k|        ojph::ui32 height = siz.get_recon_height(c);
  150|  1.59M|        for (ojph::ui32 i = height; i > 0 && !timed_out; --i)
  ------------------
  |  Branch (150:37): [True: 1.58M, False: 3.95k]
  |  Branch (150:46): [True: 1.58M, False: 0]
  ------------------
  151|  1.58M|        {
  152|  1.58M|          ojph::ui32 comp_num;
  153|  1.58M|          cs.pull(comp_num);
  154|  1.58M|          if (++pull_count % 64 == 0)
  ------------------
  |  Branch (154:15): [True: 24.0k, False: 1.56M]
  ------------------
  155|  24.0k|          {
  156|  24.0k|            struct timespec now;
  157|  24.0k|            clock_gettime(CLOCK_MONOTONIC, &now);
  158|  24.0k|            if ((ojph::ui32)(now.tv_sec - start_ts.tv_sec) >= MAX_SECONDS)
  ------------------
  |  Branch (158:17): [True: 0, False: 24.0k]
  ------------------
  159|      0|              timed_out = true;
  160|  24.0k|          }
  161|  1.58M|        }
  162|  3.95k|      }
  163|  3.59k|    }
  164|  2.45k|    else
  165|  2.45k|    {
  166|  2.45k|      ojph::ui32 height = siz.get_recon_height(0);
  167|   375k|      for (ojph::ui32 i = 0; i < height && !timed_out; ++i)
  ------------------
  |  Branch (167:30): [True: 372k, False: 2.45k]
  |  Branch (167:44): [True: 372k, False: 0]
  ------------------
  168|   372k|      {
  169|   749k|        for (ojph::ui32 c = 0; c < siz.get_num_components(); ++c)
  ------------------
  |  Branch (169:32): [True: 376k, False: 372k]
  ------------------
  170|   376k|        {
  171|   376k|          ojph::ui32 comp_num;
  172|   376k|          cs.pull(comp_num);
  173|   376k|          if (++pull_count % 64 == 0)
  ------------------
  |  Branch (173:15): [True: 5.75k, False: 370k]
  ------------------
  174|  5.75k|          {
  175|  5.75k|            struct timespec now;
  176|  5.75k|            clock_gettime(CLOCK_MONOTONIC, &now);
  177|  5.75k|            if ((ojph::ui32)(now.tv_sec - start_ts.tv_sec) >= MAX_SECONDS)
  ------------------
  |  Branch (177:17): [True: 0, False: 5.75k]
  ------------------
  178|      0|              timed_out = true;
  179|  5.75k|          }
  180|   376k|        }
  181|   372k|      }
  182|  2.45k|    }
  183|       |
  184|  6.04k|    cs.close();
  185|  6.04k|  }
  186|  6.10k|  catch (const std::exception &)
  187|  6.10k|  {
  188|  1.80k|  }
  189|       |
  190|  6.04k|  return 0;
  191|  6.10k|}

ojph_precinct.cpp:_ZN4ojph5localL7bb_initEPNS0_12bit_read_bufEjPNS_11infile_baseE:
   68|   466k|    {
   69|   466k|      bbp->avail_bits = 0;
   70|   466k|      bbp->file = file;
   71|   466k|      bbp->bytes_left = bytes_left;
   72|   466k|      bbp->tmp = 0;
   73|   466k|      bbp->unstuff = false;
   74|   466k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_skip_sopEPNS0_12bit_read_bufE:
  184|  39.5k|    {
  185|  39.5k|      if (bbp->bytes_left >= 2)
  ------------------
  |  Branch (185:11): [True: 38.9k, False: 587]
  ------------------
  186|  38.9k|      {
  187|  38.9k|        ui8 marker[2];
  188|  38.9k|        if (bbp->file->read(marker, 2) != 2)
  ------------------
  |  Branch (188:13): [True: 1.02k, False: 37.9k]
  ------------------
  189|  1.02k|          throw "error reading from file";
  190|  37.9k|        if ((int)marker[0] == (SOP >> 8) && (int)marker[1] == (SOP & 0xFF))
  ------------------
  |  Branch (190:13): [True: 4.97k, False: 32.9k]
  |  Branch (190:45): [True: 1.14k, False: 3.82k]
  ------------------
  191|  1.14k|        {
  192|  1.14k|          bbp->bytes_left -= 2;
  193|  1.14k|          if (bbp->bytes_left >= 4)
  ------------------
  |  Branch (193:15): [True: 1.07k, False: 73]
  ------------------
  194|  1.07k|          {
  195|  1.07k|            ui16 com_len;
  196|  1.07k|            if (bbp->file->read(&com_len, 2) != 2)
  ------------------
  |  Branch (196:17): [True: 349, False: 726]
  ------------------
  197|    349|              throw "error reading from file";
  198|    726|            com_len = swap_byte(com_len);
  199|    726|            if (com_len != 4)
  ------------------
  |  Branch (199:17): [True: 377, False: 349]
  ------------------
  200|    377|              throw "something is wrong with SOP length";
  201|    349|            int result = 
  202|    349|              bbp->file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
  203|    349|            if (result != 0)
  ------------------
  |  Branch (203:17): [True: 69, False: 280]
  ------------------
  204|     69|              throw "error seeking file";
  205|    280|            bbp->bytes_left -= com_len;
  206|    280|          }
  207|     73|          else
  208|     73|            throw "precinct truncated early";
  209|    280|          return true;
  210|  1.14k|        }
  211|  36.7k|        else
  212|  36.7k|        {
  213|       |          //put the bytes back
  214|  36.7k|          if (bbp->file->seek(-2, infile_base::OJPH_SEEK_CUR) != 0)
  ------------------
  |  Branch (214:15): [True: 0, False: 36.7k]
  ------------------
  215|      0|            throw "error seeking file";
  216|  36.7k|          return false;
  217|  36.7k|        }
  218|  37.9k|      }
  219|       |
  220|    587|      return false;
  221|  39.5k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_read_bitEPNS0_12bit_read_bufERj:
  103|  3.30M|    {
  104|  3.30M|      bool result = true;
  105|  3.30M|      if (bbp->avail_bits == 0)
  ------------------
  |  Branch (105:11): [True: 785k, False: 2.51M]
  ------------------
  106|   785k|        result = bb_read(bbp);
  107|  3.30M|      bit = (bbp->tmp >> --bbp->avail_bits) & 1;
  108|  3.30M|      return result;
  109|  3.30M|    }
ojph_precinct.cpp:_ZN4ojph5localL7bb_readEPNS0_12bit_read_bufE:
   79|  1.16M|    {
   80|  1.16M|      if (bbp->bytes_left > 0)
  ------------------
  |  Branch (80:11): [True: 1.15M, False: 3.59k]
  ------------------
   81|  1.15M|      {
   82|  1.15M|        ui32 t = 0;
   83|  1.15M|        if (bbp->file->read(&t, 1) != 1)
  ------------------
  |  Branch (83:13): [True: 13.5k, False: 1.14M]
  ------------------
   84|  13.5k|          throw "error reading from file";
   85|  1.14M|        bbp->tmp = t;
   86|  1.14M|        bbp->avail_bits = 8 - bbp->unstuff;
   87|  1.14M|        bbp->unstuff = (t == 0xFF);
   88|  1.14M|        --bbp->bytes_left;
   89|  1.14M|        return true;
   90|  1.15M|      }
   91|  3.59k|      else
   92|  3.59k|      {
   93|  3.59k|        bbp->tmp = 0;
   94|  3.59k|        bbp->avail_bits = 8 - bbp->unstuff;
   95|  3.59k|        bbp->unstuff = false;
   96|  3.59k|        return false;
   97|  3.59k|      }
   98|  1.16M|    }
ojph_precinct.cpp:_ZN4ojph5localL12bb_terminateEPNS0_12bit_read_bufEb:
  169|   425k|    {
  170|   425k|      bool result = true;
  171|   425k|      if (bbp->unstuff)
  ------------------
  |  Branch (171:11): [True: 2.18k, False: 423k]
  ------------------
  172|  2.18k|        result = bb_read(bbp);
  173|   425k|      assert(bbp->unstuff == false);
  174|   425k|      if (uses_eph)
  ------------------
  |  Branch (174:11): [True: 3.99k, False: 421k]
  ------------------
  175|  3.99k|        bb_skip_eph(bbp);
  176|   425k|      bbp->tmp = 0;
  177|   425k|      bbp->avail_bits = 0;
  178|   425k|      return result;
  179|   425k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_skip_ephEPNS0_12bit_read_bufE:
  154|  3.99k|    {
  155|  3.99k|      if (bbp->bytes_left >= 2)
  ------------------
  |  Branch (155:11): [True: 3.11k, False: 879]
  ------------------
  156|  3.11k|      {
  157|  3.11k|        ui8 marker[2];
  158|  3.11k|        if (bbp->file->read(marker, 2) != 2)
  ------------------
  |  Branch (158:13): [True: 321, False: 2.79k]
  ------------------
  159|    321|          throw "error reading from file";
  160|  2.79k|        bbp->bytes_left -= 2;
  161|  2.79k|        if ((int)marker[0] != (EPH >> 8) || (int)marker[1] != (EPH & 0xFF))
  ------------------
  |  Branch (161:13): [True: 2.34k, False: 446]
  |  Branch (161:45): [True: 373, False: 73]
  ------------------
  162|  2.72k|          throw "should find EPH, but found something else";
  163|  2.79k|      }
  164|  3.99k|    }
ojph_precinct.cpp:_ZN4ojph5localL12bb_read_bitsEPNS0_12bit_read_bufEiRj:
  114|   394k|    {
  115|   394k|      assert(num_bits <= 32);
  116|       |
  117|   394k|      bits = 0;
  118|   394k|      bool result = true;
  119|  1.13M|      while (num_bits) {
  ------------------
  |  Branch (119:14): [True: 743k, False: 394k]
  ------------------
  120|   743k|        if (bbp->avail_bits == 0)
  ------------------
  |  Branch (120:13): [True: 373k, False: 369k]
  ------------------
  121|   373k|          result = bb_read(bbp);
  122|   743k|        int tx_bits = ojph_min(bbp->avail_bits, num_bits);
  ------------------
  |  |   76|   743k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 349k, False: 394k]
  |  |  ------------------
  ------------------
  123|   743k|        bits <<= tx_bits;
  124|   743k|        bbp->avail_bits -= tx_bits;
  125|   743k|        num_bits -= tx_bits;
  126|   743k|        bits |= (bbp->tmp >> bbp->avail_bits) & ((1 << tx_bits) - 1);
  127|   743k|      }
  128|   394k|      return result;
  129|   394k|    }
ojph_precinct.cpp:_ZN4ojph5localL13bb_read_chunkEPNS0_12bit_read_bufEjRPNS_11coded_listsEPNS_21mem_elastic_allocatorE:
  136|  93.5k|    {
  137|  93.5k|      assert(bbp->avail_bits == 0 && bbp->unstuff == false);
  138|  93.5k|      elastic->get_buffer(num_bytes + coded_cb_header::prefix_buf_size
  139|  93.5k|        + coded_cb_header::suffix_buf_size, cur_coded_list);
  140|  93.5k|      ui32 bytes = ojph_min(num_bytes, bbp->bytes_left);
  ------------------
  |  |   76|  93.5k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 92.1k, False: 1.40k]
  |  |  ------------------
  ------------------
  141|  93.5k|      ui32 bytes_read = (ui32)bbp->file->read(
  142|  93.5k|        cur_coded_list->buf + coded_cb_header::prefix_buf_size, bytes);
  143|  93.5k|      if (num_bytes > bytes_read)
  ------------------
  |  Branch (143:11): [True: 10.9k, False: 82.6k]
  ------------------
  144|  10.9k|        memset(
  145|  10.9k|          cur_coded_list->buf + coded_cb_header::prefix_buf_size + bytes_read,
  146|  10.9k|          0, num_bytes - bytes_read);
  147|  93.5k|      bbp->bytes_left -= bytes_read;
  148|  93.5k|      return bytes_read == bytes;
  149|  93.5k|    }

_ZN4ojph5local9codeblock9pre_allocEPNS0_10codestreamERKNS_4sizeEj:
   58|  2.32M|    {
   59|  2.32M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   60|       |
   61|  2.32M|      assert(byte_alignment / sizeof(ui32) > 1);
   62|  2.32M|      const ui32 f = byte_alignment / sizeof(ui32) - 1;
   63|  2.32M|      ui32 stride = (nominal.w + f) & ~f; // a multiple of 8
   64|       |
   65|  2.32M|      if (precision <= 32)
  ------------------
  |  Branch (65:11): [True: 944k, False: 1.38M]
  ------------------
   66|   944k|        allocator->pre_alloc_data<ui32>(nominal.h * (size_t)stride, 0);
   67|  1.38M|      else
   68|  1.38M|        allocator->pre_alloc_data<ui64>(nominal.h * (size_t)stride, 0);
   69|  2.32M|    }
_ZN4ojph5local9codeblock14finalize_allocEPNS0_10codestreamEPNS0_7subbandERKNS_4sizeES8_PNS0_15coded_cb_headerEjijj:
   78|  2.28M|    {
   79|  2.28M|      mem_fixed_allocator* allocator = codestream->get_allocator();
   80|       |
   81|  2.28M|      const ui32 f = byte_alignment / sizeof(ui32) - 1;
   82|  2.28M|      this->stride = (nominal.w + f) & ~f; // a multiple of 8
   83|  2.28M|      this->buf_size = this->stride * nominal.h;
   84|       |
   85|  2.28M|      if (precision <= 32) {
  ------------------
  |  Branch (85:11): [True: 913k, False: 1.37M]
  ------------------
   86|   913k|        this->precision = BUF32;
   87|   913k|        this->buf32 = allocator->post_alloc_data<ui32>(this->buf_size, 0);
   88|   913k|      }
   89|  1.37M|      else {
   90|  1.37M|        this->precision = BUF64;
   91|  1.37M|        this->buf64 = allocator->post_alloc_data<ui64>(this->buf_size, 0);
   92|  1.37M|      }
   93|       |
   94|  2.28M|      this->nominal_size = nominal;
   95|  2.28M|      this->cb_size = cb_size;
   96|  2.28M|      this->parent = parent;
   97|  2.28M|      this->line_offset = line_offset;
   98|  2.28M|      this->cur_line = 0;
   99|  2.28M|      this->delta = parent->get_delta();
  100|  2.28M|      this->delta_inv = 1.0f / this->delta;
  101|  2.28M|      this->K_max = K_max;
  102|  11.4M|      for (int i = 0; i < 4; ++i)
  ------------------
  |  Branch (102:23): [True: 9.15M, False: 2.28M]
  ------------------
  103|  9.15M|        this->max_val64[i] = 0;
  104|  2.28M|      const param_cod* coc = codestream->get_coc(comp_idx);
  105|  2.28M|      this->reversible = coc->is_reversible();
  106|  2.28M|      this->resilient = codestream->is_resilient();
  107|  2.28M|      this->stripe_causal = coc->get_block_vertical_causality();
  108|  2.28M|      this->zero_block = false;
  109|  2.28M|      this->coded_cb = coded_cb;
  110|       |
  111|  2.28M|      this->codeblock_functions.init(reversible);
  112|  2.28M|    }
_ZN4ojph5local9codeblock8recreateERKNS_4sizeEPNS0_15coded_cb_headerE:
  177|  10.7M|    {
  178|  10.7M|      assert(cb_size.h * stride <= buf_size && cb_size.w <= stride);
  179|  10.7M|      this->cb_size = cb_size;
  180|  10.7M|      this->coded_cb = coded_cb;
  181|  10.7M|      this->cur_line = 0;
  182|  53.7M|      for (int i = 0; i < 4; ++i)
  ------------------
  |  Branch (182:23): [True: 43.0M, False: 10.7M]
  ------------------
  183|  43.0M|        this->max_val64[i] = 0;
  184|  10.7M|      this->zero_block = false;
  185|  10.7M|    }
_ZN4ojph5local9codeblock6decodeEv:
  189|  10.7M|    {
  190|  10.7M|      if (coded_cb->pass_length[0] > 0 && coded_cb->num_passes > 0 &&
  ------------------
  |  Branch (190:11): [True: 89.9k, False: 10.6M]
  |  Branch (190:43): [True: 89.9k, False: 1]
  ------------------
  191|  89.9k|          coded_cb->next_coded != NULL)
  ------------------
  |  Branch (191:11): [True: 84.0k, False: 5.87k]
  ------------------
  192|  84.0k|      {
  193|  84.0k|        bool result;
  194|  84.0k|        if (precision == BUF32)
  ------------------
  |  Branch (194:13): [True: 40.9k, False: 43.0k]
  ------------------
  195|  40.9k|        {
  196|  40.9k|          result = this->codeblock_functions.decode_cb32(
  197|  40.9k|            coded_cb->next_coded->buf + coded_cb_header::prefix_buf_size,
  198|  40.9k|            buf32, coded_cb->missing_msbs, coded_cb->num_passes,
  199|  40.9k|            coded_cb->pass_length[0], coded_cb->pass_length[1],
  200|  40.9k|            cb_size.w, cb_size.h, stride, stripe_causal);
  201|  40.9k|        }
  202|  43.0k|        else
  203|  43.0k|        {
  204|  43.0k|          assert(precision == BUF64);
  205|  43.0k|          result = this->codeblock_functions.decode_cb64(
  206|  43.0k|            coded_cb->next_coded->buf + coded_cb_header::prefix_buf_size,
  207|  43.0k|            buf64, coded_cb->missing_msbs, coded_cb->num_passes,
  208|  43.0k|            coded_cb->pass_length[0], coded_cb->pass_length[1],
  209|  43.0k|            cb_size.w, cb_size.h, stride, stripe_causal);
  210|  43.0k|        }
  211|       |
  212|  84.0k|        if (result == false)
  ------------------
  |  Branch (212:13): [True: 52.3k, False: 31.6k]
  ------------------
  213|  52.3k|        {
  214|  52.3k|          if (resilient == true) {
  ------------------
  |  Branch (214:15): [True: 52.3k, False: 2]
  ------------------
  215|  52.3k|            OJPH_INFO(0x000300A1, "Error decoding a codeblock.");
  ------------------
  |  |  285|  52.3k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  52.3k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 52.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|  52.3k|            zero_block = true;
  217|  52.3k|          }
  218|      2|          else
  219|      2|            OJPH_ERROR(0x000300A1, "Error decoding a codeblock.");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  220|  52.3k|        }
  221|  84.0k|      }
  222|  10.6M|      else
  223|  10.6M|        zero_block = true;
  224|  10.7M|    }
_ZN4ojph5local9codeblock9pull_lineEPNS_8line_bufE:
  229|  32.2M|    {
  230|       |      //convert to sign and magnitude
  231|  32.2M|      if (precision == BUF32)
  ------------------
  |  Branch (231:11): [True: 14.2M, False: 18.0M]
  ------------------
  232|  14.2M|      {
  233|  14.2M|        assert(line->flags & line_buf::LFT_32BIT);
  234|  14.2M|        si32 *dp = line->i32 + line_offset;
  235|  14.2M|        if (!zero_block)
  ------------------
  |  Branch (235:13): [True: 86.4k, False: 14.1M]
  ------------------
  236|  86.4k|        {
  237|  86.4k|          const ui32 *sp = buf32 + cur_line * stride;
  238|  86.4k|          this->codeblock_functions.tx_from_cb32(sp, dp, K_max, delta,
  239|  86.4k|                                                 cb_size.w);
  240|  86.4k|        }
  241|  14.1M|        else
  242|  14.1M|          this->codeblock_functions.mem_clear(dp, cb_size.w * sizeof(ui32));
  243|  14.2M|      }
  244|  18.0M|      else
  245|  18.0M|      {
  246|  18.0M|        assert(precision == BUF64);
  247|  18.0M|        assert((reversible && (line->flags & line_buf::LFT_64BIT))
  248|  18.0M|               || (!reversible && (line->flags & line_buf::LFT_32BIT)));
  249|  18.0M|        si64 *dp = line->i64 + line_offset;
  250|  18.0M|        if (!zero_block)
  ------------------
  |  Branch (250:13): [True: 120k, False: 17.9M]
  ------------------
  251|   120k|        {
  252|   120k|          const ui64 *sp = buf64 + cur_line * stride;
  253|   120k|          this->codeblock_functions.tx_from_cb64(sp, dp, K_max, delta,
  254|   120k|                                                 cb_size.w);
  255|   120k|        }
  256|  17.9M|        else
  257|  17.9M|          this->codeblock_functions.mem_clear(dp, cb_size.w * sizeof(*dp));
  258|  18.0M|      }
  259|       |
  260|  32.2M|      ++cur_line;
  261|       |      assert(cur_line <= cb_size.h);
  262|  32.2M|    }

_ZN4ojph5local13codeblock_fun4initEb:
  132|  2.28M|    void codeblock_fun::init(bool reversible) {
  133|       |
  134|  2.28M|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  135|       |
  136|       |      // Default path, no acceleration.  We may change this later
  137|  2.28M|      decode_cb32 = ojph_decode_codeblock32;
  138|  2.28M|      find_max_val32 = gen_find_max_val32;
  139|  2.28M|      mem_clear = gen_mem_clear;
  140|  2.28M|      if (reversible) {
  ------------------
  |  Branch (140:11): [True: 1.99M, False: 294k]
  ------------------
  141|  1.99M|        tx_to_cb32 = gen_rev_tx_to_cb32;
  142|  1.99M|        tx_from_cb32 = gen_rev_tx_from_cb32;
  143|  1.99M|      }
  144|   294k|      else
  145|   294k|      {
  146|   294k|        tx_to_cb32 = gen_irv_tx_to_cb32;
  147|   294k|        tx_from_cb32 = gen_irv_tx_from_cb32;
  148|   294k|      }
  149|  2.28M|      encode_cb32 = ojph_encode_codeblock32;
  150|       |
  151|  2.28M|      decode_cb64 = ojph_decode_codeblock64;
  152|  2.28M|      find_max_val64 = gen_find_max_val64;
  153|  2.28M|      if (reversible) {
  ------------------
  |  Branch (153:11): [True: 1.99M, False: 294k]
  ------------------
  154|  1.99M|        tx_to_cb64 = gen_rev_tx_to_cb64;
  155|  1.99M|        tx_from_cb64 = gen_rev_tx_from_cb64;
  156|  1.99M|      }
  157|   294k|      else
  158|   294k|      {
  159|   294k|        tx_to_cb64 = NULL;
  160|   294k|        tx_from_cb64 = gen_irv_tx_from_cb64;
  161|   294k|      }
  162|  2.28M|      encode_cb64 = ojph_encode_codeblock64;
  163|  2.28M|      bool result = initialize_block_encoder_tables();
  164|  2.28M|      assert(result); ojph_unused(result);
  ------------------
  |  |   78|  2.28M|#define ojph_unused(x) (void)(x)
  ------------------
  165|       |
  166|  2.28M|  #ifndef OJPH_DISABLE_SIMD
  167|       |
  168|  2.28M|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  169|       |
  170|       |      // Accelerated functions for INTEL/AMD CPUs
  171|  2.28M|      #ifndef OJPH_DISABLE_SSE
  172|  2.28M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  ------------------
  |  Branch (172:13): [True: 2.28M, False: 0]
  ------------------
  173|  2.28M|          mem_clear = sse_mem_clear;
  174|  2.28M|      #endif // !OJPH_DISABLE_SSE
  175|       |
  176|  2.28M|      #ifndef OJPH_DISABLE_SSE2
  177|  2.28M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2) {
  ------------------
  |  Branch (177:13): [True: 2.28M, False: 0]
  ------------------
  178|  2.28M|          find_max_val32 = sse2_find_max_val32;
  179|  2.28M|          if (reversible) {
  ------------------
  |  Branch (179:15): [True: 1.99M, False: 294k]
  ------------------
  180|  1.99M|            tx_to_cb32 = sse2_rev_tx_to_cb32;
  181|  1.99M|            tx_from_cb32 = sse2_rev_tx_from_cb32;
  182|  1.99M|          }
  183|   294k|          else {
  184|   294k|            tx_to_cb32 = sse2_irv_tx_to_cb32;
  185|   294k|            tx_from_cb32 = sse2_irv_tx_from_cb32;
  186|   294k|          }
  187|  2.28M|          find_max_val64 = sse2_find_max_val64;
  188|  2.28M|          if (reversible) {
  ------------------
  |  Branch (188:15): [True: 1.99M, False: 294k]
  ------------------
  189|  1.99M|            tx_to_cb64 = sse2_rev_tx_to_cb64;
  190|  1.99M|            tx_from_cb64 = sse2_rev_tx_from_cb64;
  191|  1.99M|          }
  192|   294k|          else
  193|   294k|          {
  194|   294k|            tx_to_cb64 = NULL;
  195|   294k|            tx_from_cb64 = gen_irv_tx_from_cb64;
  196|   294k|          }
  197|  2.28M|        }
  198|  2.28M|      #endif // !OJPH_DISABLE_SSE2
  199|       |
  200|  2.28M|      #ifndef OJPH_DISABLE_SSSE3
  201|  2.28M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSSE3)
  ------------------
  |  Branch (201:13): [True: 2.28M, False: 0]
  ------------------
  202|  2.28M|          decode_cb32 = ojph_decode_codeblock_ssse3;
  203|  2.28M|      #endif // !OJPH_DISABLE_SSSE3
  204|       |
  205|  2.28M|      #ifndef OJPH_DISABLE_AVX
  206|  2.28M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  ------------------
  |  Branch (206:13): [True: 2.28M, False: 0]
  ------------------
  207|  2.28M|          mem_clear = avx_mem_clear;
  208|  2.28M|      #endif // !OJPH_DISABLE_AVX
  209|       |
  210|  2.28M|      #ifndef OJPH_DISABLE_AVX2
  211|  2.28M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2) {
  ------------------
  |  Branch (211:13): [True: 2.28M, False: 0]
  ------------------
  212|  2.28M|          decode_cb32 = ojph_decode_codeblock_avx2;
  213|  2.28M|          find_max_val32 = avx2_find_max_val32;
  214|  2.28M|          if (reversible) {
  ------------------
  |  Branch (214:15): [True: 1.99M, False: 294k]
  ------------------
  215|  1.99M|            tx_to_cb32 = avx2_rev_tx_to_cb32;
  216|  1.99M|            tx_from_cb32 = avx2_rev_tx_from_cb32;
  217|  1.99M|          }
  218|   294k|          else {
  219|   294k|            tx_to_cb32 = avx2_irv_tx_to_cb32;
  220|   294k|            tx_from_cb32 = avx2_irv_tx_from_cb32;
  221|   294k|          }
  222|  2.28M|          encode_cb32 = ojph_encode_codeblock_avx2;
  223|  2.28M|          bool result = initialize_block_encoder_tables_avx2();
  224|  2.28M|          assert(result); ojph_unused(result);
  ------------------
  |  |   78|  2.28M|#define ojph_unused(x) (void)(x)
  ------------------
  225|       |
  226|  2.28M|          find_max_val64 = avx2_find_max_val64;
  227|  2.28M|          if (reversible) {
  ------------------
  |  Branch (227:15): [True: 1.99M, False: 294k]
  ------------------
  228|  1.99M|            tx_to_cb64 = avx2_rev_tx_to_cb64;
  229|  1.99M|            tx_from_cb64 = avx2_rev_tx_from_cb64;
  230|  1.99M|          }
  231|   294k|          else
  232|   294k|          {
  233|   294k|            tx_to_cb64 = NULL;
  234|   294k|            tx_from_cb64 = gen_irv_tx_from_cb64;
  235|   294k|          }
  236|  2.28M|        }
  237|  2.28M|      #endif // !OJPH_DISABLE_AVX2
  238|       |
  239|  2.28M|      #if (defined(OJPH_ARCH_X86_64) && !defined(OJPH_DISABLE_AVX512))
  240|  2.28M|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX512) {
  ------------------
  |  Branch (240:13): [True: 0, False: 2.28M]
  ------------------
  241|      0|          encode_cb32 = ojph_encode_codeblock_avx512;
  242|      0|          bool result = initialize_block_encoder_tables_avx512();
  243|      0|          assert(result); ojph_unused(result);
  ------------------
  |  |   78|      0|#define ojph_unused(x) (void)(x)
  ------------------
  244|      0|        }
  245|  2.28M|      #endif // !OJPH_DISABLE_AVX512
  246|       |
  247|       |    #elif defined(OJPH_ARCH_ARM)
  248|       |
  249|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  250|       |
  251|  2.28M|  #endif // !OJPH_DISABLE_SIMD
  252|       |
  253|       |#else // OJPH_ENABLE_WASM_SIMD
  254|       |
  255|       |      // Accelerated functions for WASM SIMD.
  256|       |      decode_cb32 = ojph_decode_codeblock_wasm;
  257|       |      find_max_val32 = wasm_find_max_val32;
  258|       |      mem_clear = wasm_mem_clear;
  259|       |      if (reversible) {
  260|       |        tx_to_cb32 = wasm_rev_tx_to_cb32;
  261|       |        tx_from_cb32 = wasm_rev_tx_from_cb32;
  262|       |      }
  263|       |      else {
  264|       |        tx_to_cb32 = wasm_irv_tx_to_cb32;
  265|       |        tx_from_cb32 = wasm_irv_tx_from_cb32;
  266|       |      }
  267|       |      encode_cb32 = ojph_encode_codeblock32;
  268|       |
  269|       |      decode_cb64 = ojph_decode_codeblock64;
  270|       |      find_max_val64 = wasm_find_max_val64;
  271|       |      if (reversible) {
  272|       |        tx_to_cb64 = wasm_rev_tx_to_cb64;
  273|       |        tx_from_cb64 = wasm_rev_tx_from_cb64;
  274|       |      }
  275|       |      else
  276|       |      {
  277|       |        tx_to_cb64 = NULL;
  278|       |        tx_from_cb64 = gen_irv_tx_from_cb64;
  279|       |      }
  280|       |      encode_cb64 = ojph_encode_codeblock64;
  281|       |      bool result = initialize_block_encoder_tables();
  282|       |      assert(result); ojph_unused(result);
  283|       |
  284|       |#endif // !OJPH_ENABLE_WASM_SIMD
  285|       |
  286|  2.28M|    }

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

_ZN4ojph5local13avx_mem_clearEPvm:
   48|  32.0M|    {
   49|  32.0M|      float* p = (float*)addr;
   50|  32.0M|      __m256 zero = _mm256_setzero_ps();
   51|  74.9M|      for (size_t i = 0; i < count; i += 32, p += 8)
  ------------------
  |  Branch (51:26): [True: 42.8M, False: 32.0M]
  ------------------
   52|  42.8M|        _mm256_storeu_ps(p, zero);
   53|  32.0M|    }

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

_ZN4ojph5local10codestreamC2Ev:
   57|  6.10k|    : precinct_scratch(NULL), allocator(NULL), elastic_alloc(NULL)
   58|  6.10k|    {
   59|  6.10k|      allocator = new mem_fixed_allocator;
   60|  6.10k|      elastic_alloc = new mem_elastic_allocator(1048576); // 1 megabyte
   61|       |
   62|  6.10k|      init_colour_transform_functions();
   63|  6.10k|      init_wavelet_transform_functions();
   64|       |
   65|  6.10k|      restart();
   66|  6.10k|    }
_ZN4ojph5local10codestreamD2Ev:
   70|  6.10k|    {
   71|  6.10k|      if (allocator)
  ------------------
  |  Branch (71:11): [True: 6.10k, False: 0]
  ------------------
   72|  6.10k|        delete allocator;
   73|  6.10k|      if (elastic_alloc)
  ------------------
  |  Branch (73:11): [True: 6.10k, False: 0]
  ------------------
   74|  6.10k|        delete elastic_alloc;
   75|  6.10k|    }
_ZN4ojph5local10codestream7restartEv:
   79|  6.10k|    {
   80|  6.10k|      tiles = NULL;
   81|  6.10k|      lines = NULL;
   82|  6.10k|      comp_size = NULL;
   83|  6.10k|      recon_comp_size = NULL;
   84|  6.10k|      outfile = NULL;
   85|  6.10k|      infile = NULL;
   86|       |
   87|  6.10k|      num_comps = 0;
   88|  6.10k|      employ_color_transform = false;
   89|  6.10k|      planar = -1;
   90|  6.10k|      profile = OJPH_PN_UNDEFINED;
   91|  6.10k|      tilepart_div = OJPH_TILEPART_NO_DIVISIONS;
   92|  6.10k|      need_tlm = false;
   93|       |
   94|  6.10k|      cur_comp = 0;
   95|  6.10k|      cur_line = 0;
   96|  6.10k|      cur_tile_row = 0;
   97|  6.10k|      resilient = false;
   98|  6.10k|      skipped_res_for_read = skipped_res_for_recon = 0;
   99|       |
  100|  6.10k|      precinct_scratch_needed_bytes = 0;
  101|       |
  102|  6.10k|      cod.restart();
  103|  6.10k|      qcd.restart();
  104|  6.10k|      nlt.restart();
  105|  6.10k|      dfs.restart();
  106|  6.10k|      atk.restart();
  107|       |
  108|  6.10k|      allocator->restart();
  109|  6.10k|      elastic_alloc->restart();
  110|  6.10k|    }
_ZN4ojph5local10codestream9pre_allocEv:
  114|  4.42k|    {
  115|  4.42k|      ojph::param_siz sz = access_siz();
  116|  4.42k|      num_tiles.w = sz.get_image_extent().x - sz.get_tile_offset().x;
  117|  4.42k|      num_tiles.w = ojph_div_ceil(num_tiles.w, sz.get_tile_size().w);
  ------------------
  |  |   70|  4.42k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  118|  4.42k|      num_tiles.h = sz.get_image_extent().y - sz.get_tile_offset().y;
  119|  4.42k|      num_tiles.h = ojph_div_ceil(num_tiles.h, sz.get_tile_size().h);
  ------------------
  |  |   70|  4.42k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  120|  4.42k|      if (num_tiles.area() > 65535)
  ------------------
  |  Branch (120:11): [True: 1, False: 4.42k]
  ------------------
  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|  4.42k|      if (num_tiles.area() == 0)
  ------------------
  |  Branch (122:11): [True: 1, False: 4.42k]
  ------------------
  123|      1|        OJPH_ERROR(0x00030012, "the number of tiles cannot be 0");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|       |
  125|       |      //allocate tiles
  126|  4.42k|      allocator->pre_alloc_obj<tile>((size_t)num_tiles.area());
  127|       |
  128|  4.42k|      ui32 num_tileparts = 0;
  129|  4.42k|      point index;
  130|  4.42k|      rect tile_rect, recon_tile_rect;
  131|  4.42k|      ui32 ds = 1 << skipped_res_for_recon;
  132|  49.3k|      for (index.y = 0; index.y < num_tiles.h; ++index.y)
  ------------------
  |  Branch (132:25): [True: 44.9k, False: 4.42k]
  ------------------
  133|  44.9k|      {
  134|  44.9k|        ui32 y0 = sz.get_tile_offset().y
  135|  44.9k|                + index.y * sz.get_tile_size().h;
  136|  44.9k|        ui32 y1 = y0 + sz.get_tile_size().h; //end of tile
  137|       |
  138|  44.9k|        tile_rect.org.y = ojph_max(y0, sz.get_image_offset().y);
  ------------------
  |  |   73|  44.9k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 40.4k, False: 4.42k]
  |  |  ------------------
  ------------------
  139|  44.9k|        tile_rect.siz.h =
  140|  44.9k|          ojph_min(y1, sz.get_image_extent().y) - tile_rect.org.y;
  ------------------
  |  |   76|  44.9k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 40.4k, False: 4.42k]
  |  |  ------------------
  ------------------
  141|       |
  142|  44.9k|        recon_tile_rect.org.y = ojph_max(ojph_div_ceil(y0, ds),
  ------------------
  |  |   73|  44.9k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 40.4k, False: 4.44k]
  |  |  ------------------
  ------------------
  143|  44.9k|          ojph_div_ceil(sz.get_image_offset().y, ds));
  144|  44.9k|        recon_tile_rect.siz.h = ojph_min(ojph_div_ceil(y1, ds),
  ------------------
  |  |   76|  44.9k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 40.4k, False: 4.48k]
  |  |  ------------------
  ------------------
  145|  44.9k|          ojph_div_ceil(sz.get_image_extent().y, ds))
  146|  44.9k|          - recon_tile_rect.org.y;
  147|       |
  148|   136k|        for (index.x = 0; index.x < num_tiles.w; ++index.x)
  ------------------
  |  Branch (148:27): [True: 91.8k, False: 44.9k]
  ------------------
  149|  91.8k|        {
  150|  91.8k|          ui32 x0 = sz.get_tile_offset().x
  151|  91.8k|                  + index.x * sz.get_tile_size().w;
  152|  91.8k|          ui32 x1 = x0 + sz.get_tile_size().w;
  153|       |
  154|  91.8k|          tile_rect.org.x = ojph_max(x0, sz.get_image_offset().x);
  ------------------
  |  |   73|  91.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 46.8k, False: 44.9k]
  |  |  ------------------
  ------------------
  155|  91.8k|          tile_rect.siz.w =
  156|  91.8k|            ojph_min(x1, sz.get_image_extent().x) - tile_rect.org.x;
  ------------------
  |  |   76|  91.8k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 46.8k, False: 44.9k]
  |  |  ------------------
  ------------------
  157|       |
  158|  91.8k|          recon_tile_rect.org.x = ojph_max(ojph_div_ceil(x0, ds),
  ------------------
  |  |   73|  91.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 46.8k, False: 44.9k]
  |  |  ------------------
  ------------------
  159|  91.8k|            ojph_div_ceil(sz.get_image_offset().x, ds));
  160|  91.8k|          recon_tile_rect.siz.w = ojph_min(ojph_div_ceil(x1, ds),
  ------------------
  |  |   76|  91.8k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 46.8k, False: 44.9k]
  |  |  ------------------
  ------------------
  161|  91.8k|            ojph_div_ceil(sz.get_image_extent().x, ds))
  162|  91.8k|            - recon_tile_rect.org.x;
  163|       |
  164|  91.8k|          ui32 tps = 0; // number of tileparts for this tile
  165|  91.8k|          tile::pre_alloc(this, tile_rect, recon_tile_rect, tps);
  166|  91.8k|          num_tileparts += tps;
  167|  91.8k|        }
  168|  44.9k|      }
  169|       |
  170|       |      //allocate lines
  171|       |      //These lines are used by codestream to exchange data with external
  172|       |      // world
  173|  4.42k|      ui32 num_comps = sz.get_num_components();
  174|  4.42k|      allocator->pre_alloc_obj<line_buf>(num_comps);
  175|  4.42k|      allocator->pre_alloc_obj<size>(num_comps); //for *comp_size
  176|  4.42k|      allocator->pre_alloc_obj<size>(num_comps); //for *recon_comp_size
  177|  9.37k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (177:24): [True: 4.95k, False: 4.42k]
  ------------------
  178|  4.95k|        allocator->pre_alloc_data<si32>(siz.get_recon_width(i), 0);
  179|       |
  180|       |      //allocate tlm
  181|  4.42k|      if (outfile != NULL && need_tlm)
  ------------------
  |  Branch (181:11): [True: 0, False: 4.42k]
  |  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|  4.42k|      ui32 num_decomps = cod.get_num_decompositions();
  186|  4.42k|      size log_cb = cod.get_log_block_dims();
  187|       |
  188|  4.42k|      size ratio;
  189|  30.8k|      for (ui32 r = 0; r <= num_decomps; ++r)
  ------------------
  |  Branch (189:24): [True: 26.4k, False: 4.42k]
  ------------------
  190|  26.4k|      {
  191|  26.4k|        size log_PP = cod.get_log_precinct_size(r);
  192|  26.4k|        ratio.w = ojph_max(ratio.w, log_PP.w - ojph_min(log_cb.w, log_PP.w));
  ------------------
  |  |   73|  52.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 4.85k, False: 21.5k]
  |  |  |  Branch (73:33): [True: 4.00k, False: 22.4k]
  |  |  |  Branch (73:46): [True: 3.13k, False: 18.4k]
  |  |  ------------------
  ------------------
  193|  26.4k|        ratio.h = ojph_max(ratio.h, log_PP.h - ojph_min(log_cb.h, log_PP.h));
  ------------------
  |  |   73|  52.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.07k, False: 25.3k]
  |  |  |  Branch (73:33): [True: 1.48k, False: 24.9k]
  |  |  |  Branch (73:46): [True: 1.35k, False: 23.9k]
  |  |  ------------------
  ------------------
  194|  26.4k|      }
  195|  4.42k|      ui32 max_ratio = ojph_max(ratio.w, ratio.h);
  ------------------
  |  |   73|  4.42k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.97k, False: 2.45k]
  |  |  ------------------
  ------------------
  196|  4.42k|      max_ratio = 1 << max_ratio;
  197|       |      // assuming that we have a hierarchy of n levels.
  198|       |      // This needs 4/3 times the area, rounded up
  199|       |      // (rounding up leaves one extra entry).
  200|       |      // This exta entry is necessary
  201|       |      // We need 4 such tables. These tables store
  202|       |      // 1. missing msbs and 2. their flags,
  203|       |      // 3. number of layers and 4. their flags
  204|  4.42k|      precinct_scratch_needed_bytes =
  205|  4.42k|        4 * ((max_ratio * max_ratio * 4 + 2) / 3);
  206|       |
  207|  4.42k|      allocator->pre_alloc_obj<ui8>(precinct_scratch_needed_bytes);
  208|  4.42k|    }
_ZN4ojph5local10codestream14finalize_allocEv:
  212|  4.40k|    {
  213|  4.40k|      allocator->alloc();
  214|       |
  215|       |      //precinct scratch buffer
  216|  4.40k|      precinct_scratch =
  217|  4.40k|        allocator->post_alloc_obj<ui8>(precinct_scratch_needed_bytes);
  218|       |
  219|       |      //get tiles
  220|  4.40k|      tiles = this->allocator->post_alloc_obj<tile>((size_t)num_tiles.area());
  221|       |
  222|  4.40k|      ui32 num_tileparts = 0;
  223|  4.40k|      point index;
  224|  4.40k|      rect tile_rect;
  225|  4.40k|      ojph::param_siz sz = access_siz();
  226|  48.0k|      for (index.y = 0; index.y < num_tiles.h; ++index.y)
  ------------------
  |  Branch (226:25): [True: 43.6k, False: 4.40k]
  ------------------
  227|  43.6k|      {
  228|  43.6k|        ui32 y0 = sz.get_tile_offset().y
  229|  43.6k|                + index.y * sz.get_tile_size().h;
  230|  43.6k|        ui32 y1 = y0 + sz.get_tile_size().h; //end of tile
  231|       |
  232|  43.6k|        tile_rect.org.y = ojph_max(y0, sz.get_image_offset().y);
  ------------------
  |  |   73|  43.6k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 39.2k, False: 4.40k]
  |  |  ------------------
  ------------------
  233|  43.6k|        tile_rect.siz.h =
  234|  43.6k|          ojph_min(y1, sz.get_image_extent().y) - tile_rect.org.y;
  ------------------
  |  |   76|  43.6k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 39.2k, False: 4.37k]
  |  |  ------------------
  ------------------
  235|       |
  236|  43.6k|        ui32 offset = 0;
  237|   133k|        for (index.x = 0; index.x < num_tiles.w; ++index.x)
  ------------------
  |  Branch (237:27): [True: 89.8k, False: 43.6k]
  ------------------
  238|  89.8k|        {
  239|  89.8k|          ui32 x0 = sz.get_tile_offset().x
  240|  89.8k|                  + index.x * sz.get_tile_size().w;
  241|  89.8k|          ui32 x1 = x0 + sz.get_tile_size().w;
  242|       |
  243|  89.8k|          tile_rect.org.x = ojph_max(x0, sz.get_image_offset().x);
  ------------------
  |  |   73|  89.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 46.1k, False: 43.6k]
  |  |  ------------------
  ------------------
  244|  89.8k|          tile_rect.siz.w =
  245|  89.8k|            ojph_min(x1, sz.get_image_extent().x) - tile_rect.org.x;
  ------------------
  |  |   76|  89.8k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 46.1k, False: 43.6k]
  |  |  ------------------
  ------------------
  246|       |
  247|  89.8k|          ui32 tps = 0; // number of tileparts for this tile
  248|  89.8k|          ui32 idx = index.y * num_tiles.w + index.x;
  249|  89.8k|          tiles[idx].finalize_alloc(this, tile_rect, idx, offset, tps);
  250|  89.8k|          num_tileparts += tps;
  251|  89.8k|        }
  252|  43.6k|      }
  253|       |
  254|       |      //allocate lines
  255|       |      //These lines are used by codestream to exchange data with external
  256|       |      // world
  257|  4.40k|      this->num_comps = sz.get_num_components();
  258|  4.40k|      lines = allocator->post_alloc_obj<line_buf>(this->num_comps);
  259|  4.40k|      comp_size = allocator->post_alloc_obj<size>(this->num_comps);
  260|  4.40k|      recon_comp_size = allocator->post_alloc_obj<size>(this->num_comps);
  261|  4.40k|      employ_color_transform = cod.is_employing_color_transform();
  262|  9.09k|      for (ui32 i = 0; i < this->num_comps; ++i)
  ------------------
  |  Branch (262:24): [True: 4.68k, False: 4.40k]
  ------------------
  263|  4.68k|      {
  264|  4.68k|        comp_size[i].w = siz.get_width(i);
  265|  4.68k|        comp_size[i].h = siz.get_height(i);
  266|  4.68k|        ui32 cw = siz.get_recon_width(i);
  267|  4.68k|        recon_comp_size[i].w = cw;
  268|  4.68k|        recon_comp_size[i].h = siz.get_recon_height(i);
  269|  4.68k|        lines[i].wrap(allocator->post_alloc_data<si32>(cw, 0), cw, 0);
  270|  4.68k|      }
  271|       |
  272|  4.40k|      cur_comp = 0;
  273|  4.40k|      cur_line = 0;
  274|       |
  275|       |      //allocate tlm
  276|  4.40k|      if (outfile != NULL && need_tlm)
  ------------------
  |  Branch (276:11): [True: 0, False: 4.40k]
  |  Branch (276:30): [True: 0, False: 0]
  ------------------
  277|      0|        tlm.init(num_tileparts,
  278|      0|          allocator->post_alloc_obj<param_tlm::Ttlm_Ptlm_pair>(num_tileparts));
  279|  4.40k|    }
_ZN4ojph5local10codestream12read_headersEPNS_11infile_baseE:
  753|  6.10k|    {
  754|  6.10k|      ui16 marker_list[20] = { SOC, SIZ, CAP, PRF, CPF, COD, COC, QCD, QCC,
  755|  6.10k|        RGN, POC, PPM, TLM, PLM, CRG, COM, DFS, ATK, NLT, SOT };
  756|  6.10k|      find_marker(file, marker_list, 1); //find SOC
  757|  6.10k|      find_marker(file, marker_list + 1, 1); //find SIZ
  758|  6.10k|      siz.read(file);
  759|  6.10k|      int marker_idx = 0;
  760|  6.10k|      int received_markers = 0; //check that COD, & QCD received
  761|   770k|      while (true)
  ------------------
  |  Branch (761:14): [True: 768k, Folded]
  ------------------
  762|   768k|      {
  763|   768k|        marker_idx = find_marker(file, marker_list + 2, 18);
  764|   768k|        if (marker_idx == 0)
  ------------------
  |  Branch (764:13): [True: 427, False: 768k]
  ------------------
  765|    427|          cap.read(file);
  766|   768k|        else if (marker_idx == 1)
  ------------------
  |  Branch (766:18): [True: 281, False: 767k]
  ------------------
  767|       |          //Skipping PRF marker segment; this should not cause any issues
  768|    281|          skip_marker(file, "PRF", NULL, OJPH_MSG_NO_MSG, false);
  769|   767k|        else if (marker_idx == 2)
  ------------------
  |  Branch (769:18): [True: 236, False: 767k]
  ------------------
  770|       |          //Skipping CPF marker segment; this should not cause any issues
  771|    236|          skip_marker(file, "CPF", NULL, OJPH_MSG_NO_MSG, false);
  772|   767k|        else if (marker_idx == 3)
  ------------------
  |  Branch (772:18): [True: 5.73k, False: 761k]
  ------------------
  773|  5.73k|        {
  774|  5.73k|          cod.read(file);
  775|  5.73k|          received_markers |= 1;
  776|  5.73k|          ojph::param_cod c(&cod);
  777|  5.73k|          int num_qlayers = c.get_num_layers();
  778|  5.73k|          if (num_qlayers != 1)
  ------------------
  |  Branch (778:15): [True: 16, False: 5.72k]
  ------------------
  779|     16|            OJPH_ERROR(0x00030053, "The current implementation supports "
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  780|  5.73k|              "1 quality layer only.  This codestream has %d quality layers",
  781|  5.73k|              num_qlayers);
  782|  5.73k|        }
  783|   761k|        else if (marker_idx == 4)
  ------------------
  |  Branch (783:18): [True: 540, False: 761k]
  ------------------
  784|    540|        {
  785|    540|          param_cod* p = cod.add_coc_object(param_cod::OJPH_COD_UNKNOWN);
  786|    540|          p->read_coc(file, siz.get_num_components(), &cod);
  787|    540|          if (p->get_comp_idx() >= siz.get_num_components())
  ------------------
  |  Branch (787:15): [True: 108, False: 432]
  ------------------
  788|    108|            OJPH_INFO(0x00030056, "The codestream carries a COC marker "
  ------------------
  |  |  285|    108|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    108|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 108, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  789|    540|              "segment for a component indexed by %d, which is more than the "
  790|    540|              "allowed index number, since the codestream has %d components",
  791|    540|              p->get_comp_idx(), num_comps);
  792|    540|          param_cod *q = cod.get_coc(p->get_comp_idx());
  793|    540|          if (p != q && p->get_comp_idx() == q->get_comp_idx())
  ------------------
  |  Branch (793:15): [True: 6, False: 534]
  |  Branch (793:25): [True: 6, False: 0]
  ------------------
  794|      6|            OJPH_ERROR(0x00030057, "The codestream has two COC 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  795|    540|              "segments for one component of index %d",  p->get_comp_idx());
  796|    540|        }
  797|   761k|        else if (marker_idx == 5)
  ------------------
  |  Branch (797:18): [True: 5.60k, False: 755k]
  ------------------
  798|  5.60k|        {
  799|  5.60k|          qcd.read(file);
  800|  5.60k|          received_markers |= 2;
  801|  5.60k|        }
  802|   755k|        else if (marker_idx == 6)
  ------------------
  |  Branch (802:18): [True: 237, False: 755k]
  ------------------
  803|    237|        {
  804|    237|          param_qcd* p = qcd.add_qcc_object(param_qcd::OJPH_QCD_UNKNOWN);
  805|    237|          p->read_qcc(file, siz.get_num_components());
  806|    237|          if (p->get_comp_idx() >= siz.get_num_components())
  ------------------
  |  Branch (806:15): [True: 15, False: 222]
  ------------------
  807|     15|            OJPH_ERROR(0x00030054, "The codestream carries a QCC marker "
  ------------------
  |  |  289|     15|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     15|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  808|    237|              "segment for a component indexed by %d, which is more than the "
  809|    237|              "allowed index number, since the codestream has %d components",
  810|    237|              p->get_comp_idx(), num_comps);
  811|    237|          param_qcd *q = qcd.get_qcc(p->get_comp_idx());
  812|    237|          if (p != q && p->get_comp_idx() == q->get_comp_idx())
  ------------------
  |  Branch (812:15): [True: 7, False: 230]
  |  Branch (812:25): [True: 7, False: 0]
  ------------------
  813|      7|            OJPH_ERROR(0x00030055, "The codestream has two QCC 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  814|    237|              "segments for one component of index %d", p->get_comp_idx());
  815|    237|        }
  816|   755k|        else if (marker_idx == 7)
  ------------------
  |  Branch (816:18): [True: 2.27k, False: 753k]
  ------------------
  817|  2.27k|          skip_marker(file, "RGN", "RGN is not supported yet",
  818|  2.27k|            OJPH_MSG_WARN, false);
  819|   753k|        else if (marker_idx == 8)
  ------------------
  |  Branch (819:18): [True: 241, False: 753k]
  ------------------
  820|    241|          skip_marker(file, "POC", "POC is not supported yet",
  821|    241|            OJPH_MSG_WARN, false);
  822|   753k|        else if (marker_idx == 9)
  ------------------
  |  Branch (822:18): [True: 383, False: 752k]
  ------------------
  823|    383|          skip_marker(file, "PPM", "PPM is not supported yet",
  824|    383|            OJPH_MSG_WARN, false);
  825|   752k|        else if (marker_idx == 10)
  ------------------
  |  Branch (825:18): [True: 465, False: 752k]
  ------------------
  826|       |          //Skipping TLM marker segment; this should not cause any issues
  827|    465|          skip_marker(file, "TLM", NULL, OJPH_MSG_NO_MSG, false);
  828|   752k|        else if (marker_idx == 11)
  ------------------
  |  Branch (828:18): [True: 228, False: 752k]
  ------------------
  829|       |          //Skipping PLM marker segment; this should not cause any issues
  830|    228|          skip_marker(file, "PLM", NULL, OJPH_MSG_NO_MSG, false);
  831|   752k|        else if (marker_idx == 12)
  ------------------
  |  Branch (831:18): [True: 271, False: 751k]
  ------------------
  832|       |          //Skipping CRG marker segment;
  833|    271|          skip_marker(file, "CRG", "CRG has been ignored; CRG is related to"
  834|    271|            " where the Cb and Cr colour components are co-sited or located"
  835|    271|            " with respect to the Y' luma component. Perhaps, it is better"
  836|    271|            " to get the individual components and assemble the samples"
  837|    271|            " according to your needs",
  838|    271|            OJPH_MSG_INFO, false);
  839|   751k|        else if (marker_idx == 13)
  ------------------
  |  Branch (839:18): [True: 334, False: 751k]
  ------------------
  840|    334|          skip_marker(file, "COM", NULL, OJPH_MSG_NO_MSG, false);
  841|   751k|        else if (marker_idx == 14)
  ------------------
  |  Branch (841:18): [True: 745k, False: 5.99k]
  ------------------
  842|   745k|          dfs.read(file);
  843|  5.99k|        else if (marker_idx == 15)
  ------------------
  |  Branch (843:18): [True: 243, False: 5.75k]
  ------------------
  844|    243|          atk.read(file);
  845|  5.75k|        else if (marker_idx == 16)
  ------------------
  |  Branch (845:18): [True: 954, False: 4.79k]
  ------------------
  846|    954|          nlt.read(file);
  847|  4.79k|        else if (marker_idx == 17)
  ------------------
  |  Branch (847:18): [True: 4.52k, False: 276]
  ------------------
  848|  4.52k|          break;
  849|    276|        else
  850|   764k|          OJPH_ERROR(0x00030051, "File ended before finding a tile segment");
  ------------------
  |  |  289|    276|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    276|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 276, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  851|   764k|      }
  852|       |
  853|  6.10k|      cod.update_atk(&atk);
  854|  6.10k|      siz.link(&cod);
  855|  6.10k|      if (dfs.exists())
  ------------------
  |  Branch (855:11): [True: 220, False: 5.88k]
  ------------------
  856|    220|        siz.link(&dfs);
  857|       |
  858|  6.10k|      if (received_markers != 3)
  ------------------
  |  Branch (858:11): [True: 22, False: 6.08k]
  ------------------
  859|     22|        OJPH_ERROR(0x00030052, "markers error, COD and QCD are required");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  860|       |
  861|  6.10k|      this->infile = file;
  862|  6.10k|      planar = cod.is_employing_color_transform() ? 0 : 1;
  ------------------
  |  Branch (862:16): [True: 312, False: 5.79k]
  ------------------
  863|  6.10k|    }
_ZN4ojph5local10codestream25restrict_input_resolutionEjj:
  868|  1.47k|    {
  869|  1.47k|      if (skipped_res_for_read < skipped_res_for_recon)
  ------------------
  |  Branch (869:11): [True: 0, False: 1.47k]
  ------------------
  870|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  871|  1.47k|          "skipped_resolution for data %d must be equal or smaller than "
  872|  1.47k|          " skipped_resolution for reconstruction %d\n",
  873|  1.47k|          skipped_res_for_read, skipped_res_for_recon);
  874|  1.47k|      if (skipped_res_for_read > cod.get_num_decompositions())
  ------------------
  |  Branch (874:11): [True: 2, False: 1.46k]
  ------------------
  875|      2|        OJPH_ERROR(0x000300A2,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  876|  1.47k|          "skipped_resolution for data %d must be smaller than "
  877|  1.47k|          " the number of decomposition levels %d\n",
  878|  1.47k|          skipped_res_for_read, cod.get_num_decompositions());
  879|       |
  880|  1.47k|      this->skipped_res_for_read = skipped_res_for_read;
  881|  1.47k|      this->skipped_res_for_recon = skipped_res_for_recon;
  882|  1.47k|      siz.set_skipped_resolutions(skipped_res_for_recon);
  883|  1.47k|    }
_ZN4ojph5local10codestream17enable_resilienceEv:
  887|  6.10k|    {
  888|  6.10k|      if (infile != NULL)
  ------------------
  |  Branch (888:11): [True: 0, False: 6.10k]
  ------------------
  889|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  890|  6.10k|          " reading file headers.\n");
  891|  6.10k|      this->resilient = true;
  892|  6.10k|    }
_ZN4ojph5local10codestream4readEv:
  896|  4.42k|    {
  897|  4.42k|      this->pre_alloc();
  898|  4.42k|      this->finalize_alloc();
  899|       |
  900|  83.9k|      while (true)
  ------------------
  |  Branch (900:14): [True: 83.7k, Folded]
  ------------------
  901|  83.7k|      {
  902|  83.7k|        param_sot sot;
  903|  83.7k|        if (sot.read(infile, resilient))
  ------------------
  |  Branch (903:13): [True: 71.2k, False: 12.4k]
  ------------------
  904|  71.2k|        {
  905|  71.2k|          ui64 tile_start_location = (ui64)infile->tell();
  906|  71.2k|          bool skip_tile = false;
  907|       |
  908|  71.2k|          if (sot.get_tile_index() >= (int)num_tiles.area())
  ------------------
  |  Branch (908:15): [True: 3.46k, False: 67.7k]
  ------------------
  909|  3.46k|          {
  910|  3.46k|            if (resilient) {
  ------------------
  |  Branch (910:17): [True: 3.46k, False: 0]
  ------------------
  911|  3.46k|              OJPH_INFO(0x00030061, "wrong tile index")
  ------------------
  |  |  285|  3.46k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  3.46k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  912|  3.46k|              skip_tile = true; // skip the faulty tile
  913|  3.46k|            }
  914|      0|            else
  915|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  916|  3.46k|          }
  917|       |
  918|  71.2k|          if (!skip_tile)
  ------------------
  |  Branch (918:15): [True: 67.7k, False: 3.46k]
  ------------------
  919|  67.7k|          {
  920|  67.7k|            if (sot.get_tile_part_index())
  ------------------
  |  Branch (920:17): [True: 39.4k, False: 28.3k]
  ------------------
  921|  39.4k|            { //tile part
  922|  39.4k|              if (sot.get_num_tile_parts() &&
  ------------------
  |  Branch (922:19): [True: 35.1k, False: 4.35k]
  ------------------
  923|  35.1k|                sot.get_tile_part_index() >= sot.get_num_tile_parts())
  ------------------
  |  Branch (923:17): [True: 3.81k, False: 31.2k]
  ------------------
  924|  3.81k|              {
  925|  3.81k|                if (resilient)
  ------------------
  |  Branch (925:21): [True: 3.81k, False: 0]
  ------------------
  926|  3.81k|                  OJPH_INFO(0x00030062,
  ------------------
  |  |  285|  3.81k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  3.81k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3.81k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  3.81k|                    "error in tile part number, should be smaller than total"
  928|  3.81k|                    " number of tile parts")
  929|      0|                else
  930|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  931|  3.81k|                    "error in tile part number, should be smaller than total"
  932|  3.81k|                    " number of tile parts")
  933|  3.81k|              }
  934|       |
  935|  39.4k|              bool sod_found = false;
  936|  39.4k|              ui16 other_tile_part_markers[7] = { SOT, POC, PPT, PLT, COM,
  937|  39.4k|                NLT, SOD };
  938|  62.7k|              while (true)
  ------------------
  |  Branch (938:22): [True: 62.7k, Folded]
  ------------------
  939|  62.7k|              {
  940|  62.7k|                int marker_idx = 0;
  941|  62.7k|                int result = 0;
  942|  62.7k|                marker_idx = find_marker(infile, other_tile_part_markers+1, 6);
  943|  62.7k|                if (marker_idx == 0)
  ------------------
  |  Branch (943:21): [True: 8.45k, False: 54.2k]
  ------------------
  944|  8.45k|                  result = skip_marker(infile, "POC",
  945|  8.45k|                    "POC marker segment in a tile is not supported yet",
  946|  8.45k|                    OJPH_MSG_WARN, resilient);
  947|  54.2k|                else if (marker_idx == 1)
  ------------------
  |  Branch (947:26): [True: 766, False: 53.5k]
  ------------------
  948|    766|                  result = skip_marker(infile, "PPT",
  949|    766|                    "PPT marker segment in a tile is not supported yet",
  950|    766|                    OJPH_MSG_WARN, resilient);
  951|  53.5k|                else if (marker_idx == 2)
  ------------------
  |  Branch (951:26): [True: 7.24k, False: 46.2k]
  ------------------
  952|       |                  //Skipping PLT marker segment;this should not cause any issues
  953|  7.24k|                  result = skip_marker(infile, "PLT", NULL,
  954|  7.24k|                    OJPH_MSG_NO_MSG, resilient);
  955|  46.2k|                else if (marker_idx == 3)
  ------------------
  |  Branch (955:26): [True: 3.94k, False: 42.3k]
  ------------------
  956|  3.94k|                  result = skip_marker(infile, "COM", NULL,
  957|  3.94k|                    OJPH_MSG_NO_MSG, resilient);
  958|  42.3k|                else if (marker_idx == 4)
  ------------------
  |  Branch (958:26): [True: 2.87k, False: 39.4k]
  ------------------
  959|  2.87k|                  result = skip_marker(infile, "NLT",
  960|  2.87k|                    "NLT marker in tile is not supported yet",
  961|  2.87k|                    OJPH_MSG_WARN, resilient);
  962|  39.4k|                else if (marker_idx == 5)
  ------------------
  |  Branch (962:26): [True: 39.1k, False: 265]
  ------------------
  963|  39.1k|                {
  964|  39.1k|                  sod_found = true;
  965|  39.1k|                  break;
  966|  39.1k|                }
  967|       |
  968|  23.5k|                if (marker_idx == -1) //marker not found
  ------------------
  |  Branch (968:21): [True: 265, False: 23.2k]
  ------------------
  969|    265|                {
  970|    265|                  if (resilient)
  ------------------
  |  Branch (970:23): [True: 265, False: 0]
  ------------------
  971|    265|                    OJPH_INFO(0x00030063,
  ------------------
  |  |  285|    265|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    265|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 265, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|    265|                      "File terminated early before start of data is found"
  973|    265|                      " for tile indexed %d and tile part %d",
  974|    265|                      sot.get_tile_index(), sot.get_tile_part_index())
  975|      0|                  else
  976|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  977|    265|                      "File terminated early before start of data is found"
  978|    265|                      " for tile indexed %d and tile part %d",
  979|    265|                      sot.get_tile_index(), sot.get_tile_part_index())
  980|    265|                  break;
  981|    265|                }
  982|  23.2k|                if (result == -1) //file terminated during marker seg. skipping
  ------------------
  |  Branch (982:21): [True: 6, False: 23.2k]
  ------------------
  983|      6|                {
  984|      6|                  if (resilient)
  ------------------
  |  Branch (984:23): [True: 6, False: 0]
  ------------------
  985|      6|                    OJPH_INFO(0x00030064,
  ------------------
  |  |  285|      6|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  986|      6|                      "File terminated during marker segment skipping")
  987|      0|                  else
  988|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  989|      6|                      "File terminated during marker segment skipping")
  990|      6|                  break;
  991|      6|                }
  992|  23.2k|              }
  993|  39.4k|              if (sod_found)
  ------------------
  |  Branch (993:19): [True: 39.1k, False: 271]
  ------------------
  994|  39.1k|                tiles[sot.get_tile_index()].parse_tile_header(sot, infile,
  995|  39.1k|                  tile_start_location);
  996|  39.4k|            }
  997|  28.3k|            else
  998|  28.3k|            { //first tile part
  999|  28.3k|              bool sod_found = false;
 1000|  28.3k|              ui16 first_tile_part_markers[12] = { SOT, COD, COC, QCD, QCC, RGN,
 1001|  28.3k|                POC, PPT, PLT, COM, NLT, SOD };
 1002|   169k|              while (true)
  ------------------
  |  Branch (1002:22): [True: 169k, Folded]
  ------------------
 1003|   169k|              {
 1004|   169k|                int marker_idx = 0;
 1005|   169k|                int result = 0;
 1006|   169k|                marker_idx = find_marker(infile, first_tile_part_markers+1, 11);
 1007|   169k|                if (marker_idx == 0)
  ------------------
  |  Branch (1007:21): [True: 69.8k, False: 99.8k]
  ------------------
 1008|  69.8k|                  result = skip_marker(infile, "COD",
 1009|  69.8k|                    "COD marker segment in a tile is not supported yet",
 1010|  69.8k|                    OJPH_MSG_WARN, resilient);
 1011|  99.8k|                else if (marker_idx == 1)
  ------------------
  |  Branch (1011:26): [True: 1.91k, False: 97.9k]
  ------------------
 1012|  1.91k|                  result = skip_marker(infile, "COC",
 1013|  1.91k|                    "COC marker segment in a tile is not supported yet",
 1014|  1.91k|                    OJPH_MSG_WARN, resilient);
 1015|  97.9k|                else if (marker_idx == 2)
  ------------------
  |  Branch (1015:26): [True: 57.1k, False: 40.8k]
  ------------------
 1016|  57.1k|                  result = skip_marker(infile, "QCD",
 1017|  57.1k|                    "QCD marker segment in a tile is not supported yet",
 1018|  57.1k|                    OJPH_MSG_WARN, resilient);
 1019|  40.8k|                else if (marker_idx == 3)
  ------------------
  |  Branch (1019:26): [True: 854, False: 39.9k]
  ------------------
 1020|    854|                  result = skip_marker(infile, "QCC",
 1021|    854|                    "QCC marker segment in a tile is not supported yet",
 1022|    854|                    OJPH_MSG_WARN, resilient);
 1023|  39.9k|                else if (marker_idx == 4)
  ------------------
  |  Branch (1023:26): [True: 878, False: 39.0k]
  ------------------
 1024|    878|                  result = skip_marker(infile, "RGN",
 1025|    878|                    "RGN marker segment in a tile is not supported yet",
 1026|    878|                    OJPH_MSG_WARN, resilient);
 1027|  39.0k|                else if (marker_idx == 5)
  ------------------
  |  Branch (1027:26): [True: 1.08k, False: 38.0k]
  ------------------
 1028|  1.08k|                  result = skip_marker(infile, "POC",
 1029|  1.08k|                    "POC marker segment in a tile is not supported yet",
 1030|  1.08k|                    OJPH_MSG_WARN, resilient);
 1031|  38.0k|                else if (marker_idx == 6)
  ------------------
  |  Branch (1031:26): [True: 464, False: 37.5k]
  ------------------
 1032|    464|                  result = skip_marker(infile, "PPT",
 1033|    464|                    "PPT marker segment in a tile is not supported yet",
 1034|    464|                    OJPH_MSG_WARN, resilient);
 1035|  37.5k|                else if (marker_idx == 7)
  ------------------
  |  Branch (1035:26): [True: 2.89k, False: 34.6k]
  ------------------
 1036|       |                  //Skipping PLT marker segment;this should not cause any issues
 1037|  2.89k|                  result = skip_marker(infile, "PLT", NULL,
 1038|  2.89k|                    OJPH_MSG_NO_MSG, resilient);
 1039|  34.6k|                else if (marker_idx == 8)
  ------------------
  |  Branch (1039:26): [True: 4.92k, False: 29.7k]
  ------------------
 1040|  4.92k|                  result = skip_marker(infile, "COM", NULL,
 1041|  4.92k|                    OJPH_MSG_NO_MSG, resilient);
 1042|  29.7k|                else if (marker_idx == 9)
  ------------------
  |  Branch (1042:26): [True: 1.42k, False: 28.2k]
  ------------------
 1043|  1.42k|                  result = skip_marker(infile, "NLT",
 1044|  1.42k|                    "PPT marker segment in a tile is not supported yet",
 1045|  1.42k|                    OJPH_MSG_WARN, resilient);
 1046|  28.2k|                else if (marker_idx == 10)
  ------------------
  |  Branch (1046:26): [True: 27.9k, False: 322]
  ------------------
 1047|  27.9k|                {
 1048|  27.9k|                  sod_found = true;
 1049|  27.9k|                  break;
 1050|  27.9k|                }
 1051|       |
 1052|   141k|                if (marker_idx == -1) //marker not found
  ------------------
  |  Branch (1052:21): [True: 322, False: 141k]
  ------------------
 1053|    322|                {
 1054|    322|                  if (resilient)
  ------------------
  |  Branch (1054:23): [True: 322, False: 0]
  ------------------
 1055|    322|                    OJPH_INFO(0x00030065,
  ------------------
  |  |  285|    322|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    322|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 322, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1056|    322|                      "File terminated early before start of data is found"
 1057|    322|                      " for tile indexed %d and tile part %d",
 1058|    322|                      sot.get_tile_index(), sot.get_tile_part_index())
 1059|      0|                  else
 1060|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1061|    322|                      "File terminated early before start of data is found"
 1062|    322|                      " for tile indexed %d and tile part %d",
 1063|    322|                      sot.get_tile_index(), sot.get_tile_part_index())
 1064|    322|                  break;
 1065|    322|                }
 1066|   141k|                if (result == -1) //file terminated during marker seg. skipping
  ------------------
  |  Branch (1066:21): [True: 27, False: 141k]
  ------------------
 1067|     27|                {
 1068|     27|                  if (resilient)
  ------------------
  |  Branch (1068:23): [True: 27, False: 0]
  ------------------
 1069|     27|                    OJPH_INFO(0x00030066,
  ------------------
  |  |  285|     27|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     27|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 27, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1070|     27|                      "File terminated during marker segment skipping")
 1071|      0|                  else
 1072|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1073|     27|                      "File terminated during marker segment skipping")
 1074|     27|                  break;
 1075|     27|                }
 1076|   141k|              }
 1077|  28.3k|              if (sod_found)
  ------------------
  |  Branch (1077:19): [True: 27.9k, False: 349]
  ------------------
 1078|  27.9k|                tiles[sot.get_tile_index()].parse_tile_header(sot, infile,
 1079|  27.9k|                  tile_start_location);
 1080|  28.3k|            }
 1081|  67.7k|          }
 1082|  71.2k|        }
 1083|       |
 1084|       |        // check the next marker; either SOT or EOC,
 1085|       |        // if something is broken, just an end of file
 1086|  83.7k|        ui16 next_markers[2] = { SOT, EOC };
 1087|  83.7k|        int marker_idx = find_marker(infile, next_markers, 2);
 1088|  83.7k|        if (marker_idx == -1)
  ------------------
  |  Branch (1088:13): [True: 4.23k, False: 79.4k]
  ------------------
 1089|  4.23k|        {
 1090|  4.23k|          OJPH_INFO(0x00030067, "File terminated early");
  ------------------
  |  |  285|  4.23k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  4.23k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4.23k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1091|  4.23k|          break;
 1092|  4.23k|        }
 1093|  79.4k|        else if (marker_idx == 0)
  ------------------
  |  Branch (1093:18): [True: 79.4k, False: 11]
  ------------------
 1094|  79.4k|          ;
 1095|     11|        else if (marker_idx == 1)
  ------------------
  |  Branch (1095:18): [True: 4, False: 7]
  ------------------
 1096|      4|          break;
 1097|  83.7k|      }
 1098|  4.42k|    }
_ZN4ojph5local10codestream10set_planarEi:
 1102|  2.83k|    {
 1103|  2.83k|      this->planar = planar;
 1104|  2.83k|    }
_ZN4ojph5local10codestream5closeEv:
 1151|  4.30k|    {
 1152|  4.30k|      if (infile)
  ------------------
  |  Branch (1152:11): [True: 4.30k, False: 0]
  ------------------
 1153|  4.30k|        infile->close();
 1154|  4.30k|      if (outfile)
  ------------------
  |  Branch (1154:11): [True: 0, False: 4.30k]
  ------------------
 1155|      0|        outfile->close();
 1156|  4.30k|    }
_ZN4ojph5local10codestream4pullERj:
 1211|  1.96M|    {
 1212|  1.96M|      bool success = false;
 1213|  3.96M|      while (!success)
  ------------------
  |  Branch (1213:14): [True: 2.00M, False: 1.96M]
  ------------------
 1214|  2.00M|      {
 1215|  2.00M|        success = true;
 1216|  4.03M|        for (ui32 i = 0; i < num_tiles.w; ++i)
  ------------------
  |  Branch (1216:26): [True: 2.07M, False: 1.96M]
  ------------------
 1217|  2.07M|        {
 1218|  2.07M|          ui32 idx = i + cur_tile_row * num_tiles.w;
 1219|  2.07M|          if ((success &= tiles[idx].pull(lines + cur_comp, cur_comp)) == false)
  ------------------
  |  Branch (1219:15): [True: 38.7k, False: 2.03M]
  ------------------
 1220|  38.7k|            break;
 1221|  2.07M|        }
 1222|  2.00M|        cur_tile_row += success == false ? 1 : 0;
  ------------------
  |  Branch (1222:25): [True: 38.7k, False: 1.96M]
  ------------------
 1223|  2.00M|        if (cur_tile_row >= num_tiles.h)
  ------------------
  |  Branch (1223:13): [True: 0, False: 2.00M]
  ------------------
 1224|      0|          cur_tile_row = 0;
 1225|  2.00M|      }
 1226|  1.96M|      comp_num = cur_comp;
 1227|       |
 1228|  1.96M|      if (planar) //process one component at a time
  ------------------
  |  Branch (1228:11): [True: 1.58M, False: 376k]
  ------------------
 1229|  1.58M|      {
 1230|  1.58M|        if (++cur_line >= recon_comp_size[cur_comp].h)
  ------------------
  |  Branch (1230:13): [True: 3.83k, False: 1.58M]
  ------------------
 1231|  3.83k|        {
 1232|  3.83k|          cur_line = 0;
 1233|  3.83k|          cur_tile_row = 0;
 1234|  3.83k|          if (cur_comp++ >= num_comps)
  ------------------
  |  Branch (1234:15): [True: 0, False: 3.83k]
  ------------------
 1235|      0|          {
 1236|      0|            comp_num = 0;
 1237|      0|            return NULL;
 1238|      0|          }
 1239|  3.83k|        }
 1240|  1.58M|      }
 1241|   376k|      else //process all component for a line
 1242|   376k|      {
 1243|   376k|        if (++cur_comp >= num_comps)
  ------------------
  |  Branch (1243:13): [True: 372k, False: 3.95k]
  ------------------
 1244|   372k|        {
 1245|   372k|          cur_comp = 0;
 1246|   372k|          if (cur_line++ >= recon_comp_size[cur_comp].h)
  ------------------
  |  Branch (1246:15): [True: 0, False: 372k]
  ------------------
 1247|      0|          {
 1248|      0|            comp_num = 0;
 1249|      0|            return NULL;
 1250|      0|          }
 1251|   372k|        }
 1252|   376k|      }
 1253|       |
 1254|  1.96M|      return lines + comp_num;
 1255|  1.96M|    }
ojph_codestream_local.cpp:_ZN4ojph5localL11find_markerEPNS_11infile_baseEPKti:
  692|  1.09M|    {
  693|       |      //returns the marker index in char_list, or -1
  694|  78.9M|      while (!f->eof())
  ------------------
  |  Branch (694:14): [True: 78.9M, False: 4.92k]
  ------------------
  695|  78.9M|      {
  696|  78.9M|        ui8 new_char;
  697|  78.9M|        size_t num_bytes = f->read(&new_char, 1);
  698|  78.9M|        if (num_bytes != 1)
  ------------------
  |  Branch (698:13): [True: 0, False: 78.9M]
  ------------------
  699|      0|            return -1;
  700|  78.9M|        if (new_char == 0xFF)
  ------------------
  |  Branch (700:13): [True: 7.46M, False: 71.4M]
  ------------------
  701|  7.46M|        {
  702|  7.46M|          size_t num_bytes = f->read(&new_char, 1);
  703|       |
  704|  7.46M|          if (num_bytes != 1)
  ------------------
  |  Branch (704:15): [True: 347, False: 7.46M]
  ------------------
  705|    347|              return -1;
  706|       |
  707|  67.1M|          for (int i = 0; i < list_len; ++i)
  ------------------
  |  Branch (707:27): [True: 60.7M, False: 6.37M]
  ------------------
  708|  60.7M|            if (new_char == (char_list[i] & 0xFF))
  ------------------
  |  Branch (708:17): [True: 1.09M, False: 59.6M]
  ------------------
  709|  1.09M|              return i;
  710|  7.46M|        }
  711|  78.9M|      }
  712|  4.92k|      return -1;
  713|  1.09M|    }
ojph_codestream_local.cpp:_ZN4ojph5localL11skip_markerEPNS_11infile_baseEPKcS4_ib:
  719|   169k|    {
  720|   169k|      ojph_unused(marker);
  ------------------
  |  |   78|   169k|#define ojph_unused(x) (void)(x)
  ------------------
  721|   169k|      ui16 com_len;
  722|   169k|      if (file->read(&com_len, 2) != 2)
  ------------------
  |  Branch (722:11): [True: 58, False: 169k]
  ------------------
  723|     58|      {
  724|     58|        if (resilient)
  ------------------
  |  Branch (724:13): [True: 33, False: 25]
  ------------------
  725|     33|          return -1;
  726|     25|        else
  727|     25|          OJPH_ERROR(0x00030041, "error reading marker");
  ------------------
  |  |  289|     25|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     25|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 25, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|     25|      }
  729|   169k|      com_len = swap_byte(com_len);
  730|   169k|      file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
  731|   169k|      if (msg != NULL && msg_level != OJPH_MSG_NO_MSG)
  ------------------
  |  Branch (731:11): [True: 148k, False: 20.5k]
  |  Branch (731:26): [True: 148k, False: 0]
  ------------------
  732|   148k|      {
  733|   148k|        if (msg_level == OJPH_MSG_INFO)
  ------------------
  |  Branch (733:13): [True: 268, False: 148k]
  ------------------
  734|    268|        {
  735|    268|          OJPH_INFO(0x00030001, "%s", msg);
  ------------------
  |  |  285|    268|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    268|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 268, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|    268|        }
  737|   148k|        else if (msg_level == OJPH_MSG_WARN)
  ------------------
  |  Branch (737:18): [True: 148k, False: 0]
  ------------------
  738|   148k|        {
  739|   148k|          OJPH_WARN(0x00030001, "%s", msg);
  ------------------
  |  |  287|   148k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|   148k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 148k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  740|   148k|        }
  741|      0|        else if (msg_level == OJPH_MSG_ERROR)
  ------------------
  |  Branch (741:18): [True: 0, False: 0]
  ------------------
  742|      0|        {
  743|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|      0|        }
  745|      0|        else // there is the option of ALL_MSG but it should not be used here
  746|       |          assert(0);
  747|   148k|      }
  748|   169k|      return 0;
  749|   169k|    }

_ZNK4ojph5local10codestream16get_tilepart_divEv:
  120|   271k|      ui32 get_tilepart_div() const { return tilepart_div; };
_ZNK4ojph5local10codestream13is_tlm_neededEv:
  121|  89.8k|      bool is_tlm_needed() const { return need_tlm; };
_ZNK4ojph5local10codestream9is_planarEv:
  118|  4.24k|      bool is_planar() const { return planar != 0; }
_ZN4ojph5local10codestream10access_sizEv:
   82|  8.83k|      { return ojph::param_siz(&siz); }
_ZN4ojph5local10codestream7get_sizEv:
   84|   232k|      { return &siz; }
_ZN4ojph5local10codestream10access_codEv:
   86|  89.8k|      { return ojph::param_cod(&cod); }
_ZN4ojph5local10codestream7get_codEv:
   88|   181k|      { return &cod; }
_ZN4ojph5local10codestream7get_cocEj:
   90|  4.04M|      { return cod.get_coc(comp_num); }
_ZN4ojph5local10codestream10access_qcdEv:
   92|  1.53M|      { return &qcd; }
_ZN4ojph5local10codestream10access_dfsEv:
   94|  24.7k|      { if (dfs.exists()) return &dfs; else return NULL; }
  ------------------
  |  Branch (94:13): [True: 24.7k, False: 1]
  ------------------
_ZN4ojph5local10codestream7get_nltEv:
   96|  89.8k|      { return &nlt; }
_ZN4ojph5local10codestream13get_allocatorEv:
   97|  7.17M|      mem_fixed_allocator* get_allocator() { return allocator; }
_ZN4ojph5local10codestream17get_elastic_allocEv:
   98|  1.08M|      mem_elastic_allocator* get_elastic_alloc() { return elastic_alloc; }
_ZN4ojph5local10codestream12is_resilientEv:
  105|  2.37M|      bool is_resilient() { return resilient; }
_ZNK4ojph5local10codestream11get_profileEv:
  119|  89.8k|      si32 get_profile() const { return profile; };
_ZN4ojph5local10codestream20get_precinct_scratchEv:
  126|  7.13M|      ui8* get_precinct_scratch() { return precinct_scratch; }
_ZN4ojph5local10codestream25get_skipped_res_for_reconEv:
  128|   629k|      { return skipped_res_for_recon; }
_ZN4ojph5local10codestream24get_skipped_res_for_readEv:
  130|   389k|      { return skipped_res_for_read; }
ojph_codestream_local.cpp:_ZN4ojph5localL9swap_byteEt:
   59|   169k|    {
   60|   169k|      return (ui16)((t << 8) | (t >> 8));
   61|   169k|    }
ojph_precinct.cpp:_ZN4ojph5localL9swap_byteEt:
   59|    726|    {
   60|    726|      return (ui16)((t << 8) | (t >> 8));
   61|    726|    }

_ZNK4ojph9param_siz16get_image_extentEv:
   97|   567k|  {
   98|   567k|    return point(state->Xsiz, state->Ysiz);
   99|   567k|  }
_ZNK4ojph9param_siz16get_image_offsetEv:
  103|   558k|  {
  104|   558k|    return point(state->XOsiz, state->YOsiz);
  105|   558k|  }
_ZNK4ojph9param_siz13get_tile_sizeEv:
  109|   558k|  {
  110|   558k|    return size(state->XTsiz, state->YTsiz);
  111|   558k|  }
_ZNK4ojph9param_siz15get_tile_offsetEv:
  115|   279k|  {
  116|   279k|    return point(state->XTOsiz, state->YTOsiz);
  117|   279k|  }
_ZNK4ojph9param_siz18get_num_componentsEv:
  121|   779k|  {
  122|   779k|    return state->Csiz;
  123|   779k|  }
_ZNK4ojph9param_siz15get_recon_widthEj:
  145|  4.66k|  {
  146|  4.66k|    return state->get_recon_width(comp_num);
  147|  4.66k|  }
_ZNK4ojph9param_siz16get_recon_heightEj:
  151|  9.26k|  {
  152|  9.26k|    return state->get_recon_height(comp_num);
  153|  9.26k|  }
_ZNK4ojph9param_cod22get_num_decompositionsEv:
  264|  35.4k|  {
  265|  35.4k|    return state->get_num_decompositions();
  266|  35.4k|  }
_ZNK4ojph9param_cod17get_precinct_sizeEj:
  288|  26.5k|  {
  289|  26.5k|    return state->get_precinct_size(level_num);
  290|  26.5k|  }
_ZNK4ojph9param_cod21get_progression_orderEv:
  300|  89.8k|  {
  301|  89.8k|    return state->SGCod.prog_order;
  302|  89.8k|  }
_ZNK4ojph9param_cod14get_num_layersEv:
  324|  5.63k|  {
  325|  5.63k|    return state->SGCod.num_layers;
  326|  5.63k|  }
_ZN4ojph5local9param_siz4readEPNS_11infile_baseE:
  681|  6.10k|    {
  682|  6.10k|      if (file->read(&Lsiz, 2) != 2)
  ------------------
  |  Branch (682:11): [True: 112, False: 5.99k]
  ------------------
  683|    112|        OJPH_ERROR(0x00050041, "error reading SIZ marker");
  ------------------
  |  |  289|    112|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    112|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 112, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  684|  6.10k|      Lsiz = swap_byte(Lsiz);
  685|  6.10k|      int num_comps = (Lsiz - 38) / 3;
  686|  6.10k|      if (Lsiz != 38 + 3 * num_comps)
  ------------------
  |  Branch (686:11): [True: 20, False: 6.08k]
  ------------------
  687|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  688|  6.10k|      if (file->read(&Rsiz, 2) != 2)
  ------------------
  |  Branch (688:11): [True: 2, False: 6.10k]
  ------------------
  689|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  690|  6.10k|      Rsiz = swap_byte(Rsiz);
  691|  6.10k|      if ((Rsiz & 0x4000) == 0)
  ------------------
  |  Branch (691:11): [True: 3, False: 6.10k]
  ------------------
  692|      3|        OJPH_ERROR(0x00050044,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  693|  6.10k|          "Rsiz bit 14 is not set (this is not a JPH file)");
  694|  6.10k|      if ((Rsiz & 0x8000) != 0 && (Rsiz & 0xD5F) != 0)
  ------------------
  |  Branch (694:11): [True: 456, False: 5.65k]
  |  Branch (694:35): [True: 442, False: 14]
  ------------------
  695|    442|        OJPH_WARN(0x00050001, "Rsiz in SIZ has unimplemented fields");
  ------------------
  |  |  287|    442|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    442|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 442, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|  6.10k|      if (file->read(&Xsiz, 4) != 4)
  ------------------
  |  Branch (696:11): [True: 24, False: 6.08k]
  ------------------
  697|     24|        OJPH_ERROR(0x00050045, "error reading SIZ marker");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|  6.10k|      Xsiz = swap_byte(Xsiz);
  699|  6.10k|      if (file->read(&Ysiz, 4) != 4)
  ------------------
  |  Branch (699:11): [True: 2, False: 6.10k]
  ------------------
  700|      2|        OJPH_ERROR(0x00050046, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  701|  6.10k|      Ysiz = swap_byte(Ysiz);
  702|  6.10k|      ui32 t_XOsiz, t_YOsiz;
  703|  6.10k|      if (file->read(&t_XOsiz, 4) != 4)
  ------------------
  |  Branch (703:11): [True: 3, False: 6.10k]
  ------------------
  704|      3|        OJPH_ERROR(0x00050047, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  705|  6.10k|      if (file->read(&t_YOsiz, 4) != 4)
  ------------------
  |  Branch (705:11): [True: 3, False: 6.10k]
  ------------------
  706|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|  6.10k|      set_image_offset(point(swap_byte(t_XOsiz), swap_byte(t_YOsiz)));
  708|  6.10k|      ui32 t_XTsiz, t_YTsiz;
  709|  6.10k|      if (file->read(&t_XTsiz, 4) != 4)
  ------------------
  |  Branch (709:11): [True: 5, False: 6.10k]
  ------------------
  710|      5|        OJPH_ERROR(0x00050049, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  711|  6.10k|      if (file->read(&t_YTsiz, 4) != 4)
  ------------------
  |  Branch (711:11): [True: 4, False: 6.10k]
  ------------------
  712|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  713|  6.10k|      set_tile_size(size(swap_byte(t_XTsiz), swap_byte(t_YTsiz)));
  714|  6.10k|      ui32 t_XTOsiz, t_YTOsiz;
  715|  6.10k|      if (file->read(&t_XTOsiz, 4) != 4)
  ------------------
  |  Branch (715:11): [True: 3, False: 6.10k]
  ------------------
  716|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  717|  6.10k|      if (file->read(&t_YTOsiz, 4) != 4)
  ------------------
  |  Branch (717:11): [True: 3, False: 6.10k]
  ------------------
  718|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  719|  6.10k|      set_tile_offset(point(swap_byte(t_XTOsiz), swap_byte(t_YTOsiz)));
  720|  6.10k|      if (file->read(&Csiz, 2) != 2)
  ------------------
  |  Branch (720:11): [True: 1, False: 6.10k]
  ------------------
  721|      1|        OJPH_ERROR(0x0005004D, "error reading SIZ 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  722|  6.10k|      Csiz = swap_byte(Csiz);
  723|  6.10k|      if (Csiz != num_comps)
  ------------------
  |  Branch (723:11): [True: 45, False: 6.06k]
  ------------------
  724|     45|        OJPH_ERROR(0x0005004E, "Csiz does not match the SIZ marker size");
  ------------------
  |  |  289|     45|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     45|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 45, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  725|  6.10k|      set_num_components(Csiz);
  726|  20.6k|      for (int c = 0; c < Csiz; ++c)
  ------------------
  |  Branch (726:23): [True: 14.5k, False: 6.10k]
  ------------------
  727|  14.5k|      {
  728|  14.5k|        if (file->read(&cptr[c].SSiz, 1) != 1)
  ------------------
  |  Branch (728:13): [True: 5, False: 14.4k]
  ------------------
  729|      5|          OJPH_ERROR(0x00050051, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|  14.5k|        if (file->read(&cptr[c].XRsiz, 1) != 1)
  ------------------
  |  Branch (730:13): [True: 3, False: 14.5k]
  ------------------
  731|      3|          OJPH_ERROR(0x00050052, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  732|  14.5k|        if (file->read(&cptr[c].YRsiz, 1) != 1)
  ------------------
  |  Branch (732:13): [True: 5, False: 14.4k]
  ------------------
  733|      5|          OJPH_ERROR(0x00050053, "error reading SIZ marker");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  734|  14.5k|        if ((cptr[c].SSiz & 0x7F) > 37)
  ------------------
  |  Branch (734:13): [True: 5, False: 14.4k]
  ------------------
  735|      5|          OJPH_ERROR(0x00050054, "Wrong SIZ-SSiz value of %d", cptr[c].SSiz);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|  14.5k|        if (cptr[c].XRsiz == 0)
  ------------------
  |  Branch (736:13): [True: 3, False: 14.5k]
  ------------------
  737|      3|          OJPH_ERROR(0x00050055, "Wrong SIZ-XRsiz value of %d", cptr[c].XRsiz);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|  14.5k|        if (cptr[c].YRsiz == 0)
  ------------------
  |  Branch (738:13): [True: 2, False: 14.5k]
  ------------------
  739|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  740|  14.5k|      }
  741|       |
  742|  6.10k|      ws_kern_support_needed = (Rsiz & 0x20) != 0;
  743|  6.10k|      dfs_support_needed = (Rsiz & 0x80) != 0;
  744|       |
  745|  6.10k|      check_validity();
  746|  6.10k|    }
_ZNK4ojph5local9param_siz22get_recon_downsamplingEj:
  750|  79.0k|    {
  751|  79.0k|      assert(comp_num < get_num_components());
  752|       |
  753|  79.0k|      point factor(1u << skipped_resolutions, 1u << skipped_resolutions);
  754|  79.0k|      const param_cod* cdp = cod->get_coc(comp_num);
  755|  79.0k|      if (dfs && cdp && cdp->is_dfs_defined()) {
  ------------------
  |  Branch (755:11): [True: 3.88k, False: 75.1k]
  |  Branch (755:18): [True: 3.88k, False: 0]
  |  Branch (755:25): [True: 1.99k, False: 1.88k]
  ------------------
  756|  1.99k|        const param_dfs* d = dfs->get_dfs(cdp->get_dfs_index());
  757|  1.99k|        factor = d->get_res_downsamp(skipped_resolutions);
  758|  1.99k|      }
  759|  79.0k|      factor.x *= (ui32)cptr[comp_num].XRsiz;
  760|  79.0k|      factor.y *= (ui32)cptr[comp_num].YRsiz;
  761|  79.0k|      return factor;
  762|  79.0k|    }
_ZNK4ojph5local9param_siz14get_recon_sizeEj:
  766|  28.2k|    {
  767|  28.2k|      assert(comp_num < get_num_components());
  768|       |
  769|  28.2k|      point factor = get_recon_downsampling(comp_num);
  770|  28.2k|      point r;
  771|  28.2k|      r.x = ojph_div_ceil(Xsiz, factor.x) - ojph_div_ceil(XOsiz, factor.x);
  ------------------
  |  |   70|  28.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
                    r.x = ojph_div_ceil(Xsiz, factor.x) - ojph_div_ceil(XOsiz, factor.x);
  ------------------
  |  |   70|  28.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  772|  28.2k|      r.y = ojph_div_ceil(Ysiz, factor.y) - ojph_div_ceil(YOsiz, factor.y);
  ------------------
  |  |   70|  28.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
                    r.y = ojph_div_ceil(Ysiz, factor.y) - ojph_div_ceil(YOsiz, factor.y);
  ------------------
  |  |   70|  28.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  773|  28.2k|      return r;
  774|  28.2k|    }
_ZN4ojph5local9param_cap4readEPNS_11infile_baseE:
  810|    427|    {
  811|    427|      if (file->read(&Lcap, 2) != 2)
  ------------------
  |  Branch (811:11): [True: 3, False: 424]
  ------------------
  812|      3|        OJPH_ERROR(0x00050061, "error reading CAP 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  813|    427|      Lcap = swap_byte(Lcap);
  814|    427|      if (file->read(&Pcap, 4) != 4)
  ------------------
  |  Branch (814:11): [True: 4, False: 423]
  ------------------
  815|      4|        OJPH_ERROR(0x00050062, "error reading CAP 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|    427|      Pcap = swap_byte(Pcap);
  817|    427|      ui32 count = population_count(Pcap);
  818|    427|      if (Pcap & 0xFFFDFFFF)
  ------------------
  |  Branch (818:11): [True: 37, False: 390]
  ------------------
  819|     37|        OJPH_ERROR(0x00050063,
  ------------------
  |  |  289|     37|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     37|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 37, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  820|    427|          "error Pcap in CAP has options that are not supported");
  821|    427|      if ((Pcap & 0x00020000) == 0)
  ------------------
  |  Branch (821:11): [True: 2, False: 425]
  ------------------
  822|      2|        OJPH_ERROR(0x00050064,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  823|    427|          "error Pcap should have its 15th MSB set, Pcap^15. "
  824|    427|          " This is not a JPH file");
  825|    808|      for (ui32 i = 0; i < count; ++i)
  ------------------
  |  Branch (825:24): [True: 381, False: 427]
  ------------------
  826|    381|        if (file->read(Ccap+i, 2) != 2)
  ------------------
  |  Branch (826:13): [True: 3, False: 378]
  ------------------
  827|      3|          OJPH_ERROR(0x00050065, "error reading CAP 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  828|    427|      if (Lcap != 6 + 2 * count)
  ------------------
  |  Branch (828:11): [True: 15, False: 412]
  ------------------
  829|     15|        OJPH_ERROR(0x00050066, "error in CAP marker length");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  830|    427|    }
_ZNK4ojph5local9param_cod13is_reversibleEv:
  842|  2.35M|    {
  843|  2.35M|      if (SPcod.wavelet_trans <= 1)
  ------------------
  |  Branch (843:11): [True: 2.35M, False: 0]
  ------------------
  844|  2.35M|        return get_wavelet_kern() == local::param_cod::DWT_REV53;
  845|      0|      else {
  846|       |        assert(atk != NULL);
  847|      0|        return atk->is_reversible();
  848|      0|      }
  849|  2.35M|    }
_ZN4ojph5local9param_cod4readEPNS_11infile_baseE:
  956|  5.73k|    {
  957|  5.73k|      assert(type == COD_MAIN);
  958|       |
  959|  5.73k|      if (file->read(&Lcod, 2) != 2)
  ------------------
  |  Branch (959:11): [True: 4, False: 5.73k]
  ------------------
  960|      4|        OJPH_ERROR(0x00050071, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  961|  5.73k|      Lcod = swap_byte(Lcod);
  962|  5.73k|      if (file->read(&Scod, 1) != 1)
  ------------------
  |  Branch (962:11): [True: 1, False: 5.73k]
  ------------------
  963|      1|        OJPH_ERROR(0x00050072, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  964|  5.73k|      if (file->read(&SGCod.prog_order, 1) != 1)
  ------------------
  |  Branch (964:11): [True: 2, False: 5.73k]
  ------------------
  965|      2|        OJPH_ERROR(0x00050073, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  966|  5.73k|      if (file->read(&SGCod.num_layers, 2) != 2)
  ------------------
  |  Branch (966:11): [True: 6, False: 5.73k]
  ------------------
  967|      6|      { OJPH_ERROR(0x00050074, "error reading COD segment"); }
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  968|  5.73k|      else
  969|  5.73k|        SGCod.num_layers = swap_byte(SGCod.num_layers);
  970|  5.73k|      if (file->read(&SGCod.mc_trans, 1) != 1)
  ------------------
  |  Branch (970:11): [True: 1, False: 5.73k]
  ------------------
  971|      1|        OJPH_ERROR(0x00050075, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|  5.73k|      if (file->read(&SPcod.num_decomp, 1) != 1)
  ------------------
  |  Branch (972:11): [True: 2, False: 5.73k]
  ------------------
  973|      2|        OJPH_ERROR(0x00050076, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  974|  5.73k|      if (file->read(&SPcod.block_width, 1) != 1)
  ------------------
  |  Branch (974:11): [True: 1, False: 5.73k]
  ------------------
  975|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  976|  5.73k|      if (file->read(&SPcod.block_height, 1) != 1)
  ------------------
  |  Branch (976:11): [True: 2, False: 5.73k]
  ------------------
  977|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  5.73k|      if (file->read(&SPcod.block_style, 1) != 1)
  ------------------
  |  Branch (978:11): [True: 3, False: 5.73k]
  ------------------
  979|      3|        OJPH_ERROR(0x00050079, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  980|  5.73k|      if (file->read(&SPcod.wavelet_trans, 1) != 1)
  ------------------
  |  Branch (980:11): [True: 1, False: 5.73k]
  ------------------
  981|      1|        OJPH_ERROR(0x0005007A, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  982|       |
  983|  5.73k|      if (get_num_decompositions() > 32
  ------------------
  |  Branch (983:11): [True: 33, False: 5.70k]
  ------------------
  984|  5.70k|        || SPcod.block_width > 8
  ------------------
  |  Branch (984:12): [True: 6, False: 5.69k]
  ------------------
  985|  5.69k|        || SPcod.block_height > 8
  ------------------
  |  Branch (985:12): [True: 6, False: 5.69k]
  ------------------
  986|  5.69k|        || SPcod.block_width + SPcod.block_height > 8
  ------------------
  |  Branch (986:12): [True: 2, False: 5.69k]
  ------------------
  987|  5.69k|        || (SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (987:12): [True: 2, False: 5.68k]
  ------------------
  988|  5.68k|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (988:12): [True: 6, False: 5.68k]
  ------------------
  989|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  990|  5.73k|      if ((SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (990:11): [True: 55, False: 5.68k]
  ------------------
  991|  5.68k|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (991:12): [True: 0, False: 5.68k]
  ------------------
  992|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  993|       |
  994|  5.73k|      ui8 num_decompositions =  get_num_decompositions();
  995|  5.73k|      if (Scod & 1) {
  ------------------
  |  Branch (995:11): [True: 5.18k, False: 552]
  ------------------
  996|  35.8k|        for (int i = 0; i <= num_decompositions; ++i) {
  ------------------
  |  Branch (996:25): [True: 30.6k, False: 5.18k]
  ------------------
  997|  30.6k|          if (file->read(&SPcod.precinct_size[i], 1) != 1)
  ------------------
  |  Branch (997:15): [True: 5, False: 30.6k]
  ------------------
  998|      5|            OJPH_ERROR(0x0005007B, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  999|  30.6k|          if (i)
  ------------------
  |  Branch (999:15): [True: 25.5k, False: 5.18k]
  ------------------
 1000|  25.5k|            if ((SPcod.precinct_size[i] & 0x0F) == 0 ||
  ------------------
  |  Branch (1000:17): [True: 10, False: 25.4k]
  ------------------
 1001|  25.4k|              (SPcod.precinct_size[i] >> 4) == 0)
  ------------------
  |  Branch (1001:15): [True: 4, False: 25.4k]
  ------------------
 1002|     14|              OJPH_ERROR(0x0005007F,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1003|  30.6k|                "Precinct width or height for resolutions other than the"
 1004|  30.6k|                " coarsest must be larger than 1; here, they are %d and %d,"
 1005|  30.6k|                " respectively.",
 1006|  30.6k|                1 << (SPcod.precinct_size[i] & 0x0F),
 1007|  30.6k|                1 << (SPcod.precinct_size[i] >> 4));
 1008|  30.6k|        }
 1009|  5.18k|      }
 1010|  5.73k|      if (Lcod != 12 + ((Scod & 1) ? 1 + SPcod.num_decomp : 0))
  ------------------
  |  Branch (1010:11): [True: 25, False: 5.71k]
  |  Branch (1010:25): [True: 5.16k, False: 571]
  ------------------
 1011|     25|        OJPH_ERROR(0x0005007C, "error in COD segment length");
  ------------------
  |  |  289|     25|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     25|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 25, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1012|  5.73k|    }
_ZN4ojph5local9param_cod8read_cocEPNS_11infile_baseEjPS1_:
 1017|    540|    {
 1018|    540|      assert(type == COC_MAIN);
 1019|    540|      assert(top_cod != NULL);
 1020|       |
 1021|    540|      this->SGCod = top_cod->SGCod;
 1022|    540|      this->top_cod = top_cod;
 1023|    540|      if (file->read(&Lcod, 2) != 2)
  ------------------
  |  Branch (1023:11): [True: 1, False: 539]
  ------------------
 1024|      1|        OJPH_ERROR(0x00050121, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1025|    540|      Lcod = swap_byte(Lcod);
 1026|    540|      if (num_comps < 257) {
  ------------------
  |  Branch (1026:11): [True: 538, False: 2]
  ------------------
 1027|    538|        ui8 t;
 1028|    538|        if (file->read(&t, 1) != 1)
  ------------------
  |  Branch (1028:13): [True: 1, False: 537]
  ------------------
 1029|      1|          OJPH_ERROR(0x00050122, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1030|    538|        comp_idx = t;
 1031|    538|      }
 1032|      2|      else {
 1033|      2|        if (file->read(&comp_idx, 2) != 2)
  ------------------
  |  Branch (1033:13): [True: 0, False: 2]
  ------------------
 1034|      0|          OJPH_ERROR(0x00050123, "error reading COC segment");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1035|      2|        comp_idx = swap_byte(comp_idx);
 1036|      2|      }
 1037|    540|      if (file->read(&Scod, 1) != 1)
  ------------------
  |  Branch (1037:11): [True: 3, False: 537]
  ------------------
 1038|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1039|    540|      if (Scod & 0xF8)
  ------------------
  |  Branch (1039:11): [True: 438, False: 102]
  ------------------
 1040|    438|        OJPH_WARN(0x00050011,
  ------------------
  |  |  287|    438|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    438|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 438, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1041|    540|          "Unsupported options in Scoc field of the COC segment");
 1042|    540|      if (file->read(&SPcod.num_decomp, 1) != 1)
  ------------------
  |  Branch (1042:11): [True: 7, False: 533]
  ------------------
 1043|      7|        OJPH_ERROR(0x00050125, "error reading COC segment");
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1044|    540|      if (file->read(&SPcod.block_width, 1) != 1)
  ------------------
  |  Branch (1044:11): [True: 2, False: 538]
  ------------------
 1045|      2|        OJPH_ERROR(0x00050126, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1046|    540|      if (file->read(&SPcod.block_height, 1) != 1)
  ------------------
  |  Branch (1046:11): [True: 2, False: 538]
  ------------------
 1047|      2|        OJPH_ERROR(0x00050127, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|    540|      if (file->read(&SPcod.block_style, 1) != 1)
  ------------------
  |  Branch (1048:11): [True: 3, False: 537]
  ------------------
 1049|      3|        OJPH_ERROR(0x00050128, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1050|    540|      if (file->read(&SPcod.wavelet_trans, 1) != 1)
  ------------------
  |  Branch (1050:11): [True: 2, False: 538]
  ------------------
 1051|      2|        OJPH_ERROR(0x00050129, "error reading COC segment");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1052|       |
 1053|    540|      if (get_num_decompositions() > 32
  ------------------
  |  Branch (1053:11): [True: 24, False: 516]
  ------------------
 1054|    516|        || SPcod.block_width > 8
  ------------------
  |  Branch (1054:12): [True: 10, False: 506]
  ------------------
 1055|    506|        || SPcod.block_height > 8
  ------------------
  |  Branch (1055:12): [True: 2, False: 504]
  ------------------
 1056|    504|        || SPcod.block_width + SPcod.block_height > 8
  ------------------
  |  Branch (1056:12): [True: 2, False: 502]
  ------------------
 1057|    502|        || (SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1057:12): [True: 2, False: 500]
  ------------------
 1058|    500|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1058:12): [True: 7, False: 493]
  ------------------
 1059|     26|        OJPH_ERROR(0x0005012C, "wrong settings in a COC-SPcoc parameter");
  ------------------
  |  |  289|     26|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     26|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 26, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1060|    540|      if ((SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1060:11): [True: 47, False: 493]
  ------------------
 1061|    493|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1061:12): [True: 0, False: 493]
  ------------------
 1062|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1063|       |
 1064|    540|      ui8 num_decompositions =  get_num_decompositions();
 1065|    540|      if (Scod & 1) {
  ------------------
  |  Branch (1065:11): [True: 200, False: 340]
  ------------------
 1066|    517|        for (int i = 0; i <= num_decompositions; ++i) {
  ------------------
  |  Branch (1066:25): [True: 317, False: 200]
  ------------------
 1067|    317|          if (file->read(&SPcod.precinct_size[i], 1) != 1)
  ------------------
  |  Branch (1067:15): [True: 10, False: 307]
  ------------------
 1068|     10|            OJPH_ERROR(0x0005012A, "error reading COC segment");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1069|    317|          if (i)
  ------------------
  |  Branch (1069:15): [True: 109, False: 208]
  ------------------
 1070|    109|            if ((SPcod.precinct_size[i] & 0x0F) == 0 ||
  ------------------
  |  Branch (1070:17): [True: 3, False: 106]
  ------------------
 1071|    106|              (SPcod.precinct_size[i] >> 4) == 0)
  ------------------
  |  Branch (1071:15): [True: 5, False: 101]
  ------------------
 1072|      8|              OJPH_ERROR(0x0005012E,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1073|    317|                "Precinct width or height for resolutions other than the"
 1074|    317|                " coarsest must be larger than 1; here, they are %d and %d,"
 1075|    317|                " respectively.",
 1076|    317|                1 << (SPcod.precinct_size[i] & 0x0F),
 1077|    317|                1 << (SPcod.precinct_size[i] >> 4));
 1078|    317|        }
 1079|    200|      }
 1080|    540|      ui32 t = 9;
 1081|    540|      t += num_comps < 257 ? 0 : 1;
  ------------------
  |  Branch (1081:12): [True: 475, False: 65]
  ------------------
 1082|    540|      t += (Scod & 1) ? 1 + num_decompositions : 0;
  ------------------
  |  Branch (1082:12): [True: 182, False: 358]
  ------------------
 1083|    540|      if (Lcod != t)
  ------------------
  |  Branch (1083:11): [True: 20, False: 520]
  ------------------
 1084|     20|        OJPH_ERROR(0x0005012B, "error in COC segment 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1085|    540|    }
_ZN4ojph5local9param_cod10update_atkEPNS0_9param_atkE:
 1089|  4.52k|    {
 1090|  4.52k|      assert(type == COD_MAIN);
 1091|  4.52k|      this->atk = atk->get_atk(SPcod.wavelet_trans);
 1092|  4.52k|      if (this->atk == NULL)
  ------------------
  |  Branch (1092:11): [True: 8, False: 4.51k]
  ------------------
 1093|      8|        OJPH_ERROR(0x00050131, "A COD segment employs the DWT kernel "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1094|  4.52k|          "atk = %d, but a corresponding ATK segment cannot be found.",
 1095|  4.52k|          SPcod.wavelet_trans);
 1096|  4.52k|      param_cod *p = next;
 1097|  4.88k|      while (p)
  ------------------
  |  Branch (1097:14): [True: 363, False: 4.52k]
  ------------------
 1098|    363|      {
 1099|    363|        p->atk = atk->get_atk(p->SPcod.wavelet_trans);
 1100|    363|        if (p->atk == NULL)
  ------------------
  |  Branch (1100:13): [True: 1, False: 362]
  ------------------
 1101|      1|          OJPH_ERROR(0x00050132, "A COC segment employs the DWT kernel "
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1102|    363|            "atk = %d, but a corresponding ATK segment cannot be found",
 1103|    363|            SPcod.wavelet_trans);
 1104|    363|        p = p->next;
 1105|    363|      }
 1106|  4.52k|    }
_ZNK4ojph5local9param_cod7get_cocEj:
 1110|  5.66M|    {
 1111|  5.66M|      assert(this->type == COD_MAIN || this->top_cod->type == COD_MAIN);
 1112|  5.66M|      const param_cod *p, *q;
 1113|  5.66M|      if (this->type == COD_MAIN)
  ------------------
  |  Branch (1113:11): [True: 5.62M, False: 38.2k]
  ------------------
 1114|  5.62M|        q = p = this;
 1115|  38.2k|      else
 1116|  38.2k|        q = p = this->top_cod;
 1117|  9.82M|      while (p && p->comp_idx != comp_idx)
  ------------------
  |  Branch (1117:14): [True: 5.78M, False: 4.03M]
  |  Branch (1117:19): [True: 4.15M, False: 1.62M]
  ------------------
 1118|  4.15M|        p = p->next;
 1119|  5.66M|      return p ? p : q;
  ------------------
  |  Branch (1119:14): [True: 1.62M, False: 4.03M]
  ------------------
 1120|  5.66M|    }
_ZN4ojph5local9param_cod7get_cocEj:
 1124|  4.04M|    {
 1125|       |      // cast object to constant
 1126|  4.04M|      const param_cod* const_p = const_cast<const param_cod*>(this);
 1127|       |      // call using the constant object, then cast to non-const
 1128|  4.04M|      return const_cast<param_cod*>(const_p->get_coc(comp_idx));
 1129|  4.04M|    }
_ZN4ojph5local9param_cod14add_coc_objectEj:
 1133|    540|    {
 1134|    540|      assert(type == COD_MAIN);
 1135|    540|      param_cod *p = this;
 1136|    790|      while (p->next != NULL)
  ------------------
  |  Branch (1136:14): [True: 250, False: 540]
  ------------------
 1137|    250|        p = p->next;
 1138|    540|      if (avail)
  ------------------
  |  Branch (1138:11): [True: 0, False: 540]
  ------------------
 1139|      0|      {
 1140|      0|        p->next = avail;
 1141|      0|        avail = avail->next;
 1142|      0|        p->next->init(this, (ui16)comp_idx);
 1143|      0|      }
 1144|    540|      else
 1145|    540|        p->next = new param_cod(this, (ui16)comp_idx);
 1146|    540|      return p->next;
 1147|    540|    }
_ZNK4ojph5local9param_qcd15get_irrev_deltaEPKNS0_9param_dfsEjjjj:
 1444|  89.4k|    {
 1445|  89.4k|      float arr[] = { 1.0f, 2.0f, 2.0f, 4.0f };
 1446|  89.4k|      if ((Sqcd & 0x1F) != 2)
  ------------------
  |  Branch (1446:11): [True: 160, False: 89.3k]
  ------------------
 1447|    160|        OJPH_ERROR(0x00050101, "There is something wrong in the configuration "
  ------------------
  |  |  289|    160|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    160|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 160, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1448|  89.4k|          "of the codestream; for component %d, the codestream defines an "
 1449|  89.4k|          "irreversible transform, for which the codestream provides a "
 1450|  89.4k|          "reversible (no quantization) step sizes in Sqcd/Sqcc.", comp_num);
 1451|       |
 1452|  89.4k|      ui32 idx;
 1453|  89.4k|      if (dfs != NULL && dfs->exists())
  ------------------
  |  Branch (1453:11): [True: 3.78k, False: 85.6k]
  |  Branch (1453:26): [True: 3.74k, False: 38]
  ------------------
 1454|  3.74k|        idx = dfs->get_subband_idx(num_decompositions, resolution, subband);
 1455|  85.7k|      else
 1456|  85.7k|        idx = resolution ? (resolution - 1) * 3 + subband : 0;
  ------------------
  |  Branch (1456:15): [True: 80.1k, False: 5.61k]
  ------------------
 1457|  89.4k|      if (idx >= num_subbands) {
  ------------------
  |  Branch (1457:11): [True: 40.8k, False: 48.6k]
  ------------------
 1458|  40.8k|        OJPH_INFO(0x00050101, "Trying to access quantization step size for "
  ------------------
  |  |  285|  40.8k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  40.8k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 40.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1459|  40.8k|          "subband %d when the QCD/QCC marker segment specifies "
 1460|  40.8k|          "quantization step sizes for %d subbands only.  To continue "
 1461|  40.8k|          "decoding, we are using the step size for subband %d, which can "
 1462|  40.8k|          "produce incorrect results",
 1463|  40.8k|          idx + 1, num_subbands, num_subbands - 1);
 1464|  40.8k|        idx = num_subbands - 1;
 1465|  40.8k|      }
 1466|  89.4k|      int eps = SPqcd.u16[idx] >> 11;
 1467|  89.4k|      float mantissa;
 1468|  89.4k|      mantissa = (float)((SPqcd.u16[idx] & 0x7FF) | 0x800) * arr[subband];
 1469|  89.4k|      mantissa /= (float)(1 << 11);
 1470|  89.4k|      mantissa /= (float)(1u << eps);
 1471|  89.4k|      return mantissa;
 1472|  89.4k|    }
_ZNK4ojph5local9param_qcd17propose_precisionEPKNS0_9param_codE:
 1476|  1.53M|    {
 1477|  1.53M|      ui32 comp_idx = cod->get_comp_idx();
 1478|  1.53M|      ui32 precision = 0;
 1479|  1.53M|      const param_cod *main =
 1480|  1.53M|        cod->get_coc(param_cod::OJPH_COD_DEFAULT);
 1481|  1.53M|      if (main->is_employing_color_transform() && comp_idx < 3)
  ------------------
  |  Branch (1481:11): [True: 110k, False: 1.42M]
  |  Branch (1481:51): [True: 18.7k, False: 92.0k]
  ------------------
 1482|  18.7k|      {
 1483|  75.0k|        for (ui32 i = 0; i < 3; ++i) {
  ------------------
  |  Branch (1483:26): [True: 56.3k, False: 18.7k]
  ------------------
 1484|  56.3k|          const param_qcd* p = this->get_qcc(i);
 1485|  56.3k|          precision = ojph_max(precision, p->get_largest_Kmax());
  ------------------
  |  |   73|  56.3k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 19.1k, False: 37.1k]
  |  |  ------------------
  ------------------
 1486|  56.3k|        }
 1487|  18.7k|      }
 1488|  1.51M|      else {
 1489|  1.51M|        precision = get_largest_Kmax();
 1490|  1.51M|      }
 1491|       |      // ``precision'' now holds the largest K_max, which excludes the sign
 1492|       |      // bit.
 1493|       |      // + 1 for the sign bit
 1494|       |      // + 1 because my block decoder/encoder does not supports up to 30
 1495|       |      //     bits (not 31), so we bump it by one more bit.
 1496|  1.53M|      return precision + 1 + 1;
 1497|  1.53M|    }
_ZNK4ojph5local9param_qcd18get_num_guard_bitsEv:
 1501|  2.39M|    {
 1502|  2.39M|      return (Sqcd >> 5);
 1503|  2.39M|    }
_ZNK4ojph5local9param_qcd8get_KmaxEPKNS0_9param_dfsEjjj:
 1508|   780k|    {
 1509|   780k|      ui32 idx;
 1510|   780k|      if (dfs != NULL && dfs->exists())
  ------------------
  |  Branch (1510:11): [True: 6.60k, False: 773k]
  |  Branch (1510:26): [True: 6.55k, False: 54]
  ------------------
 1511|  6.55k|        idx = dfs->get_subband_idx(num_decompositions, resolution, subband);
 1512|   774k|      else
 1513|   774k|        idx = resolution ? (resolution - 1) * 3 + subband : 0;
  ------------------
  |  Branch (1513:15): [True: 724k, False: 49.4k]
  ------------------
 1514|   780k|      if (idx >= num_subbands) {
  ------------------
  |  Branch (1514:11): [True: 46.1k, False: 734k]
  ------------------
 1515|  46.1k|        OJPH_INFO(0x00050111, "Trying to access quantization step size for "
  ------------------
  |  |  285|  46.1k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  46.1k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 46.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1516|  46.1k|          "subband %d when the QCD/QCC marker segment specifies "
 1517|  46.1k|          "quantization step sizes for %d subbands only.  To continue "
 1518|  46.1k|          "decoding, we are using the step size for subband %d, which can "
 1519|  46.1k|          "produce incorrect results",
 1520|  46.1k|          idx + 1, num_subbands, num_subbands - 1);
 1521|  46.1k|        idx = num_subbands - 1;
 1522|  46.1k|      }
 1523|       |
 1524|   780k|      int irrev = Sqcd & 0x1F;
 1525|   780k|      ui32 num_bits = 0;
 1526|   780k|      if (irrev == 0) // reversible; this is (10.22) from the J2K book
  ------------------
  |  Branch (1526:11): [True: 637k, False: 142k]
  ------------------
 1527|   637k|      {
 1528|   637k|        num_bits = decode_SPqcd(SPqcd.u8[idx]);
 1529|   637k|        num_bits = num_bits == 0 ? 0 : num_bits - 1;
  ------------------
  |  Branch (1529:20): [True: 106k, False: 531k]
  ------------------
 1530|   637k|      }
 1531|   142k|      else if (irrev == 1)
  ------------------
  |  Branch (1531:16): [True: 0, False: 142k]
  ------------------
 1532|   142k|        assert(0);
 1533|   142k|      else if (irrev == 2) //scalar expounded
  ------------------
  |  Branch (1533:16): [True: 142k, False: 0]
  ------------------
 1534|   142k|        num_bits = (SPqcd.u16[idx] >> 11) - 1;
 1535|      0|      else
 1536|   142k|        assert(0);
 1537|       |
 1538|   780k|      return num_bits + get_num_guard_bits();
 1539|   780k|    }
_ZNK4ojph5local9param_qcd16get_largest_KmaxEv:
 1543|  1.61M|    {
 1544|  1.61M|      int irrev = Sqcd & 0x1F;
 1545|  1.61M|      ui32 num_bits = 0;
 1546|  1.61M|      if (irrev == 0) // reversible; this is (10.22) from the J2K book
  ------------------
  |  Branch (1546:11): [True: 1.31M, False: 292k]
  ------------------
 1547|  1.31M|      {
 1548|  22.7M|        for (ui32 i = 0; i < num_subbands; ++i) {
  ------------------
  |  Branch (1548:26): [True: 21.4M, False: 1.31M]
  ------------------
 1549|  21.4M|          ui32 t = decode_SPqcd(SPqcd.u8[i]);
 1550|  21.4M|          num_bits = ojph_max(num_bits, t == 0 ? 0 : t - 1);
  ------------------
  |  |   73|  42.8M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 14.9M, False: 6.47M]
  |  |  |  Branch (73:33): [True: 4.19M, False: 17.2M]
  |  |  |  Branch (73:46): [True: 544k, False: 5.92M]
  |  |  ------------------
  ------------------
 1551|  21.4M|        }
 1552|  1.31M|      }
 1553|   292k|      else if (irrev == 1)
  ------------------
  |  Branch (1553:16): [True: 0, False: 292k]
  ------------------
 1554|   292k|        assert(0);
 1555|   292k|      else if (irrev == 2) //scalar expounded
  ------------------
  |  Branch (1555:16): [True: 292k, False: 0]
  ------------------
 1556|   292k|      {
 1557|  3.41M|        for (ui32 i = 0; i < num_subbands; ++i) {
  ------------------
  |  Branch (1557:26): [True: 3.11M, False: 292k]
  ------------------
 1558|  3.11M|          ui32 t = (SPqcd.u16[i] >> 11) - 1;
 1559|  3.11M|          num_bits = ojph_max(num_bits, t);
  ------------------
  |  |   73|  3.11M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.49M, False: 1.62M]
  |  |  ------------------
  ------------------
 1560|  3.11M|        }
 1561|   292k|      }
 1562|      0|      else
 1563|   292k|        assert(0);
 1564|       |
 1565|  1.61M|      return num_bits + get_num_guard_bits();
 1566|  1.61M|    }
_ZN4ojph5local9param_qcd4readEPNS_11infile_baseE:
 1693|  5.60k|    {
 1694|  5.60k|      if (file->read(&Lqcd, 2) != 2)
  ------------------
  |  Branch (1694:11): [True: 12, False: 5.58k]
  ------------------
 1695|     12|        OJPH_ERROR(0x00050081, "error reading QCD marker");
  ------------------
  |  |  289|     12|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     12|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1696|  5.60k|      Lqcd = swap_byte(Lqcd);
 1697|  5.60k|      if (file->read(&Sqcd, 1) != 1)
  ------------------
  |  Branch (1697:11): [True: 1, False: 5.60k]
  ------------------
 1698|      1|        OJPH_ERROR(0x00050082, "error reading QCD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1699|  5.60k|      if ((Sqcd & 0x1F) == 0)
  ------------------
  |  Branch (1699:11): [True: 4.60k, False: 994]
  ------------------
 1700|  4.60k|      {
 1701|  4.60k|        num_subbands = (Lqcd - 3);
 1702|  4.60k|        if (num_subbands == 0)
  ------------------
  |  Branch (1702:13): [True: 1, False: 4.60k]
  ------------------
 1703|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1704|  4.60k|            "quantization informtion");
 1705|  4.60k|        if (num_subbands > 97 || Lqcd != 3 + num_subbands)
  ------------------
  |  Branch (1705:13): [True: 18, False: 4.58k]
  |  Branch (1705:34): [True: 0, False: 4.58k]
  ------------------
 1706|     17|          OJPH_ERROR(0x00050083, "wrong Lqcd value of %d in QCD marker", Lqcd);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1707|  74.3k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1707:26): [True: 69.7k, False: 4.60k]
  ------------------
 1708|  69.7k|          if (file->read(&SPqcd.u8[i], 1) != 1)
  ------------------
  |  Branch (1708:15): [True: 10, False: 69.7k]
  ------------------
 1709|     10|            OJPH_ERROR(0x00050084, "error reading QCD marker");
  ------------------
  |  |  289|     10|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     10|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1710|  4.60k|      }
 1711|    994|      else if ((Sqcd & 0x1F) == 1)
  ------------------
  |  Branch (1711:16): [True: 2, False: 992]
  ------------------
 1712|      2|      {
 1713|      2|        num_subbands = 0;
 1714|      2|        OJPH_ERROR(0x00050089,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1715|      2|          "Scalar derived quantization is not supported yet in QCD marker");
 1716|      2|        if (Lqcd != 5)
  ------------------
  |  Branch (1716:13): [True: 0, False: 2]
  ------------------
 1717|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1718|      2|      }
 1719|    992|      else if ((Sqcd & 0x1F) == 2)
  ------------------
  |  Branch (1719:16): [True: 972, False: 20]
  ------------------
 1720|    972|      {
 1721|    972|        num_subbands = (Lqcd - 3) / 2;
 1722|    972|        if (num_subbands == 0)
  ------------------
  |  Branch (1722:13): [True: 1, False: 971]
  ------------------
 1723|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1724|    972|            "quantization informtion");
 1725|    972|        if (num_subbands > 97 || Lqcd != 3 + 2 * num_subbands)
  ------------------
  |  Branch (1725:13): [True: 15, False: 957]
  |  Branch (1725:34): [True: 9, False: 948]
  ------------------
 1726|     23|          OJPH_ERROR(0x00050086, "wrong Lqcd value of %d in QCD marker", Lqcd);
  ------------------
  |  |  289|     23|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     23|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 23, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1727|  9.05k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1727:26): [True: 8.08k, False: 972]
  ------------------
 1728|  8.08k|        {
 1729|  8.08k|          if (file->read(&SPqcd.u16[i], 2) != 2)
  ------------------
  |  Branch (1729:15): [True: 17, False: 8.06k]
  ------------------
 1730|     17|            OJPH_ERROR(0x00050087, "error reading QCD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1731|  8.08k|          SPqcd.u16[i] = swap_byte(SPqcd.u16[i]);
 1732|  8.08k|        }
 1733|    972|      }
 1734|     20|      else
 1735|     20|        OJPH_ERROR(0x00050088, "wrong Sqcd value in QCD marker");
  ------------------
  |  |  289|     20|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     20|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1736|  5.60k|    }
_ZN4ojph5local9param_qcd8read_qccEPNS_11infile_baseEj:
 1740|    237|    {
 1741|    237|      if (file->read(&Lqcd, 2) != 2)
  ------------------
  |  Branch (1741:11): [True: 2, False: 235]
  ------------------
 1742|      2|        OJPH_ERROR(0x000500A1, "error reading QCC marker");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1743|    237|      Lqcd = swap_byte(Lqcd);
 1744|    237|      if (num_comps < 257)
  ------------------
  |  Branch (1744:11): [True: 228, False: 9]
  ------------------
 1745|    228|      {
 1746|    228|        ui8 v;
 1747|    228|        if (file->read(&v, 1) != 1)
  ------------------
  |  Branch (1747:13): [True: 1, False: 227]
  ------------------
 1748|      1|          OJPH_ERROR(0x000500A2, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1749|    228|        comp_idx = v;
 1750|    228|      }
 1751|      9|      else
 1752|      9|      {
 1753|      9|        if (file->read(&comp_idx, 2) != 2)
  ------------------
  |  Branch (1753:13): [True: 1, False: 8]
  ------------------
 1754|      1|          OJPH_ERROR(0x000500A3, "error reading QCC marker");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1755|      9|        comp_idx = swap_byte(comp_idx);
 1756|      9|      }
 1757|    237|      if (file->read(&Sqcd, 1) != 1)
  ------------------
  |  Branch (1757:11): [True: 1, False: 236]
  ------------------
 1758|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1759|    237|      ui32 offset = num_comps < 257 ? 4 : 5;
  ------------------
  |  Branch (1759:21): [True: 226, False: 11]
  ------------------
 1760|    237|      if ((Sqcd & 0x1F) == 0)
  ------------------
  |  Branch (1760:11): [True: 126, False: 111]
  ------------------
 1761|    126|      {
 1762|    126|        num_subbands = (Lqcd - offset);
 1763|    126|        if (num_subbands == 0)
  ------------------
  |  Branch (1763:13): [True: 1, False: 125]
  ------------------
 1764|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1765|    126|            "quantization informtion");
 1766|    126|        if (num_subbands > 97 || Lqcd != offset + num_subbands)
  ------------------
  |  Branch (1766:13): [True: 21, False: 105]
  |  Branch (1766:34): [True: 0, False: 105]
  ------------------
 1767|     20|          OJPH_ERROR(0x000500A5, "wrong Lqcd value of %d in QCC marker", Lqcd);
  ------------------
  |  |  289|     20|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     20|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1768|  2.00k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1768:26): [True: 1.87k, False: 126]
  ------------------
 1769|  1.87k|          if (file->read(&SPqcd.u8[i], 1) != 1)
  ------------------
  |  Branch (1769:15): [True: 16, False: 1.86k]
  ------------------
 1770|     16|            OJPH_ERROR(0x000500A6, "error reading QCC marker");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1771|    126|      }
 1772|    111|      else if ((Sqcd & 0x1F) == 1)
  ------------------
  |  Branch (1772:16): [True: 1, False: 110]
  ------------------
 1773|      1|      {
 1774|      1|        num_subbands = 0;
 1775|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1776|      1|          "Scalar derived quantization is not supported yet in QCC marker");
 1777|      1|        if (Lqcd != offset)
  ------------------
  |  Branch (1777:13): [True: 0, False: 1]
  ------------------
 1778|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1779|      1|      }
 1780|    110|      else if ((Sqcd & 0x1F) == 2)
  ------------------
  |  Branch (1780:16): [True: 98, False: 12]
  ------------------
 1781|     98|      {
 1782|     98|        num_subbands = (Lqcd - offset) / 2;
 1783|     98|        if (num_subbands == 0)
  ------------------
  |  Branch (1783:13): [True: 1, False: 97]
  ------------------
 1784|      1|          OJPH_ERROR(0x000500AD, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1785|     98|            "quantization informtion");
 1786|     98|        if (num_subbands > 97 || Lqcd != offset + 2 * num_subbands)
  ------------------
  |  Branch (1786:13): [True: 15, False: 83]
  |  Branch (1786:34): [True: 2, False: 81]
  ------------------
 1787|     16|          OJPH_ERROR(0x000500A8, "wrong Lqcc value of %d in QCC marker", Lqcd);
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1788|  1.18k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1788:26): [True: 1.08k, False: 98]
  ------------------
 1789|  1.08k|        {
 1790|  1.08k|          if (file->read(&SPqcd.u16[i], 2) != 2)
  ------------------
  |  Branch (1790:15): [True: 15, False: 1.07k]
  ------------------
 1791|     15|            OJPH_ERROR(0x000500A9, "error reading QCC marker");
  ------------------
  |  |  289|     15|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     15|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1792|  1.08k|          SPqcd.u16[i] = swap_byte(SPqcd.u16[i]);
 1793|  1.08k|        }
 1794|     98|      }
 1795|     12|      else
 1796|     12|        OJPH_ERROR(0x000500AA, "wrong Sqcc value in QCC marker");
  ------------------
  |  |  289|     12|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     12|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1797|    237|    }
_ZN4ojph5local9param_qcd7get_qccEj:
 1801|    140|    {
 1802|       |      // cast object to constant
 1803|    140|      const param_qcd* const_p = const_cast<const param_qcd*>(this);
 1804|       |      // call using the constant object, then cast to non-const
 1805|    140|      return const_cast<param_qcd*>(const_p->get_qcc(comp_idx));
 1806|    140|    }
_ZNK4ojph5local9param_qcd7get_qccEj:
 1810|  1.59M|    {
 1811|  1.59M|      assert(this->type == QCD_MAIN || this->top_qcd->type == QCD_MAIN);
 1812|  1.59M|      const param_qcd *p, *q;
 1813|  1.59M|      if (this->type == QCD_MAIN)
  ------------------
  |  Branch (1813:11): [True: 1.56M, False: 29.7k]
  ------------------
 1814|  1.56M|        q = p = this;
 1815|  29.7k|      else
 1816|  29.7k|        q = p = this->top_qcd;
 1817|  3.21M|      while (p && p->comp_idx != comp_idx)
  ------------------
  |  Branch (1817:14): [True: 1.64M, False: 1.56M]
  |  Branch (1817:19): [True: 1.61M, False: 24.5k]
  ------------------
 1818|  1.61M|        p = p->next;
 1819|  1.59M|      return p ? p : q;
  ------------------
  |  Branch (1819:14): [True: 24.5k, False: 1.56M]
  ------------------
 1820|  1.59M|    }
_ZN4ojph5local9param_qcd14add_qcc_objectEj:
 1824|    237|    {
 1825|    237|      assert(type == QCD_MAIN);
 1826|    237|      param_qcd *p = this;
 1827|    274|      while (p->next != NULL)
  ------------------
  |  Branch (1827:14): [True: 37, False: 237]
  ------------------
 1828|     37|        p = p->next;
 1829|    237|      if (avail)
  ------------------
  |  Branch (1829:11): [True: 0, False: 237]
  ------------------
 1830|      0|      {
 1831|      0|        p->next = avail;
 1832|      0|        avail = avail->next;
 1833|      0|        p->next->init(this, (ui16)comp_idx);
 1834|      0|      }
 1835|    237|      else
 1836|    237|        p->next = new param_qcd(this, (ui16)comp_idx);
 1837|    237|      return p->next;
 1838|    237|    }
_ZNK4ojph5local9param_nlt23get_nonlinear_transformEjRhRbS2_:
 1956|  50.6k|    {
 1957|  50.6k|      assert(Cnlt == special_comp_num::ALL_COMPS);
 1958|  50.6k|      const param_nlt* p = get_nlt_object(comp_num);
 1959|  50.6k|      p = (p && p->enabled) ? p : this;
  ------------------
  |  Branch (1959:12): [True: 17, False: 50.6k]
  |  Branch (1959:17): [True: 17, False: 0]
  ------------------
 1960|  50.6k|      if (p->enabled)
  ------------------
  |  Branch (1960:11): [True: 18, False: 50.6k]
  ------------------
 1961|     18|      {
 1962|     18|        bit_depth = (ui8)((p->BDnlt & 0x7F) + 1);
 1963|     18|        bit_depth = bit_depth <= 38 ? bit_depth : 38;
  ------------------
  |  Branch (1963:21): [True: 18, False: 0]
  ------------------
 1964|     18|        is_signed = (p->BDnlt & 0x80) == 0x80;
 1965|     18|        nl_type = (nonlinearity)p->Tnlt;
 1966|     18|        return true;
 1967|     18|      }
 1968|  50.6k|      return false;
 1969|  50.6k|    }
_ZN4ojph5local9param_nlt4readEPNS_11infile_baseE:
 2001|    954|    {
 2002|    954|      ui8 buf[6];
 2003|       |
 2004|    954|      if (file->read(buf, 6) != 6)
  ------------------
  |  Branch (2004:11): [True: 14, False: 940]
  ------------------
 2005|     14|        OJPH_ERROR(0x00050141, "error reading NLT marker segment");
  ------------------
  |  |  289|     14|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     14|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2006|       |
 2007|    954|      ui16 length = swap_byte(*(ui16*)buf);
 2008|    954|      if (length != 6 || (buf[5] != 3 && buf[5] != 0)) // wrong length or type
  ------------------
  |  Branch (2008:11): [True: 46, False: 908]
  |  Branch (2008:27): [True: 663, False: 245]
  |  Branch (2008:42): [True: 8, False: 655]
  ------------------
 2009|     40|        OJPH_ERROR(0x00050142, "Unsupported NLT type %d\n", buf[5]);
  ------------------
  |  |  289|     40|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     40|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 40, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2010|       |
 2011|    954|      ui16 comp = swap_byte(*(ui16*)(buf + 2));
 2012|    954|      param_nlt* p = get_nlt_object(comp);
 2013|    954|      if (p == NULL)
  ------------------
  |  Branch (2013:11): [True: 297, False: 657]
  ------------------
 2014|    297|        p = add_object(comp);
 2015|    954|      p->enabled = true;
 2016|    954|      p->Cnlt = comp;
 2017|    954|      p->BDnlt = buf[4];
 2018|    954|      p->Tnlt = buf[5];
 2019|    954|    }
_ZN4ojph5local9param_nlt14get_nlt_objectEj:
 2023|    900|    {
 2024|       |      // cast object to constant
 2025|    900|      const param_nlt* const_p = const_cast<const param_nlt*>(this);
 2026|       |      // call using the constant object, then cast to non-const
 2027|    900|      return const_cast<param_nlt*>(const_p->get_nlt_object(comp_num));
 2028|    900|    }
_ZNK4ojph5local9param_nlt14get_nlt_objectEj:
 2032|  51.5k|    {
 2033|  51.5k|      const param_nlt* p = this;
 2034|   105k|      while (p && p->Cnlt != comp_num)
  ------------------
  |  Branch (2034:14): [True: 54.9k, False: 50.9k]
  |  Branch (2034:19): [True: 54.2k, False: 620]
  ------------------
 2035|  54.2k|        p = p->next;
 2036|  51.5k|      return p;
 2037|  51.5k|    }
_ZN4ojph5local9param_nlt10add_objectEj:
 2041|    297|    {
 2042|    297|      assert(comp_num != special_comp_num::ALL_COMPS);
 2043|    297|      assert(Cnlt == special_comp_num::ALL_COMPS);
 2044|    297|      param_nlt* p = this;
 2045|  1.01k|      while (p->next != NULL) {
  ------------------
  |  Branch (2045:14): [True: 714, False: 297]
  ------------------
 2046|    714|        assert(p->Cnlt != comp_num);
 2047|    714|        p = p->next;
 2048|    714|      }
 2049|    297|      if (avail)
  ------------------
  |  Branch (2049:11): [True: 0, False: 297]
  ------------------
 2050|      0|      {
 2051|      0|        p->next = avail;
 2052|      0|        avail = avail->next;
 2053|      0|        p->next->init();
 2054|      0|      }
 2055|    297|      else
 2056|    297|        p->next = new param_nlt;
 2057|    297|      p = p->next;
 2058|    297|      p->Cnlt = (ui16)comp_num;
 2059|    297|      return p;
 2060|    297|    }
_ZN4ojph5local9param_sot4readEPNS_11infile_baseEb:
 2142|  83.7k|    {
 2143|  83.7k|      if (resilient)
  ------------------
  |  Branch (2143:11): [True: 83.7k, False: 0]
  ------------------
 2144|  83.7k|      {
 2145|  83.7k|        if (file->read(&Lsot, 2) != 2)
  ------------------
  |  Branch (2145:13): [True: 94, False: 83.6k]
  ------------------
 2146|     94|        {
 2147|     94|          OJPH_INFO(0x00050091, "error reading SOT marker");
  ------------------
  |  |  285|     94|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     94|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 94, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2148|     94|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2149|     94|          return false;
 2150|     94|        }
 2151|  83.6k|        Lsot = swap_byte(Lsot);
 2152|  83.6k|        if (Lsot != 10)
  ------------------
  |  Branch (2152:13): [True: 11.8k, False: 71.8k]
  ------------------
 2153|  11.8k|        {
 2154|  11.8k|          OJPH_INFO(0x00050092, "error in SOT length");
  ------------------
  |  |  285|  11.8k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  11.8k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 11.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2155|  11.8k|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2156|  11.8k|          return false;
 2157|  11.8k|        }
 2158|  71.8k|        if (file->read(&Isot, 2) != 2)
  ------------------
  |  Branch (2158:13): [True: 43, False: 71.7k]
  ------------------
 2159|     43|        {
 2160|     43|          OJPH_INFO(0x00050093, "error reading tile index");
  ------------------
  |  |  285|     43|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     43|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 43, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2161|     43|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2162|     43|          return false;
 2163|     43|        }
 2164|  71.7k|        Isot = swap_byte(Isot);
 2165|  71.7k|        if (Isot == 0xFFFF)
  ------------------
  |  Branch (2165:13): [True: 456, False: 71.3k]
  ------------------
 2166|    456|        {
 2167|    456|          OJPH_INFO(0x00050094, "tile index in SOT marker cannot be 0xFFFF");
  ------------------
  |  |  285|    456|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    456|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 456, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2168|    456|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2169|    456|          return false;
 2170|    456|        }
 2171|  71.3k|        if (file->read(&Psot, 4) != 4)
  ------------------
  |  Branch (2171:13): [True: 40, False: 71.2k]
  ------------------
 2172|     40|        {
 2173|     40|          OJPH_INFO(0x00050095, "error reading SOT marker");
  ------------------
  |  |  285|     40|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     40|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 40, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2174|     40|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2175|     40|          return false;
 2176|     40|        }
 2177|  71.2k|        Psot = swap_byte(Psot);
 2178|  71.2k|        if (file->read(&TPsot, 1) != 1)
  ------------------
  |  Branch (2178:13): [True: 11, False: 71.2k]
  ------------------
 2179|     11|        {
 2180|     11|          OJPH_INFO(0x00050096, "error reading SOT marker");
  ------------------
  |  |  285|     11|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     11|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2181|     11|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2182|     11|          return false;
 2183|     11|        }
 2184|  71.2k|        if (file->read(&TNsot, 1) != 1)
  ------------------
  |  Branch (2184:13): [True: 19, False: 71.2k]
  ------------------
 2185|     19|        {
 2186|     19|          OJPH_INFO(0x00050097, "error reading SOT marker");
  ------------------
  |  |  285|     19|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     19|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 19, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2187|     19|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2188|     19|          return false;
 2189|     19|        }
 2190|  71.2k|      }
 2191|      0|      else
 2192|      0|      {
 2193|      0|        if (file->read(&Lsot, 2) != 2)
  ------------------
  |  Branch (2193:13): [True: 0, False: 0]
  ------------------
 2194|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2195|      0|        Lsot = swap_byte(Lsot);
 2196|      0|        if (Lsot != 10)
  ------------------
  |  Branch (2196:13): [True: 0, False: 0]
  ------------------
 2197|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2198|      0|        if (file->read(&Isot, 2) != 2)
  ------------------
  |  Branch (2198:13): [True: 0, False: 0]
  ------------------
 2199|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2200|      0|        Isot = swap_byte(Isot);
 2201|      0|        if (Isot == 0xFFFF)
  ------------------
  |  Branch (2201:13): [True: 0, False: 0]
  ------------------
 2202|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|      0|        if (file->read(&Psot, 4) != 4)
  ------------------
  |  Branch (2203:13): [True: 0, False: 0]
  ------------------
 2204|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2205|      0|        Psot = swap_byte(Psot);
 2206|      0|        if (file->read(&TPsot, 1) != 1)
  ------------------
  |  Branch (2206:13): [True: 0, False: 0]
  ------------------
 2207|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2208|      0|        if (file->read(&TNsot, 1) != 1)
  ------------------
  |  Branch (2208:13): [True: 0, False: 0]
  ------------------
 2209|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2210|      0|      }
 2211|  71.2k|      return true;
 2212|  83.7k|    }
_ZNK4ojph5local9param_dfs7get_dfsEi:
 2281|  26.7k|    {
 2282|  26.7k|      const param_dfs* p = this;
 2283|  42.4k|      while (p && p->Sdfs != index)
  ------------------
  |  Branch (2283:14): [True: 42.4k, False: 5]
  |  Branch (2283:19): [True: 15.6k, False: 26.7k]
  ------------------
 2284|  15.6k|        p = p->next;
 2285|  26.7k|      return p;
 2286|  26.7k|    }
_ZNK4ojph5local9param_dfs12get_dwt_typeEj:
 2290|  46.1k|    {
 2291|  46.1k|      decomp_level = ojph_min(decomp_level, Ids);
  ------------------
  |  |   76|  46.1k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 33.6k, False: 12.5k]
  |  |  ------------------
  ------------------
 2292|  46.1k|      ui32 d = decomp_level - 1;          // decomp_level starts from 1
 2293|  46.1k|      ui32 idx = d >> 2;                  // complete bytes
 2294|  46.1k|      ui32 bits = d & 0x3;                // bit within the bytes
 2295|  46.1k|      ui32 val = (Ddfs[idx] >> (6 - 2 * bits)) & 0x3;
 2296|  46.1k|      return (dfs_dwt_type)val;
 2297|  46.1k|    }
_ZNK4ojph5local9param_dfs15get_subband_idxEjjj:
 2302|  10.3k|    {
 2303|  10.3k|      assert((resolution == 0 && subband == 0) ||
 2304|  10.3k|              (resolution > 0 && subband > 0 && subband < 4));
 2305|       |
 2306|  10.3k|      ui32 ns[4] = { 0, 3, 1, 1 };
 2307|       |
 2308|  10.3k|      ui32 idx = 0;
 2309|  10.3k|      if (resolution > 0)
  ------------------
  |  Branch (2309:11): [True: 8.23k, False: 2.06k]
  ------------------
 2310|  8.23k|      {
 2311|  8.23k|        idx = 0;
 2312|  8.23k|        ui32 i = 1;
 2313|  22.6k|        for (; i < resolution; ++i)
  ------------------
  |  Branch (2313:16): [True: 14.3k, False: 8.23k]
  ------------------
 2314|  14.3k|          idx += ns[get_dwt_type(num_decompositions - i + 1)];
 2315|  8.23k|        dfs_dwt_type t = get_dwt_type(num_decompositions - i + 1);
 2316|  8.23k|        idx += subband;
 2317|  8.23k|        if (t == VERT_DWT && subband == 2)
  ------------------
  |  Branch (2317:13): [True: 3.78k, False: 4.45k]
  |  Branch (2317:30): [True: 3.78k, False: 0]
  ------------------
 2318|  3.78k|          --idx;
 2319|  8.23k|      }
 2320|       |
 2321|  10.3k|      return idx;
 2322|  10.3k|    }
_ZNK4ojph5local9param_dfs16get_res_downsampEj:
 2326|  1.99k|    {
 2327|  1.99k|      point factor(1, 1);
 2328|  1.99k|      ui32 decomp_level = 1;
 2329|  7.36k|      while (skipped_resolutions > 0)
  ------------------
  |  Branch (2329:14): [True: 5.36k, False: 1.99k]
  ------------------
 2330|  5.36k|      {
 2331|  5.36k|        param_dfs::dfs_dwt_type type = get_dwt_type(decomp_level);
 2332|  5.36k|        if (type == BIDIR_DWT)
  ------------------
  |  Branch (2332:13): [True: 433, False: 4.93k]
  ------------------
 2333|    433|        { factor.x *= 2; factor.y *= 2; }
 2334|  4.93k|        else if (type == HORZ_DWT)
  ------------------
  |  Branch (2334:18): [True: 1.51k, False: 3.41k]
  ------------------
 2335|  1.51k|          factor.x *= 2;
 2336|  3.41k|        else if (type == VERT_DWT)
  ------------------
  |  Branch (2336:18): [True: 1.71k, False: 1.70k]
  ------------------
 2337|  1.71k|          factor.y *= 2;
 2338|       |
 2339|  5.36k|        ++decomp_level;
 2340|  5.36k|        --skipped_resolutions;
 2341|  5.36k|      }
 2342|  1.99k|      return factor;
 2343|  1.99k|    }
_ZN4ojph5local9param_dfs4readEPNS_11infile_baseE:
 2347|  1.49M|    {
 2348|  1.49M|      if (Ldfs != 0) { // this param_dfs is used
  ------------------
  |  Branch (2348:11): [True: 744k, False: 745k]
  ------------------
 2349|   744k|        param_dfs* p = this;
 2350|  11.7G|        while (p->next != NULL)
  ------------------
  |  Branch (2350:16): [True: 11.7G, False: 744k]
  ------------------
 2351|  11.7G|          p = p->next;
 2352|   744k|        if (avail)
  ------------------
  |  Branch (2352:13): [True: 0, False: 744k]
  ------------------
 2353|      0|        {
 2354|      0|          p->next = avail;
 2355|      0|          avail = avail->next;
 2356|      0|          p->next->init();
 2357|      0|        }
 2358|   744k|        else
 2359|   744k|          p->next = new param_dfs;
 2360|   744k|        p = p->next;
 2361|   744k|        return p->read(file);
 2362|   744k|      }
 2363|       |
 2364|   745k|      if (file->read(&Ldfs, 2) != 2)
  ------------------
  |  Branch (2364:11): [True: 24, False: 745k]
  ------------------
 2365|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2366|   745k|      Ldfs = swap_byte(Ldfs);
 2367|   745k|      if (file->read(&Sdfs, 2) != 2)
  ------------------
  |  Branch (2367:11): [True: 13, False: 745k]
  ------------------
 2368|     13|        OJPH_ERROR(0x000500D2, "error reading DFS-Sdfs 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2369|   745k|      Sdfs = swap_byte(Sdfs);
 2370|   745k|      if (Sdfs > 15)
  ------------------
  |  Branch (2370:11): [True: 58, False: 745k]
  ------------------
 2371|     58|        OJPH_ERROR(0x000500D3, "The DFS-Sdfs parameter is %d, which is "
  ------------------
  |  |  289|     58|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     58|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 58, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2372|   745k|          "larger than the permissible 15", Sdfs);
 2373|   745k|      ui8 t, l_Ids = 0;
 2374|   745k|      if (file->read(&l_Ids, 1) != 1)
  ------------------
  |  Branch (2374:11): [True: 17, False: 745k]
  ------------------
 2375|     17|        OJPH_ERROR(0x000500D4, "error reading DFS-Ids parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2376|   745k|      constexpr int max_Ddfs = sizeof(Ddfs) * 4;
 2377|   745k|      if (l_Ids > max_Ddfs)
  ------------------
  |  Branch (2377:11): [True: 2.00k, False: 743k]
  ------------------
 2378|  2.00k|        OJPH_INFO(0x000500D5, "The DFS-Ids parameter is %d; while this is "
  ------------------
  |  |  285|  2.00k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  2.00k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2.00k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2379|   745k|          "valid, the number is unnessarily large -- you do not need more "
 2380|   745k|          "than %d.  Please contact me regarding this issue.",
 2381|   745k|          l_Ids, max_Ddfs);
 2382|   745k|      Ids = l_Ids < max_Ddfs ? l_Ids : max_Ddfs;
  ------------------
  |  Branch (2382:13): [True: 743k, False: 2.34k]
  ------------------
 2383|   777k|      for (int i = 0; i < Ids; i += 4)
  ------------------
  |  Branch (2383:23): [True: 32.5k, False: 745k]
  ------------------
 2384|  32.5k|        if (file->read(&Ddfs[i / 4], 1) != 1)
  ------------------
  |  Branch (2384:13): [True: 21, False: 32.5k]
  ------------------
 2385|     21|          OJPH_ERROR(0x000500D6, "error reading DFS-Ddfs parameters");
  ------------------
  |  |  289|   745k|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     21|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2386|   773k|      for (int i = Ids; i < l_Ids; i += 4)
  ------------------
  |  Branch (2386:25): [True: 28.2k, False: 745k]
  ------------------
 2387|  28.2k|        if (file->read(&t, 1) != 1)
  ------------------
  |  Branch (2387:13): [True: 15, False: 28.2k]
  ------------------
 2388|     15|          OJPH_ERROR(0x000500D7, "error reading DFS-Ddfs parameters");
  ------------------
  |  |  289|   745k|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     15|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2389|   745k|      return true;
 2390|  1.49M|    }
_ZN4ojph5local9param_atk7get_atkEi:
 2402|  4.95k|    {
 2403|  4.95k|      assert(top_atk == NULL);
 2404|       |
 2405|  4.95k|      if (Latk == 0)
  ------------------
  |  Branch (2405:11): [True: 4.51k, False: 433]
  ------------------
 2406|  4.51k|      {
 2407|       |        // This atk object is not used, initialize it to either 0 (irv97)
 2408|       |        // or 1 (rev53), and use it.  If index is not 0 nor 1, then index
 2409|       |        // must have been read from file previously, otherwise it is an
 2410|       |        // error.
 2411|  4.51k|        if (index == 0) { this->init_irv97(); return this; }
  ------------------
  |  Branch (2411:13): [True: 780, False: 3.73k]
  ------------------
 2412|  3.73k|        else if (index == 1) { this->init_rev53(); return this; }
  ------------------
  |  Branch (2412:18): [True: 3.73k, False: 8]
  ------------------
 2413|  4.51k|      }
 2414|       |
 2415|    441|      param_atk* p = this;
 2416|    784|      while (p && p->get_index() != index)
  ------------------
  |  Branch (2416:14): [True: 601, False: 183]
  |  Branch (2416:19): [True: 343, False: 258]
  ------------------
 2417|    343|        p = p->next;
 2418|       |
 2419|    441|      if (p == NULL && (index == 0 || index == 1))
  ------------------
  |  Branch (2419:11): [True: 183, False: 258]
  |  Branch (2419:25): [True: 45, False: 138]
  |  Branch (2419:39): [True: 72, False: 66]
  ------------------
 2420|    117|      {
 2421|       |        // The index was not found, add an atk object only if the index is
 2422|       |        // either 0 or 1
 2423|    117|        p = add_object();
 2424|    117|        if (index == 0)
  ------------------
  |  Branch (2424:13): [True: 45, False: 72]
  ------------------
 2425|     45|          p->init_irv97();
 2426|     72|        else if (index == 1)
  ------------------
  |  Branch (2426:18): [True: 72, False: 0]
  ------------------
 2427|     72|          p->init_rev53();
 2428|    117|      }
 2429|       |
 2430|    441|      return p;
 2431|  4.95k|    }
_ZN4ojph5local9param_atk16read_coefficientEPNS_11infile_baseERfRi:
 2435|  1.36k|    {
 2436|  1.36k|      int coeff_type = get_coeff_type();
 2437|  1.36k|      if (coeff_type == 0) { // 8bit
  ------------------
  |  Branch (2437:11): [True: 59, False: 1.30k]
  ------------------
 2438|     59|        ui8 v;
 2439|     59|        if (file->read(&v, 1) != 1) return false;
  ------------------
  |  Branch (2439:13): [True: 1, False: 58]
  ------------------
 2440|     58|        bytes -= 1;
 2441|     58|        K = v;
 2442|     58|      }
 2443|  1.30k|      else if (coeff_type == 1) { // 16bit
  ------------------
  |  Branch (2443:16): [True: 112, False: 1.18k]
  ------------------
 2444|    112|        ui16 v;
 2445|    112|        if (file->read(&v, 2) != 2) return false;
  ------------------
  |  Branch (2445:13): [True: 5, False: 107]
  ------------------
 2446|    107|        bytes -= 2;
 2447|    107|        K = swap_byte(v);
 2448|    107|      }
 2449|  1.18k|      else if (coeff_type == 2) { // float
  ------------------
  |  Branch (2449:16): [True: 516, False: 673]
  ------------------
 2450|    516|        union {
 2451|    516|          float f;
 2452|    516|          ui32 i;
 2453|    516|        } v;
 2454|    516|        if (file->read(&v.i, 4) != 4) return false;
  ------------------
  |  Branch (2454:13): [True: 3, False: 513]
  ------------------
 2455|    513|        bytes -= 4;
 2456|    513|        v.i = swap_byte(v.i);
 2457|    513|        K = v.f;
 2458|    513|      }
 2459|    673|      else if (coeff_type == 3) { // double
  ------------------
  |  Branch (2459:16): [True: 344, False: 329]
  ------------------
 2460|    344|        union {
 2461|    344|          double d;
 2462|    344|          ui64 i;
 2463|    344|        } v;
 2464|    344|        if (file->read(&v.i, 8) != 8) return false;
  ------------------
  |  Branch (2464:13): [True: 8, False: 336]
  ------------------
 2465|    336|        bytes -= 8;
 2466|    336|        v.i = swap_byte(v.i);
 2467|    336|        K = (float)v.d;
 2468|    336|      }
 2469|    329|      else if (coeff_type == 4) { // 128 bit float
  ------------------
  |  Branch (2469:16): [True: 84, False: 245]
  ------------------
 2470|     84|        ui64 v, v1;
 2471|     84|        if (file->read(&v, 8) != 8) return false;
  ------------------
  |  Branch (2471:13): [True: 6, False: 78]
  ------------------
 2472|     78|        bytes -= 8;
 2473|     78|        if (file->read(&v1, 8) != 8) return false; // v1 not needed
  ------------------
  |  Branch (2473:13): [True: 5, False: 73]
  ------------------
 2474|     73|        bytes -= 8;
 2475|     73|        v = swap_byte(v);
 2476|       |
 2477|     73|        union {
 2478|     73|          float f;
 2479|     73|          ui32 i;
 2480|     73|        } s;
 2481|       |        // convert the MSB of 128b float to 32b float
 2482|       |        // 32b float has 1 sign bit, 8 exponent (offset 127), 23 mantissa
 2483|       |        // 128b float has 1 sign bit, 15 exponent (offset 16383), 112 mantissa
 2484|     73|        si32 e = (si32)((v >> 48) & 0x7FFF);   // exponent
 2485|     73|        e -= 16383;
 2486|     73|        e += 127;
 2487|     73|        e = e & 0xFF;                          // removes MSBs if negative
 2488|     73|        e <<= 23;                              // move bits to their location
 2489|     73|        s.i = 0;
 2490|     73|        s.i |= ((ui32)(v >> 32) & 0x80000000); // copy sign bit
 2491|     73|        s.i |= (ui32)e;                        // copy exponent
 2492|     73|        s.i |= (ui32)((v >> 25) & 0x007FFFFF); // copy 23 mantissa
 2493|     73|        K = s.f;
 2494|     73|      }
 2495|  1.33k|      return true;
 2496|  1.36k|    }
_ZN4ojph5local9param_atk16read_coefficientEPNS_11infile_baseERsRi:
 2501|    299|    {
 2502|    299|      int coeff_type = get_coeff_type();
 2503|    299|      if (coeff_type == 0) {
  ------------------
  |  Branch (2503:11): [True: 98, False: 201]
  ------------------
 2504|     98|        si8 v;
 2505|     98|        if (file->read(&v, 1) != 1) return false;
  ------------------
  |  Branch (2505:13): [True: 5, False: 93]
  ------------------
 2506|     93|        bytes -= 1;
 2507|     93|        K = v;
 2508|     93|      }
 2509|    201|      else if (coeff_type == 1) {
  ------------------
  |  Branch (2509:16): [True: 201, False: 0]
  ------------------
 2510|    201|        si16 v;
 2511|    201|        if (file->read(&v, 2) != 2) return false;
  ------------------
  |  Branch (2511:13): [True: 3, False: 198]
  ------------------
 2512|    198|        bytes -= 2;
 2513|    198|        K = (si16)swap_byte((ui16)v);
 2514|    198|      }
 2515|      0|      else
 2516|      0|        return false;
 2517|    291|      return true;
 2518|    299|    }
_ZN4ojph5local9param_atk4readEPNS_11infile_baseE:
 2522|    312|    {
 2523|    312|      if (Latk != 0) // this param_atk is used
  ------------------
  |  Branch (2523:11): [True: 69, False: 243]
  ------------------
 2524|     69|        return add_object()->read(file);
 2525|       |
 2526|    243|      if (file->read(&Latk, 2) != 2)
  ------------------
  |  Branch (2526:11): [True: 1, False: 242]
  ------------------
 2527|      1|        OJPH_ERROR(0x000500E1, "error reading ATK-Latk parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2528|    243|      Latk = swap_byte(Latk);
 2529|    243|      si32 bytes = Latk - 2;
 2530|    243|      ojph::ui16 temp_Satk;
 2531|    243|      if (file->read(&temp_Satk, 2) != 2)
  ------------------
  |  Branch (2531:11): [True: 3, False: 240]
  ------------------
 2532|      3|        OJPH_ERROR(0x000500E2, "error reading ATK-Satk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2533|    243|      bytes -= 2;
 2534|    243|      temp_Satk = swap_byte(temp_Satk);
 2535|    243|      int tmp_idx = temp_Satk & 0xFF;
 2536|    243|      if ((top_atk && top_atk->get_atk(tmp_idx) != NULL)
  ------------------
  |  Branch (2536:12): [True: 67, False: 176]
  |  Branch (2536:23): [True: 10, False: 57]
  ------------------
 2537|    229|        || tmp_idx == 0 || tmp_idx == 1)
  ------------------
  |  Branch (2537:12): [True: 1, False: 228]
  |  Branch (2537:28): [True: 1, False: 227]
  ------------------
 2538|     12|        OJPH_ERROR(0x000500F3, "ATK-Satk parameter sets ATK marker index to "
  ------------------
  |  |  289|     12|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     12|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2539|    243|          "the illegal value of %d. ATK-Satk should be in (2-255) and, I "
 2540|    243|          "believe, must not be repeated; otherwise, it would be unclear "
 2541|    243|          "what marker segment must be employed when an index is repeated.",
 2542|    243|          tmp_idx);
 2543|    243|      Satk = temp_Satk;
 2544|    243|      if (is_m_init0() == false)  // only even-indexed is supported
  ------------------
  |  Branch (2544:11): [True: 4, False: 239]
  ------------------
 2545|      4|        OJPH_ERROR(0x000500E3, "ATK-Satk parameter sets m_init to 1, "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2546|    243|          "requiring odd-indexed subsequence in first reconstruction step, "
 2547|    243|          "which is not supported yet.");
 2548|    243|      if (is_whole_sample() == false)  // ARB filter not supported
  ------------------
  |  Branch (2548:11): [True: 3, False: 240]
  ------------------
 2549|      3|        OJPH_ERROR(0x000500E4, "ATK-Satk parameter specified ARB filter, "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2550|    243|          "which is not supported yet.");
 2551|    243|      if (is_reversible() && get_coeff_type() >= 2) // reversible & float
  ------------------
  |  Branch (2551:11): [True: 79, False: 164]
  |  Branch (2551:30): [True: 2, False: 77]
  ------------------
 2552|      2|        OJPH_ERROR(0x000500E5, "ATK-Satk parameter does not make sense. "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2553|    243|          "It employs floats with reversible filtering.");
 2554|    243|      if (is_using_ws_extension() == false)  // only sym. ext is supported
  ------------------
  |  Branch (2554:11): [True: 1, False: 242]
  ------------------
 2555|      1|        OJPH_ERROR(0x000500E6, "ATK-Satk parameter requires constant "
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2556|    243|          "boundary extension, which is not supported yet.");
 2557|    243|      if (is_reversible() == false)
  ------------------
  |  Branch (2557:11): [True: 140, False: 103]
  ------------------
 2558|    140|        if (read_coefficient(file, Katk, bytes) == false)
  ------------------
  |  Branch (2558:13): [True: 14, False: 126]
  ------------------
 2559|     14|          OJPH_ERROR(0x000500E7, "error reading ATK-Katk parameter");
  ------------------
  |  |  289|     14|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     14|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2560|    243|      if (file->read(&Natk, 1) != 1)
  ------------------
  |  Branch (2560:11): [True: 9, False: 234]
  ------------------
 2561|      9|        OJPH_ERROR(0x000500E8, "error reading ATK-Natk parameter");
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2562|    243|      bytes -= 1;
 2563|    243|      if (Natk > max_steps) {
  ------------------
  |  Branch (2563:11): [True: 86, False: 157]
  ------------------
 2564|     86|        if (d != d_store) // was this allocated -- very unlikely
  ------------------
  |  Branch (2564:13): [True: 0, False: 86]
  ------------------
 2565|      0|          delete[] d;
 2566|     86|        d = new lifting_step[Natk];
 2567|     86|        max_steps = Natk;
 2568|     86|      }
 2569|       |
 2570|    243|      if (is_reversible())
  ------------------
  |  Branch (2570:11): [True: 76, False: 167]
  ------------------
 2571|     76|      {
 2572|    407|        for (int s = 0; s < Natk; ++s)
  ------------------
  |  Branch (2572:25): [True: 331, False: 76]
  ------------------
 2573|    331|        {
 2574|    331|          if (file->read(&d[s].rev.Eatk, 1) != 1)
  ------------------
  |  Branch (2574:15): [True: 9, False: 322]
  ------------------
 2575|      9|            OJPH_ERROR(0x000500E9, "error reading ATK-Eatk parameter");
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2576|    331|          bytes -= 1;
 2577|    331|          if (file->read(&d[s].rev.Batk, 2) != 2)
  ------------------
  |  Branch (2577:15): [True: 9, False: 322]
  ------------------
 2578|      9|            OJPH_ERROR(0x000500EA, "error reading ATK-Batk parameter");
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2579|    331|          bytes -= 2;
 2580|    331|          d[s].rev.Batk = (si16)swap_byte((ui16)d[s].rev.Batk);
 2581|    331|          ui8 LCatk;
 2582|    331|          if (file->read(&LCatk, 1) != 1)
  ------------------
  |  Branch (2582:15): [True: 2, False: 329]
  ------------------
 2583|      2|            OJPH_ERROR(0x000500EB, "error reading ATK-LCatk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2584|    331|          bytes -= 1;
 2585|    331|          if (LCatk == 0)
  ------------------
  |  Branch (2585:15): [True: 2, False: 329]
  ------------------
 2586|      2|            OJPH_ERROR(0x000500EC, "Encountered a ATK-LCatk value of zero; "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2587|    331|              "something is wrong.");
 2588|    331|          if (LCatk > 1)
  ------------------
  |  Branch (2588:15): [True: 10, False: 321]
  ------------------
 2589|     10|            OJPH_ERROR(0x000500ED, "ATK-LCatk value greater than 1; "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2590|    331|              "that is, a multitap filter is not supported");
 2591|    331|          if (read_coefficient(file, d[s].rev.Aatk, bytes) == false)
  ------------------
  |  Branch (2591:15): [True: 8, False: 323]
  ------------------
 2592|      8|            OJPH_ERROR(0x000500EE, "Error reding ATK-Aatk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2593|    331|        }
 2594|     76|      }
 2595|    167|      else
 2596|    167|      {
 2597|  1.42k|        for (int s = 0; s < Natk; ++s)
  ------------------
  |  Branch (2597:25): [True: 1.25k, False: 167]
  ------------------
 2598|  1.25k|        {
 2599|  1.25k|          ui8 LCatk;
 2600|  1.25k|          if (file->read(&LCatk, 1) != 1)
  ------------------
  |  Branch (2600:15): [True: 16, False: 1.24k]
  ------------------
 2601|     16|            OJPH_ERROR(0x000500EF, "error reading ATK-LCatk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2602|  1.25k|          bytes -= 1;
 2603|  1.25k|          if (LCatk == 0)
  ------------------
  |  Branch (2603:15): [True: 5, False: 1.25k]
  ------------------
 2604|      5|            OJPH_ERROR(0x000500F0, "Encountered a ATK-LCatk value of zero; "
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2605|  1.25k|              "something is wrong.");
 2606|  1.25k|          if (LCatk > 1)
  ------------------
  |  Branch (2606:15): [True: 15, False: 1.24k]
  ------------------
 2607|     15|            OJPH_ERROR(0x000500F1, "ATK-LCatk value greater than 1; "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2608|  1.25k|              "that is, a multitap filter is not supported.");
 2609|  1.25k|          if (read_coefficient(file, d[s].irv.Aatk, bytes) == false)
  ------------------
  |  Branch (2609:15): [True: 14, False: 1.24k]
  ------------------
 2610|     14|            OJPH_ERROR(0x000500F2, "Error reding ATK-Aatk parameter");
  ------------------
  |  |  289|     14|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     14|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2611|  1.25k|        }
 2612|    167|      }
 2613|    243|      if (bytes != 0)
  ------------------
  |  Branch (2613:11): [True: 27, False: 216]
  ------------------
 2614|     27|        OJPH_ERROR(0x000500F3, "The length of an ATK marker segment "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2615|    243|          "(ATK-Latk) is not correct");
 2616|       |
 2617|    243|      return true;
 2618|    312|    }
_ZN4ojph5local9param_atk10init_irv97Ev:
 2622|    825|    {
 2623|    825|      Satk = 0x4a00;     // illegal because ATK = 0
 2624|    825|      Katk = (float)1.230174104914001;
 2625|    825|      Natk = 4;
 2626|       |      // next is (A-4) in T.801 second line
 2627|    825|      Latk = (ui16)(5 + Natk + sizeof(float) * (1 + Natk));
 2628|    825|      d[0].irv.Aatk = (float)0.443506852043971;
 2629|    825|      d[1].irv.Aatk = (float)0.882911075530934;
 2630|    825|      d[2].irv.Aatk = (float)-0.052980118572961;
 2631|    825|      d[3].irv.Aatk = (float)-1.586134342059924;
 2632|    825|    }
_ZN4ojph5local9param_atk10init_rev53Ev:
 2636|  3.80k|    {
 2637|  3.80k|      Satk = 0x5801;     // illegal because ATK = 1
 2638|  3.80k|      Natk = 2;
 2639|       |      // next is (A-4) in T.801 fourth line
 2640|  3.80k|      Latk = (ui16)(5 + 2 * Natk + sizeof(ui8) * (Natk + Natk));
 2641|  3.80k|      d[0].rev.Aatk = 1;
 2642|  3.80k|      d[0].rev.Batk = 2;
 2643|  3.80k|      d[0].rev.Eatk = 2;
 2644|  3.80k|      d[1].rev.Aatk = -1;
 2645|  3.80k|      d[1].rev.Batk = 1;
 2646|  3.80k|      d[1].rev.Eatk = 1;
 2647|  3.80k|    }
_ZN4ojph5local9param_atk10add_objectEv:
 2651|    186|    {
 2652|    186|      assert(top_atk == NULL);
 2653|    186|      param_atk *p = this;
 2654|    299|      while (p->next != NULL)
  ------------------
  |  Branch (2654:14): [True: 113, False: 186]
  ------------------
 2655|    113|        p = p->next;
 2656|    186|      if (avail)
  ------------------
  |  Branch (2656:11): [True: 0, False: 186]
  ------------------
 2657|      0|      {
 2658|      0|        p->next = avail;
 2659|      0|        avail = avail->next;
 2660|      0|      }
 2661|    186|      else
 2662|    186|        p->next = new param_atk;
 2663|    186|      p = p->next;
 2664|    186|      p->init(this);
 2665|    186|      return p;
 2666|    186|    }
ojph_params.cpp:_ZN4ojph5localL9swap_byteEt:
  491|  1.93M|    {
  492|  1.93M|      return (ui16)((t << 8) | (t >> 8));
  493|  1.93M|    }
ojph_params.cpp:_ZN4ojph5localL9swap_byteEj:
  498|   120k|    {
  499|   120k|      ui32 u = swap_byte((ui16)(t & 0xFFFFu));
  500|   120k|      u <<= 16;
  501|   120k|      u |= swap_byte((ui16)(t >> 16));
  502|   120k|      return u;
  503|   120k|    }
ojph_params.cpp:_ZN4ojph5localL9swap_byteEm:
  508|    409|    {
  509|    409|      ui64 u = swap_byte((ui32)(t & 0xFFFFFFFFu));
  510|    409|      u <<= 32;
  511|    409|      u |= swap_byte((ui32)(t >> 32));
  512|    409|      return u;
  513|    409|    }

_ZN4ojph5local9param_sizC2Ev:
  177|  6.10k|      param_siz() { init(); }
_ZN4ojph5local9param_sizD2Ev:
  178|  6.10k|      ~param_siz() { destroy(); }
_ZN4ojph5local9param_siz4initEv:
  181|  6.10k|      {
  182|  6.10k|        Lsiz = Csiz = 0;
  183|  6.10k|        Xsiz = Ysiz = XOsiz = YOsiz = XTsiz = YTsiz = XTOsiz = YTOsiz = 0;
  184|  6.10k|        skipped_resolutions = 0;
  185|  6.10k|        memset(store, 0, sizeof(store));
  186|  6.10k|        ws_kern_support_needed = dfs_support_needed = false;
  187|  6.10k|        cod = NULL;
  188|       |        dfs = NULL;
  189|  6.10k|        Rsiz = RSIZ_HT_FLAG;
  190|  6.10k|        cptr = store;
  191|  6.10k|        old_Csiz = sizeof(store) / sizeof(siz_comp_info);
  192|  6.10k|      }
_ZN4ojph5local9param_siz7destroyEv:
  195|  6.10k|      { if (cptr != store) { delete[] cptr; cptr = NULL; } }
  ------------------
  |  Branch (195:13): [True: 19, False: 6.08k]
  ------------------
_ZN4ojph5local9param_siz18set_num_componentsEj:
  198|  5.87k|      {
  199|  5.87k|        Csiz = (ui16)num_comps;
  200|  5.87k|        if (Csiz > old_Csiz)
  ------------------
  |  Branch (200:13): [True: 19, False: 5.85k]
  ------------------
  201|     19|        {
  202|     19|          if (cptr != store)
  ------------------
  |  Branch (202:15): [True: 0, False: 19]
  ------------------
  203|      0|            delete[] cptr;
  204|     19|          cptr = new siz_comp_info[num_comps];
  205|     19|          old_Csiz = Csiz;
  206|     19|        }
  207|  5.87k|        memset(cptr, 0, sizeof(local::siz_comp_info) * num_comps);
  208|  5.87k|      }
_ZN4ojph5local9param_siz13set_tile_sizeENS_4sizeE:
  222|  5.93k|      void set_tile_size(size s) { XTsiz = s.w; YTsiz = s.h; }
_ZN4ojph5local9param_siz16set_image_offsetENS_5pointE:
  225|  5.93k|      { XOsiz = offset.x; YOsiz = offset.y; }
_ZN4ojph5local9param_siz15set_tile_offsetENS_5pointE:
  229|  5.92k|      { XTOsiz = offset.x; YTOsiz = offset.y; }
_ZN4ojph5local9param_siz14check_validityEv:
  236|  5.85k|      {
  237|  5.85k|        if (Xsiz == 0 || Ysiz == 0 || XTsiz == 0 || YTsiz == 0)
  ------------------
  |  Branch (237:13): [True: 1, False: 5.85k]
  |  Branch (237:26): [True: 2, False: 5.85k]
  |  Branch (237:39): [True: 4, False: 5.84k]
  |  Branch (237:53): [True: 6, False: 5.84k]
  ------------------
  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|  5.85k|            "Image extent and/or tile size cannot be zero");
  240|  5.85k|        if (XTOsiz > XOsiz || YTOsiz > YOsiz)
  ------------------
  |  Branch (240:13): [True: 60, False: 5.79k]
  |  Branch (240:31): [True: 39, False: 5.75k]
  ------------------
  241|     86|          OJPH_ERROR(0x00040002,
  ------------------
  |  |  289|     86|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     86|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 86, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|  5.85k|            "Tile offset has to be smaller than the image offset");
  243|  5.85k|        if (XTsiz + XTOsiz <= XOsiz || YTsiz + YTOsiz <= YOsiz)
  ------------------
  |  Branch (243:13): [True: 156, False: 5.69k]
  |  Branch (243:40): [True: 20, False: 5.67k]
  ------------------
  244|     77|          OJPH_ERROR(0x00040003,
  ------------------
  |  |  289|     77|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     77|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 77, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  5.85k|            "The top left tile must intersect with the image");
  246|  5.85k|        if (Xsiz <= XOsiz || Ysiz <= YOsiz)
  ------------------
  |  Branch (246:13): [True: 192, False: 5.66k]
  |  Branch (246:30): [True: 8, False: 5.65k]
  ------------------
  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|  5.85k|            "The image extent must be larger than the image offset");
  249|  5.85k|      }
_ZNK4ojph5local9param_siz18get_num_componentsEv:
  251|   183k|      ui16 get_num_components() const { return Csiz; }
_ZNK4ojph5local9param_siz13get_bit_depthEj:
  253|  50.6k|      {
  254|       |        assert(comp_num < Csiz);
  255|  50.6k|        return (cptr[comp_num].SSiz & 0x7F) + 1u;
  256|  50.6k|      }
_ZNK4ojph5local9param_siz9is_signedEj:
  258|  50.6k|      {
  259|       |        assert(comp_num < Csiz);
  260|  50.6k|        return (cptr[comp_num].SSiz & 0x80) != 0;
  261|  50.6k|      }
_ZNK4ojph5local9param_siz16get_downsamplingEj:
  263|   156k|      {
  264|       |        assert(comp_num < Csiz);
  265|   156k|        return point(cptr[comp_num].XRsiz, cptr[comp_num].YRsiz);
  266|   156k|      }
_ZN4ojph5local9param_siz4linkEPKNS0_9param_codE:
  272|  4.51k|      { this->cod = cod; }
_ZN4ojph5local9param_siz4linkEPKNS0_9param_dfsE:
  275|    220|      { this->dfs = dfs; }
_ZN4ojph5local9param_siz23set_skipped_resolutionsEj:
  278|  1.46k|      { this->skipped_resolutions = skipped_resolutions; }
_ZNK4ojph5local9param_siz9get_widthEj:
  281|  4.68k|      {
  282|  4.68k|        assert(comp_num < get_num_components());
  283|  4.68k|        ui32 ds = (ui32)cptr[comp_num].XRsiz;
  284|  4.68k|        ui32 t = ojph_div_ceil(Xsiz, ds) - ojph_div_ceil(XOsiz, ds);
  ------------------
  |  |   70|  4.68k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
                      ui32 t = ojph_div_ceil(Xsiz, ds) - ojph_div_ceil(XOsiz, ds);
  ------------------
  |  |   70|  4.68k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  285|  4.68k|        return t;
  286|  4.68k|      }
_ZNK4ojph5local9param_siz10get_heightEj:
  289|  4.68k|      {
  290|  4.68k|        assert(comp_num < get_num_components());
  291|  4.68k|        ui32 ds = (ui32)cptr[comp_num].YRsiz;
  292|  4.68k|        ui32 t = ojph_div_ceil(Ysiz, ds) - ojph_div_ceil(YOsiz, ds);
  ------------------
  |  |   70|  4.68k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
                      ui32 t = ojph_div_ceil(Ysiz, ds) - ojph_div_ceil(YOsiz, ds);
  ------------------
  |  |   70|  4.68k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  293|  4.68k|        return t;
  294|  4.68k|      }
_ZNK4ojph5local9param_siz15get_recon_widthEj:
  299|  14.3k|      { return get_recon_size(comp_num).x; }
_ZNK4ojph5local9param_siz16get_recon_heightEj:
  301|  13.9k|      { return get_recon_size(comp_num).y; }
_ZN4ojph5local9cod_SPcodC2Ev:
  346|  6.64k|      cod_SPcod() {
  347|  6.64k|        num_decomp = 5;
  348|  6.64k|        block_width = 4;    // 64
  349|  6.64k|        block_height = 4;   // 64
  350|  6.64k|        block_style = 0x40; // HT mode
  351|  6.64k|        wavelet_trans = 0;  // reversible 5 / 3
  352|  6.64k|        memset(precinct_size, 0, sizeof(precinct_size));
  353|  6.64k|      }
_ZNK4ojph5local9cod_SPcod18get_log_block_dimsEv:
  363|  1.26M|      { return size(block_width + 2, block_height + 2); }
_ZNK4ojph5local9cod_SPcod21get_log_precinct_sizeEj:
  367|  1.59M|      {
  368|       |        assert(res_num <= num_decomp);
  369|  1.59M|        size ps(precinct_size[res_num] & 0xF, precinct_size[res_num] >> 4);
  370|  1.59M|        return ps;
  371|  1.59M|      }
_ZN4ojph5local9cod_SGcodC2Ev:
  377|  6.64k|      cod_SGcod() : prog_order(OJPH_PO_RPCL), num_layers(1), mc_trans(0) {}
_ZN4ojph5local9param_codC2EPS1_t:
  414|  6.64k|      { avail = NULL; init(top_cod, comp_idx); }
_ZN4ojph5local9param_codD2Ev:
  415|  6.64k|      ~param_cod() { destroy(); }
_ZN4ojph5local9param_cod7restartEv:
  419|  6.10k|      {
  420|  6.10k|        param_cod** p = &avail; // move next to the end of avail
  421|  6.10k|        while (*p != NULL)
  ------------------
  |  Branch (421:16): [True: 0, False: 6.10k]
  ------------------
  422|      0|          p = &((*p)->next);
  423|  6.10k|        *p = next;
  424|  6.10k|        this->init(top_cod, OJPH_COD_DEFAULT);
  425|  6.10k|      }
_ZNK4ojph5local9param_cod22get_num_decompositionsEv:
  505|  1.61M|      {
  506|  1.61M|        if (type == COD_MAIN)
  ------------------
  |  Branch (506:13): [True: 1.55M, False: 58.0k]
  ------------------
  507|  1.55M|          return SPcod.num_decomp;
  508|  58.0k|        else if (type == COC_MAIN)
  ------------------
  |  Branch (508:18): [True: 58.0k, False: 0]
  ------------------
  509|  58.0k|        {
  510|  58.0k|          if (is_dfs_defined())
  ------------------
  |  Branch (510:15): [True: 36.2k, False: 21.8k]
  ------------------
  511|  36.2k|            return top_cod->get_num_decompositions();
  512|  21.8k|          else
  513|  21.8k|            return SPcod.num_decomp;
  514|  58.0k|        }
  515|      0|        else {
  516|       |          assert(0);
  517|      0|          return 0; // just in case
  518|      0|        }
  519|  1.61M|      }
_ZNK4ojph5local9param_cod18get_log_block_dimsEv:
  527|  1.26M|      { return SPcod.get_log_block_dims(); }
_ZNK4ojph5local9param_cod16get_wavelet_kernEv:
  531|  2.35M|      { return SPcod.wavelet_trans; }
_ZNK4ojph5local9param_cod28is_employing_color_transformEv:
  538|  1.72M|      {
  539|  1.72M|        if (type == COD_MAIN || type == COD_TILE)
  ------------------
  |  Branch (539:13): [True: 1.72M, False: 0]
  |  Branch (539:33): [True: 0, False: 0]
  ------------------
  540|  1.72M|          return (SGCod.mc_trans == 1);
  541|      0|        else
  542|      0|          return top_cod->is_employing_color_transform();
  543|  1.72M|      }
_ZNK4ojph5local9param_cod17get_precinct_sizeEj:
  547|  26.5k|      {
  548|  26.5k|        size t = get_log_precinct_size(res_num);
  549|  26.5k|        return size(1 << t.w, 1 << t.h);
  550|  26.5k|      }
_ZNK4ojph5local9param_cod21get_log_precinct_sizeEj:
  554|  1.63M|      {
  555|  1.63M|        if (Scod & 1)
  ------------------
  |  Branch (555:13): [True: 1.59M, False: 41.7k]
  ------------------
  556|  1.59M|          return SPcod.get_log_precinct_size(res_num);
  557|  41.7k|        else
  558|  41.7k|          return size(15, 15);
  559|  1.63M|      }
_ZNK4ojph5local9param_cod19packets_may_use_sopEv:
  563|  7.13M|      {
  564|  7.13M|        if (type == COD_MAIN || type == COD_TILE)
  ------------------
  |  Branch (564:13): [True: 6.77M, False: 363k]
  |  Branch (564:33): [True: 0, False: 363k]
  ------------------
  565|  6.77M|          return (Scod & 2) == 2;
  566|   363k|        return false;
  567|  7.13M|      }
_ZNK4ojph5local9param_cod15packets_use_ephEv:
  571|  7.13M|      {
  572|  7.13M|        if (type == COD_MAIN || type == COD_TILE)
  ------------------
  |  Branch (572:13): [True: 6.77M, False: 363k]
  |  Branch (572:33): [True: 0, False: 363k]
  ------------------
  573|  6.77M|          return (Scod & 4) == 4;
  574|   363k|        return false;
  575|  7.13M|      }
_ZNK4ojph5local9param_cod28get_block_vertical_causalityEv:
  579|  2.28M|      { return (SPcod.block_style & local::param_cod::VERT_CAUSAL_MODE) != 0; }
_ZNK4ojph5local9param_cod10access_atkEv:
  606|  2.16M|      const param_atk* access_atk() const { return atk; }
_ZNK4ojph5local9param_cod14is_dfs_definedEv:
  611|  1.47M|      { return (SPcod.num_decomp & 0x80) != 0; }
_ZNK4ojph5local9param_cod13get_dfs_indexEv:
  615|  26.7k|      { return SPcod.num_decomp & 0xF; }
_ZNK4ojph5local9param_cod12get_comp_idxEv:
  619|  1.53M|      {
  620|       |        assert((type == COC_MAIN && comp_idx != OJPH_COD_DEFAULT) ||
  621|  1.53M|               (type == COD_MAIN && comp_idx == OJPH_COD_DEFAULT));
  622|  1.53M|        return comp_idx;
  623|  1.53M|      }
_ZN4ojph5local9param_cod4initEPS1_t:
  628|  12.7k|      {
  629|  12.7k|        type = top_cod ? COC_MAIN : COD_MAIN;
  ------------------
  |  Branch (629:16): [True: 540, False: 12.2k]
  ------------------
  630|  12.7k|        Lcod = 0;
  631|  12.7k|        Scod = 0;
  632|  12.7k|        next = NULL;
  633|       |        atk = NULL;
  634|  12.7k|        this->top_cod = top_cod;
  635|  12.7k|        this->comp_idx = comp_idx;
  636|  12.7k|      }
_ZN4ojph5local9param_cod7destroyEv:
  639|  6.64k|      void destroy() {
  640|  6.64k|        if (avail)
  ------------------
  |  Branch (640:13): [True: 0, False: 6.64k]
  ------------------
  641|      0|          delete avail;
  642|  6.64k|        if (next) {
  ------------------
  |  Branch (642:13): [True: 540, False: 6.10k]
  ------------------
  643|    540|          delete next;
  644|       |          next = NULL;
  645|    540|        }
  646|  6.64k|      }
_ZN4ojph5local9param_qcdC2EPS1_t:
  696|  6.34k|      { avail = NULL; init(top_qcd, comp_idx); }
_ZN4ojph5local9param_qcdD2Ev:
  697|  6.34k|      ~param_qcd() { destroy(); }
_ZN4ojph5local9param_qcd7restartEv:
  701|  6.10k|      {
  702|  6.10k|        param_qcd** p = &avail; // move next to the end of avail
  703|  6.10k|        while (*p != NULL)
  ------------------
  |  Branch (703:16): [True: 0, False: 6.10k]
  ------------------
  704|      0|          p = &((*p)->next);
  705|  6.10k|        *p = next;
  706|  6.10k|        this->init(top_qcd, OJPH_QCD_DEFAULT);
  707|  6.10k|      }
_ZNK4ojph5local9param_qcd12get_comp_idxEv:
  728|    331|      ui16 get_comp_idx() const { return comp_idx; }
_ZN4ojph5local9param_qcd4initEPS1_t:
  733|  12.4k|      {
  734|  12.4k|        type = top_qcd ? QCC_MAIN : QCD_MAIN;
  ------------------
  |  Branch (734:16): [True: 237, False: 12.2k]
  ------------------
  735|  12.4k|        Lqcd = 0;
  736|  12.4k|        Sqcd = 0;
  737|  12.4k|        memset(&SPqcd, 0, sizeof(SPqcd));
  738|  12.4k|        num_subbands = 0;
  739|  12.4k|        base_delta = -1.0f;
  740|  12.4k|        enabled = true;
  741|       |        next = NULL;
  742|  12.4k|        this->top_qcd = top_qcd;
  743|  12.4k|        this->comp_idx = comp_idx;
  744|  12.4k|      }
_ZN4ojph5local9param_qcd7destroyEv:
  747|  6.34k|      void destroy() {
  748|  6.34k|        if (avail)
  ------------------
  |  Branch (748:13): [True: 0, False: 6.34k]
  ------------------
  749|      0|          delete avail;
  750|  6.34k|        if (next)
  ------------------
  |  Branch (750:13): [True: 237, False: 6.10k]
  ------------------
  751|    237|        {
  752|    237|          delete next;
  753|       |          next = NULL;
  754|    237|        }
  755|  6.34k|      }
_ZNK4ojph5local9param_qcd12decode_SPqcdEh:
  766|  22.0M|      { return (ui8)(v >> 3); }
_ZN4ojph5local9param_nltC2Ev:
  806|  6.40k|      param_nlt() { avail = NULL; init(); }
_ZN4ojph5local9param_nltD2Ev:
  807|  6.40k|      ~param_nlt() { destroy(); }
_ZN4ojph5local9param_nlt7restartEv:
  811|  6.10k|      {
  812|  6.10k|        param_nlt** p = &avail; // move next to the end of avail
  813|  6.10k|        while (*p != NULL)
  ------------------
  |  Branch (813:16): [True: 0, False: 6.10k]
  ------------------
  814|      0|          p = &((*p)->next);
  815|  6.10k|        *p = next;
  816|  6.10k|        this->init();
  817|  6.10k|      }
_ZN4ojph5local9param_nlt4initEv:
  829|  12.5k|      {
  830|  12.5k|        Lnlt = 6;
  831|  12.5k|        Cnlt = special_comp_num::ALL_COMPS; // default
  832|  12.5k|        BDnlt = 0;
  833|  12.5k|        Tnlt = nonlinearity::OJPH_NLT_UNDEFINED;
  834|       |        enabled = false; next = NULL;
  835|  12.5k|      }
_ZN4ojph5local9param_nlt7destroyEv:
  839|  6.40k|      {
  840|  6.40k|        if (avail)
  ------------------
  |  Branch (840:13): [True: 0, False: 6.40k]
  ------------------
  841|      0|          delete avail;
  842|  6.40k|        if (next) {
  ------------------
  |  Branch (842:13): [True: 297, False: 6.10k]
  ------------------
  843|    297|          delete next;
  844|       |          next = NULL;
  845|    297|        }
  846|  6.40k|      }
_ZN4ojph5local9param_capC2Ev:
  883|  6.10k|      {
  884|  6.10k|        memset(this, 0, sizeof(param_cap));
  885|  6.10k|        Lcap = 8;
  886|  6.10k|        Pcap = 0x00020000; //for jph, Pcap^15 must be set, the 15th MSB
  887|  6.10k|      }
_ZN4ojph5local9param_sot4initEjthh:
  929|  89.8k|      {
  930|  89.8k|        Lsot = 10;
  931|  89.8k|        Psot = payload_length + 12; //total = payload + SOT marker
  932|  89.8k|        Isot = tile_idx;
  933|  89.8k|        TPsot = tile_part_index;
  934|  89.8k|        TNsot = num_tile_parts;
  935|  89.8k|      }
_ZNK4ojph5local9param_sot14get_tile_indexEv:
  941|   139k|      ui16 get_tile_index() const { return Isot; }
_ZNK4ojph5local9param_sot18get_payload_lengthEv:
  942|   134k|      ui32 get_payload_length() const { return Psot > 0 ? Psot - 12 : 0; }
  ------------------
  |  Branch (942:48): [True: 23.6k, False: 110k]
  ------------------
_ZNK4ojph5local9param_sot19get_tile_part_indexEv:
  943|   170k|      ui8  get_tile_part_index() const { return TPsot; }
_ZNK4ojph5local9param_sot18get_num_tile_partsEv:
  944|  74.5k|      ui8  get_num_tile_parts() const { return TNsot; }
_ZN4ojph5local9param_tlmC2Ev:
  970|  6.10k|      param_tlm() { pairs = NULL; num_pairs = 0; next_pair_index = 0; };
_ZN4ojph5local9param_dfsC2Ev:
 1003|   750k|      param_dfs() { avail = NULL; init(); }
_ZN4ojph5local9param_dfsD2Ev:
 1004|   750k|      ~param_dfs() { destroy(); }
_ZN4ojph5local9param_dfs7restartEv:
 1008|  6.10k|      {
 1009|  6.10k|        param_dfs** p = &avail; // move next to the end of avail
 1010|  6.10k|        while (*p != NULL)
  ------------------
  |  Branch (1010:16): [True: 0, False: 6.10k]
  ------------------
 1011|      0|          p = &((*p)->next);
 1012|  6.10k|        *p = next;
 1013|  6.10k|        this->init();
 1014|  6.10k|      }
_ZNK4ojph5local9param_dfs6existsEv:
 1017|  39.6k|      bool exists() const { return Ldfs != 0; }
_ZN4ojph5local9param_dfs4initEv:
 1031|   756k|      { Ldfs = Sdfs = Ids = 0; memset(Ddfs, 0, sizeof(Ddfs)); next = NULL; }
_ZN4ojph5local9param_dfs7destroyEv:
 1035|   750k|      {
 1036|   750k|        if (avail)
  ------------------
  |  Branch (1036:13): [True: 0, False: 750k]
  ------------------
 1037|      0|          delete avail;
 1038|   750k|        if (next) {
  ------------------
  |  Branch (1038:13): [True: 744k, False: 6.10k]
  ------------------
 1039|   744k|          delete next;
 1040|       |          next = NULL;
 1041|   744k|        }
 1042|   750k|      }
_ZN4ojph5local9param_atkC2Ev:
 1093|  6.29k|      {
 1094|  6.29k|        d = d_store;
 1095|  6.29k|        max_steps = sizeof(d_store) / sizeof(lifting_step);
 1096|       |        init(NULL);
 1097|  6.29k|      }
_ZN4ojph5local9param_atkD2Ev:
 1099|  6.29k|      {
 1100|  6.29k|        if (avail) {
  ------------------
  |  Branch (1100:13): [True: 0, False: 6.29k]
  ------------------
 1101|      0|          delete avail;
 1102|      0|          avail = NULL;
 1103|      0|        }
 1104|  6.29k|        if (next) {
  ------------------
  |  Branch (1104:13): [True: 186, False: 6.10k]
  ------------------
 1105|    186|          delete next;
 1106|    186|          next = NULL;
 1107|    186|        }
 1108|  6.29k|        if (d != NULL && d != d_store) {
  ------------------
  |  Branch (1108:13): [True: 6.29k, False: 0]
  |  Branch (1108:26): [True: 86, False: 6.20k]
  ------------------
 1109|     86|          delete[] d;
 1110|     86|          d = d_store;
 1111|     86|          max_steps = sizeof(d_store) / sizeof(lifting_step);
 1112|     86|        }
 1113|  6.29k|      }
_ZN4ojph5local9param_atk7restartEv:
 1117|  6.10k|      {
 1118|  6.10k|        assert(top_atk == NULL);
 1119|       |
 1120|  6.10k|        Latk = Satk = 0;
 1121|  6.10k|        Katk = 0.0f;
 1122|  6.10k|        Natk = 0;
 1123|  6.10k|        if (d == NULL || d == d_store) {
  ------------------
  |  Branch (1123:13): [True: 0, False: 6.10k]
  |  Branch (1123:26): [True: 6.10k, False: 0]
  ------------------
 1124|  6.10k|          d = d_store;
 1125|  6.10k|          max_steps = sizeof(d_store) / sizeof(lifting_step);
 1126|  6.10k|        }
 1127|  6.10k|        memset(d, 0, max_steps * sizeof(lifting_step));
 1128|       |
 1129|  6.10k|        param_atk** p = &avail; // move next to the end of avail
 1130|  6.10k|        while (*p != NULL)
  ------------------
  |  Branch (1130:16): [True: 0, False: 6.10k]
  ------------------
 1131|      0|          p = &((*p)->next);
 1132|  6.10k|        *p = next;
 1133|       |
 1134|       |        next = NULL;
 1135|  6.10k|      }
_ZNK4ojph5local9param_atk9get_indexEv:
 1139|    601|      ui8 get_index() const { return (ui8)(Satk & 0xFF); }
_ZNK4ojph5local9param_atk14get_coeff_typeEv:
 1140|  1.73k|      int get_coeff_type() const { return (Satk >> 8) & 0x7; }
_ZNK4ojph5local9param_atk15is_whole_sampleEv:
 1141|    223|      bool is_whole_sample() const { return (Satk & 0x800) != 0; }
_ZNK4ojph5local9param_atk13is_reversibleEv:
 1142|  1.53M|      bool is_reversible() const { return (Satk & 0x1000) != 0; }
_ZNK4ojph5local9param_atk10is_m_init0Ev:
 1143|    227|      bool is_m_init0() const { return (Satk & 0x2000) == 0; }
_ZNK4ojph5local9param_atk21is_using_ws_extensionEv:
 1144|    218|      bool is_using_ws_extension() const { return (Satk & 0x4000) != 0; }
_ZNK4ojph5local9param_atk8get_stepEj:
 1147|  6.71M|      { assert(s < Natk); return d + s; }
_ZNK4ojph5local9param_atk13get_num_stepsEv:
 1148|  1.83M|      ui32 get_num_steps() const { return Natk; }
_ZNK4ojph5local9param_atk5get_KEv:
 1149|   375k|      float get_K() const { return Katk; }
_ZN4ojph5local9param_atk4initEPS1_:
 1154|  6.48k|      {
 1155|  6.48k|        Latk = Satk = 0;
 1156|  6.48k|        Katk = 0.0f;
 1157|  6.48k|        Natk = 0;
 1158|  6.48k|        if (d == NULL || d == d_store) {
  ------------------
  |  Branch (1158:13): [True: 0, False: 6.48k]
  |  Branch (1158:26): [True: 6.48k, False: 0]
  ------------------
 1159|  6.48k|          d = d_store;
 1160|  6.48k|          max_steps = sizeof(d_store) / sizeof(lifting_step);
 1161|  6.48k|        }
 1162|  6.48k|        memset(d, 0, max_steps * sizeof(lifting_step));
 1163|  6.48k|        next = NULL;
 1164|  6.48k|        this->top_atk = top_atk;
 1165|       |        avail = NULL;
 1166|  6.48k|      }

_ZN4ojph5local8precinct5parseEiPjPNS_21mem_elastic_allocatorERjPNS_11infile_baseEb:
  332|   466k|    {
  333|   466k|      assert(data_left > 0);
  334|   466k|      bit_read_buf bb;
  335|   466k|      bb_init(&bb, data_left, file);
  336|   466k|      if (may_use_sop)
  ------------------
  |  Branch (336:11): [True: 39.5k, False: 426k]
  ------------------
  337|  39.5k|        bb_skip_sop(&bb);
  338|       |
  339|   466k|      bool empty_packet = true;
  340|  1.28M|      for (int s = 0; s < 4; ++s)
  ------------------
  |  Branch (340:23): [True: 1.17M, False: 108k]
  ------------------
  341|  1.17M|      {
  342|  1.17M|        if (bands[s].empty)
  ------------------
  |  Branch (342:13): [True: 504k, False: 672k]
  ------------------
  343|   504k|          continue;
  344|       |
  345|   672k|        if (cb_idxs[s].siz.w == 0 || cb_idxs[s].siz.h == 0)
  ------------------
  |  Branch (345:13): [True: 5.19k, False: 667k]
  |  Branch (345:38): [True: 40.7k, False: 627k]
  ------------------
  346|  45.9k|          continue;
  347|       |
  348|   627k|        if (empty_packet) //one bit to check if the packet is empty
  ------------------
  |  Branch (348:13): [True: 463k, False: 163k]
  ------------------
  349|   463k|        {
  350|   463k|          ui32 bit;
  351|   463k|          bb_read_bit(&bb, bit);
  352|   463k|          if (bit == 0) //empty packet
  ------------------
  |  Branch (352:15): [True: 332k, False: 130k]
  ------------------
  353|   332k|          { bb_terminate(&bb, uses_eph); data_left = bb.bytes_left; return; }
  354|   130k|          empty_packet = false;
  355|   130k|        }
  356|       |
  357|   294k|        ui32 num_levels = 1 +
  358|   294k|          ojph_max(log2ceil(cb_idxs[s].siz.w), log2ceil(cb_idxs[s].siz.h));
  ------------------
  |  |   73|   294k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 4.03k, False: 290k]
  |  |  ------------------
  ------------------
  359|       |
  360|       |        //create quad trees for inclusion and missing msbs
  361|   294k|        tag_tree inc_tag, inc_tag_flags, mmsb_tag, mmsb_tag_flags;
  362|   294k|        inc_tag.init(scratch, lev_idx, num_levels, cb_idxs[s].siz, 0);
  363|   294k|        *inc_tag.get(0, 0, num_levels) = 0;
  364|   294k|        inc_tag_flags.init(scratch + tag_tree_size, lev_idx, num_levels,
  365|   294k|          cb_idxs[s].siz, 0);
  366|   294k|        *inc_tag_flags.get(0, 0, num_levels) = 0;
  367|   294k|        mmsb_tag.init(scratch + (tag_tree_size<<1), lev_idx, num_levels,
  368|   294k|          cb_idxs[s].siz, 0);
  369|   294k|        *mmsb_tag.get(0, 0, num_levels) = 0;
  370|   294k|        mmsb_tag_flags.init(scratch + (tag_tree_size<<1) + tag_tree_size,
  371|   294k|          lev_idx, num_levels, cb_idxs[s].siz, 0);
  372|   294k|        *mmsb_tag_flags.get(0, 0, num_levels) = 0;
  373|       |
  374|       |        //
  375|   294k|        ui32 band_width = bands[s].num_blocks.w;
  376|   294k|        ui32 width = cb_idxs[s].siz.w;
  377|   294k|        ui32 height = cb_idxs[s].siz.h;
  378|   559k|        for (ui32 y = 0; y < height; ++y)
  ------------------
  |  Branch (378:26): [True: 290k, False: 269k]
  ------------------
  379|   290k|        {
  380|   290k|          coded_cb_header *cp = bands[s].coded_cbs;
  381|   290k|          cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
  382|   575k|          for (ui32 x = 0; x < width; ++x, ++cp)
  ------------------
  |  Branch (382:28): [True: 309k, False: 265k]
  ------------------
  383|   309k|          {
  384|       |            //process inclusion
  385|   309k|            bool empty_cb = false;
  386|   482k|            for (ui32 cl = num_levels; cl > 0; --cl)
  ------------------
  |  Branch (386:40): [True: 339k, False: 142k]
  ------------------
  387|   339k|            {
  388|   339k|              ui32 cur_lev = cl - 1;
  389|   339k|              empty_cb = *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) == 1;
  390|   339k|              if (empty_cb)
  ------------------
  |  Branch (390:19): [True: 20.3k, False: 319k]
  ------------------
  391|  20.3k|                break;
  392|       |              //check received
  393|   319k|              if (*inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
  ------------------
  |  Branch (393:19): [True: 296k, False: 22.5k]
  ------------------
  394|   296k|              {
  395|   296k|                ui32 bit;
  396|   296k|                if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (396:21): [True: 111, False: 296k]
  ------------------
  397|    111|                { data_left = 0; throw "error reading from file p1"; }
  398|   296k|                empty_cb = (bit == 0);
  399|   296k|                *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)(1 - bit);
  400|   296k|                *inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
  401|   296k|              }
  402|   319k|              if (empty_cb)
  ------------------
  |  Branch (402:19): [True: 146k, False: 172k]
  ------------------
  403|   146k|                break;
  404|   319k|            }
  405|       |
  406|   309k|            if (empty_cb)
  ------------------
  |  Branch (406:17): [True: 167k, False: 142k]
  ------------------
  407|   167k|              continue;
  408|       |
  409|       |            //process missing msbs
  410|   142k|            ui32 mmsbs = 0;
  411|   292k|            for (ui32 levp1 = num_levels; levp1 > 0; --levp1)
  ------------------
  |  Branch (411:43): [True: 150k, False: 142k]
  ------------------
  412|   150k|            {
  413|   150k|              ui32 cur_lev = levp1 - 1;
  414|   150k|              mmsbs = *mmsb_tag.get(x>>levp1, y>>levp1, levp1);
  415|       |              //check received
  416|   150k|              if (*mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
  ------------------
  |  Branch (416:19): [True: 147k, False: 2.16k]
  ------------------
  417|   147k|              {
  418|   147k|                ui32 bit = 0;
  419|   430k|                while (bit == 0)
  ------------------
  |  Branch (419:24): [True: 282k, False: 147k]
  ------------------
  420|   282k|                {
  421|   282k|                  if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (421:23): [True: 237, False: 282k]
  ------------------
  422|    237|                  { data_left = 0; throw "error reading from file p2"; }
  423|   282k|                  mmsbs += 1 - bit;
  424|   282k|                }
  425|   147k|                *mmsb_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)mmsbs;
  426|   147k|                *mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
  427|   147k|              }
  428|   150k|            }
  429|       |
  430|   142k|            if (mmsbs > cp->Kmax)
  ------------------
  |  Branch (430:17): [True: 3.79k, False: 138k]
  ------------------
  431|  3.79k|              throw "error in parsing a tile header; "
  432|  3.79k|              "missing msbs are larger or equal to Kmax. The most likely "
  433|  3.79k|              "cause is a corruption in the bitstream.";
  434|   138k|            cp->missing_msbs = mmsbs;
  435|       |
  436|       |            //get number of passes
  437|   138k|            ui32 bit, num_passes = 1;
  438|   138k|            if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (438:17): [True: 502, False: 138k]
  ------------------
  439|    502|            { data_left = 0; throw "error reading from file p3"; }
  440|   138k|            if (bit)
  ------------------
  |  Branch (440:17): [True: 113k, False: 24.5k]
  ------------------
  441|   113k|            {
  442|   113k|              num_passes = 2;
  443|   113k|              if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (443:19): [True: 270, False: 113k]
  ------------------
  444|    270|              { data_left = 0; throw "error reading from file p4"; }
  445|   113k|              if (bit)
  ------------------
  |  Branch (445:19): [True: 87.8k, False: 25.3k]
  ------------------
  446|  87.8k|              {
  447|  87.8k|                if (bb_read_bits(&bb, 2, bit) == false)
  ------------------
  |  Branch (447:21): [True: 234, False: 87.6k]
  ------------------
  448|    234|                { data_left = 0; throw "error reading from file p5";  }
  449|  87.6k|                num_passes = 3 + bit;
  450|  87.6k|                if (bit == 3)
  ------------------
  |  Branch (450:21): [True: 72.6k, False: 14.9k]
  ------------------
  451|  72.6k|                {
  452|  72.6k|                  if (bb_read_bits(&bb, 5, bit) == false)
  ------------------
  |  Branch (452:23): [True: 399, False: 72.2k]
  ------------------
  453|    399|                  { data_left = 0; throw "error reading from file p6"; }
  454|  72.2k|                  num_passes = 6 + bit;
  455|  72.2k|                  if (bit == 31)
  ------------------
  |  Branch (455:23): [True: 13.4k, False: 58.8k]
  ------------------
  456|  13.4k|                  {
  457|  13.4k|                    if (bb_read_bits(&bb, 7, bit) == false)
  ------------------
  |  Branch (457:25): [True: 37, False: 13.3k]
  ------------------
  458|     37|                    { data_left = 0; throw "error reading from file p7"; }
  459|  13.3k|                    num_passes = 37 + bit;
  460|  13.3k|                  }
  461|  72.2k|                }
  462|  87.6k|              }
  463|   113k|            }
  464|   137k|            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|   137k|            ui32 num_phld_passes = (num_passes - 1) / 3;
  476|   137k|            cp->missing_msbs += num_phld_passes;
  477|       |
  478|   137k|            num_phld_passes *= 3;
  479|   137k|            cp->num_passes = num_passes - num_phld_passes;
  480|   137k|            cp->pass_length[0] = cp->pass_length[1] = 0;
  481|       |
  482|   137k|            int Lblock = 3;
  483|   137k|            bit = 1;
  484|  2.14M|            while (bit)
  ------------------
  |  Branch (484:20): [True: 2.00M, False: 136k]
  ------------------
  485|  2.00M|            {
  486|       |              // add any extra bits here
  487|  2.00M|              if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (487:19): [True: 306, False: 2.00M]
  ------------------
  488|    306|              { data_left = 0; throw "error reading from file p8"; }
  489|  2.00M|              Lblock += bit;
  490|  2.00M|            }
  491|       |
  492|   136k|            int bits = Lblock + 31 -
  493|   136k|              (int)count_leading_zeros(num_phld_passes + 1);
  494|   136k|            if (bb_read_bits(&bb, bits, bit) == false)
  ------------------
  |  Branch (494:17): [True: 252, False: 136k]
  ------------------
  495|    252|            { data_left = 0; throw "error reading from file p9"; }
  496|   136k|            if (bit < 2)
  ------------------
  |  Branch (496:17): [True: 13.2k, False: 123k]
  ------------------
  497|  13.2k|              throw "The cleanup segment of an HT codeblock cannot contain "
  498|  13.2k|                "less than 2 bytes";
  499|   123k|            if (bit >= 65535)
  ------------------
  |  Branch (499:17): [True: 4.83k, False: 118k]
  ------------------
  500|  4.83k|              throw "The cleanup segment of an HT codeblock must contain "
  501|  4.83k|                "less than 65535 bytes";
  502|   118k|            cp->pass_length[0] = bit;
  503|       |
  504|   118k|            if (cp->num_passes > 1)
  ------------------
  |  Branch (504:17): [True: 85.8k, False: 32.6k]
  ------------------
  505|  85.8k|            {
  506|       |              //bits = Lblock + 31 - count_leading_zeros(cp->num_passes - 1);
  507|       |              // The following is simpler than the above, I think?
  508|  85.8k|              bits = Lblock + (cp->num_passes > 2 ? 1 : 0);
  ------------------
  |  Branch (508:32): [True: 45.7k, False: 40.1k]
  ------------------
  509|  85.8k|              if (bb_read_bits(&bb, bits, bit) == false)
  ------------------
  |  Branch (509:19): [True: 238, False: 85.6k]
  ------------------
  510|    238|              { data_left = 0; throw "error reading from file p10"; }
  511|  85.6k|              if (bit >= 2047)
  ------------------
  |  Branch (511:19): [True: 564, False: 85.0k]
  ------------------
  512|    564|                throw "The refinement segment (SigProp and MagRep passes) of "
  513|    564|                  "an HT codeblock must contain less than 2047 bytes";
  514|  85.0k|              cp->pass_length[1] = bit;
  515|  85.0k|            }
  516|   118k|          }
  517|   290k|        }
  518|   294k|      }
  519|   108k|      if (empty_packet)
  ------------------
  |  Branch (519:11): [True: 833, False: 107k]
  ------------------
  520|    833|      { // all subbands are empty
  521|    833|        ui32 bit = 0;
  522|    833|        bb_read_bit(&bb, bit);
  523|       |        //assert(bit == 0);
  524|    833|      }
  525|   108k|      bb_terminate(&bb, uses_eph);
  526|       |      //read codeblock data
  527|   476k|      for (int s = 0; s < 4; ++s)
  ------------------
  |  Branch (527:23): [True: 368k, False: 108k]
  ------------------
  528|   368k|      {
  529|   368k|        if (bands[s].empty)
  ------------------
  |  Branch (529:13): [True: 114k, False: 254k]
  ------------------
  530|   114k|          continue;
  531|       |
  532|   254k|        ui32 band_width = bands[s].num_blocks.w;
  533|   254k|        ui32 width = cb_idxs[s].siz.w;
  534|   254k|        ui32 height = cb_idxs[s].siz.h;
  535|   502k|        for (ui32 y = 0; y < height; ++y)
  ------------------
  |  Branch (535:26): [True: 247k, False: 254k]
  ------------------
  536|   247k|        {
  537|   247k|          coded_cb_header *cp = bands[s].coded_cbs;
  538|   247k|          cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
  539|   507k|          for (ui32 x = 0; x < width; ++x, ++cp)
  ------------------
  |  Branch (539:28): [True: 259k, False: 247k]
  ------------------
  540|   259k|          {
  541|   259k|            ui32 num_bytes = cp->pass_length[0] + cp->pass_length[1];
  542|   259k|            if (data_left)
  ------------------
  |  Branch (542:17): [True: 245k, False: 13.5k]
  ------------------
  543|   245k|            {
  544|   245k|              if (num_bytes)
  ------------------
  |  Branch (544:19): [True: 102k, False: 143k]
  ------------------
  545|   102k|              {
  546|   102k|                if (skipped)
  ------------------
  |  Branch (546:21): [True: 9.18k, False: 93.5k]
  ------------------
  547|  9.18k|                { //no need to read
  548|  9.18k|                  si64 cur_loc = file->tell();
  549|  9.18k|                  ui32 t = ojph_min(num_bytes, bb.bytes_left);
  ------------------
  |  |   76|  9.18k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 8.65k, False: 531]
  |  |  ------------------
  ------------------
  550|  9.18k|                  file->seek(t, infile_base::OJPH_SEEK_CUR);
  551|  9.18k|                  ui32 bytes_read = (ui32)(file->tell() - cur_loc);
  552|  9.18k|                  cp->pass_length[0] = cp->pass_length[1] = 0;
  553|  9.18k|                  bb.bytes_left -= bytes_read;
  554|  9.18k|                  assert(bytes_read == t || bb.bytes_left == 0);
  555|  9.18k|                }
  556|  93.5k|                else
  557|  93.5k|                {
  558|  93.5k|                  if (!bb_read_chunk(&bb, num_bytes, cp->next_coded, elastic))
  ------------------
  |  Branch (558:23): [True: 9.51k, False: 84.0k]
  ------------------
  559|  9.51k|                  {
  560|       |                    //no need to decode a broken codeblock
  561|  9.51k|                    cp->pass_length[0] = cp->pass_length[1] = 0;
  562|  9.51k|                    data_left = 0;
  563|  9.51k|                  }
  564|  93.5k|                }
  565|   102k|              }
  566|   245k|            }
  567|  13.5k|            else
  568|  13.5k|              cp->pass_length[0] = cp->pass_length[1] = 0;
  569|   259k|          }
  570|   247k|        }
  571|   254k|      }
  572|   108k|      data_left = bb.bytes_left;
  573|   108k|    }
ojph_precinct.cpp:_ZN4ojph5localL8log2ceilEj:
   88|   853k|    {
   89|   853k|      ui32 t = 31 - count_leading_zeros(x);
   90|   853k|      return t + (x & (x - 1) ? 1 : 0);
  ------------------
  |  Branch (90:19): [True: 1.88k, False: 851k]
  ------------------
   91|   853k|    }
_ZN4ojph5local8tag_tree4initEPhPjjNS_4sizeEi:
   61|  1.13M|      {
   62|  3.46M|        for (ui32 i = 0; i <= num_levels; ++i) //on extra level
  ------------------
  |  Branch (62:26): [True: 2.32M, False: 1.13M]
  ------------------
   63|  2.32M|          levs[i] = buf + lev_idx[i];
   64|  17.0M|        for (ui32 i = num_levels + 1; i < 16; ++i)
  ------------------
  |  Branch (64:39): [True: 15.8M, False: 1.13M]
  ------------------
   65|  15.8M|          levs[i] = (ui8*)INT_MAX; //make it crash on error
   66|  1.13M|        width = s.w;
   67|  1.13M|        height = s.h;
   68|  2.32M|        for (ui32 i = 0; i < num_levels; ++i)
  ------------------
  |  Branch (68:26): [True: 1.18M, False: 1.13M]
  ------------------
   69|  1.18M|        {
   70|  1.18M|          ui32 size = 1u << ((num_levels - 1 - i) << 1);
   71|  1.18M|          memset(levs[i], init_val, size);
   72|  1.18M|        }
   73|  1.13M|        *levs[num_levels] = 0;
   74|  1.13M|        this->num_levels = num_levels;
   75|  1.13M|      }
_ZN4ojph5local8tag_tree3getEjjj:
   78|  2.98M|      {
   79|  2.98M|        return levs[lev] + (x + y * ((width + (1 << lev) - 1) >> lev));
   80|  2.98M|      }

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

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

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

_ZN4ojph5local7subband9pre_allocEPNS0_10codestreamERKNS_4rectEjjj:
   59|   860k|    {
   60|   860k|      mem_fixed_allocator* allocator = codestream->get_allocator();
   61|       |
   62|   860k|      bool empty = ((band_rect.siz.w == 0) || (band_rect.siz.h == 0));
  ------------------
  |  Branch (62:21): [True: 387k, False: 473k]
  |  Branch (62:47): [True: 295k, False: 177k]
  ------------------
   63|   860k|      if (empty)
  ------------------
  |  Branch (63:11): [True: 682k, False: 177k]
  ------------------
   64|   682k|        return;
   65|       |
   66|   177k|      const param_cod* cdp = codestream->get_coc(comp_num);
   67|   177k|      size log_cb = cdp->get_log_block_dims();
   68|   177k|      size log_PP = cdp->get_log_precinct_size(res_num);
   69|       |
   70|   177k|      ui32 x_off = ((transform_flags & resolution::HORZ_TRX) ? 1 : 0);
  ------------------
  |  Branch (70:21): [True: 168k, False: 9.43k]
  ------------------
   71|   177k|      ui32 y_off = ((transform_flags & resolution::VERT_TRX) ? 1 : 0);
  ------------------
  |  Branch (71:21): [True: 168k, False: 9.85k]
  ------------------
   72|       |
   73|   177k|      ui32 xcb_prime = ojph_min(log_cb.w, log_PP.w - x_off);
  ------------------
  |  |   76|   177k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 32.1k, False: 145k]
  |  |  ------------------
  ------------------
   74|   177k|      ui32 ycb_prime = ojph_min(log_cb.h, log_PP.h - y_off);
  ------------------
  |  |   76|   177k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 21.8k, False: 156k]
  |  |  ------------------
  ------------------
   75|       |
   76|   177k|      size nominal(1 << xcb_prime, 1 << ycb_prime);
   77|       |
   78|   177k|      ui32 tbx0 = band_rect.org.x;
   79|   177k|      ui32 tby0 = band_rect.org.y;
   80|   177k|      ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
   81|   177k|      ui32 tby1 = band_rect.org.y + band_rect.siz.h;
   82|       |
   83|   177k|      size num_blocks;
   84|   177k|      num_blocks.w = (tbx1 + (1 << xcb_prime) - 1) >> xcb_prime;
   85|   177k|      num_blocks.w -= tbx0 >> xcb_prime;
   86|   177k|      num_blocks.h = (tby1 + (1 << ycb_prime) - 1) >> ycb_prime;
   87|   177k|      num_blocks.h -= tby0 >> ycb_prime;
   88|       |
   89|   177k|      allocator->pre_alloc_obj<codeblock>(num_blocks.w);
   90|       |      //allocate codeblock headers
   91|   177k|      allocator->pre_alloc_obj<coded_cb_header>((size_t)num_blocks.area());
   92|       |
   93|   177k|      const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
   94|   177k|      ui32 precision = qp->propose_precision(cdp);
   95|   177k|      const param_atk* atk = cdp->access_atk();
   96|   177k|      bool reversible = atk->is_reversible();
   97|       |
   98|  2.50M|      for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (98:24): [True: 2.32M, False: 177k]
  ------------------
   99|  2.32M|        codeblock::pre_alloc(codestream, nominal, precision);
  100|       |
  101|       |      //allocate lines
  102|   177k|      allocator->pre_alloc_obj<line_buf>(1);
  103|       |      //allocate line_buf
  104|   177k|      ui32 width = band_rect.siz.w + 1;
  105|   177k|      if (reversible)
  ------------------
  |  Branch (105:11): [True: 159k, False: 18.7k]
  ------------------
  106|   159k|      {
  107|   159k|        if (precision <= 32)
  ------------------
  |  Branch (107:13): [True: 43.6k, False: 115k]
  ------------------
  108|  43.6k|          allocator->pre_alloc_data<si32>(width, 1);
  109|   115k|        else
  110|   115k|          allocator->pre_alloc_data<si64>(width, 1);
  111|   159k|      }
  112|  18.7k|      else
  113|  18.7k|        allocator->pre_alloc_data<float>(width, 1);
  114|   177k|    }
_ZN4ojph5local7subband14finalize_allocEPNS0_10codestreamERKNS_4rectEPNS0_10resolutionEjj:
  121|   780k|    {
  122|   780k|      mem_fixed_allocator* allocator = codestream->get_allocator();
  123|   780k|      elastic = codestream->get_elastic_alloc();
  124|       |
  125|   780k|      this->res_num = res_num;
  126|   780k|      this->band_num = subband_num;
  127|   780k|      this->band_rect = band_rect;
  128|   780k|      this->parent = res;
  129|       |
  130|   780k|      ui32 comp_num = parent->get_comp_num();
  131|   780k|      const param_cod* cdp = codestream->get_coc(comp_num);
  132|   780k|      this->reversible = cdp->access_atk()->is_reversible();
  133|   780k|      size log_cb = cdp->get_log_block_dims();
  134|   780k|      log_PP = cdp->get_log_precinct_size(res_num);
  135|       |
  136|   780k|      ui32 x_off = ((parent->has_horz_transform()) ? 1 : 0);
  ------------------
  |  Branch (136:21): [True: 727k, False: 53.3k]
  ------------------
  137|   780k|      ui32 y_off = ((parent->has_vert_transform()) ? 1 : 0);
  ------------------
  |  Branch (137:21): [True: 727k, False: 52.7k]
  ------------------
  138|       |
  139|   780k|      xcb_prime = ojph_min(log_cb.w, log_PP.w - x_off);
  ------------------
  |  |   76|   780k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 104k, False: 676k]
  |  |  ------------------
  ------------------
  140|   780k|      ycb_prime = ojph_min(log_cb.h, log_PP.h - y_off);
  ------------------
  |  |   76|   780k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 164k, False: 616k]
  |  |  ------------------
  ------------------
  141|       |
  142|   780k|      size nominal(1 << xcb_prime, 1 << ycb_prime);
  143|       |
  144|   780k|      cur_cb_row = 0;
  145|   780k|      cur_line = 0;
  146|   780k|      cur_cb_height = 0;
  147|   780k|      const param_dfs* dfs = NULL;
  148|   780k|      if (cdp->is_dfs_defined()) {
  ------------------
  |  Branch (148:11): [True: 6.60k, False: 773k]
  ------------------
  149|  6.60k|        dfs = codestream->access_dfs();
  150|  6.60k|        if (dfs != NULL)
  ------------------
  |  Branch (150:13): [True: 6.60k, False: 0]
  ------------------
  151|  6.60k|          dfs = dfs->get_dfs(cdp->get_dfs_index());
  152|  6.60k|      }
  153|   780k|      const param_qcd* qcd = codestream->access_qcd()->get_qcc(comp_num);
  154|   780k|      ui32 num_decomps = cdp->get_num_decompositions();
  155|   780k|      this->K_max = qcd->get_Kmax(dfs, num_decomps, this->res_num, band_num);
  156|   780k|      if (!reversible)
  ------------------
  |  Branch (156:11): [True: 89.4k, False: 691k]
  ------------------
  157|  89.4k|      {
  158|  89.4k|        float d =
  159|  89.4k|          qcd->get_irrev_delta(dfs, num_decomps,
  160|  89.4k|            comp_num, res_num, subband_num);
  161|  89.4k|        d /= (float)(1u << (31 - this->K_max));
  162|  89.4k|        delta = d;
  163|  89.4k|        delta_inv = (1.0f/d);
  164|  89.4k|      }
  165|   780k|      ui32 precision = qcd->propose_precision(cdp);
  166|       |
  167|   780k|      this->empty = ((band_rect.siz.w == 0) || (band_rect.siz.h == 0));
  ------------------
  |  Branch (167:22): [True: 331k, False: 449k]
  |  Branch (167:48): [True: 276k, False: 172k]
  ------------------
  168|   780k|      if (this->empty)
  ------------------
  |  Branch (168:11): [True: 607k, False: 172k]
  ------------------
  169|   607k|        return;
  170|       |
  171|   172k|      ui32 tbx0 = band_rect.org.x;
  172|   172k|      ui32 tby0 = band_rect.org.y;
  173|   172k|      ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
  174|   172k|      ui32 tby1 = band_rect.org.y + band_rect.siz.h;
  175|       |
  176|   172k|      num_blocks = size();
  177|   172k|      num_blocks.w = (tbx1 + (1 << xcb_prime) - 1) >> xcb_prime;
  178|   172k|      num_blocks.w -= tbx0 >> xcb_prime;
  179|   172k|      num_blocks.h = (tby1 + (1 << ycb_prime) - 1) >> ycb_prime;
  180|   172k|      num_blocks.h -= tby0 >> ycb_prime;
  181|       |
  182|   172k|      blocks = allocator->post_alloc_obj<codeblock>(num_blocks.w);
  183|       |      //allocate codeblock headers
  184|   172k|      coded_cb_header *cp = coded_cbs =
  185|   172k|        allocator->post_alloc_obj<coded_cb_header>((size_t)num_blocks.area());
  186|   172k|      memset(coded_cbs, 0, sizeof(coded_cb_header) * (size_t)num_blocks.area());
  187|  18.5M|      for (int i = (int)num_blocks.area(); i > 0; --i, ++cp)
  ------------------
  |  Branch (187:44): [True: 18.3M, False: 172k]
  ------------------
  188|  18.3M|        cp->Kmax = K_max;
  189|       |
  190|   172k|      ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
  191|   172k|      ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
  192|       |
  193|   172k|      size cb_size;
  194|   172k|      cb_size.h = ojph_min(tby1, y_lower_bound + nominal.h) - tby0;
  ------------------
  |  |   76|   172k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 87.8k, False: 84.7k]
  |  |  ------------------
  ------------------
  195|   172k|      cur_cb_height = (si32)cb_size.h;
  196|   172k|      int line_offset = 0;
  197|  2.46M|      for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (197:24): [True: 2.28M, False: 172k]
  ------------------
  198|  2.28M|      {
  199|  2.28M|        ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
  ------------------
  |  |   73|  2.28M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 28.3k, False: 2.26M]
  |  |  ------------------
  ------------------
  200|  2.28M|        ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
  ------------------
  |  |   76|  2.28M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 104k, False: 2.18M]
  |  |  ------------------
  ------------------
  201|  2.28M|        cb_size.w = cbx1 - cbx0;
  202|  2.28M|        blocks[i].finalize_alloc(codestream, this, nominal, cb_size,
  203|  2.28M|                                 coded_cbs + i, K_max, line_offset,
  204|  2.28M|                                 precision, comp_num);
  205|  2.28M|        line_offset += cb_size.w;
  206|  2.28M|      }
  207|       |
  208|       |      //allocate lines
  209|   172k|      lines = allocator->post_alloc_obj<line_buf>(1);
  210|       |      //allocate line_buf
  211|   172k|      ui32 width = band_rect.siz.w + 1;
  212|   172k|      if (reversible)
  ------------------
  |  Branch (212:11): [True: 158k, False: 14.2k]
  ------------------
  213|   158k|      {
  214|   158k|        if (precision <= 32)
  ------------------
  |  Branch (214:13): [True: 42.8k, False: 115k]
  ------------------
  215|  42.8k|          lines->wrap(allocator->post_alloc_data<si32>(width, 1), width, 1);
  216|   115k|        else
  217|   115k|          lines->wrap(allocator->post_alloc_data<si64>(width, 1), width, 1);
  218|   158k|      }
  219|  14.2k|      else
  220|  14.2k|        lines->wrap(allocator->post_alloc_data<float>(width, 1), width, 1);
  221|   172k|    }
_ZN4ojph5local7subband14get_cb_indicesERKNS_4sizeEPNS0_8precinctE:
  226|   172k|    {
  227|   172k|      if (empty)
  ------------------
  |  Branch (227:11): [True: 0, False: 172k]
  ------------------
  228|      0|        return;
  229|       |
  230|   172k|      rect res_rect = parent->get_rect();
  231|   172k|      ui32 trx0 = res_rect.org.x;
  232|   172k|      ui32 try0 = res_rect.org.y;
  233|   172k|      ui32 trx1 = res_rect.org.x + res_rect.siz.w;
  234|   172k|      ui32 try1 = res_rect.org.y + res_rect.siz.h;
  235|       |
  236|   172k|      ui32 pc_lft = (res_rect.org.x >> log_PP.w) << log_PP.w;
  237|   172k|      ui32 pc_top = (res_rect.org.y >> log_PP.h) << log_PP.h;
  238|       |
  239|   172k|      ui32 pcx0, pcx1, pcy0, pcy1;
  240|   172k|      ui32 x_shift = parent->has_horz_transform() ? 1 : 0;
  ------------------
  |  Branch (240:22): [True: 163k, False: 9.10k]
  ------------------
  241|   172k|      ui32 y_shift = parent->has_vert_transform() ? 1 : 0;
  ------------------
  |  Branch (241:22): [True: 162k, False: 9.53k]
  ------------------
  242|   172k|      ui32 yb, xb, coly = 0, colx = 0;
  243|  1.54M|      for (ui32 y = 0; y < num_precincts.h; ++y)
  ------------------
  |  Branch (243:24): [True: 1.37M, False: 172k]
  ------------------
  244|  1.37M|      {
  245|  1.37M|        pcy0 = ojph_max(try0, pc_top + (y << log_PP.h));
  ------------------
  |  |   73|  1.37M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 114k, False: 1.25M]
  |  |  ------------------
  ------------------
  246|  1.37M|        pcy1 = ojph_min(try1, pc_top + ((y + 1) << log_PP.h));
  ------------------
  |  |   76|  1.37M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 146k, False: 1.22M]
  |  |  ------------------
  ------------------
  247|  1.37M|        pcy0 = (pcy0 - (band_num >> 1) + (1 << y_shift) - 1) >> y_shift;
  248|  1.37M|        pcy1 = (pcy1 - (band_num >> 1) + (1 << y_shift) - 1) >> y_shift;
  249|       |
  250|  1.37M|        precinct *p = precincts + y * num_precincts.w;
  251|  1.37M|        yb = ((pcy1 + (1<<ycb_prime) - 1) >> ycb_prime);
  252|  1.37M|        yb -= (pcy0 >> ycb_prime);
  253|  1.37M|        colx = 0;
  254|       |
  255|  19.9M|        for (ui32 x = 0; x < num_precincts.w; ++x, ++p)
  ------------------
  |  Branch (255:26): [True: 18.6M, False: 1.37M]
  ------------------
  256|  18.6M|        {
  257|  18.6M|          pcx0 = ojph_max(trx0, pc_lft + (x << log_PP.w));
  ------------------
  |  |   73|  18.6M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 285k, False: 18.3M]
  |  |  ------------------
  ------------------
  258|  18.6M|          pcx1 = ojph_min(trx1, pc_lft + ((x + 1) << log_PP.w));
  ------------------
  |  |   76|  18.6M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 1.20M, False: 17.4M]
  |  |  ------------------
  ------------------
  259|  18.6M|          pcx0 = (pcx0 - (band_num & 1) + (1 << x_shift) - 1) >> x_shift;
  260|  18.6M|          pcx1 = (pcx1 - (band_num & 1) + (1 << x_shift) - 1) >> x_shift;
  261|       |
  262|  18.6M|          rect *bp = p->cb_idxs + band_num;
  263|  18.6M|          xb = ((pcx1 + (1<<xcb_prime) - 1) >> xcb_prime);
  264|  18.6M|          xb -= (pcx0 >> xcb_prime);
  265|       |
  266|  18.6M|          bp->org.x = colx;
  267|  18.6M|          bp->org.y = coly;
  268|  18.6M|          bp->siz.w = xb;
  269|  18.6M|          bp->siz.h = yb;
  270|       |
  271|  18.6M|          colx += xb;
  272|  18.6M|        }
  273|  1.37M|        coly += yb;
  274|  1.37M|      }
  275|       |      assert(colx == num_blocks.w && coly == num_blocks.h);
  276|   172k|    }
_ZN4ojph5local7subband9pull_lineEv:
  337|  5.87M|    {
  338|  5.87M|      if (empty)
  ------------------
  |  Branch (338:11): [True: 2.59M, False: 3.27M]
  ------------------
  339|  2.59M|        return lines;
  340|       |
  341|       |      //pull from codeblocks
  342|  3.27M|      if (--cur_line <= 0)
  ------------------
  |  Branch (342:11): [True: 1.09M, False: 2.18M]
  ------------------
  343|  1.09M|      {
  344|  1.09M|        if (cur_cb_row < num_blocks.h)
  ------------------
  |  Branch (344:13): [True: 1.08M, False: 1.26k]
  ------------------
  345|  1.08M|        {
  346|  1.08M|          ui32 tbx0 = band_rect.org.x;
  347|  1.08M|          ui32 tby0 = band_rect.org.y;
  348|  1.08M|          ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
  349|  1.08M|          ui32 tby1 = band_rect.org.y + band_rect.siz.h;
  350|  1.08M|          size nominal(1 << xcb_prime, 1 << ycb_prime);
  351|       |
  352|  1.08M|          ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
  353|  1.08M|          ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
  354|  1.08M|          ui32 cby0 = ojph_max(tby0, y_lower_bound + cur_cb_row * nominal.h);
  ------------------
  |  |   73|  1.08M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 80.6k, False: 1.00M]
  |  |  ------------------
  ------------------
  355|  1.08M|          ui32 cby1 = ojph_min(tby1, y_lower_bound+(cur_cb_row+1)*nominal.h);
  ------------------
  |  |   76|  1.08M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 100k, False: 988k]
  |  |  ------------------
  ------------------
  356|       |
  357|  1.08M|          size cb_size;
  358|  1.08M|          cb_size.h = cby1 - cby0;
  359|  1.08M|          cur_line = cur_cb_height = (int)cb_size.h;
  360|  11.8M|          for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (360:28): [True: 10.7M, False: 1.08M]
  ------------------
  361|  10.7M|          {
  362|  10.7M|            ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
  ------------------
  |  |   73|  10.7M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 148k, False: 10.6M]
  |  |  ------------------
  ------------------
  363|  10.7M|            ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
  ------------------
  |  |   76|  10.7M|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 705k, False: 10.0M]
  |  |  ------------------
  ------------------
  364|  10.7M|            cb_size.w = cbx1 - cbx0;
  365|  10.7M|            blocks[i].recreate(cb_size,
  366|  10.7M|                               coded_cbs + i + cur_cb_row * num_blocks.w);
  367|  10.7M|            blocks[i].decode();
  368|  10.7M|          }
  369|  1.08M|          ++cur_cb_row;
  370|  1.08M|        }
  371|  1.09M|      }
  372|       |
  373|  3.27M|      assert(cur_line >= 0);
  374|       |
  375|       |      //pull from codeblocks
  376|  35.5M|      for (ui32 i = 0; i < num_blocks.w; ++i)
  ------------------
  |  Branch (376:24): [True: 32.2M, False: 3.27M]
  ------------------
  377|  32.2M|        blocks[i].pull_line(lines + 0);
  378|       |
  379|  3.27M|      return lines;
  380|  5.87M|    }

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

_ZN4ojph5local4tile9pre_allocEPNS0_10codestreamERKNS_4rectES6_Rj:
   58|  91.8k|    {
   59|  91.8k|      mem_fixed_allocator* allocator = codestream->get_allocator();
   60|       |
   61|       |      //allocate tiles_comp
   62|  91.8k|      const param_siz *szp = codestream->get_siz();
   63|  91.8k|      ui32 num_comps = szp->get_num_components();
   64|  91.8k|      allocator->pre_alloc_obj<tile_comp>(num_comps);
   65|  91.8k|      allocator->pre_alloc_obj<rect>(num_comps); //for comp_rects
   66|  91.8k|      allocator->pre_alloc_obj<rect>(num_comps); //for recon_comp_rects
   67|  91.8k|      allocator->pre_alloc_obj<ui32>(num_comps); //for line_offsets
   68|  91.8k|      allocator->pre_alloc_obj<ui32>(num_comps); //for num_bits
   69|  91.8k|      allocator->pre_alloc_obj<bool>(num_comps); //for is_signed
   70|  91.8k|      allocator->pre_alloc_obj<bool>(num_comps); //for reversible
   71|  91.8k|      allocator->pre_alloc_obj<ui8>(num_comps);  //for nlt_type3
   72|  91.8k|      allocator->pre_alloc_obj<ui32>(num_comps); //for cur_line
   73|       |
   74|  91.8k|      {
   75|  91.8k|        ui32 tilepart_div = codestream->get_tilepart_div();
   76|  91.8k|        ui32 t = tilepart_div & OJPH_TILEPART_MASK;
   77|  91.8k|        if (t == OJPH_TILEPART_NO_DIVISIONS)
  ------------------
  |  Branch (77:13): [True: 91.8k, False: 0]
  ------------------
   78|  91.8k|          num_tileparts = 1; //for num_rc_bytes
   79|      0|        else if (t == OJPH_TILEPART_COMPONENTS)
  ------------------
  |  Branch (79:18): [True: 0, False: 0]
  ------------------
   80|      0|          num_tileparts = num_comps;
   81|      0|        else if (t == OJPH_TILEPART_RESOLUTIONS)
  ------------------
  |  Branch (81:18): [True: 0, False: 0]
  ------------------
   82|      0|        {
   83|      0|          ui32 max_decs = 0;
   84|      0|          for (ui32 c = 0; c < num_comps; ++c) {
  ------------------
  |  Branch (84:28): [True: 0, False: 0]
  ------------------
   85|      0|            ui32 s = codestream->get_coc(c)->get_num_decompositions();
   86|      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]
  |  |  ------------------
  ------------------
   87|      0|          }
   88|      0|          num_tileparts = 1 + max_decs;
   89|      0|        }
   90|      0|        else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
  ------------------
  |  Branch (90:18): [True: 0, False: 0]
  ------------------
   91|      0|        {
   92|      0|          num_tileparts = 0;
   93|      0|          for (ui32 c = 0; c < num_comps; ++c) {
  ------------------
  |  Branch (93:28): [True: 0, False: 0]
  ------------------
   94|      0|            ui32 s = codestream->get_coc(c)->get_num_decompositions();
   95|      0|            num_tileparts += s + 1;
   96|      0|          }
   97|      0|        }
   98|  91.8k|        if (num_tileparts > 255)
  ------------------
  |  Branch (98:13): [True: 0, False: 91.8k]
  ------------------
   99|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|  91.8k|            "cannot have more than 255 tile parts.", num_tileparts);
  101|  91.8k|      }
  102|       |
  103|  91.8k|      ui32 tx0 = tile_rect.org.x;
  104|  91.8k|      ui32 ty0 = tile_rect.org.y;
  105|  91.8k|      ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
  106|  91.8k|      ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
  107|  91.8k|      ui32 recon_tx0 = recon_tile_rect.org.x;
  108|  91.8k|      ui32 recon_ty0 = recon_tile_rect.org.y;
  109|  91.8k|      ui32 recon_tx1 = recon_tile_rect.org.x + recon_tile_rect.siz.w;
  110|  91.8k|      ui32 recon_ty1 = recon_tile_rect.org.y + recon_tile_rect.siz.h;
  111|       |
  112|  91.8k|      ui32 width = 0;
  113|   146k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (113:24): [True: 54.9k, False: 91.8k]
  ------------------
  114|  54.9k|      {
  115|  54.9k|        point downsamp = szp->get_downsampling(i);
  116|       |
  117|  54.9k|        ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
  ------------------
  |  |   70|  54.9k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  118|  54.9k|        ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
  ------------------
  |  |   70|  54.9k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  119|  54.9k|        ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
  ------------------
  |  |   70|  54.9k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  120|  54.9k|        ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
  ------------------
  |  |   70|  54.9k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  121|  54.9k|        ui32 recon_tcx0 = ojph_div_ceil(recon_tx0, downsamp.x);
  ------------------
  |  |   70|  54.9k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  122|  54.9k|        ui32 recon_tcy0 = ojph_div_ceil(recon_ty0, downsamp.y);
  ------------------
  |  |   70|  54.9k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  123|  54.9k|        ui32 recon_tcx1 = ojph_div_ceil(recon_tx1, downsamp.x);
  ------------------
  |  |   70|  54.9k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  124|  54.9k|        ui32 recon_tcy1 = ojph_div_ceil(recon_ty1, downsamp.y);
  ------------------
  |  |   70|  54.9k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  125|       |
  126|  54.9k|        rect comp_rect;
  127|  54.9k|        comp_rect.org.x = tcx0;
  128|  54.9k|        comp_rect.org.y = tcy0;
  129|  54.9k|        comp_rect.siz.w = tcx1 - tcx0;
  130|  54.9k|        comp_rect.siz.h = tcy1 - tcy0;
  131|       |
  132|  54.9k|        rect recon_comp_rect;
  133|  54.9k|        recon_comp_rect.org.x = recon_tcx0;
  134|  54.9k|        recon_comp_rect.org.y = recon_tcy0;
  135|  54.9k|        recon_comp_rect.siz.w = recon_tcx1 - recon_tcx0;
  136|  54.9k|        recon_comp_rect.siz.h = recon_tcy1 - recon_tcy0;
  137|       |
  138|  54.9k|        tile_comp::pre_alloc(codestream, i, comp_rect, recon_comp_rect);
  139|  54.9k|        width = ojph_max(width, recon_comp_rect.siz.w);
  ------------------
  |  |   73|  54.9k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 2.47k, False: 52.5k]
  |  |  ------------------
  ------------------
  140|  54.9k|      }
  141|       |
  142|       |      //allocate lines
  143|  91.8k|      const param_cod* cdp = codestream->get_cod();
  144|  91.8k|      if (cdp->is_employing_color_transform())
  ------------------
  |  Branch (144:11): [True: 4.38k, False: 87.4k]
  ------------------
  145|  4.38k|      {
  146|  4.38k|        bool reversible[3];
  147|  17.5k|        for (ui32 i = 0; i < 3; ++i)
  ------------------
  |  Branch (147:26): [True: 13.1k, False: 4.38k]
  ------------------
  148|  13.1k|          reversible[i] = codestream->get_coc(i)->is_reversible();
  149|  4.38k|        if (reversible[0] != reversible[1] || reversible[1] != reversible[2])
  ------------------
  |  Branch (149:13): [True: 11, False: 4.37k]
  |  Branch (149:47): [True: 0, False: 4.37k]
  ------------------
  150|     11|          OJPH_ERROR(0x000300A2, "When the colour transform is employed. "
  ------------------
  |  |  289|     66|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     11|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (289:52): [True: 9, False: 2]
  |  |  |  Branch (289:52): [True: 2, False: 9]
  |  |  |  Branch (289:52): [True: 2, False: 9]
  |  |  ------------------
  ------------------
  151|  4.38k|            "all colour components must undergo either reversible or "
  152|  4.38k|            "irreversible wavelet transform; if not, then it is not clear "
  153|  4.38k|            "what colour transform should be used (reversible or "
  154|  4.38k|            "irreversible).  Here we found that the first three colour "
  155|  4.38k|            "components uses %s, %s, and %s transforms, respectively.",
  156|  4.38k|            reversible[0] ? "reversible" : "irreversible",
  157|  4.38k|            reversible[1] ? "reversible" : "irreversible",
  158|  4.38k|            reversible[2] ? "reversible" : "irreversible");
  159|       |
  160|  4.38k|        allocator->pre_alloc_obj<line_buf>(3);
  161|  4.38k|        if (reversible[0])
  ------------------
  |  Branch (161:13): [True: 242, False: 4.13k]
  ------------------
  162|    968|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (162:27): [True: 726, False: 242]
  ------------------
  163|    726|            allocator->pre_alloc_data<si32>(width, 0);
  164|  4.13k|        else
  165|  16.5k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (165:27): [True: 12.3k, False: 4.13k]
  ------------------
  166|  12.3k|            allocator->pre_alloc_data<float>(width, 0);
  167|  4.38k|      }
  168|  91.8k|    }
_ZN4ojph5local4tile14finalize_allocEPNS0_10codestreamERKNS_4rectEjRjS7_:
  174|  89.8k|    {
  175|       |      //this->parent = codestream;
  176|  89.8k|      mem_fixed_allocator* allocator = codestream->get_allocator();
  177|       |
  178|  89.8k|      sot.init(0, (ui16)tile_idx, 0, 1);
  179|  89.8k|      prog_order = codestream->access_cod().get_progression_order();
  180|       |
  181|       |      //allocate tiles_comp
  182|  89.8k|      const param_siz *szp = codestream->get_siz();
  183|  89.8k|      const param_nlt *nlp = codestream->get_nlt();
  184|       |
  185|  89.8k|      this->num_bytes = 0;
  186|  89.8k|      num_comps = szp->get_num_components();
  187|  89.8k|      skipped_res_for_read = codestream->get_skipped_res_for_read();
  188|  89.8k|      comps = allocator->post_alloc_obj<tile_comp>(num_comps);
  189|  89.8k|      comp_rects = allocator->post_alloc_obj<rect>(num_comps);
  190|  89.8k|      recon_comp_rects = allocator->post_alloc_obj<rect>(num_comps);
  191|  89.8k|      line_offsets = allocator->post_alloc_obj<ui32>(num_comps);
  192|  89.8k|      num_bits = allocator->post_alloc_obj<ui32>(num_comps);
  193|  89.8k|      is_signed = allocator->post_alloc_obj<bool>(num_comps);
  194|  89.8k|      reversible = allocator->post_alloc_obj<bool>(num_comps);
  195|  89.8k|      nlt_type3 = allocator->post_alloc_obj<ui8>(num_comps);
  196|  89.8k|      cur_line = allocator->post_alloc_obj<ui32>(num_comps);
  197|       |
  198|  89.8k|      profile = codestream->get_profile();
  199|  89.8k|      tilepart_div = codestream->get_tilepart_div();
  200|  89.8k|      need_tlm = codestream->is_tlm_needed();
  201|  89.8k|      {
  202|  89.8k|        ui32 tilepart_div = codestream->get_tilepart_div();
  203|  89.8k|        ui32 t = tilepart_div & OJPH_TILEPART_MASK;
  204|  89.8k|        if (t == OJPH_TILEPART_NO_DIVISIONS)
  ------------------
  |  Branch (204:13): [True: 89.8k, False: 0]
  ------------------
  205|  89.8k|          num_tileparts = 1; //for num_rc_bytes
  206|      0|        else if (t == OJPH_TILEPART_COMPONENTS)
  ------------------
  |  Branch (206:18): [True: 0, False: 0]
  ------------------
  207|      0|          num_tileparts = num_comps;
  208|      0|        else if (t == OJPH_TILEPART_RESOLUTIONS)
  ------------------
  |  Branch (208:18): [True: 0, False: 0]
  ------------------
  209|      0|        {
  210|      0|          ui32 max_decs = 0;
  211|      0|          for (ui32 c = 0; c < num_comps; ++c) {
  ------------------
  |  Branch (211:28): [True: 0, False: 0]
  ------------------
  212|      0|            ui32 s = codestream->get_coc(c)->get_num_decompositions();
  213|      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]
  |  |  ------------------
  ------------------
  214|      0|          }
  215|      0|          num_tileparts = 1 + max_decs;
  216|      0|        }
  217|      0|        else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
  ------------------
  |  Branch (217:18): [True: 0, False: 0]
  ------------------
  218|      0|        {
  219|      0|          num_tileparts = 0;
  220|      0|          for (ui32 c = 0; c < num_comps; ++c) {
  ------------------
  |  Branch (220:28): [True: 0, False: 0]
  ------------------
  221|      0|            ui32 s = codestream->get_coc(c)->get_num_decompositions();
  222|      0|            num_tileparts += s + 1;
  223|      0|          }
  224|      0|        }
  225|  89.8k|        if (num_tileparts > 255)
  ------------------
  |  Branch (225:13): [True: 0, False: 89.8k]
  ------------------
  226|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|  89.8k|          "cannot have more than 255 tile parts.", num_tileparts);
  228|  89.8k|      }
  229|       |
  230|  89.8k|      this->resilient = codestream->is_resilient();
  231|  89.8k|      this->tile_rect = tile_rect;
  232|       |
  233|  89.8k|      ui32 tx0 = tile_rect.org.x;
  234|  89.8k|      ui32 ty0 = tile_rect.org.y;
  235|  89.8k|      ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
  236|  89.8k|      ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
  237|       |
  238|  89.8k|      ui32 width = 0;
  239|   140k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (239:24): [True: 50.8k, False: 89.8k]
  ------------------
  240|  50.8k|      {
  241|  50.8k|        ui8 bd; bool is; // used for nlt_type3
  242|       |
  243|  50.8k|        point downsamp = szp->get_downsampling(i);
  244|  50.8k|        point recon_downsamp = szp->get_recon_downsampling(i);
  245|       |
  246|  50.8k|        ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
  ------------------
  |  |   70|  50.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  247|  50.8k|        ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
  ------------------
  |  |   70|  50.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  248|  50.8k|        ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
  ------------------
  |  |   70|  50.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  249|  50.8k|        ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
  ------------------
  |  |   70|  50.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  250|  50.8k|        ui32 recon_tcx0 = ojph_div_ceil(tx0, recon_downsamp.x);
  ------------------
  |  |   70|  50.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  251|  50.8k|        ui32 recon_tcy0 = ojph_div_ceil(ty0, recon_downsamp.y);
  ------------------
  |  |   70|  50.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  252|  50.8k|        ui32 recon_tcx1 = ojph_div_ceil(tx1, recon_downsamp.x);
  ------------------
  |  |   70|  50.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  253|  50.8k|        ui32 recon_tcy1 = ojph_div_ceil(ty1, recon_downsamp.y);
  ------------------
  |  |   70|  50.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  254|       |
  255|  50.8k|        line_offsets[i] =
  256|  50.8k|          recon_tcx0 - ojph_div_ceil(tx0 - offset, recon_downsamp.x);
  ------------------
  |  |   70|  50.8k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  257|  50.8k|        comp_rects[i].org.x = tcx0;
  258|  50.8k|        comp_rects[i].org.y = tcy0;
  259|  50.8k|        comp_rects[i].siz.w = tcx1 - tcx0;
  260|  50.8k|        comp_rects[i].siz.h = tcy1 - tcy0;
  261|  50.8k|        recon_comp_rects[i].org.x = recon_tcx0;
  262|  50.8k|        recon_comp_rects[i].org.y = recon_tcy0;
  263|  50.8k|        recon_comp_rects[i].siz.w = recon_tcx1 - recon_tcx0;
  264|  50.8k|        recon_comp_rects[i].siz.h = recon_tcy1 - recon_tcy0;
  265|       |
  266|  50.8k|        comps[i].finalize_alloc(codestream, this, i, comp_rects[i],
  267|  50.8k|          recon_comp_rects[i]);
  268|  50.8k|        width = ojph_max(width, recon_comp_rects[i].siz.w);
  ------------------
  |  |   73|  50.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.49k, False: 49.3k]
  |  |  ------------------
  ------------------
  269|       |
  270|  50.8k|        num_bits[i] = szp->get_bit_depth(i);
  271|  50.8k|        is_signed[i] = szp->is_signed(i);
  272|  50.8k|        bool result = nlp->get_nonlinear_transform(i, bd, is, nlt_type3[i]);
  273|  50.8k|        if (result == true && (bd != num_bits[i] || is != is_signed[i]))
  ------------------
  |  Branch (273:13): [True: 18, False: 50.7k]
  |  Branch (273:32): [True: 0, False: 18]
  |  Branch (273:53): [True: 0, False: 18]
  ------------------
  274|      0|          OJPH_ERROR(0x000300A1, "Mismatch between Ssiz (bit_depth = %d, "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (289:52): [True: 0, False: 0]
  |  |  |  Branch (289:52): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  275|  50.8k|            "is_signed = %s) from SIZ marker segment, and BDnlt "
  276|  50.8k|            "(bit_depth = %d, is_signed = %s) from NLT marker segment, "
  277|  50.8k|            "for component %d", i, num_bits[i],
  278|  50.8k|            is_signed[i] ? "True" : "False", bd, is ? "True" : "False");
  279|  50.8k|        if (result == false)
  ------------------
  |  Branch (279:13): [True: 50.6k, False: 178]
  ------------------
  280|  50.6k|          nlt_type3[i] = param_nlt::nonlinearity::OJPH_NLT_NO_NLT;
  281|  50.8k|        cur_line[i] = 0;
  282|  50.8k|        reversible[i] = codestream->get_coc(i)->is_reversible();
  283|  50.8k|      }
  284|       |
  285|  89.8k|      offset += tile_rect.siz.w;
  286|       |
  287|       |      //allocate lines
  288|  89.8k|      const param_cod* cdp = codestream->get_cod();
  289|  89.8k|      this->employ_color_transform = cdp->is_employing_color_transform();
  290|  89.8k|      if (this->employ_color_transform)
  ------------------
  |  Branch (290:11): [True: 3.11k, False: 86.7k]
  ------------------
  291|  3.11k|      {
  292|  3.11k|        num_lines = 3;
  293|  3.11k|        lines = allocator->post_alloc_obj<line_buf>(num_lines);
  294|  3.11k|        if (reversible[0])
  ------------------
  |  Branch (294:13): [True: 252, False: 2.85k]
  ------------------
  295|  1.00k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (295:27): [True: 756, False: 252]
  ------------------
  296|    756|            lines[i].wrap(
  297|    756|              allocator->post_alloc_data<si32>(width, 0), width, 0);
  298|  2.85k|        else
  299|  11.4k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (299:27): [True: 8.57k, False: 2.85k]
  ------------------
  300|  8.57k|            lines[i].wrap(
  301|  8.57k|              allocator->post_alloc_data<float>(width, 0), width, 0);
  302|  3.11k|      }
  303|  86.7k|      else
  304|  86.7k|      {
  305|       |        lines = NULL;
  306|  86.7k|        num_lines = 0;
  307|  86.7k|      }
  308|  89.8k|      next_tile_part = 0;
  309|  89.8k|    }
_ZN4ojph5local4tile4pullEPNS_8line_bufEj:
  406|  2.07M|    {
  407|  2.07M|      constexpr ui8 type3 =
  408|  2.07M|        param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
  409|       |
  410|  2.07M|      assert(comp_num < num_comps);
  411|  2.07M|      if (cur_line[comp_num] >= recon_comp_rects[comp_num].siz.h)
  ------------------
  |  Branch (411:11): [True: 38.7k, False: 2.03M]
  ------------------
  412|  38.7k|        return false;
  413|       |
  414|  2.03M|      cur_line[comp_num]++;
  415|       |
  416|  2.03M|      ui32 comp_width = recon_comp_rects[comp_num].siz.w;
  417|  2.03M|      if (comp_width == 0)
  ------------------
  |  Branch (417:11): [True: 7.32k, False: 2.02M]
  ------------------
  418|  7.32k|        return true; // nothing to pull, but not an error
  419|       |
  420|  2.02M|      if (!employ_color_transform || num_comps == 1)
  ------------------
  |  Branch (420:11): [True: 1.90M, False: 121k]
  |  Branch (420:38): [True: 100k, False: 21.5k]
  ------------------
  421|  2.00M|      {
  422|  2.00M|        line_buf *src_line = comps[comp_num].pull_line();
  423|  2.00M|        if (reversible[comp_num])
  ------------------
  |  Branch (423:13): [True: 1.82M, False: 179k]
  ------------------
  424|  1.82M|        {
  425|  1.82M|          si64 shift = (si64)1 << (num_bits[comp_num] - 1);
  426|  1.82M|          if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (426:15): [True: 4.27k, False: 1.81M]
  |  Branch (426:38): [True: 0, False: 4.27k]
  ------------------
  427|      0|            rev_convert_nlt_type3(src_line, 0, tgt_line,
  428|      0|              line_offsets[comp_num], shift + 1, comp_width);
  429|  1.82M|          else {
  430|  1.82M|            shift = is_signed[comp_num] ? 0 : shift;
  ------------------
  |  Branch (430:21): [True: 4.27k, False: 1.81M]
  ------------------
  431|  1.82M|            rev_convert(src_line, 0, tgt_line,
  432|  1.82M|              line_offsets[comp_num], shift, comp_width);
  433|  1.82M|          }
  434|  1.82M|        }
  435|   179k|        else
  436|   179k|        {
  437|   179k|          if (nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (437:15): [True: 476, False: 179k]
  ------------------
  438|    476|            irv_convert_to_integer_nlt_type3(src_line, tgt_line,
  439|    476|              line_offsets[comp_num], num_bits[comp_num],
  440|    476|              is_signed[comp_num], comp_width);
  441|   179k|          else
  442|   179k|            irv_convert_to_integer(src_line, tgt_line,
  443|   179k|              line_offsets[comp_num], num_bits[comp_num],
  444|   179k|              is_signed[comp_num], comp_width);
  445|   179k|        }
  446|  2.00M|      }
  447|  21.5k|      else
  448|  21.5k|      {
  449|  21.5k|        assert(num_comps >= 3);
  450|  21.5k|        if (comp_num == 0)
  ------------------
  |  Branch (450:13): [True: 4.70k, False: 16.8k]
  ------------------
  451|  4.70k|        {
  452|  4.70k|          if (reversible[comp_num])
  ------------------
  |  Branch (452:15): [True: 3.57k, False: 1.13k]
  ------------------
  453|  3.57k|            rct_backward(comps[0].pull_line(), comps[1].pull_line(),
  454|  3.57k|              comps[2].pull_line(), lines + 0, lines + 1,
  455|  3.57k|              lines + 2, comp_width);
  456|  1.13k|          else
  457|  1.13k|            ict_backward(comps[0].pull_line()->f32, comps[1].pull_line()->f32,
  458|  1.13k|              comps[2].pull_line()->f32, lines[0].f32, lines[1].f32,
  459|  1.13k|              lines[2].f32, comp_width);
  460|  4.70k|        }
  461|  21.5k|        if (reversible[comp_num])
  ------------------
  |  Branch (461:13): [True: 14.4k, False: 7.14k]
  ------------------
  462|  14.4k|        {
  463|  14.4k|          si64 shift = (si64)1 << (num_bits[comp_num] - 1);
  464|  14.4k|          line_buf* src_line;
  465|  14.4k|          if (comp_num < 3)
  ------------------
  |  Branch (465:15): [True: 14.4k, False: 0]
  ------------------
  466|  14.4k|            src_line = lines + comp_num;
  467|      0|          else
  468|      0|            src_line = comps[comp_num].pull_line();
  469|  14.4k|          if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (469:15): [True: 1.35k, False: 13.0k]
  |  Branch (469:38): [True: 0, False: 1.35k]
  ------------------
  470|      0|            rev_convert_nlt_type3(src_line, 0, tgt_line,
  471|      0|              line_offsets[comp_num], shift + 1, comp_width);
  472|  14.4k|          else {
  473|  14.4k|            shift = is_signed[comp_num] ? 0 : shift;
  ------------------
  |  Branch (473:21): [True: 1.35k, False: 13.0k]
  ------------------
  474|  14.4k|            rev_convert(src_line, 0, tgt_line,
  475|  14.4k|              line_offsets[comp_num], shift, comp_width);
  476|  14.4k|          }
  477|  14.4k|        }
  478|  7.14k|        else
  479|  7.14k|        {
  480|  7.14k|          line_buf* lbp;
  481|  7.14k|          if (comp_num < 3)
  ------------------
  |  Branch (481:15): [True: 7.14k, False: 0]
  ------------------
  482|  7.14k|            lbp = lines + comp_num;
  483|      0|          else
  484|      0|            lbp = comps[comp_num].pull_line();
  485|  7.14k|          if (nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (485:15): [True: 0, False: 7.14k]
  ------------------
  486|      0|            irv_convert_to_integer_nlt_type3(lbp, tgt_line,
  487|      0|              line_offsets[comp_num], num_bits[comp_num],
  488|      0|              is_signed[comp_num], comp_width);
  489|  7.14k|          else
  490|  7.14k|            irv_convert_to_integer(lbp, tgt_line,
  491|  7.14k|              line_offsets[comp_num], num_bits[comp_num],
  492|  7.14k|              is_signed[comp_num], comp_width);
  493|  7.14k|        }
  494|  21.5k|      }
  495|       |
  496|  2.02M|      return true;
  497|  2.03M|    }
_ZN4ojph5local4tile17parse_tile_headerERKNS0_9param_sotEPNS_11infile_baseERKm:
  759|  67.1k|    {
  760|  67.1k|      if (sot.get_tile_part_index() != next_tile_part)
  ------------------
  |  Branch (760:11): [True: 64.7k, False: 2.41k]
  ------------------
  761|  64.7k|      {
  762|  64.7k|        if (resilient)
  ------------------
  |  Branch (762:13): [True: 64.7k, False: 6]
  ------------------
  763|  64.7k|          OJPH_INFO(0x00030091, "wrong tile part index")
  ------------------
  |  |  285|  64.7k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  64.7k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 64.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  764|      6|        else
  765|      6|          OJPH_ERROR(0x00030091, "wrong tile part index")
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  766|  64.7k|      }
  767|  67.1k|      ++next_tile_part;
  768|       |
  769|       |      //tile_end_location used on failure
  770|  67.1k|      ui64 tile_end_location = tile_start_location + sot.get_payload_length();
  771|       |
  772|  67.1k|      ui32 data_left = sot.get_payload_length(); //bytes left to parse
  773|  67.1k|      data_left -= (ui32)((ui64)file->tell() - tile_start_location);
  774|       |
  775|  67.1k|      if (data_left == 0)
  ------------------
  |  Branch (775:11): [True: 100, False: 67.0k]
  ------------------
  776|    100|        return;
  777|       |
  778|  67.0k|      ui32 max_decompositions = 0;
  779|   138k|      for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (779:24): [True: 71.0k, False: 67.0k]
  ------------------
  780|  71.0k|        max_decompositions = ojph_max(max_decompositions,
  ------------------
  |  |   73|   138k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 264, False: 70.8k]
  |  |  ------------------
  ------------------
  781|  67.0k|          comps[c].get_num_decompositions());
  782|       |
  783|  67.0k|      try
  784|  67.0k|      {
  785|       |        //sequence the reading of precincts according to progression order
  786|  67.0k|        if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
  ------------------
  |  Branch (786:13): [True: 23.4k, False: 43.6k]
  |  Branch (786:43): [True: 4.42k, False: 39.1k]
  ------------------
  787|  27.8k|        {
  788|  27.8k|          max_decompositions -= skipped_res_for_read;
  789|   178k|          for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (789:28): [True: 150k, False: 27.8k]
  ------------------
  790|   305k|            for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (790:30): [True: 154k, False: 150k]
  ------------------
  791|   154k|              if (data_left > 0)
  ------------------
  |  Branch (791:19): [True: 152k, False: 2.15k]
  ------------------
  792|   152k|                comps[c].parse_precincts(r, data_left, file);
  793|  27.8k|        }
  794|  39.1k|        else if (prog_order == OJPH_PO_RPCL)
  ------------------
  |  Branch (794:18): [True: 11.1k, False: 28.0k]
  ------------------
  795|  11.1k|        {
  796|  11.1k|          max_decompositions -= skipped_res_for_read;
  797|  61.2k|          for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (797:28): [True: 50.0k, False: 11.1k]
  ------------------
  798|  50.0k|          {
  799|   146k|            while (true)
  ------------------
  |  Branch (799:20): [True: 137k, Folded]
  ------------------
  800|   137k|            {
  801|   137k|              bool found = false;
  802|   137k|              ui32 comp_num = 0;
  803|   137k|              point smallest(INT_MAX, INT_MAX), cur;
  804|   289k|              for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (804:32): [True: 152k, False: 137k]
  ------------------
  805|   152k|              {
  806|   152k|                if (!comps[c].get_top_left_precinct(r, cur))
  ------------------
  |  Branch (806:21): [True: 44.8k, False: 107k]
  ------------------
  807|  44.8k|                  continue;
  808|   107k|                else
  809|   107k|                  found = true;
  810|       |
  811|   107k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (811:21): [True: 97.8k, False: 9.61k]
  ------------------
  812|  97.8k|                { smallest = cur; comp_num = c; }
  813|  9.61k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (813:26): [True: 8.12k, False: 1.48k]
  |  Branch (813:49): [True: 2.00k, False: 6.12k]
  ------------------
  814|  2.00k|                { smallest = cur; comp_num = c; }
  815|   107k|              }
  816|   137k|              if (found == true && data_left > 0)
  ------------------
  |  Branch (816:19): [True: 96.9k, False: 40.0k]
  |  Branch (816:36): [True: 96.2k, False: 748]
  ------------------
  817|  96.2k|                comps[comp_num].parse_one_precinct(r, data_left, file);
  818|  40.8k|              else
  819|  40.8k|                break;
  820|   137k|            }
  821|  50.0k|          }
  822|  11.1k|        }
  823|  28.0k|        else if (prog_order == OJPH_PO_PCRL)
  ------------------
  |  Branch (823:18): [True: 10.6k, False: 17.3k]
  ------------------
  824|  10.6k|        {
  825|   126k|          while (true)
  ------------------
  |  Branch (825:18): [True: 118k, Folded]
  ------------------
  826|   118k|          {
  827|   118k|            bool found = false;
  828|   118k|            ui32 comp_num = 0;
  829|   118k|            ui32 res_num = 0;
  830|   118k|            point smallest(INT_MAX, INT_MAX), cur;
  831|   251k|            for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (831:30): [True: 132k, False: 118k]
  ------------------
  832|   132k|            {
  833|   930k|              for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
  ------------------
  |  Branch (833:32): [True: 797k, False: 132k]
  ------------------
  834|   797k|              {
  835|   797k|                if (!comps[c].get_top_left_precinct(r, cur))
  ------------------
  |  Branch (835:21): [True: 151k, False: 646k]
  ------------------
  836|   151k|                  continue;
  837|   646k|                else
  838|   646k|                  found = true;
  839|       |
  840|   646k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (840:21): [True: 261k, False: 384k]
  ------------------
  841|   261k|                { smallest = cur; comp_num = c; res_num = r; }
  842|   384k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (842:26): [True: 257k, False: 127k]
  |  Branch (842:49): [True: 102k, False: 154k]
  ------------------
  843|   102k|                { smallest = cur; comp_num = c; res_num = r; }
  844|   282k|                else if (cur.y == smallest.y && cur.x == smallest.x &&
  ------------------
  |  Branch (844:26): [True: 154k, False: 127k]
  |  Branch (844:49): [True: 138k, False: 16.0k]
  ------------------
  845|   138k|                         c < comp_num)
  ------------------
  |  Branch (845:26): [True: 0, False: 138k]
  ------------------
  846|      0|                { smallest = cur; comp_num = c; res_num = r; }
  847|   282k|                else if (cur.y == smallest.y && cur.x == smallest.x &&
  ------------------
  |  Branch (847:26): [True: 154k, False: 127k]
  |  Branch (847:49): [True: 138k, False: 16.0k]
  ------------------
  848|   138k|                         c == comp_num && r < res_num)
  ------------------
  |  Branch (848:26): [True: 130k, False: 7.98k]
  |  Branch (848:43): [True: 0, False: 130k]
  ------------------
  849|      0|                { smallest = cur; comp_num = c; res_num = r; }
  850|   646k|              }
  851|   132k|            }
  852|   118k|            if (found == true && data_left > 0)
  ------------------
  |  Branch (852:17): [True: 116k, False: 1.97k]
  |  Branch (852:34): [True: 116k, False: 419]
  ------------------
  853|   116k|              comps[comp_num].parse_one_precinct(res_num, data_left, file);
  854|  2.38k|            else
  855|  2.38k|              break;
  856|   118k|          }
  857|  10.6k|        }
  858|  17.3k|        else if (prog_order == OJPH_PO_CPRL)
  ------------------
  |  Branch (858:18): [True: 17.0k, False: 250]
  ------------------
  859|  17.0k|        {
  860|  34.5k|          for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (860:28): [True: 17.4k, False: 17.0k]
  ------------------
  861|  17.4k|          {
  862|   156k|            while (true)
  ------------------
  |  Branch (862:20): [True: 142k, Folded]
  ------------------
  863|   142k|            {
  864|   142k|              bool found = false;
  865|   142k|              ui32 res_num = 0;
  866|   142k|              point smallest(INT_MAX, INT_MAX), cur;
  867|  1.00M|              for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (867:32): [True: 867k, False: 142k]
  ------------------
  868|   867k|              {
  869|   867k|                if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
  ------------------
  |  Branch (869:21): [True: 142k, False: 724k]
  ------------------
  870|   142k|                  continue;
  871|   724k|                else
  872|   724k|                  found = true;
  873|       |
  874|   724k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (874:21): [True: 353k, False: 370k]
  ------------------
  875|   353k|                { smallest = cur; res_num = r; }
  876|   370k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (876:26): [True: 312k, False: 58.2k]
  |  Branch (876:49): [True: 83.4k, False: 229k]
  ------------------
  877|  83.4k|                { smallest = cur; res_num = r; }
  878|   724k|              }
  879|   142k|              if (found == true && data_left > 0)
  ------------------
  |  Branch (879:19): [True: 139k, False: 2.82k]
  |  Branch (879:36): [True: 138k, False: 727]
  ------------------
  880|   138k|                comps[c].parse_one_precinct(res_num, data_left, file);
  881|  3.55k|              else
  882|  3.55k|                break;
  883|   142k|            }
  884|  17.4k|          }
  885|  17.0k|        }
  886|    250|        else
  887|  17.3k|          assert(0);
  888|       |
  889|  67.0k|      }
  890|  67.0k|      catch (const char *error)
  891|  67.0k|      {
  892|  43.5k|        if (resilient)
  ------------------
  |  Branch (892:13): [True: 43.5k, False: 1]
  ------------------
  893|  43.5k|          OJPH_INFO(0x00030092, "%s", error)
  ------------------
  |  |  285|  43.5k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  43.5k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 43.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  894|      1|        else
  895|      1|          OJPH_ERROR(0x00030092, "%s", error)
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  896|  43.5k|      }
  897|  67.0k|      file->seek((si64)tile_end_location, infile_base::OJPH_SEEK_SET);
  898|  67.0k|    }

_ZN4ojph5local4tile13get_tile_rectEv:
   75|   298k|      rect get_tile_rect() { return tile_rect; }

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

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

ojph_block_common.cpp:_ZN4ojph5localL15vlc_init_tablesEv:
  118|      2|    {
  119|      2|      const bool debug = false; //useful for checking 
  120|       |
  121|       |      //Data in the table is arranged in this format (taken from the standard)
  122|       |      // c_q is the context for a quad
  123|       |      // rho is the significance pattern for a quad
  124|       |      // u_off indicate if u value is 0 (u_off is 0), or communicated
  125|       |      // e_k, e_1 EMB patterns
  126|       |      // cwd VLC codeword
  127|       |      // cwd VLC codeword length
  128|      2|      struct vlc_src_table { int c_q, rho, u_off, e_k, e_1, cwd, cwd_len; };
  129|       |      // initial quad rows
  130|      2|      vlc_src_table tbl0[] = {
  131|      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}
  ------------------
  132|      2|      };
  133|       |      // number of entries in the table
  134|      2|      size_t tbl0_size = sizeof(tbl0) / sizeof(vlc_src_table); 
  135|       |
  136|       |      // nono-initial quad rows
  137|      2|      vlc_src_table tbl1[] = {
  138|      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}
  ------------------
  139|      2|      };
  140|       |      // number of entries in the table
  141|      2|      size_t tbl1_size = sizeof(tbl1) / sizeof(vlc_src_table);
  142|       |
  143|      2|      if (debug) memset(vlc_tbl0, 0, sizeof(vlc_tbl0)); //unnecessary
  ------------------
  |  Branch (143:11): [Folded, False: 2]
  ------------------
  144|       |
  145|       |      // this is to convert table entries into values for decoder look up
  146|       |      // There can be at most 1024 possibilities, not all of them are valid.
  147|       |      // 
  148|  2.05k|      for (int i = 0; i < 1024; ++i)
  ------------------
  |  Branch (148:23): [True: 2.04k, False: 2]
  ------------------
  149|  2.04k|      {
  150|  2.04k|        int cwd = i & 0x7F; // from i extract codeword
  151|  2.04k|        int c_q = i >> 7;   // from i extract context
  152|       |        // See if this case exist in the table, if so then set the entry in
  153|       |        // vlc_tbl0
  154|   911k|        for (size_t j = 0; j < tbl0_size; ++j) 
  ------------------
  |  Branch (154:28): [True: 909k, False: 2.04k]
  ------------------
  155|   909k|          if (tbl0[j].c_q == c_q) // this is an and operation
  ------------------
  |  Branch (155:15): [True: 113k, False: 795k]
  ------------------
  156|   113k|            if (tbl0[j].cwd == (cwd & ((1 << tbl0[j].cwd_len) - 1)))
  ------------------
  |  Branch (156:17): [True: 2.04k, False: 111k]
  ------------------
  157|  2.04k|            {
  158|  2.04k|              if (debug) assert(vlc_tbl0[i] == 0);
  ------------------
  |  Branch (158:19): [Folded, False: 2.04k]
  ------------------
  159|       |              // Put this entry into the table
  160|  2.04k|              vlc_tbl0[i] = (ui16)((tbl0[j].rho << 4) | (tbl0[j].u_off << 3)
  161|  2.04k|                | (tbl0[j].e_k << 12) | (tbl0[j].e_1 << 8) | tbl0[j].cwd_len);
  162|  2.04k|            }
  163|  2.04k|      }
  164|       |
  165|      2|      if (debug) memset(vlc_tbl1, 0, sizeof(vlc_tbl1)); //unnecessary
  ------------------
  |  Branch (165:11): [Folded, False: 2]
  ------------------
  166|       |
  167|       |      // this the same as above but for non-initial rows
  168|  2.05k|      for (int i = 0; i < 1024; ++i)
  ------------------
  |  Branch (168:23): [True: 2.04k, False: 2]
  ------------------
  169|  2.04k|      {
  170|  2.04k|        int cwd = i & 0x7F; //7 bits
  171|  2.04k|        int c_q = i >> 7;
  172|   735k|        for (size_t j = 0; j < tbl1_size; ++j)
  ------------------
  |  Branch (172:28): [True: 733k, False: 2.04k]
  ------------------
  173|   733k|          if (tbl1[j].c_q == c_q) // this is an and operation
  ------------------
  |  Branch (173:15): [True: 91.6k, False: 641k]
  ------------------
  174|  91.6k|            if (tbl1[j].cwd == (cwd & ((1 << tbl1[j].cwd_len) - 1)))
  ------------------
  |  Branch (174:17): [True: 2.04k, False: 89.6k]
  ------------------
  175|  2.04k|            {
  176|  2.04k|              if (debug) assert(vlc_tbl1[i] == 0);
  ------------------
  |  Branch (176:19): [Folded, False: 2.04k]
  ------------------
  177|  2.04k|              vlc_tbl1[i] = (ui16)((tbl1[j].rho << 4) | (tbl1[j].u_off << 3)
  178|  2.04k|                | (tbl1[j].e_k << 12) | (tbl1[j].e_1 << 8) | tbl1[j].cwd_len);
  179|  2.04k|            }
  180|  2.04k|      }
  181|       |
  182|      2|      return true;
  183|      2|    }
ojph_block_common.cpp:_ZN4ojph5localL16uvlc_init_tablesEv:
  190|      2|    {
  191|       |      // table stores possible decoding three bits from vlc
  192|       |      // there are 8 entries for xx1, x10, 100, 000, where x means do not
  193|       |      // care table value is made up of
  194|       |      // 2 bits in the LSB for prefix length 
  195|       |      // 3 bits for suffix length
  196|       |      // 3 bits in the MSB for prefix value (u_pfx in Table 3 of ITU T.814)
  197|      2|      static const ui8 dec[8] = { // the index is the prefix codeword
  198|      2|        3 | (5 << 2) | (5 << 5), //000 == 000, prefix codeword "000"
  199|      2|        1 | (0 << 2) | (1 << 5), //001 == xx1, prefix codeword "1"
  200|      2|        2 | (0 << 2) | (2 << 5), //010 == x10, prefix codeword "01"
  201|      2|        1 | (0 << 2) | (1 << 5), //011 == xx1, prefix codeword "1"
  202|      2|        3 | (1 << 2) | (3 << 5), //100 == 100, prefix codeword "001"
  203|      2|        1 | (0 << 2) | (1 << 5), //101 == xx1, prefix codeword "1"
  204|      2|        2 | (0 << 2) | (2 << 5), //110 == x10, prefix codeword "01"
  205|      2|        1 | (0 << 2) | (1 << 5)  //111 == xx1, prefix codeword "1"
  206|      2|      };
  207|       |
  208|    642|      for (ui32 i = 0; i < 256 + 64; ++i)
  ------------------
  |  Branch (208:24): [True: 640, False: 2]
  ------------------
  209|    640|      { 
  210|    640|        ui32 mode = i >> 6;
  211|    640|        ui32 vlc = i & 0x3F;
  212|       |
  213|    640|        if (mode == 0) {      // both u_off are 0
  ------------------
  |  Branch (213:13): [True: 128, False: 512]
  ------------------
  214|    128|          uvlc_tbl0[i] = 0;
  215|    128|          uvlc_bias[i] = 0;
  216|    128|        }
  217|    512|        else if (mode <= 2) // u_off are either 01 or 10
  ------------------
  |  Branch (217:18): [True: 256, False: 256]
  ------------------
  218|    256|        {
  219|    256|          ui32 d = dec[vlc & 0x7];   //look at the least significant 3 bits
  220|       |
  221|    256|          ui32 total_prefix = d & 0x3;
  222|    256|          ui32 total_suffix = (d >> 2) & 0x7;
  223|    256|          ui32 u0_suffix_len = (mode == 1) ? total_suffix : 0;
  ------------------
  |  Branch (223:32): [True: 128, False: 128]
  ------------------
  224|    256|          ui32 u0 = (mode == 1) ? (d >> 5) : 0;
  ------------------
  |  Branch (224:21): [True: 128, False: 128]
  ------------------
  225|    256|          ui32 u1 = (mode == 1) ? 0 : (d >> 5);
  ------------------
  |  Branch (225:21): [True: 128, False: 128]
  ------------------
  226|       |
  227|    256|          uvlc_tbl0[i] = (ui16)(total_prefix | 
  228|    256|                               (total_suffix << 3) |
  229|    256|                               (u0_suffix_len << 7) |
  230|    256|                               (u0 << 10) |
  231|    256|                               (u1 << 13));
  232|       |          
  233|    256|        }
  234|    256|        else if (mode == 3) // both u_off are 1, and MEL event is 0
  ------------------
  |  Branch (234:18): [True: 128, False: 128]
  ------------------
  235|    128|        {
  236|    128|          ui32 d0 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  237|    128|          vlc >>= d0 & 0x3;          // Consume bits
  238|    128|          ui32 d1 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  239|       |
  240|    128|          ui32 total_prefix, u0_suffix_len, total_suffix, u0, u1;
  241|    128|          if ((d0 & 0x3) == 3)
  ------------------
  |  Branch (241:15): [True: 32, False: 96]
  ------------------
  242|     32|          {
  243|     32|            total_prefix = (d0 & 0x3) + 1;
  244|     32|            u0_suffix_len = (d0 >> 2) & 0x7;
  245|     32|            total_suffix = u0_suffix_len;
  246|     32|            u0 = d0 >> 5;
  247|     32|            u1 = (vlc & 1) + 1;
  248|     32|            uvlc_bias[i] = 4; // 0b00 for u0 and 0b01 for u1
  249|     32|          }
  250|     96|          else
  251|     96|          {
  252|     96|            total_prefix = (d0 & 0x3) + (d1 & 0x3);
  253|     96|            u0_suffix_len = (d0 >> 2) & 0x7;
  254|     96|            total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
  255|     96|            u0 = d0 >> 5;
  256|     96|            u1 = d1 >> 5;
  257|     96|            uvlc_bias[i] = 0;
  258|     96|          }
  259|       |
  260|    128|          uvlc_tbl0[i] = (ui16)(total_prefix | 
  261|    128|                               (total_suffix << 3) |
  262|    128|                               (u0_suffix_len << 7) |
  263|    128|                               (u0 << 10) |
  264|    128|                               (u1 << 13));
  265|    128|        }
  266|    128|        else if (mode == 4) // both u_off are 1, and MEL event is 1
  ------------------
  |  Branch (266:18): [True: 128, False: 0]
  ------------------
  267|    128|        {
  268|    128|          ui32 d0 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  269|    128|          vlc >>= d0 & 0x3;          // Consume bits
  270|    128|          ui32 d1 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  271|       |
  272|    128|          ui32 total_prefix = (d0 & 0x3) + (d1 & 0x3);
  273|    128|          ui32 u0_suffix_len = (d0 >> 2) & 0x7;
  274|    128|          ui32 total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
  275|    128|          ui32 u0 = (d0 >> 5) + 2;
  276|    128|          ui32 u1 = (d1 >> 5) + 2;
  277|       |
  278|    128|          uvlc_tbl0[i] = (ui16)(total_prefix | 
  279|    128|                               (total_suffix << 3) |
  280|    128|                               (u0_suffix_len << 7) |
  281|    128|                               (u0 << 10) |
  282|    128|                               (u1 << 13));
  283|    128|          uvlc_bias[i] = 10; // 0b10 for u0 and 0b10 for u1
  284|    128|        }
  285|    640|      }
  286|       |
  287|    514|      for (ui32 i = 0; i < 256; ++i)
  ------------------
  |  Branch (287:24): [True: 512, False: 2]
  ------------------
  288|    512|      {
  289|    512|        ui32 mode = i >> 6;
  290|    512|        ui32 vlc = i & 0x3F;
  291|       |
  292|    512|        if (mode == 0)       // both u_off are 0
  ------------------
  |  Branch (292:13): [True: 128, False: 384]
  ------------------
  293|    128|          uvlc_tbl1[i] = 0;
  294|    384|        else if (mode <= 2)  // u_off are either 01 or 10
  ------------------
  |  Branch (294:18): [True: 256, False: 128]
  ------------------
  295|    256|        {
  296|    256|          ui32 d = dec[vlc & 0x7];   // look at the 3 LSB bits
  297|       |
  298|    256|          ui32 total_prefix = d & 0x3;
  299|    256|          ui32 total_suffix = (d >> 2) & 0x7;
  300|    256|          ui32 u0_suffix_len = (mode == 1) ? total_suffix : 0;
  ------------------
  |  Branch (300:32): [True: 128, False: 128]
  ------------------
  301|    256|          ui32 u0 = (mode == 1) ? (d >> 5) : 0;
  ------------------
  |  Branch (301:21): [True: 128, False: 128]
  ------------------
  302|    256|          ui32 u1 = (mode == 1) ? 0 : (d >> 5);
  ------------------
  |  Branch (302:21): [True: 128, False: 128]
  ------------------
  303|       |
  304|    256|          uvlc_tbl1[i] = (ui16)(total_prefix | 
  305|    256|                               (total_suffix << 3) |
  306|    256|                               (u0_suffix_len << 7) |
  307|    256|                               (u0 << 10) |
  308|    256|                               (u1 << 13));
  309|    256|        }
  310|    128|        else if (mode == 3) // both u_off are 1
  ------------------
  |  Branch (310:18): [True: 128, False: 0]
  ------------------
  311|    128|        {
  312|    128|          ui32 d0 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  313|    128|          vlc >>= d0 & 0x3;          // Consume bits
  314|    128|          ui32 d1 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  315|       |
  316|    128|          ui32 total_prefix = (d0 & 0x3) + (d1 & 0x3);
  317|    128|          ui32 u0_suffix_len = (d0 >> 2) & 0x7;
  318|    128|          ui32 total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
  319|    128|          ui32 u0 = d0 >> 5;
  320|    128|          ui32 u1 = d1 >> 5;
  321|       |
  322|    128|          uvlc_tbl1[i] = (ui16)(total_prefix | 
  323|    128|                               (total_suffix << 3) |
  324|    128|                               (u0_suffix_len << 7) |
  325|    128|                               (u0 << 10) |
  326|    128|                               (u1 << 13));
  327|    128|        }
  328|    512|      }
  329|      2|      return true;
  330|      2|    }

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

_ZN4ojph5local23ojph_decode_codeblock64EPhPmjjjjjjjb:
  771|  43.0k|    {
  772|       |      // static bool insufficient_precision = false;
  773|       |      // static bool modify_code = false;
  774|       |      // static bool truncate_spp_mrp = false;
  775|       |
  776|  43.0k|      if (num_passes > 1 && lengths2 == 0)
  ------------------
  |  Branch (776:11): [True: 31.0k, False: 12.0k]
  |  Branch (776:29): [True: 6.68k, False: 24.3k]
  ------------------
  777|  6.68k|      {
  778|  6.68k|        OJPH_WARN(0x00010001, "A malformed codeblock that has more than "
  ------------------
  |  |  287|  6.68k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  6.68k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6.68k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  779|  6.68k|                              "one coding pass, but zero length for "
  780|  6.68k|                              "2nd and potential 3rd pass.");
  781|  6.68k|        num_passes = 1;
  782|  6.68k|      }
  783|       |
  784|  43.0k|      if (num_passes > 3)
  ------------------
  |  Branch (784:11): [True: 0, False: 43.0k]
  ------------------
  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|  43.0k|      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|  43.0k|      if (lengths1 < 2)
  ------------------
  |  Branch (831:11): [True: 0, False: 43.0k]
  ------------------
  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|  43.0k|      int lcup, scup;
  839|  43.0k|      lcup = (int)lengths1;  // length of CUP
  840|       |      //scup is the length of MEL + VLC
  841|  43.0k|      scup = (((int)coded_data[lcup-1]) << 4) + (coded_data[lcup-2] & 0xF);
  842|  43.0k|      if (scup < 2 || scup > lcup || scup > 4079) //something is wrong
  ------------------
  |  Branch (842:11): [True: 6.03k, False: 37.0k]
  |  Branch (842:23): [True: 16.3k, False: 20.6k]
  |  Branch (842:38): [True: 308, False: 20.3k]
  ------------------
  843|  22.7k|        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|  20.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|  20.3k|      ui32 sstr = ((width + 2u) + 7u) & ~7u; // multiples of 8
  869|       |
  870|  20.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|  20.3k|      {
  880|       |        // init structures
  881|  20.3k|        dec_mel_st mel;
  882|  20.3k|        mel_init(&mel, coded_data, lcup, scup);
  883|  20.3k|        rev_struct vlc;
  884|  20.3k|        rev_init8(&vlc, coded_data, lcup, scup);
  885|       |
  886|  20.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|  20.3k|        ui64 vlc_val;
  891|  20.3k|        ui32 c_q = 0;
  892|  20.3k|        ui16 *sp = scratch;
  893|       |        //initial quad row
  894|  99.3k|        for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (894:26): [True: 78.9k, False: 20.3k]
  ------------------
  895|  78.9k|        {
  896|       |          // decode VLC
  897|       |          /////////////
  898|       |
  899|       |          // first quad
  900|  78.9k|          vlc_val = rev_fetch64(&vlc);
  901|       |
  902|       |          //decode VLC using the context c_q and the head of VLC bitstream
  903|  78.9k|          ui16 t0 = vlc_tbl0[ c_q + (vlc_val & 0x7F) ];
  904|       |
  905|       |          // if context is zero, use one MEL event
  906|  78.9k|          if (c_q == 0) //zero context
  ------------------
  |  Branch (906:15): [True: 43.0k, False: 35.9k]
  ------------------
  907|  43.0k|          {
  908|  43.0k|            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|  43.0k|            t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (913:18): [True: 26.6k, False: 16.4k]
  ------------------
  914|       |
  915|       |            // is run -1 or -2? this means a run has been consumed
  916|  43.0k|            if (run < 0) 
  ------------------
  |  Branch (916:17): [True: 40.4k, False: 2.66k]
  ------------------
  917|  40.4k|              run = mel_get_run(&mel);  // get another run
  918|  43.0k|          }
  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|  78.9k|          sp[0] = t0;
  924|  78.9k|          x += 2;
  925|       |
  926|       |          // prepare context for the next quad; eqn. 1 in ITU T.814
  927|  78.9k|          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|  78.9k|          vlc_val = rev_advance64(&vlc, t0 & 0x7);
  931|       |
  932|       |          //second quad
  933|  78.9k|          ui16 t1 = 0;
  934|       |
  935|       |          //decode VLC using the context c_q and the head of VLC bitstream
  936|  78.9k|          t1 = vlc_tbl0[c_q + (vlc_val & 0x7F)]; 
  937|       |
  938|       |          // if context is zero, use one MEL event
  939|  78.9k|          if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (939:15): [True: 24.0k, False: 54.9k]
  |  Branch (939:27): [True: 20.2k, False: 3.81k]
  ------------------
  940|  20.2k|          {
  941|  20.2k|            run -= 2; //subtract 2, since events number if multiplied by 2
  942|       |
  943|       |            // if event is 0, discard decoded t1
  944|  20.2k|            t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (944:18): [True: 7.45k, False: 12.8k]
  ------------------
  945|       |
  946|  20.2k|            if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (946:17): [True: 13.3k, False: 6.93k]
  ------------------
  947|  13.3k|              run = mel_get_run(&mel); // if yes, then get another run
  948|  20.2k|          }
  949|  78.9k|          t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (949:16): [True: 66.3k, False: 12.6k]
  ------------------
  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|  78.9k|          sp[2] = t1;
  955|  78.9k|          x += 2;
  956|       |
  957|       |          //prepare context for the next quad, eqn. 1 in ITU T.814
  958|  78.9k|          c_q = ((t1 & 0x10U) << 3) | ((t1 & 0xE0U) << 2);
  959|       |
  960|       |          //remove data from vlc stream, if qinf is not used, cwdlen is 0
  961|  78.9k|          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|  78.9k|          ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
  967|  78.9k|          if (uvlc_mode == 0xc0)// if both u_offset are set, get an event from
  ------------------
  |  Branch (967:15): [True: 24.4k, False: 54.5k]
  ------------------
  968|  24.4k|          {                     // the MEL run of events
  969|  24.4k|            run -= 2; //subtract 2, since events number if multiplied by 2
  970|       |
  971|  24.4k|            uvlc_mode += (run == -1) ? 0x40 : 0; // increment uvlc_mode by
  ------------------
  |  Branch (971:26): [True: 13.2k, False: 11.1k]
  ------------------
  972|       |                                                 // is 0x40
  973|       |
  974|  24.4k|            if (run < 0)//if run is consumed (run is -1 or -2), get another run
  ------------------
  |  Branch (974:17): [True: 21.1k, False: 3.21k]
  ------------------
  975|  21.1k|              run = mel_get_run(&mel);
  976|  24.4k|          }
  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|  78.9k|          ui32 idx = uvlc_mode + (ui32)(vlc_val & 0x3F);
  984|  78.9k|          ui32 uvlc_entry = uvlc_tbl0[idx];
  985|  78.9k|          ui16 u_bias = uvlc_bias[idx];          
  986|       |          //remove total prefix length
  987|  78.9k|          vlc_val = rev_advance64(&vlc, uvlc_entry & 0x7); 
  988|  78.9k|          uvlc_entry >>= 3; 
  989|       |          //extract suffixes for quad 0 and 1
  990|  78.9k|          ui32 len = uvlc_entry & 0xF;             // suffix length for 2 quads
  991|  78.9k|          ui32 tmp = (ui32)(vlc_val&((1<<len)-1)); // suffix value for 2 quads
  992|  78.9k|          vlc_val = rev_advance64(&vlc, len);
  993|  78.9k|          uvlc_entry >>= 4;
  994|       |          // quad 0 length
  995|  78.9k|          len = uvlc_entry & 0x7; // quad 0 suffix length
  996|  78.9k|          uvlc_entry >>= 3;
  997|  78.9k|          ui16 u_q0 = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
  998|  78.9k|          ui16 u_q1 = (ui16)((uvlc_entry >> 3) + (tmp >> len));
  999|       |
 1000|       |          // decode u_q extensions, which is needed only when u_q > 32
 1001|  78.9k|          ui16 u_ext; bool cond0, cond1;
 1002|  78.9k|          cond0 = u_q0 - (u_bias & 0x3) > 32;
 1003|  78.9k|          u_ext = (ui16)(cond0 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1003:26): [True: 288, False: 78.7k]
  ------------------
 1004|  78.9k|          vlc_val = rev_advance64(&vlc, cond0 ? 4 : 0);
  ------------------
  |  Branch (1004:41): [True: 288, False: 78.7k]
  ------------------
 1005|  78.9k|          u_q0 = (ui16)(u_q0 + (u_ext << 2));
 1006|  78.9k|          sp[1] = (ui16)(u_q0 + 1); // kappa = 1
 1007|  78.9k|          cond1 = u_q1 - (u_bias >> 2) > 32;
 1008|  78.9k|          u_ext = (ui16)(cond1 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1008:26): [True: 231, False: 78.7k]
  ------------------
 1009|  78.9k|          vlc_val = rev_advance64(&vlc, cond1 ? 4 : 0);
  ------------------
  |  Branch (1009:41): [True: 231, False: 78.7k]
  ------------------
 1010|  78.9k|          u_q1 = (ui16)(u_q1 + (u_ext << 2));
 1011|  78.9k|          sp[3] = (ui16)(u_q1 + 1); // kappa = 1
 1012|  78.9k|        }
 1013|  20.3k|        sp[0] = sp[1] = 0;
 1014|       |
 1015|       |        //non initial quad rows
 1016|  76.8k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1016:26): [True: 56.4k, False: 20.3k]
  ------------------
 1017|  56.4k|        {
 1018|  56.4k|          c_q = 0;                                // context
 1019|  56.4k|          ui16 *sp = scratch + (y >> 1) * sstr;   // this row of quads
 1020|       |
 1021|   177k|          for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1021:28): [True: 120k, False: 56.4k]
  ------------------
 1022|   120k|          {
 1023|       |            // decode VLC
 1024|       |            /////////////
 1025|       |
 1026|       |            // sigma_q (n, ne, nf)
 1027|   120k|            c_q |= ((sp[0 - (si32)sstr] & 0xA0U) << 2);
 1028|   120k|            c_q |= ((sp[2 - (si32)sstr] & 0x20U) << 4);
 1029|       |
 1030|       |            // first quad
 1031|   120k|            vlc_val = rev_fetch64(&vlc);
 1032|       |
 1033|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1034|   120k|            ui16 t0 = vlc_tbl1[ c_q + (vlc_val & 0x7F) ];
 1035|       |
 1036|       |            // if context is zero, use one MEL event
 1037|   120k|            if (c_q == 0) //zero context
  ------------------
  |  Branch (1037:17): [True: 78.5k, False: 42.2k]
  ------------------
 1038|  78.5k|            {
 1039|  78.5k|              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|  78.5k|              t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1044:20): [True: 32.1k, False: 46.3k]
  ------------------
 1045|       |
 1046|       |              // is run -1 or -2? this means a run has been consumed
 1047|  78.5k|              if (run < 0) 
  ------------------
  |  Branch (1047:19): [True: 49.0k, False: 29.4k]
  ------------------
 1048|  49.0k|                run = mel_get_run(&mel);  // get another run
 1049|  78.5k|            }
 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|   120k|            sp[0] = t0;
 1055|   120k|            x += 2;
 1056|       |
 1057|       |            // prepare context for the next quad; eqn. 2 in ITU T.814
 1058|       |            // sigma_q (w, sw)
 1059|   120k|            c_q = ((t0 & 0x40U) << 2) | ((t0 & 0x80U) << 1);
 1060|       |            // sigma_q (nw)
 1061|   120k|            c_q |= sp[0 - (si32)sstr] & 0x80;
 1062|       |            // sigma_q (n, ne, nf)
 1063|   120k|            c_q |= ((sp[2 - (si32)sstr] & 0xA0U) << 2);
 1064|   120k|            c_q |= ((sp[4 - (si32)sstr] & 0x20U) << 4);
 1065|       |
 1066|       |            //remove data from vlc stream (0 bits are removed if vlc is unused)
 1067|   120k|            vlc_val = rev_advance64(&vlc, t0 & 0x7);
 1068|       |
 1069|       |            //second quad
 1070|   120k|            ui16 t1 = 0;
 1071|       |
 1072|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1073|   120k|            t1 = vlc_tbl1[ c_q + (vlc_val & 0x7F)]; 
 1074|       |
 1075|       |            // if context is zero, use one MEL event
 1076|   120k|            if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1076:17): [True: 76.2k, False: 44.5k]
  |  Branch (1076:29): [True: 54.3k, False: 21.8k]
  ------------------
 1077|  54.3k|            {
 1078|  54.3k|              run -= 2; //subtract 2, since events number if multiplied by 2
 1079|       |
 1080|       |              // if event is 0, discard decoded t1
 1081|  54.3k|              t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1081:20): [True: 16.8k, False: 37.5k]
  ------------------
 1082|       |
 1083|  54.3k|              if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1083:19): [True: 25.2k, False: 29.1k]
  ------------------
 1084|  25.2k|                run = mel_get_run(&mel); // if yes, then get another run
 1085|  54.3k|            }
 1086|   120k|            t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1086:18): [True: 89.2k, False: 31.5k]
  ------------------
 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|   120k|            sp[2] = t1;
 1092|   120k|            x += 2;
 1093|       |
 1094|       |            // partial c_q, will be completed when we process the next quad
 1095|       |            // sigma_q (w, sw)
 1096|   120k|            c_q = ((t1 & 0x40U) << 2) | ((t1 & 0x80U) << 1);
 1097|       |            // sigma_q (nw)
 1098|   120k|            c_q |= sp[2 - (si32)sstr] & 0x80;
 1099|       |
 1100|       |            //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1101|   120k|            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|   120k|            ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1107|   120k|            ui32 uvlc_entry = uvlc_tbl1[uvlc_mode + (vlc_val & 0x3F)];
 1108|       |            //remove total prefix length
 1109|   120k|            vlc_val = rev_advance64(&vlc, uvlc_entry & 0x7);
 1110|   120k|            uvlc_entry >>= 3;
 1111|       |            //extract suffixes for quad 0 and 1
 1112|   120k|            ui32 len = uvlc_entry & 0xF;             //suffix length for 2 quads
 1113|   120k|            ui32 tmp = (ui32)(vlc_val&((1<<len)-1)); //suffix value for 2 quads
 1114|   120k|            vlc_val = rev_advance64(&vlc, len);
 1115|   120k|            uvlc_entry >>= 4;
 1116|       |            // quad 0 length
 1117|   120k|            len = uvlc_entry & 0x7; // quad 0 suffix length
 1118|   120k|            uvlc_entry >>= 3;
 1119|   120k|            ui16 u_q0 = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
 1120|   120k|            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|   120k|            ui16 u_ext; bool cond0, cond1;
 1124|   120k|            cond0 = u_q0 > 32;
 1125|   120k|            u_ext = (ui16)(cond0 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1125:28): [True: 231, False: 120k]
  ------------------
 1126|   120k|            vlc_val = rev_advance64(&vlc, cond0 ? 4 : 0);
  ------------------
  |  Branch (1126:43): [True: 231, False: 120k]
  ------------------
 1127|   120k|            u_q0 = (ui16)(u_q0 + (u_ext << 2));
 1128|   120k|            sp[1] = u_q0;
 1129|   120k|            cond1 = u_q1 > 32;
 1130|   120k|            u_ext = (ui16)(cond1 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1130:28): [True: 87, False: 120k]
  ------------------
 1131|   120k|            vlc_val = rev_advance64(&vlc, cond1 ? 4 : 0);
  ------------------
  |  Branch (1131:43): [True: 87, False: 120k]
  ------------------
 1132|   120k|            u_q1 = (ui16)(u_q1 + (u_ext << 2));
 1133|   120k|            sp[3] = u_q1;
 1134|   120k|          }
 1135|  56.4k|          sp[0] = sp[1] = 0;
 1136|  56.4k|        }
 1137|  20.3k|      }
 1138|       |
 1139|       |      // step2 we decode magsgn
 1140|  20.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|  20.3k|        const int v_n_size = 512 + 4;
 1148|  20.3k|        ui64 v_n_scratch[v_n_size] = {0};  // 4+ kB
 1149|       |
 1150|  20.3k|        frwd_struct64 magsgn;
 1151|  20.3k|        frwd_init8<0xFF>(&magsgn, coded_data, lcup - scup);
 1152|       |
 1153|  20.3k|        const ui16 *sp = scratch;
 1154|  20.3k|        ui64 *vp = v_n_scratch;
 1155|  20.3k|        ui64 *dp = decoded_data;
 1156|       |
 1157|  20.3k|        ui64 prev_v_n = 0;
 1158|   126k|        for (ui32 x = 0; x < width; sp += 2, ++vp)
  ------------------
  |  Branch (1158:26): [True: 117k, False: 9.08k]
  ------------------
 1159|   117k|        {
 1160|   117k|          ui32 inf = sp[0];
 1161|   117k|          ui32 U_q = sp[1];
 1162|   117k|          if (U_q > mmsbp2)
  ------------------
  |  Branch (1162:15): [True: 3.24k, False: 114k]
  ------------------
 1163|  3.24k|            return false;
 1164|       |
 1165|   114k|          ui64 v_n;
 1166|   114k|          ui64 val = 0;
 1167|   114k|          ui32 bit = 0;
 1168|   114k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1168:15): [True: 33.4k, False: 80.6k]
  ------------------
 1169|  33.4k|          {
 1170|       |            //get 32 bits of magsgn data
 1171|  33.4k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1172|  33.4k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1173|  33.4k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1174|       |
 1175|  33.4k|            val = ms_val << 63;                           // get sign bit
 1176|  33.4k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1177|  33.4k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1178|  33.4k|            v_n |= 1;                                     // add center of bin    
 1179|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1180|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1181|  33.4k|            val |= (v_n + 2) << (p - 1);
 1182|  33.4k|          }
 1183|   114k|          dp[0] = val;
 1184|       |
 1185|   114k|          v_n = 0;
 1186|   114k|          val = 0;
 1187|   114k|          bit = 1;
 1188|   114k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1188:15): [True: 49.9k, False: 64.1k]
  ------------------
 1189|  49.9k|          {
 1190|       |            //get 32 bits of magsgn data
 1191|  49.9k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1192|  49.9k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1193|  49.9k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1194|       |
 1195|  49.9k|            val = ms_val << 63;                           // get sign bit
 1196|  49.9k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1197|  49.9k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1198|  49.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|  49.9k|            val |= (v_n + 2) << (p - 1);
 1202|  49.9k|          }
 1203|   114k|          dp[stride] = val;
 1204|   114k|          vp[0] = prev_v_n | v_n;
 1205|   114k|          prev_v_n = 0;
 1206|   114k|          ++dp;
 1207|   114k|          if (++x >= width)
  ------------------
  |  Branch (1207:15): [True: 8.02k, False: 106k]
  ------------------
 1208|  8.02k|          { ++vp; break; }
 1209|       |
 1210|   106k|          val = 0;
 1211|   106k|          bit = 2;
 1212|   106k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1212:15): [True: 32.4k, False: 73.6k]
  ------------------
 1213|  32.4k|          {
 1214|       |            //get 32 bits of magsgn data
 1215|  32.4k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1216|  32.4k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1217|  32.4k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1218|       |
 1219|  32.4k|            val = ms_val << 63;                           // get sign bit
 1220|  32.4k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1221|  32.4k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1222|  32.4k|            v_n |= 1;                                     // add center of bin    
 1223|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1224|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1225|  32.4k|            val |= (v_n + 2) << (p - 1);
 1226|  32.4k|          }
 1227|   106k|          dp[0] = val;
 1228|       |
 1229|   106k|          v_n = 0;
 1230|   106k|          val = 0;
 1231|   106k|          bit = 3;
 1232|   106k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1232:15): [True: 29.2k, False: 76.9k]
  ------------------
 1233|  29.2k|          {
 1234|       |            //get 32 bits of magsgn data
 1235|  29.2k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1236|  29.2k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1237|  29.2k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1238|       |
 1239|  29.2k|            val = ms_val << 63;                           // get sign bit
 1240|  29.2k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1241|  29.2k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1242|  29.2k|            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|  29.2k|            val |= (v_n + 2) << (p - 1);
 1246|  29.2k|          }
 1247|   106k|          dp[stride] = val;
 1248|   106k|          prev_v_n = v_n;
 1249|   106k|          ++dp;
 1250|   106k|          ++x;
 1251|   106k|        }
 1252|  17.1k|        vp[0] = prev_v_n;
 1253|       |
 1254|  64.7k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1254:26): [True: 49.0k, False: 15.6k]
  ------------------
 1255|  49.0k|        {
 1256|  49.0k|          const ui16 *sp = scratch + (y >> 1) * sstr;
 1257|  49.0k|          ui64 *vp = v_n_scratch;
 1258|  49.0k|          ui64 *dp = decoded_data + y * stride;
 1259|       |
 1260|  49.0k|          prev_v_n = 0;
 1261|   194k|          for (ui32 x = 0; x < width; sp += 2, ++vp)
  ------------------
  |  Branch (1261:28): [True: 168k, False: 26.1k]
  ------------------
 1262|   168k|          {
 1263|   168k|            ui32 inf = sp[0];
 1264|   168k|            ui32 u_q = sp[1];
 1265|       |
 1266|   168k|            ui32 gamma = inf & 0xF0; gamma &= gamma - 0x10; //is gamma_q 1?
 1267|   168k|            ui32 emax = 63 - count_leading_zeros(2 | vp[0] | vp[1]); // emax-1
 1268|   168k|            ui32 kappa = gamma ? emax : 1;
  ------------------
  |  Branch (1268:26): [True: 13.1k, False: 155k]
  ------------------
 1269|       |
 1270|   168k|            ui32 U_q = u_q + kappa;
 1271|   168k|            if (U_q > mmsbp2)
  ------------------
  |  Branch (1271:17): [True: 1.43k, False: 166k]
  ------------------
 1272|  1.43k|              return false;
 1273|       |
 1274|   166k|            ui64 v_n;
 1275|   166k|            ui64 val = 0;
 1276|   166k|            ui32 bit = 0;
 1277|   166k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1277:17): [True: 40.9k, False: 126k]
  ------------------
 1278|  40.9k|            {
 1279|       |              //get 32 bits of magsgn data
 1280|  40.9k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1281|  40.9k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1282|  40.9k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1283|       |
 1284|  40.9k|              val = ms_val << 63;                         // get sign bit
 1285|  40.9k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1286|  40.9k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1287|  40.9k|              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|  40.9k|              val |= (v_n + 2) << (p - 1);
 1291|  40.9k|            }
 1292|   166k|            dp[0] = val;
 1293|       |
 1294|   166k|            v_n = 0;
 1295|   166k|            val = 0;
 1296|   166k|            bit = 1;
 1297|   166k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1297:17): [True: 12.3k, False: 154k]
  ------------------
 1298|  12.3k|            {
 1299|       |              //get 32 bits of magsgn data
 1300|  12.3k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1301|  12.3k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1302|  12.3k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1303|       |
 1304|  12.3k|              val = ms_val << 63;                         // get sign bit
 1305|  12.3k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1306|  12.3k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1307|  12.3k|              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|  12.3k|              val |= (v_n + 2) << (p - 1);
 1311|  12.3k|            }
 1312|   166k|            dp[stride] = val;
 1313|   166k|            vp[0] = prev_v_n | v_n;
 1314|   166k|            prev_v_n = 0;
 1315|   166k|            ++dp;
 1316|   166k|            if (++x >= width)
  ------------------
  |  Branch (1316:17): [True: 21.4k, False: 145k]
  ------------------
 1317|  21.4k|            { ++vp; break; }
 1318|       |
 1319|   145k|            val = 0;
 1320|   145k|            bit = 2;
 1321|   145k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1321:17): [True: 9.25k, False: 136k]
  ------------------
 1322|  9.25k|            {
 1323|       |              //get 32 bits of magsgn data
 1324|  9.25k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1325|  9.25k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1326|  9.25k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1327|       |
 1328|  9.25k|              val = ms_val << 63;                         // get sign bit
 1329|  9.25k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1330|  9.25k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1331|  9.25k|              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|  9.25k|              val |= (v_n + 2) << (p - 1);
 1335|  9.25k|            }
 1336|   145k|            dp[0] = val;
 1337|       |
 1338|   145k|            v_n = 0;
 1339|   145k|            val = 0;
 1340|   145k|            bit = 3;
 1341|   145k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1341:17): [True: 8.25k, False: 137k]
  ------------------
 1342|  8.25k|            {
 1343|       |              //get 32 bits of magsgn data
 1344|  8.25k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1345|  8.25k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1346|  8.25k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1347|       |
 1348|  8.25k|              val = ms_val << 63;                         // get sign bit
 1349|  8.25k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1350|  8.25k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1351|  8.25k|              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|  8.25k|              val |= (v_n + 2) << (p - 1);
 1355|  8.25k|            }
 1356|   145k|            dp[stride] = val;
 1357|   145k|            prev_v_n = v_n;
 1358|   145k|            ++dp;
 1359|   145k|            ++x;
 1360|   145k|          }
 1361|  47.6k|          vp[0] = prev_v_n;
 1362|  47.6k|        }
 1363|  17.1k|      }
 1364|       |
 1365|  15.6k|      if (num_passes > 1)
  ------------------
  |  Branch (1365:11): [True: 12.4k, False: 3.23k]
  ------------------
 1366|  12.4k|      {
 1367|       |        // We use scratch again, we can divide it into multiple regions
 1368|       |        // sigma holds all the significant samples, and it cannot
 1369|       |        // be modified after it is set.  it will be used during the
 1370|       |        // Magnitude Refinement Pass
 1371|  12.4k|        ui16* const sigma = scratch;
 1372|       |
 1373|  12.4k|        ui32 mstr = (width + 3u) >> 2;   // divide by 4, since each
 1374|       |                                         // ui16 contains 4 columns
 1375|  12.4k|        mstr = ((mstr + 2u) + 7u) & ~7u; // multiples of 8
 1376|       |
 1377|       |        // We re-arrange quad significance, where each 4 consecutive
 1378|       |        // bits represent one quad, into column significance, where,
 1379|       |        // each 4 consequtive bits represent one column of 4 rows
 1380|  12.4k|        {
 1381|  12.4k|          ui32 y;
 1382|  41.3k|          for (y = 0; y < height; y += 4)
  ------------------
  |  Branch (1382:23): [True: 28.9k, False: 12.4k]
  ------------------
 1383|  28.9k|          {
 1384|  28.9k|            ui16* sp = scratch + (y >> 1) * sstr;
 1385|  28.9k|            ui16* dp = sigma + (y >> 2) * mstr;
 1386|   102k|            for (ui32 x = 0; x < width; x += 4, sp += 4, ++dp) {
  ------------------
  |  Branch (1386:30): [True: 73.1k, False: 28.9k]
  ------------------
 1387|  73.1k|              ui32 t0 = 0, t1 = 0;
 1388|  73.1k|              t0  = ((sp[0     ] & 0x30u) >> 4)  | ((sp[0     ] & 0xC0u) >> 2);
 1389|  73.1k|              t0 |= ((sp[2     ] & 0x30u) << 4)  | ((sp[2     ] & 0xC0u) << 6);
 1390|  73.1k|              t1  = ((sp[0+sstr] & 0x30u) >> 2)  | ((sp[0+sstr] & 0xC0u)     );
 1391|  73.1k|              t1 |= ((sp[2+sstr] & 0x30u) << 6)  | ((sp[2+sstr] & 0xC0u) << 8);
 1392|  73.1k|              dp[0] = (ui16)(t0 | t1);
 1393|  73.1k|            }
 1394|  28.9k|            dp[0] = 0; // set an extra entry on the right with 0
 1395|  28.9k|          }
 1396|  12.4k|          {
 1397|       |            // reset one row after the codeblock
 1398|  12.4k|            ui16* dp = sigma + (y >> 2) * mstr;
 1399|  61.1k|            for (ui32 x = 0; x < width; x += 4, ++dp)
  ------------------
  |  Branch (1399:30): [True: 48.7k, False: 12.4k]
  ------------------
 1400|  48.7k|              dp[0] = 0;
 1401|  12.4k|            dp[0] = 0; // set an extra entry on the right with 0
 1402|  12.4k|          }
 1403|  12.4k|        }
 1404|       |
 1405|       |        // We perform Significance Propagation Pass here
 1406|  12.4k|        {
 1407|       |          // This stores significance information of the previous
 1408|       |          // 4 rows.  Significance information in this array includes
 1409|       |          // all signicant samples in bitplane p - 1; that is,
 1410|       |          // significant samples for bitplane p (discovered during the
 1411|       |          // cleanup pass and stored in sigma) and samples that have recently
 1412|       |          // became significant (during the SPP) in bitplane p-1.
 1413|       |          // We store enough for the widest row, containing 1024 columns,
 1414|       |          // which is equivalent to 256 of ui16, since each stores 4 columns.
 1415|       |          // We add an extra 8 entries, just in case we need more
 1416|  12.4k|          ui16 prev_row_sig[256 + 8] = {0}; // 528 Bytes
 1417|       |
 1418|  12.4k|          frwd_struct64 sigprop;
 1419|  12.4k|          frwd_init<0>(&sigprop, coded_data + lengths1, (int)lengths2);
 1420|       |
 1421|  41.3k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1421:28): [True: 28.9k, False: 12.4k]
  ------------------
 1422|  28.9k|          {
 1423|  28.9k|            ui32 pattern = 0xFFFFu; // a pattern needed samples
 1424|  28.9k|            if (height - y < 4) {
  ------------------
  |  Branch (1424:17): [True: 5.93k, False: 22.9k]
  ------------------
 1425|  5.93k|              pattern = 0x7777u;
 1426|  5.93k|              if (height - y < 3) {
  ------------------
  |  Branch (1426:19): [True: 5.04k, False: 890]
  ------------------
 1427|  5.04k|                pattern = 0x3333u;
 1428|  5.04k|                if (height - y < 2)
  ------------------
  |  Branch (1428:21): [True: 1.93k, False: 3.11k]
  ------------------
 1429|  1.93k|                  pattern = 0x1111u;
 1430|  5.04k|              }
 1431|  5.93k|            }
 1432|       |
 1433|       |            // prev holds sign. info. for the previous quad, together
 1434|       |            // with the rows on top of it and below it.
 1435|  28.9k|            ui32 prev = 0;
 1436|  28.9k|            ui16 *prev_sig = prev_row_sig;
 1437|  28.9k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1438|  28.9k|            ui64 *dpp = decoded_data + y * stride;
 1439|   102k|            for (ui32 x = 0; x < width; x += 4, ++cur_sig, ++prev_sig)
  ------------------
  |  Branch (1439:30): [True: 73.1k, False: 28.9k]
  ------------------
 1440|  73.1k|            {
 1441|       |              // only rows and columns inside the stripe are included
 1442|  73.1k|              si32 s = (si32)x + 4 - (si32)width;
 1443|  73.1k|              s = ojph_max(s, 0);
  ------------------
  |  |   73|  73.1k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 17.2k, False: 55.8k]
  |  |  ------------------
  ------------------
 1444|  73.1k|              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|  73.1k|              ui32 ps = *(ui32*)prev_sig;
 1459|  73.1k|              ui32 ns = *(ui32*)(cur_sig + mstr);
 1460|  73.1k|              ui32 u = (ps & 0x88888888) >> 3; // the row on top
 1461|  73.1k|              if (!stripe_causal)
  ------------------
  |  Branch (1461:19): [True: 72.4k, False: 738]
  ------------------
 1462|  72.4k|                u |= (ns & 0x11111111) << 3;   // the row below
 1463|       |
 1464|  73.1k|              ui32 cs = *(ui32*)cur_sig;
 1465|       |              // vertical integration
 1466|  73.1k|              ui32 mbr =  cs;                // this sig. info.
 1467|  73.1k|              mbr |= (cs & 0x77777777) << 1; //above neighbors
 1468|  73.1k|              mbr |= (cs & 0xEEEEEEEE) >> 1; //below neighbors
 1469|  73.1k|              mbr |= u;
 1470|       |              // horizontal integration
 1471|  73.1k|              ui32 t = mbr;
 1472|  73.1k|              mbr |= t << 4;      // neighbors on the left
 1473|  73.1k|              mbr |= t >> 4;      // neighbors on the right
 1474|  73.1k|              mbr |= prev >> 12;  // significance of previous group
 1475|       |
 1476|       |              // remove outside samples, and already significant samples
 1477|  73.1k|              mbr &= pattern;
 1478|  73.1k|              mbr &= ~cs;
 1479|       |
 1480|       |              // find samples that become significant during the SPP
 1481|  73.1k|              ui32 new_sig = mbr;
 1482|  73.1k|              if (new_sig)
  ------------------
  |  Branch (1482:19): [True: 54.1k, False: 19.0k]
  ------------------
 1483|  54.1k|              {
 1484|  54.1k|                ui64 cwd = frwd_fetch<0>(&sigprop);
 1485|       |
 1486|  54.1k|                ui32 cnt = 0;
 1487|  54.1k|                ui32 col_mask = 0xFu;
 1488|  54.1k|                ui32 inv_sig = ~cs & pattern;
 1489|   270k|                for (int i = 0; i < 16; i += 4, col_mask <<= 4)
  ------------------
  |  Branch (1489:33): [True: 216k, False: 54.1k]
  ------------------
 1490|   216k|                {
 1491|   216k|                  if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1491:23): [True: 58.7k, False: 157k]
  ------------------
 1492|  58.7k|                    continue;
 1493|       |
 1494|       |                  //scan one column
 1495|   157k|                  ui32 sample_mask = 0x1111u & col_mask;
 1496|   157k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1496:23): [True: 100k, False: 56.7k]
  ------------------
 1497|   100k|                  {
 1498|   100k|                    new_sig &= ~sample_mask;
 1499|   100k|                    if (cwd & 1)
  ------------------
  |  Branch (1499:25): [True: 40.7k, False: 60.2k]
  ------------------
 1500|  40.7k|                    {
 1501|  40.7k|                      ui32 t = 0x33u << i;
 1502|  40.7k|                      new_sig |= t & inv_sig;
 1503|  40.7k|                    }
 1504|   100k|                    cwd >>= 1; ++cnt;
 1505|   100k|                  }
 1506|       |
 1507|   157k|                  sample_mask <<= 1;
 1508|   157k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1508:23): [True: 96.1k, False: 61.5k]
  ------------------
 1509|  96.1k|                  {
 1510|  96.1k|                    new_sig &= ~sample_mask;
 1511|  96.1k|                    if (cwd & 1)
  ------------------
  |  Branch (1511:25): [True: 28.6k, False: 67.4k]
  ------------------
 1512|  28.6k|                    {
 1513|  28.6k|                      ui32 t = 0x76u << i;
 1514|  28.6k|                      new_sig |= t & inv_sig;
 1515|  28.6k|                    }
 1516|  96.1k|                    cwd >>= 1; ++cnt;
 1517|  96.1k|                  }
 1518|       |
 1519|   157k|                  sample_mask <<= 1;
 1520|   157k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1520:23): [True: 99.1k, False: 58.5k]
  ------------------
 1521|  99.1k|                  {
 1522|  99.1k|                    new_sig &= ~sample_mask;
 1523|  99.1k|                    if (cwd & 1)
  ------------------
  |  Branch (1523:25): [True: 33.4k, False: 65.7k]
  ------------------
 1524|  33.4k|                    {
 1525|  33.4k|                      ui32 t = 0xECu << i;
 1526|  33.4k|                      new_sig |= t & inv_sig;
 1527|  33.4k|                    }
 1528|  99.1k|                    cwd >>= 1; ++cnt;
 1529|  99.1k|                  }
 1530|       |
 1531|   157k|                  sample_mask <<= 1;
 1532|   157k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1532:23): [True: 82.4k, False: 75.2k]
  ------------------
 1533|  82.4k|                  {
 1534|  82.4k|                    new_sig &= ~sample_mask;
 1535|  82.4k|                    if (cwd & 1)
  ------------------
  |  Branch (1535:25): [True: 34.4k, False: 48.0k]
  ------------------
 1536|  34.4k|                    {
 1537|  34.4k|                      ui32 t = 0xC8u << i;
 1538|  34.4k|                      new_sig |= t & inv_sig;
 1539|  34.4k|                    }
 1540|  82.4k|                    cwd >>= 1; ++cnt;
 1541|  82.4k|                  }
 1542|   157k|                }
 1543|       |
 1544|  54.1k|                if (new_sig)
  ------------------
  |  Branch (1544:21): [True: 28.7k, False: 25.3k]
  ------------------
 1545|  28.7k|                {
 1546|       |                  // new_sig has newly-discovered sig. samples during SPP
 1547|       |                  // find the signs and update decoded_data
 1548|  28.7k|                  ui64 *dp = dpp + x;
 1549|  28.7k|                  ui64 val = 3u << (p - 2);
 1550|  28.7k|                  col_mask = 0xFu;
 1551|   143k|                  for (int i = 0; i < 4; ++i, ++dp, col_mask <<= 4)
  ------------------
  |  Branch (1551:35): [True: 114k, False: 28.7k]
  ------------------
 1552|   114k|                  {
 1553|   114k|                    if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1553:25): [True: 49.3k, False: 65.5k]
  ------------------
 1554|  49.3k|                      continue;
 1555|       |
 1556|       |                    //scan 4 signs
 1557|  65.5k|                    ui32 sample_mask = 0x1111u & col_mask;
 1558|  65.5k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1558:25): [True: 40.7k, False: 24.8k]
  ------------------
 1559|  40.7k|                    {
 1560|  40.7k|                      assert(dp[0] == 0);
 1561|  40.7k|                      dp[0] = (cwd << 63) | val;
 1562|  40.7k|                      cwd >>= 1; ++cnt;
 1563|  40.7k|                    }
 1564|       |
 1565|  65.5k|                    sample_mask += sample_mask;
 1566|  65.5k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1566:25): [True: 28.6k, False: 36.9k]
  ------------------
 1567|  28.6k|                    {
 1568|  28.6k|                      assert(dp[stride] == 0);
 1569|  28.6k|                      dp[stride] = (cwd << 63) | val;
 1570|  28.6k|                      cwd >>= 1; ++cnt;
 1571|  28.6k|                    }
 1572|       |
 1573|  65.5k|                    sample_mask += sample_mask;
 1574|  65.5k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1574:25): [True: 33.4k, False: 32.1k]
  ------------------
 1575|  33.4k|                    {
 1576|  33.4k|                      assert(dp[2 * stride] == 0);
 1577|  33.4k|                      dp[2 * stride] = (cwd << 63) | val;
 1578|  33.4k|                      cwd >>= 1; ++cnt;
 1579|  33.4k|                    }
 1580|       |
 1581|  65.5k|                    sample_mask += sample_mask;
 1582|  65.5k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1582:25): [True: 34.4k, False: 31.0k]
  ------------------
 1583|  34.4k|                    {
 1584|  34.4k|                      assert(dp[3 * stride] == 0);
 1585|  34.4k|                      dp[3 * stride] = (cwd << 63) | val;
 1586|  34.4k|                      cwd >>= 1; ++cnt;
 1587|  34.4k|                    }
 1588|  65.5k|                  }
 1589|  28.7k|                }
 1590|  54.1k|                frwd_advance(&sigprop, cnt);
 1591|  54.1k|              }
 1592|       |
 1593|  73.1k|              new_sig |= cs;
 1594|  73.1k|              *prev_sig = (ui16)(new_sig);
 1595|       |
 1596|       |              // vertical integration for the new sig. info.
 1597|  73.1k|              t = new_sig;
 1598|  73.1k|              new_sig |= (t & 0x7777) << 1; //above neighbors
 1599|  73.1k|              new_sig |= (t & 0xEEEE) >> 1; //below neighbors
 1600|       |              // add sig. info. from the row on top and below
 1601|  73.1k|              prev = new_sig | u;
 1602|       |              // we need only the bits in 0xF000
 1603|  73.1k|              prev &= 0xF000;
 1604|  73.1k|            }
 1605|  28.9k|          }
 1606|  12.4k|        }
 1607|       |
 1608|       |        // We perform Magnitude Refinement Pass here
 1609|  12.4k|        if (num_passes > 2)
  ------------------
  |  Branch (1609:13): [True: 9.45k, False: 2.97k]
  ------------------
 1610|  9.45k|        {
 1611|  9.45k|          rev_struct magref;
 1612|  9.45k|          rev_init_mrp(&magref, coded_data, (int)lengths1, (int)lengths2);
 1613|       |
 1614|  31.2k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1614:28): [True: 21.8k, False: 9.45k]
  ------------------
 1615|  21.8k|          {
 1616|  21.8k|            ui32 *cur_sig = (ui32*)(sigma + (y >> 2) * mstr);
 1617|  21.8k|            ui64 *dpp = decoded_data + y * stride;
 1618|  21.8k|            ui64 half = 1ULL << (p - 2);
 1619|  60.1k|            for (ui32 i = 0; i < width; i += 8)
  ------------------
  |  Branch (1619:30): [True: 38.3k, False: 21.8k]
  ------------------
 1620|  38.3k|            {
 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|  38.3k|              ui32 cwd = rev_fetch_mrp(&magref); // get 32 bit data
 1625|  38.3k|              ui32 sig = *cur_sig++; // 32 bit that will be processed now
 1626|  38.3k|              ui32 col_mask = 0xFu;  // a mask for a column in sig
 1627|  38.3k|              if (sig) // if any of the 32 bits are set
  ------------------
  |  Branch (1627:19): [True: 31.5k, False: 6.80k]
  ------------------
 1628|  31.5k|              {
 1629|   283k|                for (int j = 0; j < 8; ++j) //one column at a time
  ------------------
  |  Branch (1629:33): [True: 252k, False: 31.5k]
  ------------------
 1630|   252k|                {
 1631|   252k|                  if (sig & col_mask) // lowest nibble
  ------------------
  |  Branch (1631:23): [True: 100k, False: 152k]
  ------------------
 1632|   100k|                  {
 1633|   100k|                    ui64 *dp = dpp + i + j; // next column in decoded samples
 1634|   100k|                    ui32 sample_mask = 0x11111111u & col_mask; //LSB
 1635|       |
 1636|   500k|                    for (int k = 0; k < 4; ++k) {
  ------------------
  |  Branch (1636:37): [True: 400k, False: 100k]
  ------------------
 1637|   400k|                      if (sig & sample_mask) //if LSB is set
  ------------------
  |  Branch (1637:27): [True: 168k, False: 232k]
  ------------------
 1638|   168k|                      {
 1639|   168k|                        assert(dp[0] != 0); // decoded value cannot be zero
 1640|   168k|                        assert((dp[0] & half) == 0); // no half
 1641|   168k|                        ui64 sym = cwd & 1;          // get it value
 1642|   168k|                        sym = (1 - sym) << (p - 1); // previous center of bin
 1643|   168k|                        sym |= half;            // put half the center of bin
 1644|   168k|                        dp[0] ^= sym;    // remove old bin center and put new
 1645|   168k|                        cwd >>= 1;       // consume word
 1646|   168k|                      }
 1647|   400k|                      sample_mask += sample_mask; //next row
 1648|   400k|                      dp += stride; // next samples row
 1649|   400k|                    }
 1650|   100k|                  }
 1651|   252k|                  col_mask <<= 4; //next column
 1652|   252k|                }
 1653|  31.5k|              }
 1654|       |              // consume data according to the number of bits set
 1655|  38.3k|              rev_advance_mrp(&magref, population_count(sig));
 1656|  38.3k|            }
 1657|  21.8k|          }
 1658|  9.45k|        }
 1659|  12.4k|      }
 1660|  15.6k|      return true;
 1661|  17.1k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL8mel_initEPNS0_10dec_mel_stEPhii:
  222|  20.3k|    {
  223|  20.3k|      melp->data = bbuf + lcup - scup; // move the pointer to the start of MEL
  224|  20.3k|      melp->bits = 0;                  // 0 bits in tmp
  225|  20.3k|      melp->tmp = 0;                   //
  226|  20.3k|      melp->unstuff = false;           // no unstuffing
  227|  20.3k|      melp->size = scup - 1;           // size is the length of MEL+VLC-1
  228|  20.3k|      melp->k = 0;                     // 0 for state 
  229|  20.3k|      melp->num_runs = 0;              // num_runs is 0
  230|  20.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|  20.3k|      int num = 4 - (int)(intptr_t(melp->data) & 0x3);
  236|  72.5k|      for (int i = 0; i < num; ++i) { // this code is similar to mel_read
  ------------------
  |  Branch (236:23): [True: 52.2k, False: 20.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: 48.6k, False: 3.61k]
  ------------------
  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: 5.10k, False: 47.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|  20.3k|      melp->tmp <<= (64 - melp->bits); //push all the way up so the first bit
  250|       |                                       // is the MSB
  251|  20.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL9rev_init8EPNS0_10rev_structEPhii:
  344|  20.3k|    {
  345|       |      //first byte has only the upper 4 bits
  346|  20.3k|      vlcp->data = data + lcup - 2;
  347|       |
  348|       |      //size can not be larger than this, in fact it should be smaller
  349|  20.3k|      vlcp->size = scup - 2;
  350|       |
  351|  20.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|  20.3k|      val = (ui8)(val >> 4);
  356|  20.3k|      ui8 t = ((val & 0x7) == 0x7) ? 1 : 0; // unstuffing is needed
  ------------------
  |  Branch (356:15): [True: 5.71k, False: 14.6k]
  ------------------
  357|  20.3k|      val = (ui8)(val & (0xFU >> t)); // protect against erroneous 1 in MSB
  358|  20.3k|      vlcp->tmp = val;
  359|  20.3k|      vlcp->bits = 4 - t;
  360|  20.3k|      vlcp->unstuff = val > 0x8; //this is useful for the next byte
  361|  20.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL11mel_get_runEPNS0_10dec_mel_stE:
  261|   169k|    {
  262|   169k|      if (melp->num_runs == 0)  //if no runs, decode more bit from MEL segment
  ------------------
  |  Branch (262:11): [True: 36.4k, False: 133k]
  ------------------
  263|  36.4k|        mel_decode(melp);
  264|       |
  265|   169k|      int t = melp->runs & 0x7F; //retrieve one run
  266|   169k|      melp->runs >>= 7;  // remove the retrieved run
  267|   169k|      melp->num_runs--;
  268|   169k|      return t; // return run
  269|   169k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10mel_decodeEPNS0_10dec_mel_stE:
  171|  36.4k|    {
  172|  36.4k|      static const int mel_exp[13] = { //MEL exponents
  173|  36.4k|        0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5
  174|  36.4k|      };
  175|       |
  176|  36.4k|      if (melp->bits < 6) // if there are less than 6 bits in tmp
  ------------------
  |  Branch (176:11): [True: 5.61k, False: 30.8k]
  ------------------
  177|  5.61k|        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|   287k|      while (melp->bits >= 6 && melp->num_runs < 8)
  ------------------
  |  Branch (182:14): [True: 278k, False: 8.82k]
  |  Branch (182:33): [True: 251k, False: 27.6k]
  ------------------
  183|   251k|      {
  184|   251k|        int eval = mel_exp[melp->k]; // number of bits associated with state
  185|   251k|        int run = 0;
  186|   251k|        if (melp->tmp & (1ull<<63)) //The next bit to decode (stored in MSB)
  ------------------
  |  Branch (186:13): [True: 97.8k, False: 153k]
  ------------------
  187|  97.8k|        { //one is found
  188|  97.8k|          run = 1 << eval;  
  189|  97.8k|          run--; // consecutive runs of 0 events - 1
  190|  97.8k|          melp->k = melp->k + 1 < 12 ? melp->k + 1 : 12;//increment, max is 12
  ------------------
  |  Branch (190:21): [True: 93.0k, False: 4.79k]
  ------------------
  191|  97.8k|          melp->tmp <<= 1; // consume one bit from tmp
  192|  97.8k|          melp->bits -= 1;
  193|  97.8k|          run = run << 1; // a stretch of zeros not terminating in one
  194|  97.8k|        }
  195|   153k|        else
  196|   153k|        { //0 is found
  197|   153k|          run = (int)(melp->tmp >> (63 - eval)) & ((1 << eval) - 1);
  198|   153k|          melp->k = melp->k - 1 > 0 ? melp->k - 1 : 0; //decrement, min is 0
  ------------------
  |  Branch (198:21): [True: 20.4k, False: 133k]
  ------------------
  199|   153k|          melp->tmp <<= eval + 1; //consume eval + 1 bits (max is 6)
  200|   153k|          melp->bits -= eval + 1;
  201|   153k|          run = (run << 1) + 1; // a stretch of zeros terminating with one
  202|   153k|        }
  203|   251k|        eval = melp->num_runs * 7;           // 7 bits per run
  204|   251k|        melp->runs &= ~((ui64)0x3F << eval); // 6 bits are sufficient
  205|   251k|        melp->runs |= ((ui64)run) << eval;   // store the value in runs
  206|   251k|        melp->num_runs++;                    // increment count  
  207|   251k|      }
  208|  36.4k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL8mel_readEPNS0_10dec_mel_stE:
   94|  5.61k|    {
   95|  5.61k|      if (melp->bits > 32)  //there are enough bits in the tmp variable
  ------------------
  |  Branch (95:11): [True: 0, False: 5.61k]
  ------------------
   96|      0|        return;             // return without reading new data
   97|       |
   98|  5.61k|      ui32 val = 0xFFFFFFFF;       // feed in 0xFF if buffer is exhausted
   99|  5.61k|      if (melp->size > 4) {        // if there is data in the MEL segment
  ------------------
  |  Branch (99:11): [True: 2.86k, False: 2.74k]
  ------------------
  100|  2.86k|        val = *(ui32*)melp->data;  // read 32 bits from MEL data
  101|  2.86k|        melp->data += 4;           // advance pointer
  102|  2.86k|        melp->size -= 4;           // reduce counter
  103|  2.86k|      }
  104|  2.74k|      else if (melp->size > 0)
  ------------------
  |  Branch (104:16): [True: 2.13k, False: 611]
  ------------------
  105|  2.13k|      { // 4 or less
  106|  2.13k|        int i = 0;
  107|  3.29k|        while (melp->size > 1) {   
  ------------------
  |  Branch (107:16): [True: 1.15k, False: 2.13k]
  ------------------
  108|  1.15k|          ui32 v = *melp->data++;    // read one byte at a time
  109|  1.15k|          ui32 m = ~(0xFFu << i);    // mask of location
  110|  1.15k|          val = (val & m) | (v << i);// put one byte in its correct location
  111|  1.15k|          --melp->size;
  112|  1.15k|          i += 8;
  113|  1.15k|        }
  114|       |        // size equal to 1
  115|  2.13k|        ui32 v = *melp->data++;    // the one before the last is different 
  116|  2.13k|        v |= 0xF;                  // MEL and VLC segments can overlap
  117|  2.13k|        ui32 m = ~(0xFFu << i);
  118|  2.13k|        val = (val & m) | (v << i);
  119|  2.13k|        --melp->size;
  120|  2.13k|      }
  121|       |      
  122|       |      // next we unstuff them before adding them to the buffer
  123|  5.61k|      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|  5.61k|      ui32 t = val & 0xFF; 
  130|  5.61k|      bool unstuff = ((val & 0xFF) == 0xFF); // true if we need unstuffing
  131|  5.61k|      bits -= unstuff; // there is one less bit in t if unstuffing is needed
  132|  5.61k|      t = t << (8 - unstuff); // move up to make room for the next byte
  133|       |
  134|       |      //this is a repeat of the above
  135|  5.61k|      t |= (val>>8) & 0xFF;
  136|  5.61k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  137|  5.61k|      bits -= unstuff;
  138|  5.61k|      t = t << (8 - unstuff);
  139|       |
  140|  5.61k|      t |= (val>>16) & 0xFF;
  141|  5.61k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  142|  5.61k|      bits -= unstuff;
  143|  5.61k|      t = t << (8 - unstuff);
  144|       |
  145|  5.61k|      t |= (val>>24) & 0xFF;
  146|  5.61k|      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|  5.61k|      melp->tmp |= ((ui64)t) << (64 - bits - melp->bits);
  151|  5.61k|      melp->bits += bits; //increment the number of bits in tmp
  152|  5.61k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL11rev_fetch64EPNS0_10rev_structE:
  372|   199k|    {
  373|   474k|      while (vlcp->bits <= 56)
  ------------------
  |  Branch (373:14): [True: 274k, False: 199k]
  ------------------
  374|   274k|        rev_read8(vlcp); // read 8 bits, but unstuffing might reduce this
  375|   199k|      return vlcp->tmp;  // return unstuff decoded bits
  376|   199k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL9rev_read8EPNS0_10rev_structE:
  306|   274k|    {
  307|       |      // process 1 bytes
  308|   274k|      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|   274k|      if (vlcp->size > 0)  // if there are more than 3 bytes left in VLC
  ------------------
  |  Branch (314:11): [True: 127k, False: 147k]
  ------------------
  315|   127k|      {
  316|   127k|        val = *vlcp->data; // then read 8 bits
  317|   127k|        --vlcp->data;      // increment data pointer
  318|   127k|        --vlcp->size;      // decrement number of bytes in the buffer
  319|   127k|      }
  320|       |
  321|       |      // accumulate in tmp, and increment bits, check if unstuffing is needed
  322|   274k|      ui8 t = (vlcp->unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0;
  ------------------
  |  Branch (322:16): [True: 32.3k, False: 242k]
  |  Branch (322:33): [True: 7.09k, False: 25.3k]
  ------------------
  323|   274k|      val = (ui8)(val & (0xFFU >> t)); // protect against erroneous 1 in MSB
  324|   274k|      vlcp->tmp |= (ui64)val << vlcp->bits;
  325|   274k|      vlcp->bits += 8 - t;
  326|   274k|      vlcp->unstuff = val > 0x8F;
  327|   274k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL13rev_advance64EPNS0_10rev_structEj:
  386|  1.19M|    {
  387|       |      assert(num_bits <= vlcp->bits); // vlcp->tmp must have more than num_bits
  388|  1.19M|      vlcp->tmp >>= num_bits;         // remove bits
  389|  1.19M|      vlcp->bits -= num_bits;         // decrement the number of bits
  390|  1.19M|      return vlcp->tmp;
  391|  1.19M|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL12frwd_advanceEPNS0_13frwd_struct64Ej:
  707|   270k|    {
  708|       |      assert(num_bits <= msp->bits);
  709|   270k|      msp->tmp >>= num_bits;  // consume num_bits
  710|   270k|      msp->bits -= num_bits;
  711|   270k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12rev_init_mrpEPNS0_10rev_structEPhii:
  470|  9.45k|    {
  471|  9.45k|      mrp->data = data + lcup + len2 - 1;
  472|  9.45k|      mrp->size = len2;
  473|  9.45k|      mrp->unstuff = true;
  474|  9.45k|      mrp->bits = 0;
  475|  9.45k|      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|  9.45k|      int num = 1 + (int)(intptr_t(mrp->data) & 0x3);
  482|  33.4k|      for (int i = 0; i < num; ++i) {
  ------------------
  |  Branch (482:23): [True: 23.9k, False: 9.45k]
  ------------------
  483|  23.9k|        ui64 d;
  484|       |        //read a byte, 0 if no more data
  485|  23.9k|        d = (mrp->size-- > 0) ? *mrp->data-- : 0; 
  ------------------
  |  Branch (485:13): [True: 22.8k, False: 1.13k]
  ------------------
  486|       |        //check if unstuffing is needed
  487|  23.9k|        ui32 d_bits = 8 - ((mrp->unstuff && ((d & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (487:29): [True: 14.0k, False: 9.89k]
  |  Branch (487:45): [True: 3.34k, False: 10.7k]
  ------------------
  488|  23.9k|        mrp->tmp |= d << mrp->bits; // move data to vlcp->tmp
  489|  23.9k|        mrp->bits += d_bits;
  490|  23.9k|        mrp->unstuff = d > 0x8F; // for next byte
  491|  23.9k|      }
  492|  9.45k|      rev_read_mrp(mrp);
  493|  9.45k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12rev_read_mrpEPNS0_10rev_structE:
  406|  13.8k|    {
  407|       |      //process 4 bytes at a time
  408|  13.8k|      if (mrp->bits > 32)
  ------------------
  |  Branch (408:11): [True: 0, False: 13.8k]
  ------------------
  409|      0|        return;
  410|  13.8k|      ui32 val = 0;
  411|  13.8k|      if (mrp->size > 3) // If there are 3 byte or more
  ------------------
  |  Branch (411:11): [True: 10.3k, False: 3.46k]
  ------------------
  412|  10.3k|      { // (mrp->data - 3) move pointer back to read 32 bits at once
  413|  10.3k|        val = *(ui32*)(mrp->data - 3); // read 32 bits
  414|  10.3k|        mrp->data -= 4;                // move back pointer
  415|  10.3k|        mrp->size -= 4;                // reduce count
  416|  10.3k|      }
  417|  3.46k|      else if (mrp->size > 0)
  ------------------
  |  Branch (417:16): [True: 1.59k, False: 1.86k]
  ------------------
  418|  1.59k|      {
  419|  1.59k|        int i = 24;
  420|  5.07k|        while (mrp->size > 0) {   
  ------------------
  |  Branch (420:16): [True: 3.48k, False: 1.59k]
  ------------------
  421|  3.48k|          ui32 v = *mrp->data--; // read one byte at a time
  422|  3.48k|          val |= (v << i);       // put byte in its correct location
  423|  3.48k|          --mrp->size;
  424|  3.48k|          i -= 8;
  425|  3.48k|        }
  426|  1.59k|      }
  427|       |
  428|       |      //accumulate in tmp, and keep count in bits
  429|  13.8k|      ui32 bits, tmp = val >> 24;
  430|       |
  431|       |      //test if the last byte > 0x8F (unstuff must be true) and this is 0x7F
  432|  13.8k|      bits = 8 - ((mrp->unstuff && (((val >> 24) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (432:20): [True: 6.06k, False: 7.74k]
  |  Branch (432:36): [True: 3.39k, False: 2.67k]
  ------------------
  433|  13.8k|      bool unstuff = (val >> 24) > 0x8F;
  434|       |
  435|       |      //process the next byte
  436|  13.8k|      tmp |= ((val >> 16) & 0xFF) << bits;
  437|  13.8k|      bits += 8 - ((unstuff && (((val >> 16) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (437:21): [True: 6.08k, False: 7.73k]
  |  Branch (437:32): [True: 3.66k, False: 2.42k]
  ------------------
  438|  13.8k|      unstuff = ((val >> 16) & 0xFF) > 0x8F;
  439|       |
  440|  13.8k|      tmp |= ((val >> 8) & 0xFF) << bits;
  441|  13.8k|      bits += 8 - ((unstuff && (((val >> 8) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (441:21): [True: 6.18k, False: 7.62k]
  |  Branch (441:32): [True: 2.91k, False: 3.27k]
  ------------------
  442|  13.8k|      unstuff = ((val >> 8) & 0xFF) > 0x8F;
  443|       |
  444|  13.8k|      tmp |= (val & 0xFF) << bits;
  445|  13.8k|      bits += 8 - ((unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (445:21): [True: 4.69k, False: 9.12k]
  |  Branch (445:32): [True: 2.51k, False: 2.17k]
  ------------------
  446|  13.8k|      unstuff = (val & 0xFF) > 0x8F;
  447|       |
  448|  13.8k|      mrp->tmp |= (ui64)tmp << mrp->bits; // move data to mrp pointer
  449|  13.8k|      mrp->bits += bits;
  450|  13.8k|      mrp->unstuff = unstuff;             // next byte
  451|  13.8k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL13rev_fetch_mrpEPNS0_10rev_structE:
  504|  38.3k|    {
  505|  38.3k|      if (mrp->bits < 32) // if there are less than 32 bits in mrp->tmp
  ------------------
  |  Branch (505:11): [True: 4.08k, False: 34.2k]
  ------------------
  506|  4.08k|      {
  507|  4.08k|        rev_read_mrp(mrp);    // read 30-32 bits from mrp
  508|  4.08k|        if (mrp->bits < 32)   // if there is a space of 32 bits
  ------------------
  |  Branch (508:13): [True: 269, False: 3.81k]
  ------------------
  509|    269|          rev_read_mrp(mrp);  // read more
  510|  4.08k|      }
  511|  38.3k|      return (ui32)mrp->tmp;  // return the head of mrp->tmp
  512|  38.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL15rev_advance_mrpEPNS0_10rev_structEj:
  522|  38.3k|    {
  523|       |      assert(num_bits <= mrp->bits); // we must not consume more than mrp->bits
  524|  38.3k|      mrp->tmp >>= num_bits;  // discard the lowest num_bits bits
  525|  38.3k|      mrp->bits -= num_bits;
  526|  38.3k|      return (ui32)mrp->tmp;  // return data after consumption
  527|  38.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_init8ILh255EEEvPNS0_13frwd_struct64EPKhi:
  690|  20.3k|    {
  691|  20.3k|      msp->data = data;
  692|  20.3k|      msp->tmp = 0;
  693|  20.3k|      msp->bits = 0;
  694|  20.3k|      msp->unstuff = 0;
  695|  20.3k|      msp->size = size;
  696|  20.3k|      frwd_read8<X>(msp); // read 8 bits
  697|  20.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_read8ILh255EEEvPNS0_13frwd_struct64E:
  626|   203k|    {
  627|   203k|      ui8 val = X;
  628|   203k|      if (msp->size > 0) {
  ------------------
  |  Branch (628:11): [True: 154k, False: 49.8k]
  ------------------
  629|   154k|        val = *msp->data;  // read 8 bits
  630|   154k|        ++msp->data;      // increment pointer
  631|   154k|        --msp->size;      // reduce size
  632|   154k|      }
  633|       |
  634|       |      // unstuff and accumulate
  635|   203k|      ui8 t = msp->unstuff ? 1 : 0;
  ------------------
  |  Branch (635:15): [True: 40.1k, False: 163k]
  ------------------
  636|   203k|      val = (ui8)(val & (0xFFU >> t));
  637|   203k|      msp->unstuff = (val == 0xFF);
  638|   203k|      msp->tmp |= ((ui64)val) << msp->bits;  // move data to msp->tmp
  639|   203k|      msp->bits += 8 - t;
  640|   203k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12frwd_fetch64ILh255EEEmPNS0_13frwd_struct64E:
  743|   215k|    {
  744|   399k|      while (msp->bits <= 56)
  ------------------
  |  Branch (744:14): [True: 183k, False: 215k]
  ------------------
  745|   183k|        frwd_read8<X>(msp);
  746|   215k|      return msp->tmp;
  747|   215k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL9frwd_initILi0EEEvPNS0_13frwd_struct64EPKhi:
  654|  12.4k|    {
  655|  12.4k|      msp->data = data;
  656|  12.4k|      msp->tmp = 0;
  657|  12.4k|      msp->bits = 0;
  658|  12.4k|      msp->unstuff = 0;
  659|  12.4k|      msp->size = size;
  660|       |
  661|       |      //This code is designed for an architecture that read address should
  662|       |      // align to the read size (address multiple of 4 if read size is 4)
  663|       |      //These few lines take care of the case where data is not at a multiple
  664|       |      // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the bitstream
  665|  12.4k|      int num = 4 - (int)(intptr_t(msp->data) & 0x3);
  666|  42.4k|      for (int i = 0; i < num; ++i)
  ------------------
  |  Branch (666:23): [True: 29.9k, False: 12.4k]
  ------------------
  667|  29.9k|      {
  668|  29.9k|        ui64 d;
  669|       |        //read a byte if the buffer is not exhausted, otherwise set it to X
  670|  29.9k|        d = msp->size-- > 0 ? *msp->data++ : X;
  ------------------
  |  Branch (670:13): [True: 28.3k, False: 1.67k]
  ------------------
  671|  29.9k|        msp->tmp |= (d << msp->bits);      // store data in msp->tmp
  672|  29.9k|        msp->bits += 8 - msp->unstuff;     // number of bits added to msp->tmp
  673|  29.9k|        msp->unstuff = ((d & 0xFF) == 0xFF); // unstuffing for next byte
  674|  29.9k|      }
  675|  12.4k|      frwd_read<X>(msp); // read 32 bits more
  676|  12.4k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL9frwd_readILi0EEEvPNS0_13frwd_struct64E:
  562|  26.7k|    {
  563|  26.7k|      assert(msp->bits <= 32); // assert that there is a space for 32 bits
  564|       |
  565|  26.7k|      ui32 val = 0;
  566|  26.7k|      if (msp->size > 3) {
  ------------------
  |  Branch (566:11): [True: 14.9k, False: 11.8k]
  ------------------
  567|  14.9k|        val = *(ui32*)msp->data;  // read 32 bits
  568|  14.9k|        msp->data += 4;           // increment pointer
  569|  14.9k|        msp->size -= 4;           // reduce size
  570|  14.9k|      }
  571|  11.8k|      else if (msp->size > 0)
  ------------------
  |  Branch (571:16): [True: 5.01k, False: 6.81k]
  ------------------
  572|  5.01k|      {
  573|  5.01k|        int i = 0;
  574|  5.01k|        val = X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (574:15): [Folded, False: 5.01k]
  ------------------
  575|  14.4k|        while (msp->size > 0) {   
  ------------------
  |  Branch (575:16): [True: 9.41k, False: 5.01k]
  ------------------
  576|  9.41k|          ui32 v = *msp->data++;    // read one byte at a time
  577|  9.41k|          ui32 m = ~(0xFFu << i);    // mask of location
  578|  9.41k|          val = (val & m) | (v << i);// put one byte in its correct location
  579|  9.41k|          --msp->size;
  580|  9.41k|          i += 8;          
  581|  9.41k|        }
  582|  5.01k|      }
  583|  6.81k|      else
  584|  6.81k|        val = X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (584:15): [Folded, False: 6.81k]
  ------------------
  585|       |
  586|       |      // we accumulate in t and keep a count of the number of bits in bits
  587|  26.7k|      ui32 bits = 8 - msp->unstuff;        
  588|  26.7k|      ui32 t = val & 0xFF;
  589|  26.7k|      bool unstuff = ((val & 0xFF) == 0xFF);  // Do we need unstuffing next?
  590|       |
  591|  26.7k|      t |= ((val >> 8) & 0xFF) << bits;
  592|  26.7k|      bits += 8 - unstuff;
  593|  26.7k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  594|       |
  595|  26.7k|      t |= ((val >> 16) & 0xFF) << bits;
  596|  26.7k|      bits += 8 - unstuff;
  597|  26.7k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  598|       |
  599|  26.7k|      t |= ((val >> 24) & 0xFF) << bits;
  600|  26.7k|      bits += 8 - unstuff;
  601|  26.7k|      msp->unstuff = (((val >> 24) & 0xFF) == 0xFF); // for next byte
  602|       |
  603|  26.7k|      msp->tmp |= ((ui64)t) << msp->bits;  // move data to msp->tmp
  604|  26.7k|      msp->bits += bits;
  605|  26.7k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_fetchILi0EEEjPNS0_13frwd_struct64E:
  723|  54.1k|    {
  724|  54.1k|      if (msp->bits < 32)
  ------------------
  |  Branch (724:11): [True: 13.9k, False: 40.1k]
  ------------------
  725|  13.9k|      {
  726|  13.9k|        frwd_read<X>(msp);
  727|  13.9k|        if (msp->bits < 32) //need to test
  ------------------
  |  Branch (727:13): [True: 392, False: 13.5k]
  ------------------
  728|    392|          frwd_read<X>(msp);
  729|  13.9k|      }
  730|  54.1k|      return (ui32)msp->tmp;
  731|  54.1k|    }

_ZN4ojph5local26ojph_decode_codeblock_avx2EPhPjjjjjjjjb:
 1073|  40.9k|    {
 1074|  40.9k|      static bool insufficient_precision = false;
 1075|  40.9k|      static bool modify_code = false;
 1076|  40.9k|      static bool truncate_spp_mrp = false;
 1077|       |
 1078|  40.9k|      if (num_passes > 1 && lengths2 == 0)
  ------------------
  |  Branch (1078:11): [True: 32.2k, False: 8.68k]
  |  Branch (1078:29): [True: 7.86k, False: 24.4k]
  ------------------
 1079|  7.86k|      {
 1080|  7.86k|        OJPH_WARN(0x00010001, "A malformed codeblock that has more than "
  ------------------
  |  |  287|  7.86k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  7.86k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7.86k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1081|  7.86k|                              "one coding pass, but zero length for "
 1082|  7.86k|                              "2nd and potential 3rd pass.");
 1083|  7.86k|        num_passes = 1;
 1084|  7.86k|      }
 1085|       |
 1086|  40.9k|      if (num_passes > 3)
  ------------------
  |  Branch (1086:11): [True: 0, False: 40.9k]
  ------------------
 1087|      0|      {
 1088|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1089|      0|                              "This codeblocks has %d passes.",
 1090|      0|                              num_passes);
 1091|      0|        return false;
 1092|      0|      }
 1093|       |
 1094|  40.9k|      if (missing_msbs > 30) // p < 0
  ------------------
  |  Branch (1094:11): [True: 842, False: 40.1k]
  ------------------
 1095|    842|      {
 1096|    842|        if (insufficient_precision == false)
  ------------------
  |  Branch (1096:13): [True: 1, False: 841]
  ------------------
 1097|      1|        {
 1098|      1|          insufficient_precision = true;
 1099|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1100|      1|                                "codeblock. This message will not be "
 1101|      1|                                "displayed again.");
 1102|      1|        }
 1103|    842|        return false;
 1104|    842|      }
 1105|  40.1k|      else if (missing_msbs == 30) // p == 0
  ------------------
  |  Branch (1105:16): [True: 207, False: 39.9k]
  ------------------
 1106|    207|      { // not enough precision to decode and set the bin center to 1
 1107|    207|        if (modify_code == false) {
  ------------------
  |  Branch (1107:13): [True: 1, False: 206]
  ------------------
 1108|      1|          modify_code = true;
 1109|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1110|      1|                                "pass. The code can be modified to support "
 1111|      1|                                "this case. This message will not be "
 1112|      1|                                "displayed again.");
 1113|      1|        }
 1114|    207|         return false;         // 32 bits are not enough to decode this
 1115|    207|       }
 1116|  39.9k|      else if (missing_msbs == 29) // if p is 1, then num_passes must be 1
  ------------------
  |  Branch (1116:16): [True: 352, False: 39.5k]
  ------------------
 1117|    352|      {
 1118|    352|        if (num_passes > 1) {
  ------------------
  |  Branch (1118:13): [True: 263, False: 89]
  ------------------
 1119|    263|          num_passes = 1;
 1120|    263|          if (truncate_spp_mrp == false) {
  ------------------
  |  Branch (1120:15): [True: 1, False: 262]
  ------------------
 1121|      1|            truncate_spp_mrp = true;
 1122|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1123|      1|                                  "nor MagRef passes; both will be skipped. "
 1124|      1|                                  "This message will not be displayed "
 1125|      1|                                  "again.");
 1126|      1|          }
 1127|    263|        }
 1128|    352|      }
 1129|  39.9k|      ui32 p = 30 - missing_msbs; // The least significant bitplane for CUP
 1130|       |      // There is a way to handle the case of p == 0, but a different path
 1131|       |      // is required
 1132|       |
 1133|  39.9k|      if (lengths1 < 2)
  ------------------
  |  Branch (1133:11): [True: 0, False: 39.9k]
  ------------------
 1134|      0|      {
 1135|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1136|      0|        return false;
 1137|      0|      }
 1138|       |
 1139|       |      // read scup and fix the bytes there
 1140|  39.9k|      int lcup, scup;
 1141|  39.9k|      lcup = (int)lengths1;  // length of CUP
 1142|       |      //scup is the length of MEL + VLC
 1143|  39.9k|      scup = (((int)coded_data[lcup-1]) << 4) + (coded_data[lcup-2] & 0xF);
 1144|  39.9k|      if (scup < 2 || scup > lcup || scup > 4079) //something is wrong
  ------------------
  |  Branch (1144:11): [True: 5.45k, False: 34.4k]
  |  Branch (1144:23): [True: 15.1k, False: 19.3k]
  |  Branch (1144:38): [True: 95, False: 19.2k]
  ------------------
 1145|  20.6k|        return false;
 1146|       |
 1147|       |      // The temporary storage scratch holds two types of data in an
 1148|       |      // interleaved fashion. The interleaving allows us to use one
 1149|       |      // memory pointer.
 1150|       |      // We have one entry for a decoded VLC code, and one entry for UVLC.
 1151|       |      // Entries are 16 bits each, corresponding to one quad,
 1152|       |      // but since we want to use XMM registers of the SSE family
 1153|       |      // of SIMD; we allocated 16 bytes or more per quad row; that is,
 1154|       |      // the width is no smaller than 16 bytes (or 8 entries), and the
 1155|       |      // height is 512 quads
 1156|       |      // Each VLC entry contains, in the following order, starting
 1157|       |      // from MSB
 1158|       |      // e_k (4bits), e_1 (4bits), rho (4bits), useless for step 2 (4bits)
 1159|       |      // Each entry in UVLC contains u_q
 1160|       |      // One extra row to handle the case of SPP propagating downwards
 1161|       |      // when codeblock width is 4
 1162|  19.2k|      ui16 scratch[8 * 513] = {0};          // 8+ kB
 1163|       |
 1164|       |      // We need an extra two entries (one inf and one u_q) beyond
 1165|       |      // the last column.
 1166|       |      // If the block width is 4 (2 quads), then we use sstr of 8
 1167|       |      // (enough for 4 quads). If width is 8 (4 quads) we use
 1168|       |      // sstr is 16 (enough for 8 quads). For a width of 16 (8
 1169|       |      // quads), we use 24 (enough for 12 quads).
 1170|  19.2k|      ui32 sstr = ((width + 2u) + 7u) & ~7u; // multiples of 8
 1171|       |
 1172|  19.2k|      assert((stride & 0x3) == 0);
 1173|       |
 1174|  19.2k|      ui32 mmsbp2 = missing_msbs + 2;
 1175|       |
 1176|       |      // The cleanup pass is decoded in two steps; in step one,
 1177|       |      // the VLC and MEL segments are decoded, generating a record that
 1178|       |      // has 2 bytes per quad. The 2 bytes contain, u, rho, e^1 & e^k.
 1179|       |      // This information should be sufficient for the next step.
 1180|       |      // In step 2, we decode the MagSgn segment.
 1181|       |
 1182|       |      // step 1 decoding VLC and MEL segments
 1183|  19.2k|      {
 1184|       |        // init structures
 1185|  19.2k|        dec_mel_st mel;
 1186|  19.2k|        mel_init(&mel, coded_data, lcup, scup);
 1187|  19.2k|        rev_struct vlc;
 1188|  19.2k|        rev_init(&vlc, coded_data, lcup, scup);
 1189|       |
 1190|  19.2k|        int run = mel_get_run(&mel); // decode runs of events from MEL bitstrm
 1191|       |                                     // data represented as runs of 0 events
 1192|       |                                     // See mel_decode description
 1193|       |
 1194|  19.2k|        ui32 vlc_val;
 1195|  19.2k|        ui32 c_q = 0;
 1196|  19.2k|        ui16 *sp = scratch;
 1197|       |        //initial quad row
 1198|  93.8k|        for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1198:26): [True: 74.5k, False: 19.2k]
  ------------------
 1199|  74.5k|        {
 1200|       |          // decode VLC
 1201|       |          /////////////
 1202|       |
 1203|       |          // first quad
 1204|  74.5k|          vlc_val = rev_fetch(&vlc);
 1205|       |
 1206|       |          //decode VLC using the context c_q and the head of VLC bitstream
 1207|  74.5k|          ui16 t0 = vlc_tbl0[ c_q + (vlc_val & 0x7F) ];
 1208|       |
 1209|       |          // if context is zero, use one MEL event
 1210|  74.5k|          if (c_q == 0) //zero context
  ------------------
  |  Branch (1210:15): [True: 47.5k, False: 27.0k]
  ------------------
 1211|  47.5k|          {
 1212|  47.5k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1213|       |
 1214|       |            // Is the run terminated in 1? if so, use decoded VLC code,
 1215|       |            // otherwise, discard decoded data, since we will decoded again
 1216|       |            // using a different context
 1217|  47.5k|            t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1217:18): [True: 29.6k, False: 17.8k]
  ------------------
 1218|       |
 1219|       |            // is run -1 or -2? this means a run has been consumed
 1220|  47.5k|            if (run < 0)
  ------------------
  |  Branch (1220:17): [True: 44.8k, False: 2.72k]
  ------------------
 1221|  44.8k|              run = mel_get_run(&mel);  // get another run
 1222|  47.5k|          }
 1223|       |          //run -= (c_q == 0) ? 2 : 0;
 1224|       |          //t0 = (c_q != 0 || run == -1) ? t0 : 0;
 1225|       |          //if (run < 0)
 1226|       |          //  run = mel_get_run(&mel);  // get another run
 1227|  74.5k|          sp[0] = t0;
 1228|  74.5k|          x += 2;
 1229|       |
 1230|       |          // prepare context for the next quad; eqn. 1 in ITU T.814
 1231|  74.5k|          c_q = ((t0 & 0x10U) << 3) | ((t0 & 0xE0U) << 2);
 1232|       |
 1233|       |          //remove data from vlc stream (0 bits are removed if vlc is not used)
 1234|  74.5k|          vlc_val = rev_advance(&vlc, t0 & 0x7);
 1235|       |
 1236|       |          //second quad
 1237|  74.5k|          ui16 t1 = 0;
 1238|       |
 1239|       |          //decode VLC using the context c_q and the head of VLC bitstream
 1240|  74.5k|          t1 = vlc_tbl0[c_q + (vlc_val & 0x7F)];
 1241|       |
 1242|       |          // if context is zero, use one MEL event
 1243|  74.5k|          if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1243:15): [True: 24.3k, False: 50.2k]
  |  Branch (1243:27): [True: 20.0k, False: 4.32k]
  ------------------
 1244|  20.0k|          {
 1245|  20.0k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1246|       |
 1247|       |            // if event is 0, discard decoded t1
 1248|  20.0k|            t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1248:18): [True: 7.28k, False: 12.7k]
  ------------------
 1249|       |
 1250|  20.0k|            if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1250:17): [True: 12.6k, False: 7.41k]
  ------------------
 1251|  12.6k|              run = mel_get_run(&mel); // if yes, then get another run
 1252|  20.0k|          }
 1253|  74.5k|          t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1253:16): [True: 63.1k, False: 11.4k]
  ------------------
 1254|       |          //run -= (c_q == 0 && x < width) ? 2 : 0;
 1255|       |          //t1 = (c_q != 0 || run == -1) ? t1 : 0;
 1256|       |          //if (run < 0)
 1257|       |          //  run = mel_get_run(&mel);  // get another run
 1258|  74.5k|          sp[2] = t1;
 1259|  74.5k|          x += 2;
 1260|       |
 1261|       |          //prepare context for the next quad, eqn. 1 in ITU T.814
 1262|  74.5k|          c_q = ((t1 & 0x10U) << 3) | ((t1 & 0xE0U) << 2);
 1263|       |
 1264|       |          //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1265|  74.5k|          vlc_val = rev_advance(&vlc, t1 & 0x7);
 1266|       |
 1267|       |          // decode u
 1268|       |          /////////////
 1269|       |          // uvlc_mode is made up of u_offset bits from the quad pair
 1270|  74.5k|          ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1271|  74.5k|          if (uvlc_mode == 0xc0)// if both u_offset are set, get an event from
  ------------------
  |  Branch (1271:15): [True: 16.1k, False: 58.4k]
  ------------------
 1272|  16.1k|          {                     // the MEL run of events
 1273|  16.1k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1274|       |
 1275|  16.1k|            uvlc_mode += (run == -1) ? 0x40 : 0; // increment uvlc_mode by
  ------------------
  |  Branch (1275:26): [True: 9.49k, False: 6.66k]
  ------------------
 1276|       |                                                 // is 0x40
 1277|       |
 1278|  16.1k|            if (run < 0)//if run is consumed (run is -1 or -2), get another run
  ------------------
  |  Branch (1278:17): [True: 14.4k, False: 1.69k]
  ------------------
 1279|  14.4k|              run = mel_get_run(&mel);
 1280|  16.1k|          }
 1281|       |          //run -= (uvlc_mode == 0xc0) ? 2 : 0;
 1282|       |          //uvlc_mode += (uvlc_mode == 0xc0 && run == -1) ? 0x40 : 0;
 1283|       |          //if (run < 0)
 1284|       |          //  run = mel_get_run(&mel);  // get another run
 1285|       |
 1286|       |          //decode uvlc_mode to get u for both quads
 1287|  74.5k|          ui32 uvlc_entry = uvlc_tbl0[uvlc_mode + (vlc_val & 0x3F)];
 1288|       |          //remove total prefix length
 1289|  74.5k|          vlc_val = rev_advance(&vlc, uvlc_entry & 0x7);
 1290|  74.5k|          uvlc_entry >>= 3;
 1291|       |          //extract suffixes for quad 0 and 1
 1292|  74.5k|          ui32 len = uvlc_entry & 0xF;           //suffix length for 2 quads
 1293|  74.5k|          ui32 tmp = vlc_val & ((1 << len) - 1); //suffix value for 2 quads
 1294|  74.5k|          vlc_val = rev_advance(&vlc, len);
 1295|  74.5k|          ojph_unused(vlc_val); //static code analysis: unused value
  ------------------
  |  |   78|  74.5k|#define ojph_unused(x) (void)(x)
  ------------------
 1296|  74.5k|          uvlc_entry >>= 4;
 1297|       |          // quad 0 length
 1298|  74.5k|          len = uvlc_entry & 0x7; // quad 0 suffix length
 1299|  74.5k|          uvlc_entry >>= 3;
 1300|  74.5k|          ui16 u_q = (ui16)(1 + (uvlc_entry&7) + (tmp&~(0xFFU<<len))); //kap. 1
 1301|  74.5k|          sp[1] = u_q;
 1302|  74.5k|          u_q = (ui16)(1 + (uvlc_entry >> 3) + (tmp >> len));  //kappa == 1
 1303|  74.5k|          sp[3] = u_q;
 1304|  74.5k|        }
 1305|  19.2k|        sp[0] = sp[1] = 0;
 1306|       |
 1307|       |        //non initial quad rows
 1308|  55.3k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1308:26): [True: 36.1k, False: 19.2k]
  ------------------
 1309|  36.1k|        {
 1310|  36.1k|          c_q = 0;                                // context
 1311|  36.1k|          ui16 *sp = scratch + (y >> 1) * sstr;   // this row of quads
 1312|       |
 1313|   141k|          for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1313:28): [True: 105k, False: 36.1k]
  ------------------
 1314|   105k|          {
 1315|       |            // decode VLC
 1316|       |            /////////////
 1317|       |
 1318|       |            // sigma_q (n, ne, nf)
 1319|   105k|            c_q |= ((sp[0 - (si32)sstr] & 0xA0U) << 2);
 1320|   105k|            c_q |= ((sp[2 - (si32)sstr] & 0x20U) << 4);
 1321|       |
 1322|       |            // first quad
 1323|   105k|            vlc_val = rev_fetch(&vlc);
 1324|       |
 1325|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1326|   105k|            ui16 t0 = vlc_tbl1[ c_q + (vlc_val & 0x7F) ];
 1327|       |
 1328|       |            // if context is zero, use one MEL event
 1329|   105k|            if (c_q == 0) //zero context
  ------------------
  |  Branch (1329:17): [True: 69.9k, False: 35.3k]
  ------------------
 1330|  69.9k|            {
 1331|  69.9k|              run -= 2; //subtract 2, since events number is multiplied by 2
 1332|       |
 1333|       |              // Is the run terminated in 1? if so, use decoded VLC code,
 1334|       |              // otherwise, discard decoded data, since we will decoded again
 1335|       |              // using a different context
 1336|  69.9k|              t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1336:20): [True: 21.4k, False: 48.4k]
  ------------------
 1337|       |
 1338|       |              // is run -1 or -2? this means a run has been consumed
 1339|  69.9k|              if (run < 0)
  ------------------
  |  Branch (1339:19): [True: 32.3k, False: 37.5k]
  ------------------
 1340|  32.3k|                run = mel_get_run(&mel);  // get another run
 1341|  69.9k|            }
 1342|       |            //run -= (c_q == 0) ? 2 : 0;
 1343|       |            //t0 = (c_q != 0 || run == -1) ? t0 : 0;
 1344|       |            //if (run < 0)
 1345|       |            //  run = mel_get_run(&mel);  // get another run
 1346|   105k|            sp[0] = t0;
 1347|   105k|            x += 2;
 1348|       |
 1349|       |            // prepare context for the next quad; eqn. 2 in ITU T.814
 1350|       |            // sigma_q (w, sw)
 1351|   105k|            c_q = ((t0 & 0x40U) << 2) | ((t0 & 0x80U) << 1);
 1352|       |            // sigma_q (nw)
 1353|   105k|            c_q |= sp[0 - (si32)sstr] & 0x80;
 1354|       |            // sigma_q (n, ne, nf)
 1355|   105k|            c_q |= ((sp[2 - (si32)sstr] & 0xA0U) << 2);
 1356|   105k|            c_q |= ((sp[4 - (si32)sstr] & 0x20U) << 4);
 1357|       |
 1358|       |            //remove data from vlc stream (0 bits are removed if vlc is unused)
 1359|   105k|            vlc_val = rev_advance(&vlc, t0 & 0x7);
 1360|       |
 1361|       |            //second quad
 1362|   105k|            ui16 t1 = 0;
 1363|       |
 1364|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1365|   105k|            t1 = vlc_tbl1[ c_q + (vlc_val & 0x7F)];
 1366|       |
 1367|       |            // if context is zero, use one MEL event
 1368|   105k|            if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1368:17): [True: 69.4k, False: 35.7k]
  |  Branch (1368:29): [True: 55.5k, False: 13.9k]
  ------------------
 1369|  55.5k|            {
 1370|  55.5k|              run -= 2; //subtract 2, since events number if multiplied by 2
 1371|       |
 1372|       |              // if event is 0, discard decoded t1
 1373|  55.5k|              t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1373:20): [True: 13.0k, False: 42.5k]
  ------------------
 1374|       |
 1375|  55.5k|              if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1375:19): [True: 21.2k, False: 34.2k]
  ------------------
 1376|  21.2k|                run = mel_get_run(&mel); // if yes, then get another run
 1377|  55.5k|            }
 1378|   105k|            t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1378:18): [True: 86.2k, False: 19.0k]
  ------------------
 1379|       |            //run -= (c_q == 0 && x < width) ? 2 : 0;
 1380|       |            //t1 = (c_q != 0 || run == -1) ? t1 : 0;
 1381|       |            //if (run < 0)
 1382|       |            //  run = mel_get_run(&mel);  // get another run
 1383|   105k|            sp[2] = t1;
 1384|   105k|            x += 2;
 1385|       |
 1386|       |            // partial c_q, will be completed when we process the next quad
 1387|       |            // sigma_q (w, sw)
 1388|   105k|            c_q = ((t1 & 0x40U) << 2) | ((t1 & 0x80U) << 1);
 1389|       |            // sigma_q (nw)
 1390|   105k|            c_q |= sp[2 - (si32)sstr] & 0x80;
 1391|       |
 1392|       |            //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1393|   105k|            vlc_val = rev_advance(&vlc, t1 & 0x7);
 1394|       |
 1395|       |            // decode u
 1396|       |            /////////////
 1397|       |            // uvlc_mode is made up of u_offset bits from the quad pair
 1398|   105k|            ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1399|   105k|            ui32 uvlc_entry = uvlc_tbl1[uvlc_mode + (vlc_val & 0x3F)];
 1400|       |            //remove total prefix length
 1401|   105k|            vlc_val = rev_advance(&vlc, uvlc_entry & 0x7);
 1402|   105k|            uvlc_entry >>= 3;
 1403|       |            //extract suffixes for quad 0 and 1
 1404|   105k|            ui32 len = uvlc_entry & 0xF;           //suffix length for 2 quads
 1405|   105k|            ui32 tmp = vlc_val & ((1 << len) - 1); //suffix value for 2 quads
 1406|   105k|            vlc_val = rev_advance(&vlc, len);
 1407|   105k|            ojph_unused(vlc_val); //static code analysis: unused value
  ------------------
  |  |   78|   105k|#define ojph_unused(x) (void)(x)
  ------------------
 1408|   105k|            uvlc_entry >>= 4;
 1409|       |            // quad 0 length
 1410|   105k|            len = uvlc_entry & 0x7; // quad 0 suffix length
 1411|   105k|            uvlc_entry >>= 3;
 1412|   105k|            ui16 u_q = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
 1413|   105k|            sp[1] = u_q;
 1414|   105k|            u_q = (ui16)((uvlc_entry >> 3) + (tmp >> len)); // u_q
 1415|   105k|            sp[3] = u_q;
 1416|   105k|          }
 1417|  36.1k|          sp[0] = sp[1] = 0;
 1418|  36.1k|        }
 1419|  19.2k|      }
 1420|       |
 1421|       |      // step2 we decode magsgn
 1422|       |      // mmsbp2 equals K_max + 1 (we decode up to K_max bits + 1 sign bit)
 1423|       |      // The 32 bit path decode 16 bits data, for which one would think
 1424|       |      // 16 bits are enough, because we want to put in the center of the
 1425|       |      // bin.
 1426|       |      // If you have mmsbp2 equals 16 bit, and reversible coding, and
 1427|       |      // no bitplanes are missing, then we can decoding using the 16 bit
 1428|       |      // path, but we are not doing this here.
 1429|  19.2k|      if (mmsbp2 >= 16)
  ------------------
  |  Branch (1429:11): [True: 1.95k, False: 17.2k]
  ------------------
 1430|  1.95k|      {
 1431|       |        // We allocate a scratch row for storing v_n values.
 1432|       |        // We have 512 quads horizontally.
 1433|       |        // We may go beyond the last entry by up to 4 entries.
 1434|       |        // Here we allocate additional 8 entries.
 1435|       |        // There are two rows in this structure, the bottom
 1436|       |        // row is used to store processed entries.
 1437|  1.95k|        const int v_n_size = 512 + 16;
 1438|  1.95k|        ui32 v_n_scratch[2 * v_n_size] = {0}; // 4+ kB
 1439|       |
 1440|  1.95k|        frwd_struct_avx2 magsgn;
 1441|  1.95k|        frwd_init<0xFF>(&magsgn, coded_data, lcup - scup);
 1442|       |
 1443|  1.95k|        const __m256i avx_mmsbp2 = _mm256_set1_epi32((int)mmsbp2);
 1444|       |
 1445|  1.95k|        {
 1446|  1.95k|          ui16 *sp = scratch;
 1447|  1.95k|          ui32 *vp = v_n_scratch;
 1448|  1.95k|          ui32 *dp = decoded_data;
 1449|  1.95k|          vp[0] = 2; // for easy calculation of emax
 1450|       |
 1451|  11.2k|          for (ui32 x = 0; x < width; x += 4, sp += 4, vp += 2, dp += 4)
  ------------------
  |  Branch (1451:28): [True: 9.43k, False: 1.80k]
  ------------------
 1452|  9.43k|          {
 1453|  9.43k|            __m128i vn = _mm_set1_epi32(2);
 1454|       |
 1455|  9.43k|            __m256i inf_u_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)sp));
 1456|  9.43k|            inf_u_q = _mm256_permutevar8x32_epi32(inf_u_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1457|       |
 1458|  9.43k|            __m256i U_q = _mm256_srli_epi32(inf_u_q, 16);
 1459|  9.43k|            __m256i w = _mm256_cmpgt_epi32(U_q, avx_mmsbp2);
 1460|  9.43k|            if (!_mm256_testz_si256(w, w)) {
  ------------------
  |  Branch (1460:17): [True: 155, False: 9.27k]
  ------------------
 1461|    155|                return false;
 1462|    155|            }
 1463|       |
 1464|  9.27k|            __m256i row = decode_two_quad32_avx2(inf_u_q, U_q, &magsgn, p, vn);
 1465|  9.27k|            row = _mm256_permutevar8x32_epi32(row, _mm256_setr_epi32(0, 2, 4, 6, 1, 3, 5, 7));
 1466|  9.27k|            _mm_store_si128((__m128i*)dp, _mm256_castsi256_si128(row));
 1467|  9.27k|            _mm_store_si128((__m128i*)(dp + stride), _mm256_extracti128_si256(row, 0x1));
 1468|       |
 1469|  9.27k|            __m128i w0 = _mm_cvtsi32_si128(*(int const*)vp);
 1470|  9.27k|            w0 = _mm_or_si128(w0, vn);
 1471|  9.27k|            _mm_storeu_si128((__m128i*)vp, w0);
 1472|  9.27k|          }
 1473|  1.95k|        }
 1474|       |
 1475|  7.28k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1475:26): [True: 5.61k, False: 1.67k]
  ------------------
 1476|  5.61k|        {
 1477|  5.61k|          {
 1478|       |            // perform 31 - count_leading_zeros(*vp) here
 1479|  5.61k|            ui32 *vp = v_n_scratch;
 1480|  5.61k|            ui16* sp = scratch + (y >> 1) * sstr;
 1481|       |
 1482|  5.61k|            const __m256i avx_31 = _mm256_set1_epi32(31);
 1483|  5.61k|            const __m256i avx_f0 = _mm256_set1_epi32(0xF0);
 1484|  5.61k|            const __m256i avx_1 = _mm256_set1_epi32(1);
 1485|  5.61k|            const __m256i avx_0 = _mm256_setzero_si256();
 1486|       |
 1487|  12.9k|            for (ui32 x = 0; x <= width; x += 16, vp += 8, sp += 16) {
  ------------------
  |  Branch (1487:30): [True: 7.45k, False: 5.48k]
  ------------------
 1488|  7.45k|              __m256i v = _mm256_loadu_si256((__m256i*)vp);
 1489|  7.45k|              __m256i v_p1 = _mm256_loadu_si256((__m256i*)(vp + 1));
 1490|  7.45k|              v = _mm256_or_si256(v, v_p1);
 1491|  7.45k|              v = avx2_lzcnt_epi32(v);
 1492|  7.45k|              v = _mm256_sub_epi32(avx_31, v);
 1493|       |
 1494|  7.45k|              __m256i inf_u_q = _mm256_loadu_si256((__m256i*)sp);
 1495|  7.45k|              __m256i gamma = _mm256_and_si256(inf_u_q, avx_f0);
 1496|  7.45k|              __m256i w0 = _mm256_sub_epi32(gamma, avx_1);
 1497|  7.45k|              gamma = _mm256_and_si256(gamma, w0);
 1498|  7.45k|              gamma = _mm256_cmpeq_epi32(gamma, avx_0);
 1499|       |
 1500|  7.45k|              v = _mm256_andnot_si256(gamma, v);
 1501|  7.45k|              v = _mm256_max_epi32(v, avx_1);
 1502|       |
 1503|  7.45k|              inf_u_q = _mm256_srli_epi32(inf_u_q, 16);
 1504|  7.45k|              v = _mm256_add_epi32(inf_u_q, v);
 1505|       |
 1506|  7.45k|              w0 = _mm256_cmpgt_epi32(v, avx_mmsbp2);
 1507|  7.45k|              if (!_mm256_testz_si256(w0, w0)) {
  ------------------
  |  Branch (1507:19): [True: 131, False: 7.32k]
  ------------------
 1508|    131|                  return false;
 1509|    131|              }
 1510|       |
 1511|  7.32k|              _mm256_storeu_si256((__m256i*)(vp + v_n_size), v);
 1512|  7.32k|            }
 1513|  5.61k|          }
 1514|       |
 1515|  5.48k|          ui32 *vp = v_n_scratch;
 1516|  5.48k|          ui16 *sp = scratch + (y >> 1) * sstr;
 1517|  5.48k|          ui32 *dp = decoded_data + y * stride;
 1518|  5.48k|          vp[0] = 2; // for easy calculation of emax
 1519|       |
 1520|  19.3k|          for (ui32 x = 0; x < width; x += 4, sp += 4, vp += 2, dp += 4) {
  ------------------
  |  Branch (1520:28): [True: 13.8k, False: 5.48k]
  ------------------
 1521|       |            //process two quads
 1522|  13.8k|            __m128i vn = _mm_set1_epi32(2);
 1523|       |
 1524|  13.8k|            __m256i inf_u_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)sp));
 1525|  13.8k|            inf_u_q = _mm256_permutevar8x32_epi32(inf_u_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1526|       |
 1527|  13.8k|            __m256i U_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)(vp + v_n_size)));
 1528|  13.8k|            U_q = _mm256_permutevar8x32_epi32(U_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1529|       |
 1530|  13.8k|            __m256i row = decode_two_quad32_avx2(inf_u_q, U_q,  &magsgn, p, vn);
 1531|  13.8k|            row = _mm256_permutevar8x32_epi32(row, _mm256_setr_epi32(0, 2, 4, 6, 1, 3, 5, 7));
 1532|  13.8k|            _mm_store_si128((__m128i*)dp, _mm256_castsi256_si128(row));
 1533|  13.8k|            _mm_store_si128((__m128i*)(dp + stride), _mm256_extracti128_si256(row, 0x1));
 1534|       |
 1535|  13.8k|            __m128i w0 = _mm_cvtsi32_si128(*(int const*)vp);
 1536|  13.8k|            w0 = _mm_or_si128(w0, vn);
 1537|  13.8k|            _mm_storeu_si128((__m128i*)vp, w0);
 1538|  13.8k|          }
 1539|  5.48k|        }
 1540|  1.80k|      }
 1541|  17.2k|      else {
 1542|       |
 1543|       |        // reduce bitplane by 16 because we now have 16 bits instead of 32
 1544|  17.2k|        p -= 16;
 1545|       |
 1546|       |        // We allocate a scratch row for storing v_n values.
 1547|       |        // We have 512 quads horizontally.
 1548|       |        // We may go beyond the last entry by up to 8 entries.
 1549|       |        // Therefore we allocate additional 8 entries.
 1550|       |        // There are two rows in this structure, the bottom
 1551|       |        // row is used to store processed entries.
 1552|  17.2k|        const int v_n_size = 512 + 16;
 1553|  17.2k|        ui16 v_n_scratch[v_n_size] = {0}; // 1+ kB
 1554|  17.2k|        ui32 v_n_scratch_32[v_n_size] = {0}; // 2+ kB
 1555|       |
 1556|  17.2k|        frwd_struct_avx2 magsgn;
 1557|  17.2k|        frwd_init<0xFF>(&magsgn, coded_data, lcup - scup);
 1558|       |
 1559|  17.2k|        {
 1560|  17.2k|          ui16 *sp = scratch;
 1561|  17.2k|          ui16 *vp = v_n_scratch;
 1562|  17.2k|          ui32 *dp = decoded_data;
 1563|  17.2k|          vp[0] = 2; // for easy calculation of emax
 1564|       |
 1565|  50.2k|          for (ui32 x = 0; x < width; x += 8, sp += 8, vp += 4, dp += 8) {
  ------------------
  |  Branch (1565:28): [True: 35.2k, False: 15.0k]
  ------------------
 1566|       |              ////process four quads
 1567|  35.2k|              __m128i inf_u_q = _mm_loadu_si128((__m128i*)sp);
 1568|  35.2k|              __m128i U_q = _mm_srli_epi32(inf_u_q, 16);
 1569|  35.2k|              __m128i w = _mm_cmpgt_epi32(U_q, _mm_set1_epi32((int)mmsbp2));
 1570|  35.2k|              if (!_mm_testz_si128(w, w)) {
  ------------------
  |  Branch (1570:19): [True: 2.21k, False: 33.0k]
  ------------------
 1571|  2.21k|                  return false;
 1572|  2.21k|              }
 1573|       |
 1574|  33.0k|              __m128i vn = _mm_set1_epi16(2);
 1575|  33.0k|              __m256i row = decode_four_quad16(inf_u_q, U_q, &magsgn, p, vn);
 1576|       |
 1577|  33.0k|              w = _mm_cvtsi32_si128(*(unsigned short const*)(vp));
 1578|  33.0k|              _mm_storeu_si128((__m128i*)vp, _mm_or_si128(w, vn));
 1579|       |
 1580|  33.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));
 1581|  33.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));
 1582|       |
 1583|  33.0k|              _mm256_storeu_si256((__m256i*)dp, w0);
 1584|  33.0k|              _mm256_storeu_si256((__m256i*)(dp + stride), w1);
 1585|  33.0k|          }
 1586|  17.2k|        }
 1587|       |
 1588|  39.2k|        for (ui32 y = 2; y < height; y += 2) {
  ------------------
  |  Branch (1588:26): [True: 24.9k, False: 14.3k]
  ------------------
 1589|  24.9k|          {
 1590|       |            // perform 15 - count_leading_zeros(*vp) here
 1591|  24.9k|            ui16 *vp = v_n_scratch;
 1592|  24.9k|            ui32 *vp_32 = v_n_scratch_32;
 1593|       |
 1594|  24.9k|            ui16* sp = scratch + (y >> 1) * sstr;
 1595|  24.9k|            const __m256i avx_mmsbp2 = _mm256_set1_epi32((int)mmsbp2);
 1596|  24.9k|            const __m256i avx_31 = _mm256_set1_epi32(31);
 1597|  24.9k|            const __m256i avx_f0 = _mm256_set1_epi32(0xF0);
 1598|  24.9k|            const __m256i avx_1 = _mm256_set1_epi32(1);
 1599|  24.9k|            const __m256i avx_0 = _mm256_setzero_si256();
 1600|       |
 1601|  57.0k|            for (ui32 x = 0; x <= width; x += 16, vp += 8, sp += 16, vp_32 += 8) {
  ------------------
  |  Branch (1601:30): [True: 32.8k, False: 24.1k]
  ------------------
 1602|  32.8k|              __m128i v = _mm_loadu_si128((__m128i*)vp);
 1603|  32.8k|              __m128i v_p1 = _mm_loadu_si128((__m128i*)(vp + 1));
 1604|  32.8k|              v = _mm_or_si128(v, v_p1);
 1605|       |
 1606|  32.8k|              __m256i v_avx = _mm256_cvtepu16_epi32(v);
 1607|  32.8k|              v_avx = avx2_lzcnt_epi32(v_avx);
 1608|  32.8k|              v_avx = _mm256_sub_epi32(avx_31, v_avx);
 1609|       |
 1610|  32.8k|              __m256i inf_u_q = _mm256_loadu_si256((__m256i*)sp);
 1611|  32.8k|              __m256i gamma = _mm256_and_si256(inf_u_q, avx_f0);
 1612|  32.8k|              __m256i w0 = _mm256_sub_epi32(gamma, avx_1);
 1613|  32.8k|              gamma = _mm256_and_si256(gamma, w0);
 1614|  32.8k|              gamma = _mm256_cmpeq_epi32(gamma, avx_0);
 1615|       |
 1616|  32.8k|              v_avx = _mm256_andnot_si256(gamma, v_avx);
 1617|  32.8k|              v_avx = _mm256_max_epi32(v_avx, avx_1);
 1618|       |
 1619|  32.8k|              inf_u_q = _mm256_srli_epi32(inf_u_q, 16);
 1620|  32.8k|              v_avx = _mm256_add_epi32(inf_u_q, v_avx);
 1621|       |
 1622|  32.8k|              w0 = _mm256_cmpgt_epi32(v_avx, avx_mmsbp2);
 1623|  32.8k|              if (!_mm256_testz_si256(w0, w0)) {
  ------------------
  |  Branch (1623:19): [True: 726, False: 32.1k]
  ------------------
 1624|    726|                  return false;
 1625|    726|              }
 1626|       |
 1627|  32.1k|              _mm256_storeu_si256((__m256i*)vp_32, v_avx);
 1628|  32.1k|            }
 1629|  24.9k|          }
 1630|       |
 1631|  24.1k|          ui16 *vp = v_n_scratch;
 1632|  24.1k|          ui32* vp_32 = v_n_scratch_32;
 1633|  24.1k|          ui16 *sp = scratch + (y >> 1) * sstr;
 1634|  24.1k|          ui32 *dp = decoded_data + y * stride;
 1635|  24.1k|          vp[0] = 2; // for easy calculation of emax
 1636|       |
 1637|  63.3k|          for (ui32 x = 0; x < width; x += 8, sp += 8, vp += 4, dp += 8, vp_32 += 4) {
  ------------------
  |  Branch (1637:28): [True: 39.1k, False: 24.1k]
  ------------------
 1638|       |            ////process four quads
 1639|  39.1k|              __m128i inf_u_q = _mm_loadu_si128((__m128i*)sp);
 1640|  39.1k|              __m128i U_q = _mm_loadu_si128((__m128i*)vp_32);
 1641|       |
 1642|  39.1k|            __m128i vn = _mm_set1_epi16(2);
 1643|  39.1k|            __m256i row = decode_four_quad16(inf_u_q, U_q, &magsgn, p, vn);
 1644|       |
 1645|  39.1k|            __m128i w = _mm_cvtsi32_si128(*(unsigned short const*)(vp));
 1646|  39.1k|            _mm_storeu_si128((__m128i*)vp, _mm_or_si128(w, vn));
 1647|       |
 1648|  39.1k|            __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));
 1649|  39.1k|            __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));
 1650|       |
 1651|  39.1k|            _mm256_storeu_si256((__m256i*)dp, w0);
 1652|  39.1k|            _mm256_storeu_si256((__m256i*)(dp + stride), w1);
 1653|  39.1k|          }
 1654|  24.1k|        }
 1655|       |
 1656|       |        // increase bitplane back by 16 because we need to process 32 bits
 1657|  14.3k|        p += 16;
 1658|  14.3k|      }
 1659|       |
 1660|  16.0k|      if (num_passes > 1)
  ------------------
  |  Branch (1660:11): [True: 12.7k, False: 3.29k]
  ------------------
 1661|  12.7k|      {
 1662|       |        // We use scratch again, we can divide it into multiple regions
 1663|       |        // sigma holds all the significant samples, and it cannot
 1664|       |        // be modified after it is set.  it will be used during the
 1665|       |        // Magnitude Refinement Pass
 1666|  12.7k|        ui16* const sigma = scratch;
 1667|       |
 1668|  12.7k|        ui32 mstr = (width + 3u) >> 2;   // divide by 4, since each
 1669|       |                                         // ui16 contains 4 columns
 1670|  12.7k|        mstr = ((mstr + 2u) + 7u) & ~7u; // multiples of 8
 1671|       |
 1672|       |        // We re-arrange quad significance, where each 4 consecutive
 1673|       |        // bits represent one quad, into column significance, where,
 1674|       |        // each 4 consequtive bits represent one column of 4 rows
 1675|  12.7k|        {
 1676|  12.7k|          ui32 y;
 1677|       |
 1678|  12.7k|          const __m128i mask_3 = _mm_set1_epi32(0x30);
 1679|  12.7k|          const __m128i mask_C = _mm_set1_epi32(0xC0);
 1680|  12.7k|          const __m128i shuffle_mask = _mm_set_epi32(-1, -1, -1, 0x0C080400);
 1681|  33.5k|          for (y = 0; y < height; y += 4)
  ------------------
  |  Branch (1681:23): [True: 20.8k, False: 12.7k]
  ------------------
 1682|  20.8k|          {
 1683|  20.8k|            ui16* sp = scratch + (y >> 1) * sstr;
 1684|  20.8k|            ui16* dp = sigma + (y >> 2) * mstr;
 1685|  62.3k|            for (ui32 x = 0; x < width; x += 8, sp += 8, dp += 2)
  ------------------
  |  Branch (1685:30): [True: 41.4k, False: 20.8k]
  ------------------
 1686|  41.4k|            {
 1687|  41.4k|              __m128i s0, s1, u3, uC, t0, t1;
 1688|       |
 1689|  41.4k|              s0 = _mm_loadu_si128((__m128i*)(sp));
 1690|  41.4k|              u3 = _mm_and_si128(s0, mask_3);
 1691|  41.4k|              u3 = _mm_srli_epi32(u3, 4);
 1692|  41.4k|              uC = _mm_and_si128(s0, mask_C);
 1693|  41.4k|              uC = _mm_srli_epi32(uC, 2);
 1694|  41.4k|              t0 = _mm_or_si128(u3, uC);
 1695|       |
 1696|  41.4k|              s1 = _mm_loadu_si128((__m128i*)(sp + sstr));
 1697|  41.4k|              u3 = _mm_and_si128(s1, mask_3);
 1698|  41.4k|              u3 = _mm_srli_epi32(u3, 2);
 1699|  41.4k|              uC = _mm_and_si128(s1, mask_C);
 1700|  41.4k|              t1 = _mm_or_si128(u3, uC);
 1701|       |
 1702|  41.4k|              __m128i r = _mm_or_si128(t0, t1);
 1703|  41.4k|              r = _mm_shuffle_epi8(r, shuffle_mask);
 1704|       |
 1705|  41.4k|              *(ui32*)dp = (ui32)_mm_extract_epi32(r, 0);
 1706|  41.4k|            }
 1707|  20.8k|            dp[0] = 0; // set an extra entry on the right with 0
 1708|  20.8k|          }
 1709|  12.7k|          {
 1710|       |            // reset one row after the codeblock
 1711|  12.7k|            ui16* dp = sigma + (y >> 2) * mstr;
 1712|  12.7k|            __m128i zero = _mm_setzero_si128();
 1713|  27.4k|            for (ui32 x = 0; x < width; x += 32, dp += 8)
  ------------------
  |  Branch (1713:30): [True: 14.7k, False: 12.7k]
  ------------------
 1714|  14.7k|              _mm_storeu_si128((__m128i*)dp, zero);
 1715|  12.7k|            dp[0] = 0; // set an extra entry on the right with 0
 1716|  12.7k|          }
 1717|  12.7k|        }
 1718|       |
 1719|       |        // We perform Significance Propagation Pass here
 1720|  12.7k|        {
 1721|       |          // This stores significance information of the previous
 1722|       |          // 4 rows.  Significance information in this array includes
 1723|       |          // all signicant samples in bitplane p - 1; that is,
 1724|       |          // significant samples for bitplane p (discovered during the
 1725|       |          // cleanup pass and stored in sigma) and samples that have recently
 1726|       |          // became significant (during the SPP) in bitplane p-1.
 1727|       |          // We store enough for the widest row, containing 1024 columns,
 1728|       |          // which is equivalent to 256 of ui16, since each stores 4 columns.
 1729|       |          // We add an extra 8 entries, just in case we need more
 1730|  12.7k|          ui16 prev_row_sig[256 + 8] = {0}; // 528 Bytes
 1731|       |
 1732|  12.7k|          frwd_struct_avx2 sigprop;
 1733|  12.7k|          frwd_init<0>(&sigprop, coded_data + lengths1, (int)lengths2);
 1734|       |
 1735|  33.5k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1735:28): [True: 20.8k, False: 12.7k]
  ------------------
 1736|  20.8k|          {
 1737|  20.8k|            ui32 pattern = 0xFFFFu; // a pattern needed samples
 1738|  20.8k|            if (height - y < 4) {
  ------------------
  |  Branch (1738:17): [True: 5.92k, False: 14.9k]
  ------------------
 1739|  5.92k|              pattern = 0x7777u;
 1740|  5.92k|              if (height - y < 3) {
  ------------------
  |  Branch (1740:19): [True: 5.50k, False: 420]
  ------------------
 1741|  5.50k|                pattern = 0x3333u;
 1742|  5.50k|                if (height - y < 2)
  ------------------
  |  Branch (1742:21): [True: 2.05k, False: 3.45k]
  ------------------
 1743|  2.05k|                  pattern = 0x1111u;
 1744|  5.50k|              }
 1745|  5.92k|            }
 1746|       |
 1747|       |            // prev holds sign. info. for the previous quad, together
 1748|       |            // with the rows on top of it and below it.
 1749|  20.8k|            ui32 prev = 0;
 1750|  20.8k|            ui16 *prev_sig = prev_row_sig;
 1751|  20.8k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1752|  20.8k|            ui32 *dpp = decoded_data + y * stride;
 1753|  90.0k|            for (ui32 x = 0; x < width; x += 4, dpp += 4, ++cur_sig, ++prev_sig)
  ------------------
  |  Branch (1753:30): [True: 69.1k, False: 20.8k]
  ------------------
 1754|  69.1k|            {
 1755|       |              // only rows and columns inside the stripe are included
 1756|  69.1k|              si32 s = (si32)x + 4 - (si32)width;
 1757|  69.1k|              s = ojph_max(s, 0);
  ------------------
  |  |   73|  69.1k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 13.1k, False: 55.9k]
  |  |  ------------------
  ------------------
 1758|  69.1k|              pattern = pattern >> (s * 4);
 1759|       |
 1760|       |              // We first find locations that need to be tested (potential
 1761|       |              // SPP members); these location will end up in mbr
 1762|       |              // In each iteration, we produce 16 bits because cwd can have
 1763|       |              // up to 16 bits of significance information, followed by the
 1764|       |              // corresponding 16 bits of sign information; therefore, it is
 1765|       |              // sufficient to fetch 32 bit data per loop.
 1766|       |
 1767|       |              // Althougth we are interested in 16 bits only, we load 32 bits.
 1768|       |              // For the 16 bits we are producing, we need the next 4 bits --
 1769|       |              // We need data for at least 5 columns out of 8.
 1770|       |              // Therefore loading 32 bits is easier than loading 16 bits
 1771|       |              // twice.
 1772|  69.1k|              ui32 ps = *(ui32*)prev_sig;
 1773|  69.1k|              ui32 ns = *(ui32*)(cur_sig + mstr);
 1774|  69.1k|              ui32 u = (ps & 0x88888888) >> 3; // the row on top
 1775|  69.1k|              if (!stripe_causal)
  ------------------
  |  Branch (1775:19): [True: 68.9k, False: 246]
  ------------------
 1776|  68.9k|                u |= (ns & 0x11111111) << 3;   // the row below
 1777|       |
 1778|  69.1k|              ui32 cs = *(ui32*)cur_sig;
 1779|       |              // vertical integration
 1780|  69.1k|              ui32 mbr =  cs;                // this sig. info.
 1781|  69.1k|              mbr |= (cs & 0x77777777) << 1; //above neighbors
 1782|  69.1k|              mbr |= (cs & 0xEEEEEEEE) >> 1; //below neighbors
 1783|  69.1k|              mbr |= u;
 1784|       |              // horizontal integration
 1785|  69.1k|              ui32 t = mbr;
 1786|  69.1k|              mbr |= t << 4;      // neighbors on the left
 1787|  69.1k|              mbr |= t >> 4;      // neighbors on the right
 1788|  69.1k|              mbr |= prev >> 12;  // significance of previous group
 1789|       |
 1790|       |              // remove outside samples, and already significant samples
 1791|  69.1k|              mbr &= pattern;
 1792|  69.1k|              mbr &= ~cs;
 1793|       |
 1794|       |              // find samples that become significant during the SPP
 1795|  69.1k|              ui32 new_sig = mbr;
 1796|  69.1k|              if (new_sig)
  ------------------
  |  Branch (1796:19): [True: 47.0k, False: 22.1k]
  ------------------
 1797|  47.0k|              {
 1798|  47.0k|                __m128i cwd_vec = frwd_fetch<0>(&sigprop);
 1799|  47.0k|                ui32 cwd = (ui32)_mm_extract_epi16(cwd_vec, 0);
 1800|       |
 1801|  47.0k|                ui32 cnt = 0;
 1802|  47.0k|                ui32 col_mask = 0xFu;
 1803|  47.0k|                ui32 inv_sig = ~cs & pattern;
 1804|   235k|                for (int i = 0; i < 16; i += 4, col_mask <<= 4)
  ------------------
  |  Branch (1804:33): [True: 188k, False: 47.0k]
  ------------------
 1805|   188k|                {
 1806|   188k|                  if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1806:23): [True: 43.8k, False: 144k]
  ------------------
 1807|  43.8k|                    continue;
 1808|       |
 1809|       |                  //scan one column
 1810|   144k|                  ui32 sample_mask = 0x1111u & col_mask;
 1811|   144k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1811:23): [True: 92.7k, False: 51.3k]
  ------------------
 1812|  92.7k|                  {
 1813|  92.7k|                    new_sig &= ~sample_mask;
 1814|  92.7k|                    if (cwd & 1)
  ------------------
  |  Branch (1814:25): [True: 34.5k, False: 58.1k]
  ------------------
 1815|  34.5k|                    {
 1816|  34.5k|                      ui32 t = 0x33u << i;
 1817|  34.5k|                      new_sig |= t & inv_sig;
 1818|  34.5k|                    }
 1819|  92.7k|                    cwd >>= 1; ++cnt;
 1820|  92.7k|                  }
 1821|       |
 1822|   144k|                  sample_mask <<= 1;
 1823|   144k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1823:23): [True: 62.5k, False: 81.6k]
  ------------------
 1824|  62.5k|                  {
 1825|  62.5k|                    new_sig &= ~sample_mask;
 1826|  62.5k|                    if (cwd & 1)
  ------------------
  |  Branch (1826:25): [True: 15.9k, False: 46.5k]
  ------------------
 1827|  15.9k|                    {
 1828|  15.9k|                      ui32 t = 0x76u << i;
 1829|  15.9k|                      new_sig |= t & inv_sig;
 1830|  15.9k|                    }
 1831|  62.5k|                    cwd >>= 1; ++cnt;
 1832|  62.5k|                  }
 1833|       |
 1834|   144k|                  sample_mask <<= 1;
 1835|   144k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1835:23): [True: 80.3k, False: 63.7k]
  ------------------
 1836|  80.3k|                  {
 1837|  80.3k|                    new_sig &= ~sample_mask;
 1838|  80.3k|                    if (cwd & 1)
  ------------------
  |  Branch (1838:25): [True: 23.2k, False: 57.1k]
  ------------------
 1839|  23.2k|                    {
 1840|  23.2k|                      ui32 t = 0xECu << i;
 1841|  23.2k|                      new_sig |= t & inv_sig;
 1842|  23.2k|                    }
 1843|  80.3k|                    cwd >>= 1; ++cnt;
 1844|  80.3k|                  }
 1845|       |
 1846|   144k|                  sample_mask <<= 1;
 1847|   144k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1847:23): [True: 56.5k, False: 87.5k]
  ------------------
 1848|  56.5k|                  {
 1849|  56.5k|                    new_sig &= ~sample_mask;
 1850|  56.5k|                    if (cwd & 1)
  ------------------
  |  Branch (1850:25): [True: 20.5k, False: 36.0k]
  ------------------
 1851|  20.5k|                    {
 1852|  20.5k|                      ui32 t = 0xC8u << i;
 1853|  20.5k|                      new_sig |= t & inv_sig;
 1854|  20.5k|                    }
 1855|  56.5k|                    cwd >>= 1; ++cnt;
 1856|  56.5k|                  }
 1857|   144k|                }
 1858|       |
 1859|  47.0k|                if (new_sig)
  ------------------
  |  Branch (1859:21): [True: 25.1k, False: 21.8k]
  ------------------
 1860|  25.1k|                {
 1861|  25.1k|                  cwd |= (ui32)_mm_extract_epi16(cwd_vec, 1) << (16 - cnt);
 1862|       |
 1863|       |                  // Spread new_sig, such that each bit is in one byte with a
 1864|       |                  // value of 0 if new_sig bit is 0, and 0xFF if new_sig is 1
 1865|  25.1k|                  __m128i new_sig_vec = _mm_set1_epi16((si16)new_sig);
 1866|  25.1k|                  new_sig_vec = _mm_shuffle_epi8(new_sig_vec,
 1867|  25.1k|                    _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1868|  25.1k|                  new_sig_vec = _mm_and_si128(new_sig_vec,
 1869|  25.1k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1870|  25.1k|                  new_sig_vec = _mm_cmpeq_epi8(new_sig_vec,
 1871|  25.1k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1872|       |
 1873|       |                  // find cumulative sums
 1874|       |                  // to find which bit in cwd we should extract
 1875|  25.1k|                  __m128i inc_sum = new_sig_vec; // inclusive scan
 1876|  25.1k|                  inc_sum = _mm_abs_epi8(inc_sum); // cvrt to 0 or 1
 1877|  25.1k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 1));
 1878|  25.1k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 2));
 1879|  25.1k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 4));
 1880|  25.1k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 8));
 1881|  25.1k|                  cnt += (ui32)_mm_extract_epi16(inc_sum, 7) >> 8;
 1882|       |                  // exclusive scan
 1883|  25.1k|                  __m128i ex_sum = _mm_bslli_si128(inc_sum, 1);
 1884|       |
 1885|       |                  // Spread cwd, such that each bit is in one byte
 1886|       |                  // with a value of 0 or 1.
 1887|  25.1k|                  cwd_vec = _mm_set1_epi16((si16)cwd);
 1888|  25.1k|                  cwd_vec = _mm_shuffle_epi8(cwd_vec,
 1889|  25.1k|                    _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1890|  25.1k|                  cwd_vec = _mm_and_si128(cwd_vec,
 1891|  25.1k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1892|  25.1k|                  cwd_vec = _mm_cmpeq_epi8(cwd_vec,
 1893|  25.1k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1894|  25.1k|                  cwd_vec = _mm_abs_epi8(cwd_vec);
 1895|       |
 1896|       |                  // Obtain bit from cwd_vec correspondig to ex_sum
 1897|       |                  // Basically, collect needed bits from cwd_vec
 1898|  25.1k|                  __m128i v = _mm_shuffle_epi8(cwd_vec, ex_sum);
 1899|       |
 1900|       |                  // load data and set spp coefficients
 1901|  25.1k|                  __m128i m =
 1902|  25.1k|                    _mm_set_epi8(-1,-1,-1,12,-1,-1,-1,8,-1,-1,-1,4,-1,-1,-1,0);
 1903|  25.1k|                  __m128i val = _mm_set1_epi32(3 << (p - 2));
 1904|  25.1k|                  ui32 *dp = dpp;
 1905|   125k|                  for (int c = 0; c < 4; ++ c) {
  ------------------
  |  Branch (1905:35): [True: 100k, False: 25.1k]
  ------------------
 1906|   100k|                    __m128i s0, s0_ns, s0_val;
 1907|       |                    // load coefficients
 1908|   100k|                    s0 = _mm_load_si128((__m128i*)dp);
 1909|       |
 1910|       |                    // epi32 is -1 only for coefficient that
 1911|       |                    // are changed during the SPP
 1912|   100k|                    s0_ns = _mm_shuffle_epi8(new_sig_vec, m);
 1913|   100k|                    s0_ns = _mm_cmpeq_epi32(s0_ns, _mm_set1_epi32(0xFF));
 1914|       |
 1915|       |                    // obtain sign for coefficients in SPP
 1916|   100k|                    s0_val = _mm_shuffle_epi8(v, m);
 1917|   100k|                    s0_val = _mm_slli_epi32(s0_val, 31);
 1918|   100k|                    s0_val = _mm_or_si128(s0_val, val);
 1919|   100k|                    s0_val = _mm_and_si128(s0_val, s0_ns);
 1920|       |
 1921|       |                    // update vector
 1922|   100k|                    s0 = _mm_or_si128(s0, s0_val);
 1923|       |                    // store coefficients
 1924|   100k|                    _mm_store_si128((__m128i*)dp, s0);
 1925|       |                    // prepare for next row
 1926|   100k|                    dp += stride;
 1927|   100k|                    m = _mm_add_epi32(m, _mm_set1_epi32(1));
 1928|   100k|                  }
 1929|  25.1k|                }
 1930|  47.0k|                frwd_advance(&sigprop, cnt);
 1931|  47.0k|              }
 1932|       |
 1933|  69.1k|              new_sig |= cs;
 1934|  69.1k|              *prev_sig = (ui16)(new_sig);
 1935|       |
 1936|       |              // vertical integration for the new sig. info.
 1937|  69.1k|              t = new_sig;
 1938|  69.1k|              new_sig |= (t & 0x7777) << 1; //above neighbors
 1939|  69.1k|              new_sig |= (t & 0xEEEE) >> 1; //below neighbors
 1940|       |              // add sig. info. from the row on top and below
 1941|  69.1k|              prev = new_sig | u;
 1942|       |              // we need only the bits in 0xF000
 1943|  69.1k|              prev &= 0xF000;
 1944|  69.1k|            }
 1945|  20.8k|          }
 1946|  12.7k|        }
 1947|       |
 1948|       |        // We perform Magnitude Refinement Pass here
 1949|  12.7k|        if (num_passes > 2)
  ------------------
  |  Branch (1949:13): [True: 10.9k, False: 1.70k]
  ------------------
 1950|  10.9k|        {
 1951|  10.9k|          rev_struct magref;
 1952|  10.9k|          rev_init_mrp(&magref, coded_data, (int)lengths1, (int)lengths2);
 1953|       |
 1954|  27.5k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1954:28): [True: 16.5k, False: 10.9k]
  ------------------
 1955|  16.5k|          {
 1956|  16.5k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1957|  16.5k|            ui32 *dpp = decoded_data + y * stride;
 1958|  74.9k|            for (ui32 i = 0; i < width; i += 4, dpp += 4)
  ------------------
  |  Branch (1958:30): [True: 58.4k, False: 16.5k]
  ------------------
 1959|  58.4k|            {
 1960|       |              //Process one entry from sigma array at a time
 1961|       |              // Each nibble (4 bits) in the sigma array represents 4 rows,
 1962|  58.4k|              ui32 cwd = rev_fetch_mrp(&magref); // get 32 bit data
 1963|  58.4k|              ui16 sig = *cur_sig++; // 16 bit that will be processed now
 1964|  58.4k|              int total_bits = 0;
 1965|  58.4k|              if (sig) // if any of the 32 bits are set
  ------------------
  |  Branch (1965:19): [True: 43.9k, False: 14.4k]
  ------------------
 1966|  43.9k|              {
 1967|       |                // We work on 4 rows, with 4 samples each, since
 1968|       |                // data is 32 bit (4 bytes)
 1969|       |
 1970|       |                // spread the 16 bits in sig to 0 or 1 bytes in sig_vec
 1971|  43.9k|                __m128i sig_vec = _mm_set1_epi16((si16)sig);
 1972|  43.9k|                sig_vec = _mm_shuffle_epi8(sig_vec,
 1973|  43.9k|                  _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1974|  43.9k|                sig_vec = _mm_and_si128(sig_vec,
 1975|  43.9k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1976|  43.9k|                sig_vec = _mm_cmpeq_epi8(sig_vec,
 1977|  43.9k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1978|  43.9k|                sig_vec = _mm_abs_epi8(sig_vec);
 1979|       |
 1980|       |                // find cumulative sums
 1981|       |                // to find which bit in cwd we should extract
 1982|  43.9k|                __m128i inc_sum = sig_vec; // inclusive scan
 1983|  43.9k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 1));
 1984|  43.9k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 2));
 1985|  43.9k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 4));
 1986|  43.9k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 8));
 1987|  43.9k|                total_bits = _mm_extract_epi16(inc_sum, 7) >> 8;
 1988|  43.9k|                __m128i ex_sum = _mm_bslli_si128(inc_sum, 1); // exclusive scan
 1989|       |
 1990|       |                // Spread the 16 bits in cwd to inverted 0 or 1 bytes in
 1991|       |                // cwd_vec. Then, convert these to a form suitable
 1992|       |                // for coefficient modifications; in particular, a value
 1993|       |                // of 0 is presented as binary 11, and a value of 1 is
 1994|       |                // represented as binary 01
 1995|  43.9k|                __m128i cwd_vec = _mm_set1_epi16((si16)cwd);
 1996|  43.9k|                cwd_vec = _mm_shuffle_epi8(cwd_vec,
 1997|  43.9k|                  _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1998|  43.9k|                cwd_vec = _mm_and_si128(cwd_vec,
 1999|  43.9k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 2000|  43.9k|                cwd_vec = _mm_cmpeq_epi8(cwd_vec,
 2001|  43.9k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 2002|  43.9k|                cwd_vec = _mm_add_epi8(cwd_vec, _mm_set1_epi8(1));
 2003|  43.9k|                cwd_vec = _mm_add_epi8(cwd_vec, cwd_vec);
 2004|  43.9k|                cwd_vec = _mm_or_si128(cwd_vec, _mm_set1_epi8(1));
 2005|       |
 2006|       |                // load data and insert the mrp bit
 2007|  43.9k|                __m128i m =
 2008|  43.9k|                  _mm_set_epi8(-1,-1,-1,12,-1,-1,-1,8,-1,-1,-1,4,-1,-1,-1,0);
 2009|  43.9k|                ui32 *dp = dpp;
 2010|   219k|                for (int c = 0; c < 4; ++c) {
  ------------------
  |  Branch (2010:33): [True: 175k, False: 43.9k]
  ------------------
 2011|   175k|                  __m128i s0, s0_sig, s0_idx, s0_val;
 2012|       |                  // load coefficients
 2013|   175k|                  s0 = _mm_load_si128((__m128i*)dp);
 2014|       |                  // find significant samples in this row
 2015|   175k|                  s0_sig = _mm_shuffle_epi8(sig_vec, m);
 2016|   175k|                  s0_sig = _mm_cmpeq_epi8(s0_sig, _mm_setzero_si128());
 2017|       |                  // get MRP bit index, and MRP pattern
 2018|   175k|                  s0_idx = _mm_shuffle_epi8(ex_sum, m);
 2019|   175k|                  s0_val = _mm_shuffle_epi8(cwd_vec, s0_idx);
 2020|       |                  // keep data from significant samples only
 2021|   175k|                  s0_val = _mm_andnot_si128(s0_sig, s0_val);
 2022|       |                  // move mrp bits to correct position, and employ
 2023|   175k|                  s0_val = _mm_slli_epi32(s0_val, (si32)p - 2);
 2024|   175k|                  s0 = _mm_xor_si128(s0, s0_val);
 2025|       |                  // store coefficients
 2026|   175k|                  _mm_store_si128((__m128i*)dp, s0);
 2027|       |                  // prepare for next row
 2028|   175k|                  dp += stride;
 2029|   175k|                  m = _mm_add_epi32(m, _mm_set1_epi32(1));
 2030|   175k|                }
 2031|  43.9k|              }
 2032|       |              // consume data according to the number of bits set
 2033|  58.4k|              rev_advance_mrp(&magref, (ui32)total_bits);
 2034|  58.4k|            }
 2035|  16.5k|          }
 2036|  10.9k|        }
 2037|  12.7k|      }
 2038|       |
 2039|  16.0k|      return true;
 2040|  19.2k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8mel_initEPNS0_10dec_mel_stEPhii:
  225|  19.2k|    {
  226|  19.2k|      melp->data = bbuf + lcup - scup; // move the pointer to the start of MEL
  227|  19.2k|      melp->bits = 0;                  // 0 bits in tmp
  228|  19.2k|      melp->tmp = 0;                   //
  229|  19.2k|      melp->unstuff = false;           // no unstuffing
  230|  19.2k|      melp->size = scup - 1;           // size is the length of MEL+VLC-1
  231|  19.2k|      melp->k = 0;                     // 0 for state
  232|  19.2k|      melp->num_runs = 0;              // num_runs is 0
  233|  19.2k|      melp->runs = 0;                  //
  234|       |
  235|       |      //This code is borrowed; original is for a different architecture
  236|       |      //These few lines take care of the case where data is not at a multiple
  237|       |      // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the MEL segment
  238|  19.2k|      int num = 4 - (int)(intptr_t(melp->data) & 0x3);
  239|  71.6k|      for (int i = 0; i < num; ++i) { // this code is similar to mel_read
  ------------------
  |  Branch (239:23): [True: 52.4k, False: 19.2k]
  ------------------
  240|  52.4k|        assert(melp->unstuff == false || melp->data[0] <= 0x8F);
  241|  52.4k|        ui64 d = (melp->size > 0) ? *melp->data : 0xFF;//if buffer is consumed
  ------------------
  |  Branch (241:18): [True: 47.9k, False: 4.51k]
  ------------------
  242|       |                                                       //set data to 0xFF
  243|  52.4k|        if (melp->size == 1) d |= 0xF; //if this is MEL+VLC-1, set LSBs to 0xF
  ------------------
  |  Branch (243:13): [True: 4.32k, False: 48.1k]
  ------------------
  244|       |                                       // see the standard
  245|  52.4k|        melp->data += melp->size-- > 0; //increment if the end is not reached
  246|  52.4k|        int d_bits = 8 - melp->unstuff; //if unstuffing is needed, reduce by 1
  247|  52.4k|        melp->tmp = (melp->tmp << d_bits) | d; //store bits in tmp
  248|  52.4k|        melp->bits += d_bits;  //increment tmp by number of bits
  249|  52.4k|        melp->unstuff = ((d & 0xFF) == 0xFF); //true of next byte needs
  250|       |                                              //unstuffing
  251|  52.4k|      }
  252|  19.2k|      melp->tmp <<= (64 - melp->bits); //push all the way up so the first bit
  253|       |                                       // is the MSB
  254|  19.2k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8rev_initEPNS0_10rev_structEPhii:
  382|  19.2k|    {
  383|       |      //first byte has only the upper 4 bits
  384|  19.2k|      vlcp->data = data + lcup - 2;
  385|       |
  386|       |      //size can not be larger than this, in fact it should be smaller
  387|  19.2k|      vlcp->size = scup - 2;
  388|       |
  389|  19.2k|      ui32 d = *vlcp->data--; // read one byte (this is a half byte)
  390|  19.2k|      vlcp->tmp = d >> 4;    // both initialize and set
  391|  19.2k|      vlcp->bits = 4 - ((vlcp->tmp & 7) == 7); //check standard
  392|  19.2k|      vlcp->unstuff = (d | 0xF) > 0x8F; //this is useful for the next byte
  393|       |
  394|       |      //This code is designed for an architecture that read address should
  395|       |      // align to the read size (address multiple of 4 if read size is 4)
  396|       |      //These few lines take care of the case where data is not at a multiple
  397|       |      // of 4 boundary. It reads 1,2,3 up to 4 bytes from the VLC bitstream.
  398|       |      // To read 32 bits, read from (vlcp->data - 3)
  399|  19.2k|      int num = 1 + (int)(intptr_t(vlcp->data) & 0x3);
  400|  19.2k|      int tnum = num < vlcp->size ? num : vlcp->size;
  ------------------
  |  Branch (400:18): [True: 12.7k, False: 6.47k]
  ------------------
  401|  62.8k|      for (int i = 0; i < tnum; ++i) {
  ------------------
  |  Branch (401:23): [True: 43.6k, False: 19.2k]
  ------------------
  402|  43.6k|        ui64 d;
  403|  43.6k|        d = *vlcp->data--;  // read one byte and move read pointer
  404|       |        //check if the last byte was >0x8F (unstuff == true) and this is 0x7F
  405|  43.6k|        ui32 d_bits = 8 - ((vlcp->unstuff && ((d & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (405:29): [True: 17.0k, False: 26.5k]
  |  Branch (405:46): [True: 5.79k, False: 11.2k]
  ------------------
  406|  43.6k|        vlcp->tmp |= d << vlcp->bits; // move data to vlcp->tmp
  407|  43.6k|        vlcp->bits += d_bits;
  408|  43.6k|        vlcp->unstuff = d > 0x8F; // for next byte
  409|  43.6k|      }
  410|  19.2k|      vlcp->size -= tnum;
  411|  19.2k|      rev_read(vlcp);  // read another 32 buts
  412|  19.2k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8rev_readEPNS0_10rev_structE:
  312|  46.3k|    {
  313|       |      //process 4 bytes at a time
  314|  46.3k|      if (vlcp->bits > 32)  // if there are more than 32 bits in tmp, then
  ------------------
  |  Branch (314:11): [True: 3.32k, False: 43.0k]
  ------------------
  315|  3.32k|        return;             // reading 32 bits can overflow vlcp->tmp
  316|  43.0k|      ui32 val = 0;
  317|       |      //the next line (the if statement) needs to be tested first
  318|  43.0k|      if (vlcp->size > 3)  // if there are more than 3 bytes left in VLC
  ------------------
  |  Branch (318:11): [True: 17.7k, False: 25.3k]
  ------------------
  319|  17.7k|      {
  320|       |        // (vlcp->data - 3) move pointer back to read 32 bits at once
  321|  17.7k|        val = *(ui32*)(vlcp->data - 3); // then read 32 bits
  322|  17.7k|        vlcp->data -= 4;          // move data pointer back by 4
  323|  17.7k|        vlcp->size -= 4;          // reduce available byte by 4
  324|  17.7k|      }
  325|  25.3k|      else if (vlcp->size > 0)
  ------------------
  |  Branch (325:16): [True: 3.46k, False: 21.8k]
  ------------------
  326|  3.46k|      { // 4 or less
  327|  3.46k|        int i = 24;
  328|  11.5k|        while (vlcp->size > 0) {
  ------------------
  |  Branch (328:16): [True: 8.10k, False: 3.46k]
  ------------------
  329|  8.10k|          ui32 v = *vlcp->data--; // read one byte at a time
  330|  8.10k|          val |= (v << i);        // put byte in its correct location
  331|  8.10k|          --vlcp->size;
  332|  8.10k|          i -= 8;
  333|  8.10k|        }
  334|  3.46k|      }
  335|       |
  336|  43.0k|      __m128i tmp_vec = _mm_set1_epi32((int32_t)val);
  337|  43.0k|      tmp_vec = _mm_srlv_epi32(tmp_vec, _mm_setr_epi32(24, 16, 8, 0));
  338|  43.0k|      tmp_vec = _mm_and_si128(tmp_vec, _mm_set1_epi32(0xff));
  339|       |
  340|  43.0k|      __m128i unstuff_vec = _mm_cmpgt_epi32(tmp_vec, _mm_set1_epi32(0x8F));
  341|  43.0k|      bool unstuff_next = _mm_extract_epi32(unstuff_vec, 3);
  342|  43.0k|      unstuff_vec = _mm_slli_si128(unstuff_vec, 4);
  343|  43.0k|      unstuff_vec = _mm_insert_epi32(unstuff_vec, vlcp->unstuff * 0xffffffff, 0);
  344|       |
  345|  43.0k|      __m128i val_7f = _mm_set1_epi32(0x7F);
  346|  43.0k|      __m128i this_byte_7f = _mm_cmpeq_epi32(_mm_and_si128(tmp_vec, val_7f), val_7f);
  347|  43.0k|      unstuff_vec = _mm_and_si128(unstuff_vec, this_byte_7f);
  348|  43.0k|      unstuff_vec = _mm_srli_epi32(unstuff_vec, 31);
  349|       |
  350|  43.0k|      __m128i inc_sum = _mm_sub_epi32(_mm_set1_epi32(8), unstuff_vec);
  351|  43.0k|      inc_sum = _mm_add_epi32(inc_sum, _mm_bslli_si128(inc_sum, 4));
  352|  43.0k|      inc_sum = _mm_add_epi32(inc_sum, _mm_bslli_si128(inc_sum, 8));
  353|  43.0k|      ui32 total_bits = (ui32)_mm_extract_epi32(inc_sum, 3);
  354|       |
  355|  43.0k|      __m128i final_shift = _mm_slli_si128(inc_sum, 4);
  356|  43.0k|      tmp_vec = _mm_sllv_epi32(tmp_vec, final_shift);
  357|  43.0k|      tmp_vec = _mm_or_si128(tmp_vec, _mm_bsrli_si128(tmp_vec, 8));
  358|       |
  359|  43.0k|      ui64 tmp = (ui32)_mm_cvtsi128_si32(tmp_vec) | (ui32)_mm_extract_epi32(tmp_vec, 1);
  360|       |
  361|  43.0k|      vlcp->unstuff = unstuff_next;
  362|  43.0k|      vlcp->tmp |= tmp << vlcp->bits;
  363|  43.0k|      vlcp->bits += total_bits;
  364|  43.0k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11mel_get_runEPNS0_10dec_mel_stE:
  264|   144k|    {
  265|   144k|      if (melp->num_runs == 0)  //if no runs, decode more bit from MEL segment
  ------------------
  |  Branch (265:11): [True: 31.7k, False: 112k]
  ------------------
  266|  31.7k|        mel_decode(melp);
  267|       |
  268|   144k|      int t = melp->runs & 0x7F; //retrieve one run
  269|   144k|      melp->runs >>= 7;  // remove the retrieved run
  270|   144k|      melp->num_runs--;
  271|   144k|      return t; // return run
  272|   144k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL10mel_decodeEPNS0_10dec_mel_stE:
  174|  31.7k|    {
  175|  31.7k|      static const int mel_exp[13] = { //MEL exponents
  176|  31.7k|        0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5
  177|  31.7k|      };
  178|       |
  179|  31.7k|      if (melp->bits < 6) // if there are less than 6 bits in tmp
  ------------------
  |  Branch (179:11): [True: 3.95k, False: 27.8k]
  ------------------
  180|  3.95k|        mel_read(melp);   // then read from the MEL bitstream
  181|       |                          // 6 bits is the largest decodable MEL cwd
  182|       |
  183|       |      //repeat so long that there is enough decodable bits in tmp,
  184|       |      // and the runs store is not full (num_runs < 8)
  185|   254k|      while (melp->bits >= 6 && melp->num_runs < 8)
  ------------------
  |  Branch (185:14): [True: 247k, False: 6.85k]
  |  Branch (185:33): [True: 222k, False: 24.9k]
  ------------------
  186|   222k|      {
  187|   222k|        int eval = mel_exp[melp->k]; // number of bits associated with state
  188|   222k|        int run = 0;
  189|   222k|        if (melp->tmp & (1ull<<63)) //The next bit to decode (stored in MSB)
  ------------------
  |  Branch (189:13): [True: 90.0k, False: 132k]
  ------------------
  190|  90.0k|        { //one is found
  191|  90.0k|          run = 1 << eval;
  192|  90.0k|          run--; // consecutive runs of 0 events - 1
  193|  90.0k|          melp->k = melp->k + 1 < 12 ? melp->k + 1 : 12;//increment, max is 12
  ------------------
  |  Branch (193:21): [True: 85.0k, False: 4.94k]
  ------------------
  194|  90.0k|          melp->tmp <<= 1; // consume one bit from tmp
  195|  90.0k|          melp->bits -= 1;
  196|  90.0k|          run = run << 1; // a stretch of zeros not terminating in one
  197|  90.0k|        }
  198|   132k|        else
  199|   132k|        { //0 is found
  200|   132k|          run = (int)(melp->tmp >> (63 - eval)) & ((1 << eval) - 1);
  201|   132k|          melp->k = melp->k - 1 > 0 ? melp->k - 1 : 0; //decrement, min is 0
  ------------------
  |  Branch (201:21): [True: 14.5k, False: 117k]
  ------------------
  202|   132k|          melp->tmp <<= eval + 1; //consume eval + 1 bits (max is 6)
  203|   132k|          melp->bits -= eval + 1;
  204|   132k|          run = (run << 1) + 1; // a stretch of zeros terminating with one
  205|   132k|        }
  206|   222k|        eval = melp->num_runs * 7;           // 7 bits per run
  207|   222k|        melp->runs &= ~((ui64)0x3F << eval); // 6 bits are sufficient
  208|   222k|        melp->runs |= ((ui64)run) << eval;   // store the value in runs
  209|   222k|        melp->num_runs++;                    // increment count
  210|   222k|      }
  211|  31.7k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8mel_readEPNS0_10dec_mel_stE:
   97|  3.95k|    {
   98|  3.95k|      if (melp->bits > 32)  //there are enough bits in the tmp variable
  ------------------
  |  Branch (98:11): [True: 0, False: 3.95k]
  ------------------
   99|      0|        return;             // return without reading new data
  100|       |
  101|  3.95k|      ui32 val = 0xFFFFFFFF;       // feed in 0xFF if buffer is exhausted
  102|  3.95k|      if (melp->size > 4) {        // if there is data in the MEL segment
  ------------------
  |  Branch (102:11): [True: 2.21k, False: 1.74k]
  ------------------
  103|  2.21k|        val = *(ui32*)melp->data;  // read 32 bits from MEL data
  104|  2.21k|        melp->data += 4;           // advance pointer
  105|  2.21k|        melp->size -= 4;           // reduce counter
  106|  2.21k|      }
  107|  1.74k|      else if (melp->size > 0)
  ------------------
  |  Branch (107:16): [True: 1.33k, False: 410]
  ------------------
  108|  1.33k|      { // 4 or less
  109|  1.33k|        int i = 0;
  110|  2.60k|        while (melp->size > 1) {
  ------------------
  |  Branch (110:16): [True: 1.27k, False: 1.33k]
  ------------------
  111|  1.27k|          ui32 v = *melp->data++;    // read one byte at a time
  112|  1.27k|          ui32 m = ~(0xFFu << i);    // mask of location
  113|  1.27k|          val = (val & m) | (v << i);// put one byte in its correct location
  114|  1.27k|          --melp->size;
  115|  1.27k|          i += 8;
  116|  1.27k|        }
  117|       |        // size equal to 1
  118|  1.33k|        ui32 v = *melp->data++;    // the one before the last is different
  119|  1.33k|        v |= 0xF;                  // MEL and VLC segments can overlap
  120|  1.33k|        ui32 m = ~(0xFFu << i);
  121|  1.33k|        val = (val & m) | (v << i);
  122|  1.33k|        --melp->size;
  123|  1.33k|      }
  124|       |
  125|       |      // next we unstuff them before adding them to the buffer
  126|  3.95k|      int bits = 32 - melp->unstuff; // number of bits in val, subtract 1 if
  127|       |                                     // the previously read byte requires
  128|       |                                     // unstuffing
  129|       |
  130|       |      // data is unstuffed and accumulated in t
  131|       |      // bits has the number of bits in t
  132|  3.95k|      ui32 t = val & 0xFF;
  133|  3.95k|      bool unstuff = ((val & 0xFF) == 0xFF); // true if we need unstuffing
  134|  3.95k|      bits -= unstuff; // there is one less bit in t if unstuffing is needed
  135|  3.95k|      t = t << (8 - unstuff); // move up to make room for the next byte
  136|       |
  137|       |      //this is a repeat of the above
  138|  3.95k|      t |= (val>>8) & 0xFF;
  139|  3.95k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  140|  3.95k|      bits -= unstuff;
  141|  3.95k|      t = t << (8 - unstuff);
  142|       |
  143|  3.95k|      t |= (val>>16) & 0xFF;
  144|  3.95k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  145|  3.95k|      bits -= unstuff;
  146|  3.95k|      t = t << (8 - unstuff);
  147|       |
  148|  3.95k|      t |= (val>>24) & 0xFF;
  149|  3.95k|      melp->unstuff = (((val >> 24) & 0xFF) == 0xFF);
  150|       |
  151|       |      // move t to tmp, and push the result all the way up, so we read from
  152|       |      // the MSB
  153|  3.95k|      melp->tmp |= ((ui64)t) << (64 - bits - melp->bits);
  154|  3.95k|      melp->bits += bits; //increment the number of bits in tmp
  155|  3.95k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL9rev_fetchEPNS0_10rev_structE:
  423|   179k|    {
  424|   179k|      if (vlcp->bits < 32)  // if there are less then 32 bits, read more
  ------------------
  |  Branch (424:11): [True: 27.0k, False: 152k]
  ------------------
  425|  27.0k|      {
  426|  27.0k|        rev_read(vlcp);     // read 32 bits, but unstuffing might reduce this
  427|  27.0k|        if (vlcp->bits < 32)// if there is still space in vlcp->tmp for 32 bits
  ------------------
  |  Branch (427:13): [True: 76, False: 27.0k]
  ------------------
  428|     76|          rev_read(vlcp);   // read another 32
  429|  27.0k|      }
  430|   179k|      return (ui32)vlcp->tmp; // return the head (bottom-most) of vlcp->tmp
  431|   179k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11rev_advanceEPNS0_10rev_structEj:
  441|   719k|    {
  442|       |      assert(num_bits <= vlcp->bits); // vlcp->tmp must have more than num_bits
  443|   719k|      vlcp->tmp >>= num_bits;         // remove bits
  444|   719k|      vlcp->bits -= num_bits;         // decrement the number of bits
  445|   719k|      return (ui32)vlcp->tmp;
  446|   719k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL22decode_two_quad32_avx2EDv4_xS1_PNS0_16frwd_struct_avx2EjRDv2_x:
  787|  23.1k|    static inline __m256i decode_two_quad32_avx2(__m256i inf_u_q, __m256i U_q, frwd_struct_avx2* magsgn, ui32 p, __m128i& vn) {
  788|  23.1k|        __m256i row = _mm256_setzero_si256();
  789|       |
  790|       |        // we keeps e_k, e_1, and rho in w2
  791|  23.1k|        __m256i flags = _mm256_and_si256(inf_u_q, _mm256_set_epi32(0x8880, 0x4440, 0x2220, 0x1110, 0x8880, 0x4440, 0x2220, 0x1110));
  792|  23.1k|        __m256i insig = _mm256_cmpeq_epi32(flags, _mm256_setzero_si256());
  793|       |
  794|  23.1k|        if ((uint32_t)_mm256_movemask_epi8(insig) != (uint32_t)0xFFFFFFFF) //are all insignificant?
  ------------------
  |  Branch (794:13): [True: 12.9k, False: 10.1k]
  ------------------
  795|  12.9k|        {
  796|  12.9k|            flags = _mm256_mullo_epi16(flags, _mm256_set_epi16(1, 1, 2, 2, 4, 4, 8, 8, 1, 1, 2, 2, 4, 4, 8, 8));
  797|       |
  798|       |            // U_q holds U_q for this quad
  799|       |            // flags has e_k, e_1, and rho such that e_k is sitting in the
  800|       |            // 0x8000, e_1 in 0x800, and rho in 0x80
  801|       |
  802|       |            // next e_k and m_n
  803|  12.9k|            __m256i m_n;
  804|  12.9k|            __m256i w0 = _mm256_srli_epi32(flags, 15); // e_k
  805|  12.9k|            m_n = _mm256_sub_epi32(U_q, w0);
  806|  12.9k|            m_n = _mm256_andnot_si256(insig, m_n);
  807|       |
  808|       |            // find cumulative sums
  809|       |            // to find at which bit in ms_vec the sample starts
  810|  12.9k|            __m256i inc_sum = m_n; // inclusive scan
  811|  12.9k|            inc_sum = _mm256_add_epi32(inc_sum, _mm256_bslli_epi128(inc_sum, 4));
  812|  12.9k|            inc_sum = _mm256_add_epi32(inc_sum, _mm256_bslli_epi128(inc_sum, 8));
  813|  12.9k|            int total_mn1 = _mm256_extract_epi16(inc_sum, 6);
  814|  12.9k|            int total_mn2 = _mm256_extract_epi16(inc_sum, 14);
  815|       |
  816|  12.9k|            __m128i ms_vec0 = _mm_setzero_si128();
  817|  12.9k|            __m128i ms_vec1 = _mm_setzero_si128();
  818|  12.9k|            if (total_mn1) {
  ------------------
  |  Branch (818:17): [True: 11.0k, False: 1.90k]
  ------------------
  819|  11.0k|                ms_vec0 = frwd_fetch<0xFF>(magsgn);
  820|  11.0k|                frwd_advance(magsgn, (ui32)total_mn1);
  821|  11.0k|            }
  822|  12.9k|            if (total_mn2) {
  ------------------
  |  Branch (822:17): [True: 7.78k, False: 5.21k]
  ------------------
  823|  7.78k|                ms_vec1 = frwd_fetch<0xFF>(magsgn);
  824|  7.78k|                frwd_advance(magsgn, (ui32)total_mn2);
  825|  7.78k|            }
  826|       |
  827|  12.9k|            __m256i ms_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ms_vec0), ms_vec1, 0x1);
  828|       |
  829|  12.9k|            __m256i ex_sum = _mm256_bslli_epi128(inc_sum, 4); // exclusive scan
  830|       |
  831|       |            // find the starting byte and starting bit
  832|  12.9k|            __m256i byte_idx = _mm256_srli_epi32(ex_sum, 3);
  833|  12.9k|            __m256i bit_idx = _mm256_and_si256(ex_sum, _mm256_set1_epi32(7));
  834|  12.9k|            byte_idx = _mm256_shuffle_epi8(byte_idx,
  835|  12.9k|                _mm256_set_epi32(0x0C0C0C0C, 0x08080808, 0x04040404, 0x00000000, 0x0C0C0C0C, 0x08080808, 0x04040404, 0x00000000));
  836|  12.9k|            byte_idx = _mm256_add_epi32(byte_idx, _mm256_set1_epi32(0x03020100));
  837|  12.9k|            __m256i d0 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  838|  12.9k|            byte_idx = _mm256_add_epi32(byte_idx, _mm256_set1_epi32(0x01010101));
  839|  12.9k|            __m256i d1 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  840|       |
  841|       |            // shift samples values to correct location
  842|  12.9k|            bit_idx = _mm256_or_si256(bit_idx, _mm256_slli_epi32(bit_idx, 16));
  843|       |
  844|  12.9k|            __m128i a = _mm_set_epi8(1, 3, 7, 15, 31, 63, 127, -1, 1, 3, 7, 15, 31, 63, 127, -1);
  845|  12.9k|            __m256i aa = _mm256_inserti128_si256(_mm256_castsi128_si256(a), a, 0x1);
  846|       |
  847|  12.9k|            __m256i bit_shift = _mm256_shuffle_epi8(aa, bit_idx);
  848|  12.9k|            bit_shift = _mm256_add_epi16(bit_shift, _mm256_set1_epi16(0x0101));
  849|  12.9k|            d0 = _mm256_mullo_epi16(d0, bit_shift);
  850|  12.9k|            d0 = _mm256_srli_epi16(d0, 8); // we should have 8 bits in the LSB
  851|  12.9k|            d1 = _mm256_mullo_epi16(d1, bit_shift);
  852|  12.9k|            d1 = _mm256_and_si256(d1, _mm256_set1_epi32((si32)0xFF00FF00)); // 8 in MSB
  853|  12.9k|            d0 = _mm256_or_si256(d0, d1);
  854|       |
  855|       |            // find location of e_k and mask
  856|  12.9k|            __m256i shift;
  857|  12.9k|            __m256i ones = _mm256_set1_epi32(1);
  858|  12.9k|            __m256i twos = _mm256_set1_epi32(2);
  859|  12.9k|            __m256i U_q_m1 = _mm256_sub_epi32(U_q, ones);
  860|  12.9k|            U_q_m1 = _mm256_and_si256(U_q_m1, _mm256_set_epi32(0, 0, 0, 0x1F, 0, 0, 0, 0x1F));
  861|  12.9k|            U_q_m1 = _mm256_shuffle_epi32(U_q_m1, 0);
  862|  12.9k|            w0 = _mm256_sub_epi32(twos, w0);
  863|  12.9k|            shift = _mm256_sllv_epi32(w0, U_q_m1); // U_q_m1 must be no more than 31
  864|  12.9k|            ms_vec = _mm256_and_si256(d0, _mm256_sub_epi32(shift, ones));
  865|       |
  866|       |            // next e_1
  867|  12.9k|            w0 = _mm256_and_si256(flags, _mm256_set1_epi32(0x800));
  868|  12.9k|            w0 = _mm256_cmpeq_epi32(w0, _mm256_setzero_si256());
  869|  12.9k|            w0 = _mm256_andnot_si256(w0, shift);  // e_1 in correct position
  870|  12.9k|            ms_vec = _mm256_or_si256(ms_vec, w0); // e_1
  871|  12.9k|            w0 = _mm256_slli_epi32(ms_vec, 31);   // sign
  872|  12.9k|            ms_vec = _mm256_or_si256(ms_vec, ones); // bin center
  873|  12.9k|            __m256i tvn = ms_vec;
  874|  12.9k|            ms_vec = _mm256_add_epi32(ms_vec, twos);// + 2
  875|  12.9k|            ms_vec = _mm256_slli_epi32(ms_vec, (si32)p - 1);
  876|  12.9k|            ms_vec = _mm256_or_si256(ms_vec, w0); // sign
  877|  12.9k|            row = _mm256_andnot_si256(insig, ms_vec); // significant only
  878|       |
  879|  12.9k|            ms_vec = _mm256_andnot_si256(insig, tvn); // significant only
  880|       |
  881|  12.9k|            tvn = _mm256_shuffle_epi8(ms_vec, _mm256_set_epi32(-1, 0x0F0E0D0C, 0x07060504, -1, -1, -1, 0x0F0E0D0C, 0x07060504));
  882|       |
  883|  12.9k|            vn = _mm_or_si128(vn, _mm256_castsi256_si128(tvn));
  884|       |            vn = _mm_or_si128(vn, _mm256_extracti128_si256(tvn, 0x1));
  885|  12.9k|        }
  886|  23.1k|        return row;
  887|  23.1k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL10frwd_fetchILi255EEEDv2_xPNS0_16frwd_struct_avx2E:
  766|  80.0k|    {
  767|  80.0k|      if (msp->bits <= 128)
  ------------------
  |  Branch (767:11): [True: 16.9k, False: 63.1k]
  ------------------
  768|  16.9k|      {
  769|  16.9k|        frwd_read<X>(msp);
  770|  16.9k|        if (msp->bits <= 128) //need to test
  ------------------
  |  Branch (770:13): [True: 0, False: 16.9k]
  ------------------
  771|      0|          frwd_read<X>(msp);
  772|  16.9k|      }
  773|  80.0k|      __m128i t = _mm_loadu_si128((__m128i*)msp->tmp);
  774|  80.0k|      return t;
  775|  80.0k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL9frwd_readILi255EEEvPNS0_16frwd_struct_avx2E:
  616|  36.1k|    {
  617|  36.1k|      assert(msp->bits <= 128);
  618|       |
  619|  36.1k|      __m128i offset, val, validity, all_xff;
  620|  36.1k|      val = _mm_loadu_si128((__m128i*)msp->data);
  621|  36.1k|      int bytes = msp->size >= 16 ? 16 : msp->size;
  ------------------
  |  Branch (621:19): [True: 22.0k, False: 14.0k]
  ------------------
  622|  36.1k|      validity = _mm_set1_epi8((char)bytes);
  623|  36.1k|      msp->data += bytes;
  624|  36.1k|      msp->size -= bytes;
  625|  36.1k|      int bits = 128;
  626|  36.1k|      offset = _mm_set_epi64x(0x0F0E0D0C0B0A0908,0x0706050403020100);
  627|  36.1k|      validity = _mm_cmpgt_epi8(validity, offset);
  628|  36.1k|      all_xff = _mm_set1_epi8(-1);
  629|  36.1k|      if (X == 0xFF) // the compiler should remove this if statement
  ------------------
  |  Branch (629:11): [True: 36.1k, Folded]
  ------------------
  630|  36.1k|      {
  631|  36.1k|        __m128i t = _mm_xor_si128(validity, all_xff); // complement
  632|  36.1k|        val = _mm_or_si128(t, val); // fill with 0xFF
  633|  36.1k|      }
  634|      0|      else if (X == 0)
  ------------------
  |  Branch (634:16): [Folded, False: 0]
  ------------------
  635|      0|        val = _mm_and_si128(validity, val); // fill with zeros
  636|      0|      else
  637|      0|        assert(0);
  638|       |
  639|  36.1k|      __m128i ff_bytes;
  640|  36.1k|      ff_bytes = _mm_cmpeq_epi8(val, all_xff);
  641|  36.1k|      ff_bytes = _mm_and_si128(ff_bytes, validity);
  642|  36.1k|      ui32 flags = (ui32)_mm_movemask_epi8(ff_bytes);
  643|  36.1k|      flags <<= 1; // unstuff following byte
  644|  36.1k|      ui32 next_unstuff = flags >> 16;
  645|  36.1k|      flags |= msp->unstuff;
  646|  36.1k|      flags &= 0xFFFF;
  647|  98.3k|      while (flags)
  ------------------
  |  Branch (647:14): [True: 62.2k, False: 36.1k]
  ------------------
  648|  62.2k|      { // bit unstuffing occurs on average once every 256 bytes
  649|       |        // therefore it is not an issue if it is a bit slow
  650|       |        // here we process 16 bytes
  651|  62.2k|        --bits; // consuming one stuffing bit
  652|       |
  653|  62.2k|        ui32 loc = 31 - count_leading_zeros(flags);
  654|  62.2k|        flags ^= 1 << loc;
  655|       |
  656|  62.2k|        __m128i m, t, c;
  657|  62.2k|        t = _mm_set1_epi8((char)loc);
  658|  62.2k|        m = _mm_cmpgt_epi8(offset, t);
  659|       |
  660|  62.2k|        t = _mm_and_si128(m, val);  // keep bits at locations larger than loc
  661|  62.2k|        c = _mm_srli_epi64(t, 1);   // 1 bits left
  662|  62.2k|        t = _mm_srli_si128(t, 8);   // 8 bytes left
  663|  62.2k|        t = _mm_slli_epi64(t, 63);  // keep the MSB only
  664|  62.2k|        t = _mm_or_si128(t, c);     // combine the above 3 steps
  665|       |
  666|  62.2k|        val = _mm_or_si128(t, _mm_andnot_si128(m, val));
  667|  62.2k|      }
  668|       |
  669|       |      // combine with earlier data
  670|  36.1k|      assert(msp->bits >= 0 && msp->bits <= 128);
  671|  36.1k|      int cur_bytes = msp->bits >> 3;
  672|  36.1k|      int cur_bits = msp->bits & 7;
  673|  36.1k|      __m128i b1, b2;
  674|  36.1k|      b1 = _mm_sll_epi64(val, _mm_set1_epi64x(cur_bits));
  675|  36.1k|      b2 = _mm_slli_si128(val, 8);  // 8 bytes right
  676|  36.1k|      b2 = _mm_srl_epi64(b2, _mm_set1_epi64x(64-cur_bits));
  677|  36.1k|      b1 = _mm_or_si128(b1, b2);
  678|  36.1k|      b2 = _mm_loadu_si128((__m128i*)(msp->tmp + cur_bytes));
  679|  36.1k|      b2 = _mm_or_si128(b1, b2);
  680|  36.1k|      _mm_storeu_si128((__m128i*)(msp->tmp + cur_bytes), b2);
  681|       |
  682|  36.1k|      int consumed_bits = bits < 128 - cur_bits ? bits : 128 - cur_bits;
  ------------------
  |  Branch (682:27): [True: 14.4k, False: 21.6k]
  ------------------
  683|  36.1k|      cur_bytes = (msp->bits + (ui32)consumed_bits + 7) >> 3; // round up
  684|  36.1k|      int upper = _mm_extract_epi16(val, 7);
  685|  36.1k|      upper >>= consumed_bits - 128 + 16;
  686|  36.1k|      msp->tmp[cur_bytes] = (ui8)upper; // copy byte
  687|       |
  688|  36.1k|      msp->bits += (ui32)bits;
  689|  36.1k|      msp->unstuff = next_unstuff;   // next unstuff
  690|       |      assert(msp->unstuff == 0 || msp->unstuff == 1);
  691|  36.1k|    }
_ZN4ojph5local16avx2_lzcnt_epi32EDv4_x:
 1039|  40.2k|    inline __m256i avx2_lzcnt_epi32(__m256i v) {
 1040|       |        // prevent value from being rounded up to the next power of two
 1041|  40.2k|        v = _mm256_andnot_si256(_mm256_srli_epi32(v, 8), v);  // keep 8 MSB
 1042|       |
 1043|  40.2k|        v = _mm256_castps_si256(_mm256_cvtepi32_ps(v));    // convert an integer to float
 1044|  40.2k|        v = _mm256_srli_epi32(v, 23);                   // shift down the exponent
 1045|  40.2k|        v = _mm256_subs_epu16(_mm256_set1_epi32(158), v);  // undo bias
 1046|  40.2k|        v = _mm256_min_epi16(v, _mm256_set1_epi32(32));    // clamp at 32
 1047|       |
 1048|  40.2k|        return v;
 1049|  40.2k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL18decode_four_quad16EDv2_xS1_PNS0_16frwd_struct_avx2EjRS1_:
  901|  72.1k|    static inline __m256i decode_four_quad16(const __m128i inf_u_q, __m128i U_q, frwd_struct_avx2* magsgn, ui32 p, __m128i& vn) {
  902|       |
  903|  72.1k|        __m256i w0;     // workers
  904|  72.1k|        __m256i insig;  // lanes hold FF's if samples are insignificant
  905|  72.1k|        __m256i flags;  // lanes hold e_k, e_1, and rho
  906|       |
  907|  72.1k|        __m256i row = _mm256_setzero_si256();
  908|  72.1k|        __m128i ddd = _mm_shuffle_epi8(inf_u_q,
  909|  72.1k|            _mm_set_epi16(0x0d0c, 0x0d0c, 0x0908, 0x908, 0x0504, 0x0504, 0x0100, 0x0100));
  910|  72.1k|        w0 = _mm256_permutevar8x32_epi32(_mm256_castsi128_si256(ddd),
  911|  72.1k|            _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3));
  912|       |        // we keeps e_k, e_1, and rho in w2
  913|  72.1k|        flags = _mm256_and_si256(w0,
  914|  72.1k|            _mm256_set_epi16((si16)0x8880, 0x4440, 0x2220, 0x1110,
  915|  72.1k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110,
  916|  72.1k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110,
  917|  72.1k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110));
  918|  72.1k|        insig = _mm256_cmpeq_epi16(flags, _mm256_setzero_si256());
  919|  72.1k|        if ((uint32_t)_mm256_movemask_epi8(insig) != (uint32_t)0xFFFFFFFF) //are all insignificant?
  ------------------
  |  Branch (919:13): [True: 40.0k, False: 32.1k]
  ------------------
  920|  40.0k|        {
  921|  40.0k|            ddd = _mm_or_si128(_mm_bslli_si128(U_q, 2), U_q);
  922|  40.0k|            __m256i U_q_avx = _mm256_permutevar8x32_epi32(_mm256_castsi128_si256(ddd),
  923|  40.0k|                _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3));
  924|  40.0k|            flags = _mm256_mullo_epi16(flags, _mm256_set_epi16(1, 2, 4, 8, 1, 2, 4, 8, 1, 2, 4, 8, 1, 2, 4, 8));
  925|       |
  926|       |            // U_q holds U_q for this quad
  927|       |            // flags has e_k, e_1, and rho such that e_k is sitting in the
  928|       |            // 0x8000, e_1 in 0x800, and rho in 0x80
  929|       |
  930|       |            // next e_k and m_n
  931|  40.0k|            __m256i m_n;
  932|  40.0k|            w0 = _mm256_srli_epi16(flags, 15); // e_k
  933|  40.0k|            m_n = _mm256_sub_epi16(U_q_avx, w0);
  934|  40.0k|            m_n = _mm256_andnot_si256(insig, m_n);
  935|       |
  936|       |            // find cumulative sums
  937|       |            // to find at which bit in ms_vec the sample starts
  938|  40.0k|            __m256i inc_sum = m_n; // inclusive scan
  939|  40.0k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 2));
  940|  40.0k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 4));
  941|  40.0k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 8));
  942|  40.0k|            int total_mn1 = _mm256_extract_epi16(inc_sum, 7);
  943|  40.0k|            int total_mn2 = _mm256_extract_epi16(inc_sum, 15);
  944|  40.0k|            __m256i ex_sum = _mm256_bslli_epi128(inc_sum, 2); // exclusive scan
  945|       |
  946|  40.0k|            __m128i ms_vec0 = _mm_setzero_si128();
  947|  40.0k|            __m128i ms_vec1 = _mm_setzero_si128();
  948|  40.0k|            if (total_mn1) {
  ------------------
  |  Branch (948:17): [True: 37.1k, False: 2.95k]
  ------------------
  949|  37.1k|                ms_vec0 = frwd_fetch<0xFF>(magsgn);
  950|  37.1k|                frwd_advance(magsgn, (ui32)total_mn1);
  951|  37.1k|            }
  952|  40.0k|            if (total_mn2) {
  ------------------
  |  Branch (952:17): [True: 24.0k, False: 16.0k]
  ------------------
  953|  24.0k|                ms_vec1 = frwd_fetch<0xFF>(magsgn);
  954|  24.0k|                frwd_advance(magsgn, (ui32)total_mn2);
  955|  24.0k|            }
  956|       |
  957|  40.0k|            __m256i ms_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ms_vec0), ms_vec1, 0x1);
  958|       |
  959|       |            // find the starting byte and starting bit
  960|  40.0k|            __m256i byte_idx = _mm256_srli_epi16(ex_sum, 3);
  961|  40.0k|            __m256i bit_idx = _mm256_and_si256(ex_sum, _mm256_set1_epi16(7));
  962|  40.0k|            byte_idx = _mm256_shuffle_epi8(byte_idx,
  963|  40.0k|                _mm256_set_epi16(0x0E0E, 0x0C0C, 0x0A0A, 0x0808,
  964|  40.0k|                    0x0606, 0x0404, 0x0202, 0x0000, 0x0E0E, 0x0C0C, 0x0A0A, 0x0808,
  965|  40.0k|                    0x0606, 0x0404, 0x0202, 0x0000));
  966|  40.0k|            byte_idx = _mm256_add_epi16(byte_idx, _mm256_set1_epi16(0x0100));
  967|  40.0k|            __m256i d0 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  968|  40.0k|            byte_idx = _mm256_add_epi16(byte_idx, _mm256_set1_epi16(0x0101));
  969|  40.0k|            __m256i d1 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  970|       |
  971|       |            // shift samples values to correct location
  972|  40.0k|            __m256i bit_shift = _mm256_shuffle_epi8(
  973|  40.0k|                _mm256_set_epi8(1, 3, 7, 15, 31, 63, 127, -1,
  974|  40.0k|                    1, 3, 7, 15, 31, 63, 127, -1, 1, 3, 7, 15, 31, 63, 127, -1,
  975|  40.0k|                    1, 3, 7, 15, 31, 63, 127, -1), bit_idx);
  976|  40.0k|            bit_shift = _mm256_add_epi16(bit_shift, _mm256_set1_epi16(0x0101));
  977|  40.0k|            d0 = _mm256_mullo_epi16(d0, bit_shift);
  978|  40.0k|            d0 = _mm256_srli_epi16(d0, 8); // we should have 8 bits in the LSB
  979|  40.0k|            d1 = _mm256_mullo_epi16(d1, bit_shift);
  980|  40.0k|            d1 = _mm256_and_si256(d1, _mm256_set1_epi16((si16)0xFF00)); // 8 in MSB
  981|  40.0k|            d0 = _mm256_or_si256(d0, d1);
  982|       |
  983|       |            // find location of e_k and mask
  984|  40.0k|            __m256i shift, t0, t1, Uq0, Uq1;
  985|  40.0k|            __m256i ones = _mm256_set1_epi16(1);
  986|  40.0k|            __m256i twos = _mm256_set1_epi16(2);
  987|  40.0k|            __m256i U_q_m1 = _mm256_sub_epi32(U_q_avx, ones);
  988|  40.0k|            Uq0 = _mm256_and_si256(U_q_m1, _mm256_set_epi32(0, 0, 0, 0x1F, 0, 0, 0, 0x1F));
  989|  40.0k|            Uq1 = _mm256_bsrli_epi128(U_q_m1, 14);
  990|  40.0k|            w0 = _mm256_sub_epi16(twos, w0);
  991|  40.0k|            t0 = _mm256_and_si256(w0, _mm256_set_epi64x(0, -1, 0, -1));
  992|  40.0k|            t1 = _mm256_and_si256(w0, _mm256_set_epi64x(-1, 0, -1, 0));
  993|  40.0k|            {//no _mm256_sllv_epi16 in avx2
  994|  40.0k|                __m128i t_0_sse = _mm256_castsi256_si128(t0);
  995|  40.0k|                t_0_sse = _mm_sll_epi16(t_0_sse, _mm256_castsi256_si128(Uq0));
  996|  40.0k|                __m128i t_1_sse = _mm256_extracti128_si256(t0 , 0x1);
  997|  40.0k|                t_1_sse = _mm_sll_epi16(t_1_sse, _mm256_extracti128_si256(Uq0, 0x1));
  998|  40.0k|                t0 = _mm256_inserti128_si256(_mm256_castsi128_si256(t_0_sse), t_1_sse, 0x1);
  999|       |
 1000|  40.0k|                t_0_sse = _mm256_castsi256_si128(t1);
 1001|  40.0k|                t_0_sse = _mm_sll_epi16(t_0_sse, _mm256_castsi256_si128(Uq1));
 1002|  40.0k|                t_1_sse = _mm256_extracti128_si256(t1, 0x1);
 1003|  40.0k|                t_1_sse = _mm_sll_epi16(t_1_sse, _mm256_extracti128_si256(Uq1, 0x1));
 1004|  40.0k|                t1 = _mm256_inserti128_si256(_mm256_castsi128_si256(t_0_sse), t_1_sse, 0x1);
 1005|  40.0k|            }
 1006|  40.0k|            shift = _mm256_or_si256(t0, t1);
 1007|  40.0k|            ms_vec = _mm256_and_si256(d0, _mm256_sub_epi16(shift, ones));
 1008|       |
 1009|       |            // next e_1
 1010|  40.0k|            w0 = _mm256_and_si256(flags, _mm256_set1_epi16(0x800));
 1011|  40.0k|            w0 = _mm256_cmpeq_epi16(w0, _mm256_setzero_si256());
 1012|  40.0k|            w0 = _mm256_andnot_si256(w0, shift);  // e_1 in correct position
 1013|  40.0k|            ms_vec = _mm256_or_si256(ms_vec, w0); // e_1
 1014|  40.0k|            w0 = _mm256_slli_epi16(ms_vec, 15);   // sign
 1015|  40.0k|            ms_vec = _mm256_or_si256(ms_vec, ones); // bin center
 1016|  40.0k|            __m256i tvn = ms_vec;
 1017|  40.0k|            ms_vec = _mm256_add_epi16(ms_vec, twos);// + 2
 1018|  40.0k|            ms_vec = _mm256_slli_epi16(ms_vec, (si32)p - 1);
 1019|  40.0k|            ms_vec = _mm256_or_si256(ms_vec, w0); // sign
 1020|  40.0k|            row = _mm256_andnot_si256(insig, ms_vec); // significant only
 1021|       |
 1022|  40.0k|            ms_vec = _mm256_andnot_si256(insig, tvn); // significant only
 1023|       |
 1024|  40.0k|            __m256i ms_vec_shuffle1 = _mm256_shuffle_epi8(ms_vec,
 1025|  40.0k|                _mm256_set_epi16(-1, -1, -1, -1, 0x0706, 0x0302, -1, -1,
 1026|  40.0k|                                 -1, -1, -1, -1, -1, -1, 0x0706, 0x0302));
 1027|  40.0k|            __m256i ms_vec_shuffle2 = _mm256_shuffle_epi8(ms_vec,
 1028|  40.0k|                _mm256_set_epi16(-1, -1, -1, 0x0F0E, 0x0B0A, -1, -1, -1,
 1029|  40.0k|                                 -1, -1, -1, -1, -1, 0x0F0E, 0x0B0A, -1));
 1030|  40.0k|            ms_vec = _mm256_or_si256(ms_vec_shuffle1, ms_vec_shuffle2);
 1031|       |
 1032|  40.0k|            vn = _mm_or_si128(vn, _mm256_castsi256_si128(ms_vec));
 1033|       |            vn = _mm_or_si128(vn, _mm256_extracti128_si256(ms_vec, 0x1));
 1034|  40.0k|        }
 1035|  72.1k|        return row;
 1036|  72.1k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL12frwd_advanceEPNS0_16frwd_struct_avx2Ej:
  726|   127k|    {
  727|   127k|      assert(num_bits > 0 && num_bits <= msp->bits && num_bits < 128);
  728|   127k|      msp->bits -= num_bits;
  729|       |
  730|   127k|      __m128i *p = (__m128i*)(msp->tmp + ((num_bits >> 3) & 0x18));
  731|   127k|      num_bits &= 63;
  732|       |
  733|   127k|      __m128i v0, v1, c0, c1, t;
  734|   127k|      v0 = _mm_loadu_si128(p);
  735|   127k|      v1 = _mm_loadu_si128(p + 1);
  736|       |
  737|       |      // shift right by num_bits
  738|   127k|      c0 = _mm_srl_epi64(v0, _mm_set1_epi64x(num_bits));
  739|   127k|      t = _mm_srli_si128(v0, 8);
  740|   127k|      t = _mm_sll_epi64(t, _mm_set1_epi64x(64 - num_bits));
  741|   127k|      c0 = _mm_or_si128(c0, t);
  742|   127k|      t = _mm_slli_si128(v1, 8);
  743|   127k|      t = _mm_sll_epi64(t, _mm_set1_epi64x(64 - num_bits));
  744|   127k|      c0 = _mm_or_si128(c0, t);
  745|       |
  746|   127k|      _mm_storeu_si128((__m128i*)msp->tmp, c0);
  747|       |
  748|   127k|      c1 = _mm_srl_epi64(v1, _mm_set1_epi64x(num_bits));
  749|   127k|      t = _mm_srli_si128(v1, 8);
  750|   127k|      t = _mm_sll_epi64(t, _mm_set1_epi64x(64 - num_bits));
  751|   127k|      c1 = _mm_or_si128(c1, t);
  752|       |
  753|   127k|      _mm_storeu_si128((__m128i*)msp->tmp + 1, c1);
  754|   127k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL12rev_init_mrpEPNS0_10rev_structEPhii:
  525|  10.9k|    {
  526|  10.9k|      mrp->data = data + lcup + len2 - 1;
  527|  10.9k|      mrp->size = len2;
  528|  10.9k|      mrp->unstuff = true;
  529|  10.9k|      mrp->bits = 0;
  530|  10.9k|      mrp->tmp = 0;
  531|       |
  532|       |      //This code is designed for an architecture that read address should
  533|       |      // align to the read size (address multiple of 4 if read size is 4)
  534|       |      //These few lines take care of the case where data is not at a multiple
  535|       |      // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the MRP stream
  536|  10.9k|      int num = 1 + (int)(intptr_t(mrp->data) & 0x3);
  537|  40.3k|      for (int i = 0; i < num; ++i) {
  ------------------
  |  Branch (537:23): [True: 29.3k, False: 10.9k]
  ------------------
  538|  29.3k|        ui64 d;
  539|       |        //read a byte, 0 if no more data
  540|  29.3k|        d = (mrp->size-- > 0) ? *mrp->data-- : 0;
  ------------------
  |  Branch (540:13): [True: 27.9k, False: 1.40k]
  ------------------
  541|       |        //check if unstuffing is needed
  542|  29.3k|        ui32 d_bits = 8 - ((mrp->unstuff && ((d & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (542:29): [True: 15.0k, False: 14.3k]
  |  Branch (542:45): [True: 2.40k, False: 12.6k]
  ------------------
  543|  29.3k|        mrp->tmp |= d << mrp->bits; // move data to vlcp->tmp
  544|  29.3k|        mrp->bits += d_bits;
  545|  29.3k|        mrp->unstuff = d > 0x8F; // for next byte
  546|  29.3k|      }
  547|  10.9k|      rev_read_mrp(mrp);
  548|  10.9k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL12rev_read_mrpEPNS0_10rev_structE:
  461|  14.6k|    {
  462|       |      //process 4 bytes at a time
  463|  14.6k|      if (mrp->bits > 32)
  ------------------
  |  Branch (463:11): [True: 0, False: 14.6k]
  ------------------
  464|      0|        return;
  465|  14.6k|      ui32 val = 0;
  466|  14.6k|      if (mrp->size > 3) // If there are 3 byte or more
  ------------------
  |  Branch (466:11): [True: 10.5k, False: 4.06k]
  ------------------
  467|  10.5k|      { // (mrp->data - 3) move pointer back to read 32 bits at once
  468|  10.5k|        val = *(ui32*)(mrp->data - 3); // read 32 bits
  469|  10.5k|        mrp->data -= 4;                // move back pointer
  470|  10.5k|        mrp->size -= 4;                // reduce count
  471|  10.5k|      }
  472|  4.06k|      else if (mrp->size > 0)
  ------------------
  |  Branch (472:16): [True: 1.76k, False: 2.29k]
  ------------------
  473|  1.76k|      {
  474|  1.76k|        int i = 24;
  475|  6.09k|        while (mrp->size > 0) {
  ------------------
  |  Branch (475:16): [True: 4.32k, False: 1.76k]
  ------------------
  476|  4.32k|          ui32 v = *mrp->data--; // read one byte at a time
  477|  4.32k|          val |= (v << i);       // put byte in its correct location
  478|  4.32k|          --mrp->size;
  479|  4.32k|          i -= 8;
  480|  4.32k|        }
  481|  1.76k|      }
  482|       |
  483|       |      //accumulate in tmp, and keep count in bits
  484|  14.6k|      ui32 bits, tmp = val >> 24;
  485|       |
  486|       |      //test if the last byte > 0x8F (unstuff must be true) and this is 0x7F
  487|  14.6k|      bits = 8 - ((mrp->unstuff && (((val >> 24) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (487:20): [True: 4.96k, False: 9.66k]
  |  Branch (487:36): [True: 3.40k, False: 1.55k]
  ------------------
  488|  14.6k|      bool unstuff = (val >> 24) > 0x8F;
  489|       |
  490|       |      //process the next byte
  491|  14.6k|      tmp |= ((val >> 16) & 0xFF) << bits;
  492|  14.6k|      bits += 8 - ((unstuff && (((val >> 16) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (492:21): [True: 6.67k, False: 7.94k]
  |  Branch (492:32): [True: 2.97k, False: 3.70k]
  ------------------
  493|  14.6k|      unstuff = ((val >> 16) & 0xFF) > 0x8F;
  494|       |
  495|  14.6k|      tmp |= ((val >> 8) & 0xFF) << bits;
  496|  14.6k|      bits += 8 - ((unstuff && (((val >> 8) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (496:21): [True: 5.49k, False: 9.13k]
  |  Branch (496:32): [True: 1.80k, False: 3.69k]
  ------------------
  497|  14.6k|      unstuff = ((val >> 8) & 0xFF) > 0x8F;
  498|       |
  499|  14.6k|      tmp |= (val & 0xFF) << bits;
  500|  14.6k|      bits += 8 - ((unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (500:21): [True: 3.93k, False: 10.6k]
  |  Branch (500:32): [True: 2.09k, False: 1.84k]
  ------------------
  501|  14.6k|      unstuff = (val & 0xFF) > 0x8F;
  502|       |
  503|  14.6k|      mrp->tmp |= (ui64)tmp << mrp->bits; // move data to mrp pointer
  504|  14.6k|      mrp->bits += bits;
  505|  14.6k|      mrp->unstuff = unstuff;             // next byte
  506|  14.6k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL13rev_fetch_mrpEPNS0_10rev_structE:
  559|  58.4k|    {
  560|  58.4k|      if (mrp->bits < 32) // if there are less than 32 bits in mrp->tmp
  ------------------
  |  Branch (560:11): [True: 3.63k, False: 54.8k]
  ------------------
  561|  3.63k|      {
  562|  3.63k|        rev_read_mrp(mrp);    // read 30-32 bits from mrp
  563|  3.63k|        if (mrp->bits < 32)   // if there is a space of 32 bits
  ------------------
  |  Branch (563:13): [True: 0, False: 3.63k]
  ------------------
  564|      0|          rev_read_mrp(mrp);  // read more
  565|  3.63k|      }
  566|  58.4k|      return (ui32)mrp->tmp;  // return the head of mrp->tmp
  567|  58.4k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL9frwd_initILi255EEEvPNS0_16frwd_struct_avx2EPKhi:
  705|  19.2k|    {
  706|  19.2k|      msp->data = data;
  707|  19.2k|      _mm_storeu_si128((__m128i *)msp->tmp, _mm_setzero_si128());
  708|  19.2k|      _mm_storeu_si128((__m128i *)msp->tmp + 1, _mm_setzero_si128());
  709|  19.2k|      _mm_storeu_si128((__m128i *)msp->tmp + 2, _mm_setzero_si128());
  710|       |
  711|  19.2k|      msp->bits = 0;
  712|  19.2k|      msp->unstuff = 0;
  713|  19.2k|      msp->size = size;
  714|       |
  715|  19.2k|      frwd_read<X>(msp); // read 128 bits more
  716|  19.2k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL9frwd_initILi0EEEvPNS0_16frwd_struct_avx2EPKhi:
  705|  12.7k|    {
  706|  12.7k|      msp->data = data;
  707|  12.7k|      _mm_storeu_si128((__m128i *)msp->tmp, _mm_setzero_si128());
  708|  12.7k|      _mm_storeu_si128((__m128i *)msp->tmp + 1, _mm_setzero_si128());
  709|  12.7k|      _mm_storeu_si128((__m128i *)msp->tmp + 2, _mm_setzero_si128());
  710|       |
  711|  12.7k|      msp->bits = 0;
  712|  12.7k|      msp->unstuff = 0;
  713|  12.7k|      msp->size = size;
  714|       |
  715|  12.7k|      frwd_read<X>(msp); // read 128 bits more
  716|  12.7k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL9frwd_readILi0EEEvPNS0_16frwd_struct_avx2E:
  616|  23.8k|    {
  617|  23.8k|      assert(msp->bits <= 128);
  618|       |
  619|  23.8k|      __m128i offset, val, validity, all_xff;
  620|  23.8k|      val = _mm_loadu_si128((__m128i*)msp->data);
  621|  23.8k|      int bytes = msp->size >= 16 ? 16 : msp->size;
  ------------------
  |  Branch (621:19): [True: 2.84k, False: 20.9k]
  ------------------
  622|  23.8k|      validity = _mm_set1_epi8((char)bytes);
  623|  23.8k|      msp->data += bytes;
  624|  23.8k|      msp->size -= bytes;
  625|  23.8k|      int bits = 128;
  626|  23.8k|      offset = _mm_set_epi64x(0x0F0E0D0C0B0A0908,0x0706050403020100);
  627|  23.8k|      validity = _mm_cmpgt_epi8(validity, offset);
  628|  23.8k|      all_xff = _mm_set1_epi8(-1);
  629|  23.8k|      if (X == 0xFF) // the compiler should remove this if statement
  ------------------
  |  Branch (629:11): [Folded, False: 23.8k]
  ------------------
  630|      0|      {
  631|      0|        __m128i t = _mm_xor_si128(validity, all_xff); // complement
  632|      0|        val = _mm_or_si128(t, val); // fill with 0xFF
  633|      0|      }
  634|  23.8k|      else if (X == 0)
  ------------------
  |  Branch (634:16): [True: 23.8k, Folded]
  ------------------
  635|  23.8k|        val = _mm_and_si128(validity, val); // fill with zeros
  636|      0|      else
  637|  23.8k|        assert(0);
  638|       |
  639|  23.8k|      __m128i ff_bytes;
  640|  23.8k|      ff_bytes = _mm_cmpeq_epi8(val, all_xff);
  641|  23.8k|      ff_bytes = _mm_and_si128(ff_bytes, validity);
  642|  23.8k|      ui32 flags = (ui32)_mm_movemask_epi8(ff_bytes);
  643|  23.8k|      flags <<= 1; // unstuff following byte
  644|  23.8k|      ui32 next_unstuff = flags >> 16;
  645|  23.8k|      flags |= msp->unstuff;
  646|  23.8k|      flags &= 0xFFFF;
  647|  51.9k|      while (flags)
  ------------------
  |  Branch (647:14): [True: 28.1k, False: 23.8k]
  ------------------
  648|  28.1k|      { // bit unstuffing occurs on average once every 256 bytes
  649|       |        // therefore it is not an issue if it is a bit slow
  650|       |        // here we process 16 bytes
  651|  28.1k|        --bits; // consuming one stuffing bit
  652|       |
  653|  28.1k|        ui32 loc = 31 - count_leading_zeros(flags);
  654|  28.1k|        flags ^= 1 << loc;
  655|       |
  656|  28.1k|        __m128i m, t, c;
  657|  28.1k|        t = _mm_set1_epi8((char)loc);
  658|  28.1k|        m = _mm_cmpgt_epi8(offset, t);
  659|       |
  660|  28.1k|        t = _mm_and_si128(m, val);  // keep bits at locations larger than loc
  661|  28.1k|        c = _mm_srli_epi64(t, 1);   // 1 bits left
  662|  28.1k|        t = _mm_srli_si128(t, 8);   // 8 bytes left
  663|  28.1k|        t = _mm_slli_epi64(t, 63);  // keep the MSB only
  664|  28.1k|        t = _mm_or_si128(t, c);     // combine the above 3 steps
  665|       |
  666|  28.1k|        val = _mm_or_si128(t, _mm_andnot_si128(m, val));
  667|  28.1k|      }
  668|       |
  669|       |      // combine with earlier data
  670|  23.8k|      assert(msp->bits >= 0 && msp->bits <= 128);
  671|  23.8k|      int cur_bytes = msp->bits >> 3;
  672|  23.8k|      int cur_bits = msp->bits & 7;
  673|  23.8k|      __m128i b1, b2;
  674|  23.8k|      b1 = _mm_sll_epi64(val, _mm_set1_epi64x(cur_bits));
  675|  23.8k|      b2 = _mm_slli_si128(val, 8);  // 8 bytes right
  676|  23.8k|      b2 = _mm_srl_epi64(b2, _mm_set1_epi64x(64-cur_bits));
  677|  23.8k|      b1 = _mm_or_si128(b1, b2);
  678|  23.8k|      b2 = _mm_loadu_si128((__m128i*)(msp->tmp + cur_bytes));
  679|  23.8k|      b2 = _mm_or_si128(b1, b2);
  680|  23.8k|      _mm_storeu_si128((__m128i*)(msp->tmp + cur_bytes), b2);
  681|       |
  682|  23.8k|      int consumed_bits = bits < 128 - cur_bits ? bits : 128 - cur_bits;
  ------------------
  |  Branch (682:27): [True: 10.2k, False: 13.6k]
  ------------------
  683|  23.8k|      cur_bytes = (msp->bits + (ui32)consumed_bits + 7) >> 3; // round up
  684|  23.8k|      int upper = _mm_extract_epi16(val, 7);
  685|  23.8k|      upper >>= consumed_bits - 128 + 16;
  686|  23.8k|      msp->tmp[cur_bytes] = (ui8)upper; // copy byte
  687|       |
  688|  23.8k|      msp->bits += (ui32)bits;
  689|  23.8k|      msp->unstuff = next_unstuff;   // next unstuff
  690|       |      assert(msp->unstuff == 0 || msp->unstuff == 1);
  691|  23.8k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL10frwd_fetchILi0EEEDv2_xPNS0_16frwd_struct_avx2E:
  766|  47.0k|    {
  767|  47.0k|      if (msp->bits <= 128)
  ------------------
  |  Branch (767:11): [True: 11.1k, False: 35.8k]
  ------------------
  768|  11.1k|      {
  769|  11.1k|        frwd_read<X>(msp);
  770|  11.1k|        if (msp->bits <= 128) //need to test
  ------------------
  |  Branch (770:13): [True: 0, False: 11.1k]
  ------------------
  771|      0|          frwd_read<X>(msp);
  772|  11.1k|      }
  773|  47.0k|      __m128i t = _mm_loadu_si128((__m128i*)msp->tmp);
  774|  47.0k|      return t;
  775|  47.0k|    }

_ZN4ojph5local15rev_advance_mrpEPNS0_10rev_structEj:
  573|  58.4k|    {
  574|       |      assert(num_bits <= mrp->bits); // we must not consume more than mrp->bits
  575|  58.4k|      mrp->tmp >>= num_bits;  // discard the lowest num_bits bits
  576|  58.4k|      mrp->bits -= num_bits;
  577|  58.4k|      return (ui32)mrp->tmp;  // return data after consumption
  578|  58.4k|    }

_ZN4ojph5local31initialize_block_encoder_tablesEv:
  258|  2.28M|    bool initialize_block_encoder_tables() {
  259|  2.28M|      static bool tables_initialized = false;
  260|  2.28M|      static std::once_flag tables_initialized_flag;
  261|  2.28M|      std::call_once(tables_initialized_flag, []() {
  262|  2.28M|        memset(vlc_tbl0, 0, 2048 * sizeof(ui16));
  263|  2.28M|        memset(vlc_tbl1, 0, 2048 * sizeof(ui16));
  264|  2.28M|        tables_initialized = vlc_init_tables();
  265|  2.28M|        tables_initialized = tables_initialized && uvlc_init_tables();
  266|  2.28M|      });
  267|  2.28M|      return tables_initialized;
  268|  2.28M|    }
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:
  225|  2.28M|    bool initialize_block_encoder_tables_avx2() {
  226|  2.28M|      static bool tables_initialized = false;
  227|  2.28M|      static std::once_flag tables_initialized_flag;
  228|  2.28M|      std::call_once(tables_initialized_flag, []() {
  229|  2.28M|        memset(vlc_tbl0, 0, 2048 * sizeof(ui32));
  230|  2.28M|        memset(vlc_tbl1, 0, 2048 * sizeof(ui32));
  231|  2.28M|        tables_initialized = vlc_init_tables();
  232|  2.28M|        tables_initialized = tables_initialized && uvlc_init_tables();
  233|  2.28M|      });
  234|  2.28M|      return tables_initialized;
  235|  2.28M|    }
ojph_block_encoder_avx2.cpp:_ZZN4ojph5local36initialize_block_encoder_tables_avx2EvENK3$_0clEv:
  228|      1|      std::call_once(tables_initialized_flag, []() {
  229|      1|        memset(vlc_tbl0, 0, 2048 * sizeof(ui32));
  230|      1|        memset(vlc_tbl1, 0, 2048 * sizeof(ui32));
  231|      1|        tables_initialized = vlc_init_tables();
  232|      1|        tables_initialized = tables_initialized && uvlc_init_tables();
  ------------------
  |  Branch (232:30): [True: 1, False: 0]
  |  Branch (232:52): [True: 1, False: 0]
  ------------------
  233|      1|      });
ojph_block_encoder_avx2.cpp:_ZN4ojph5localL15vlc_init_tablesEv:
   82|      1|    {
   83|      1|      struct vlc_src_table { int c_q, rho, u_off, e_k, e_1, cwd, cwd_len; };
   84|      1|      vlc_src_table tbl0[] = {
   85|      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}
  ------------------
   86|      1|      };
   87|      1|      size_t tbl0_size = sizeof(tbl0) / sizeof(vlc_src_table);
   88|       |
   89|      1|      si32 pattern_popcnt[16];
   90|     17|      for (ui32 i = 0; i < 16; ++i)
  ------------------
  |  Branch (90:24): [True: 16, False: 1]
  ------------------
   91|     16|        pattern_popcnt[i] = (si32)population_count(i);
   92|       |
   93|      1|      vlc_src_table* src_tbl = tbl0;
   94|      1|      ui32 *tgt_tbl = vlc_tbl0;
   95|      1|      size_t tbl_size = tbl0_size;
   96|  2.04k|      for (int i = 0; i < 2048; ++i)
  ------------------
  |  Branch (96:23): [True: 2.04k, False: 1]
  ------------------
   97|  2.04k|      {
   98|  2.04k|        int c_q = i >> 8, rho = (i >> 4) & 0xF, emb = i & 0xF;
   99|  2.04k|        if (((emb & rho) != emb) || (rho == 0 && c_q == 0))
  ------------------
  |  Branch (99:13): [True: 1.40k, False: 648]
  |  Branch (99:38): [True: 8, False: 640]
  |  Branch (99:50): [True: 1, False: 7]
  ------------------
  100|  1.40k|          tgt_tbl[i] = 0;
  101|    647|        else
  102|    647|        {
  103|    647|          vlc_src_table *best_entry = NULL;
  104|    647|          if (emb) // u_off = 1
  ------------------
  |  Branch (104:15): [True: 520, False: 127]
  ------------------
  105|    520|          {
  106|    520|            int best_e_k = -1;
  107|   231k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (107:32): [True: 230k, False: 520]
  ------------------
  108|   230k|            {
  109|   230k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (109:19): [True: 28.8k, False: 202k]
  |  Branch (109:44): [True: 2.74k, False: 26.1k]
  ------------------
  110|  2.74k|                if (src_tbl[j].u_off == 1)
  ------------------
  |  Branch (110:21): [True: 2.22k, False: 520]
  ------------------
  111|  2.22k|                  if ((emb & src_tbl[j].e_k) == src_tbl[j].e_1)
  ------------------
  |  Branch (111:23): [True: 527, False: 1.70k]
  ------------------
  112|    527|                  {
  113|       |                    //now we need to find the smallest cwd with the highest
  114|       |                    // number of bits set in e_k
  115|    527|                    int ones_count = pattern_popcnt[src_tbl[j].e_k];
  116|    527|                    if (ones_count >= best_e_k)
  ------------------
  |  Branch (116:25): [True: 520, False: 7]
  ------------------
  117|    520|                    {
  118|    520|                      best_entry = src_tbl + j;
  119|    520|                      best_e_k = ones_count;
  120|    520|                    }
  121|    527|                  }
  122|   230k|            }
  123|    520|          }
  124|    127|          else // u_off = 0
  125|    127|          {
  126|  25.1k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (126:32): [True: 25.1k, False: 0]
  ------------------
  127|  25.1k|            {
  128|  25.1k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (128:19): [True: 2.57k, False: 22.5k]
  |  Branch (128:44): [True: 127, False: 2.44k]
  ------------------
  129|    127|                if (src_tbl[j].u_off == 0)
  ------------------
  |  Branch (129:21): [True: 127, False: 0]
  ------------------
  130|    127|                {
  131|    127|                  best_entry = src_tbl + j;
  132|    127|                  break;
  133|    127|                }
  134|  25.1k|            }
  135|    127|          }
  136|    647|          assert(best_entry);
  137|    647|          tgt_tbl[i] = (ui16)((best_entry->cwd<<8) + (best_entry->cwd_len<<4)
  138|    647|                             + best_entry->e_k);
  139|    647|        }
  140|  2.04k|      }
  141|       |
  142|      1|      vlc_src_table tbl1[] = {
  143|      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}
  ------------------
  144|      1|      };
  145|      1|      size_t tbl1_size = sizeof(tbl1) / sizeof(vlc_src_table);
  146|       |
  147|      1|      src_tbl = tbl1;
  148|      1|      tgt_tbl = vlc_tbl1;
  149|      1|      tbl_size = tbl1_size;
  150|  2.04k|      for (int i = 0; i < 2048; ++i)
  ------------------
  |  Branch (150:23): [True: 2.04k, False: 1]
  ------------------
  151|  2.04k|      {
  152|  2.04k|        int c_q = i >> 8, rho = (i >> 4) & 0xF, emb = i & 0xF;
  153|  2.04k|        if (((emb & rho) != emb) || (rho == 0 && c_q == 0))
  ------------------
  |  Branch (153:13): [True: 1.40k, False: 648]
  |  Branch (153:38): [True: 8, False: 640]
  |  Branch (153:50): [True: 1, False: 7]
  ------------------
  154|  1.40k|          tgt_tbl[i] = 0;
  155|    647|        else
  156|    647|        {
  157|    647|          vlc_src_table *best_entry = NULL;
  158|    647|          if (emb) // u_off = 1
  ------------------
  |  Branch (158:15): [True: 520, False: 127]
  ------------------
  159|    520|          {
  160|    520|            int best_e_k = -1;
  161|   186k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (161:32): [True: 186k, False: 520]
  ------------------
  162|   186k|            {
  163|   186k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (163:19): [True: 23.2k, False: 162k]
  |  Branch (163:44): [True: 2.08k, False: 21.1k]
  ------------------
  164|  2.08k|                if (src_tbl[j].u_off == 1)
  ------------------
  |  Branch (164:21): [True: 1.56k, False: 520]
  ------------------
  165|  1.56k|                  if ((emb & src_tbl[j].e_k) == src_tbl[j].e_1)
  ------------------
  |  Branch (165:23): [True: 529, False: 1.03k]
  ------------------
  166|    529|                  {
  167|       |                    //now we need to find the smallest cwd with the highest
  168|       |                    // number of bits set in e_k
  169|    529|                    int ones_count = pattern_popcnt[src_tbl[j].e_k];
  170|    529|                    if (ones_count >= best_e_k)
  ------------------
  |  Branch (170:25): [True: 520, False: 9]
  ------------------
  171|    520|                    {
  172|    520|                      best_entry = src_tbl + j;
  173|    520|                      best_e_k = ones_count;
  174|    520|                    }
  175|    529|                  }
  176|   186k|            }
  177|    520|          }
  178|    127|          else // u_off = 0
  179|    127|          {
  180|  19.7k|            for (size_t j = 0; j < tbl_size; ++j)
  ------------------
  |  Branch (180:32): [True: 19.7k, False: 0]
  ------------------
  181|  19.7k|            {
  182|  19.7k|              if (src_tbl[j].c_q == c_q && src_tbl[j].rho == rho)
  ------------------
  |  Branch (182:19): [True: 2.22k, False: 17.5k]
  |  Branch (182:44): [True: 127, False: 2.10k]
  ------------------
  183|    127|                if (src_tbl[j].u_off == 0)
  ------------------
  |  Branch (183:21): [True: 127, False: 0]
  ------------------
  184|    127|                {
  185|    127|                  best_entry = src_tbl + j;
  186|    127|                  break;
  187|    127|                }
  188|  19.7k|            }
  189|    127|          }
  190|    647|          assert(best_entry);
  191|    647|          tgt_tbl[i] = (ui16)((best_entry->cwd<<8) + (best_entry->cwd_len<<4)
  192|    647|                             + best_entry->e_k);
  193|    647|        }
  194|  2.04k|      }
  195|       |
  196|       |
  197|      1|      return true;
  198|      1|    }
ojph_block_encoder_avx2.cpp:_ZN4ojph5localL16uvlc_init_tablesEv:
  202|      1|    {
  203|       |      //code goes from 0 to 31, extension and 32 are not supported here
  204|      1|      ulvc_cwd_pre[0] = 0; ulvc_cwd_pre[1] = 1; ulvc_cwd_pre[2] = 2;
  205|      1|      ulvc_cwd_pre[3] = 4; ulvc_cwd_pre[4] = 4;
  206|      1|      ulvc_cwd_pre_len[0] = 0; ulvc_cwd_pre_len[1] = 1;
  207|      1|      ulvc_cwd_pre_len[2] = 2;
  208|      1|      ulvc_cwd_pre_len[3] = 3; ulvc_cwd_pre_len[4] = 3;
  209|      1|      ulvc_cwd_suf[0] = 0; ulvc_cwd_suf[1] = 0; ulvc_cwd_suf[2] = 0;
  210|      1|      ulvc_cwd_suf[3] = 0; ulvc_cwd_suf[4] = 1;
  211|      1|      ulvc_cwd_suf_len[0] = 0; ulvc_cwd_suf_len[1] = 0;
  212|      1|      ulvc_cwd_suf_len[2] = 0;
  213|      1|      ulvc_cwd_suf_len[3] = 1; ulvc_cwd_suf_len[4] = 1;
  214|     29|      for (int i = 5; i < 33; ++i)
  ------------------
  |  Branch (214:23): [True: 28, False: 1]
  ------------------
  215|     28|      {
  216|     28|        ulvc_cwd_pre[i] = 0;
  217|     28|        ulvc_cwd_pre_len[i] = 3;
  218|     28|        ulvc_cwd_suf[i] = (ui32)(i-5);
  219|     28|        ulvc_cwd_suf_len[i] = 5;
  220|     28|      }
  221|      1|      return true;
  222|      1|    }

ojph_expand_fuzz_target.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_codestream.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_codestream_local.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  79.4k|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|  79.4k|  }
_ZN4ojph17calc_aligned_sizeINS_5local4tileELj8EEEmm:
  302|  8.83k|  size_t calc_aligned_size(size_t size) {
  303|  8.83k|    size = size * sizeof(T) + N - 1;
  304|  8.83k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  8.83k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  8.83k|    return size;
  307|  8.83k|  }
ojph_codestream_local.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  53.2k|  {
  207|       |  #ifdef OJPH_COMPILER_MSVC
  208|       |    unsigned long result = 0;
  209|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  210|       |      _BitScanReverse64(&result, val);
  211|       |    #elif (defined OJPH_ARCH_I386)
  212|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  213|       |      if (msb == 0)
  214|       |        _BitScanReverse(&result, lsb);
  215|       |      else {
  216|       |        _BitScanReverse(&result, msb);
  217|       |        result += 32;
  218|       |      }
  219|       |    #else
  220|       |      #error Error unsupport MSVC version
  221|       |    #endif
  222|       |    return 63 ^ (ui32)result;
  223|       |  #elif (defined OJPH_COMPILER_GNUC)
  224|       |    return (ui32)__builtin_clzll(val);
  225|       |  #else
  226|       |    val |= (val >> 1);
  227|       |    val |= (val >> 2);
  228|       |    val |= (val >> 4);
  229|       |    val |= (val >> 8);
  230|       |    val |= (val >> 16);
  231|       |    val |= (val >> 32);
  232|       |    return 64 - population_count64(val);
  233|       |  #endif
  234|  53.2k|  }
_ZN4ojph17calc_aligned_sizeINS_8line_bufELj8EEEmm:
  302|   944k|  size_t calc_aligned_size(size_t size) {
  303|   944k|    size = size * sizeof(T) + N - 1;
  304|   944k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   944k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   944k|    return size;
  307|   944k|  }
_ZN4ojph17calc_aligned_sizeINS_4sizeELj8EEEmm:
  302|  17.3k|  size_t calc_aligned_size(size_t size) {
  303|  17.3k|    size = size * sizeof(T) + N - 1;
  304|  17.3k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  17.3k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  17.3k|    return size;
  307|  17.3k|  }
_ZN4ojph17calc_aligned_sizeIiLj64EEEmm:
  302|   453k|  size_t calc_aligned_size(size_t size) {
  303|   453k|    size = size * sizeof(T) + N - 1;
  304|   453k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   453k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   453k|    return size;
  307|   453k|  }
_ZN4ojph17calc_aligned_sizeIhLj8EEEmm:
  302|   190k|  size_t calc_aligned_size(size_t size) {
  303|   190k|    size = size * sizeof(T) + N - 1;
  304|   190k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   190k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   190k|    return size;
  307|   190k|  }
_ZN4ojph9align_ptrIhLj8EEEPT_S2_:
  312|  94.2k|  inline T *align_ptr(T *ptr) {
  313|  94.2k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  94.2k|    p += N - 1;
  315|  94.2k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  94.2k|    return reinterpret_cast<T *>(p);
  317|  94.2k|  }
_ZN4ojph9align_ptrINS_5local4tileELj8EEEPT_S4_:
  312|  4.40k|  inline T *align_ptr(T *ptr) {
  313|  4.40k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  4.40k|    p += N - 1;
  315|  4.40k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  4.40k|    return reinterpret_cast<T *>(p);
  317|  4.40k|  }
_ZN4ojph9align_ptrINS_8line_bufELj8EEEPT_S3_:
  312|   455k|  inline T *align_ptr(T *ptr) {
  313|   455k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   455k|    p += N - 1;
  315|   455k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   455k|    return reinterpret_cast<T *>(p);
  317|   455k|  }
_ZN4ojph9align_ptrINS_4sizeELj8EEEPT_S3_:
  312|  8.49k|  inline T *align_ptr(T *ptr) {
  313|  8.49k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  8.49k|    p += N - 1;
  315|  8.49k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  8.49k|    return reinterpret_cast<T *>(p);
  317|  8.49k|  }
_ZN4ojph9align_ptrIiLj64EEEPT_S2_:
  312|   219k|  inline T *align_ptr(T *ptr) {
  313|   219k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   219k|    p += N - 1;
  315|   219k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   219k|    return reinterpret_cast<T *>(p);
  317|   219k|  }
ojph_params.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_params.cpp:_ZN4ojphL16population_countEj:
  157|    420|  {
  158|       |  #if defined(OJPH_COMPILER_MSVC)  \
  159|       |    && (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  160|       |    return (ui32)__popcnt(val);
  161|       |  #elif (defined OJPH_COMPILER_GNUC)
  162|       |    return (ui32)__builtin_popcount(val);
  163|       |  #else
  164|       |    val -= ((val >> 1) & 0x55555555);
  165|       |    val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
  166|       |    val = (((val >> 4) + val) & 0x0f0f0f0f);
  167|       |    val += (val >> 8);
  168|       |    val += (val >> 16);
  169|       |    return (int)(val & 0x0000003f);
  170|       |  #endif
  171|    420|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  2.48M|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|  2.48M|  }
_ZN4ojph17calc_aligned_sizeINS_5local9tile_compELj8EEEmm:
  302|   181k|  size_t calc_aligned_size(size_t size) {
  303|   181k|    size = size * sizeof(T) + N - 1;
  304|   181k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   181k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   181k|    return size;
  307|   181k|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  1.66M|  {
  207|       |  #ifdef OJPH_COMPILER_MSVC
  208|       |    unsigned long result = 0;
  209|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  210|       |      _BitScanReverse64(&result, val);
  211|       |    #elif (defined OJPH_ARCH_I386)
  212|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  213|       |      if (msb == 0)
  214|       |        _BitScanReverse(&result, lsb);
  215|       |      else {
  216|       |        _BitScanReverse(&result, msb);
  217|       |        result += 32;
  218|       |      }
  219|       |    #else
  220|       |      #error Error unsupport MSVC version
  221|       |    #endif
  222|       |    return 63 ^ (ui32)result;
  223|       |  #elif (defined OJPH_COMPILER_GNUC)
  224|       |    return (ui32)__builtin_clzll(val);
  225|       |  #else
  226|       |    val |= (val >> 1);
  227|       |    val |= (val >> 2);
  228|       |    val |= (val >> 4);
  229|       |    val |= (val >> 8);
  230|       |    val |= (val >> 16);
  231|       |    val |= (val >> 32);
  232|       |    return 64 - population_count64(val);
  233|       |  #endif
  234|  1.66M|  }
_ZN4ojph17calc_aligned_sizeINS_4rectELj8EEEmm:
  302|   363k|  size_t calc_aligned_size(size_t size) {
  303|   363k|    size = size * sizeof(T) + N - 1;
  304|   363k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   363k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   363k|    return size;
  307|   363k|  }
_ZN4ojph17calc_aligned_sizeIjLj8EEEmm:
  302|   544k|  size_t calc_aligned_size(size_t size) {
  303|   544k|    size = size * sizeof(T) + N - 1;
  304|   544k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   544k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   544k|    return size;
  307|   544k|  }
_ZN4ojph17calc_aligned_sizeIbLj8EEEmm:
  302|   363k|  size_t calc_aligned_size(size_t size) {
  303|   363k|    size = size * sizeof(T) + N - 1;
  304|   363k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   363k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   363k|    return size;
  307|   363k|  }
_ZN4ojph17calc_aligned_sizeIfLj64EEEmm:
  302|   555k|  size_t calc_aligned_size(size_t size) {
  303|   555k|    size = size * sizeof(T) + N - 1;
  304|   555k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   555k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   555k|    return size;
  307|   555k|  }
_ZN4ojph9align_ptrINS_5local9tile_compELj8EEEPT_S4_:
  312|  89.8k|  inline T *align_ptr(T *ptr) {
  313|  89.8k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  89.8k|    p += N - 1;
  315|  89.8k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  89.8k|    return reinterpret_cast<T *>(p);
  317|  89.8k|  }
_ZN4ojph9align_ptrINS_4rectELj8EEEPT_S3_:
  312|   179k|  inline T *align_ptr(T *ptr) {
  313|   179k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   179k|    p += N - 1;
  315|   179k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   179k|    return reinterpret_cast<T *>(p);
  317|   179k|  }
_ZN4ojph9align_ptrIjLj8EEEPT_S2_:
  312|   269k|  inline T *align_ptr(T *ptr) {
  313|   269k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   269k|    p += N - 1;
  315|   269k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   269k|    return reinterpret_cast<T *>(p);
  317|   269k|  }
_ZN4ojph9align_ptrIbLj8EEEPT_S2_:
  312|   179k|  inline T *align_ptr(T *ptr) {
  313|   179k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   179k|    p += N - 1;
  315|   179k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   179k|    return reinterpret_cast<T *>(p);
  317|   179k|  }
_ZN4ojph9align_ptrIfLj64EEEPT_S2_:
  312|   204k|  inline T *align_ptr(T *ptr) {
  313|   204k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   204k|    p += N - 1;
  315|   204k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   204k|    return reinterpret_cast<T *>(p);
  317|   204k|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|   156k|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|   156k|  }
_ZN4ojph17calc_aligned_sizeINS_5local10resolutionELj8EEEmm:
  302|   629k|  size_t calc_aligned_size(size_t size) {
  303|   629k|    size = size * sizeof(T) + N - 1;
  304|   629k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   629k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   629k|    return size;
  307|   629k|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|   105k|  {
  207|       |  #ifdef OJPH_COMPILER_MSVC
  208|       |    unsigned long result = 0;
  209|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  210|       |      _BitScanReverse64(&result, val);
  211|       |    #elif (defined OJPH_ARCH_I386)
  212|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  213|       |      if (msb == 0)
  214|       |        _BitScanReverse(&result, lsb);
  215|       |      else {
  216|       |        _BitScanReverse(&result, msb);
  217|       |        result += 32;
  218|       |      }
  219|       |    #else
  220|       |      #error Error unsupport MSVC version
  221|       |    #endif
  222|       |    return 63 ^ (ui32)result;
  223|       |  #elif (defined OJPH_COMPILER_GNUC)
  224|       |    return (ui32)__builtin_clzll(val);
  225|       |  #else
  226|       |    val |= (val >> 1);
  227|       |    val |= (val >> 2);
  228|       |    val |= (val >> 4);
  229|       |    val |= (val >> 8);
  230|       |    val |= (val >> 16);
  231|       |    val |= (val >> 32);
  232|       |    return 64 - population_count64(val);
  233|       |  #endif
  234|   105k|  }
_ZN4ojph9align_ptrINS_5local10resolutionELj8EEEPT_S4_:
  312|   300k|  inline T *align_ptr(T *ptr) {
  313|   300k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   300k|    p += N - 1;
  315|   300k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   300k|    return reinterpret_cast<T *>(p);
  317|   300k|  }
ojph_file.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_mem.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_message.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_colour.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_colour_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_colour_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_colour_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_colour_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform_avx512.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_resolution.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  7.48M|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|  7.48M|  }
_ZN4ojph17calc_aligned_sizeINS_5local7subbandELj8EEEmm:
  302|   629k|  size_t calc_aligned_size(size_t size) {
  303|   629k|    size = size * sizeof(T) + N - 1;
  304|   629k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   629k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   629k|    return size;
  307|   629k|  }
ojph_resolution.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  5.08M|  {
  207|       |  #ifdef OJPH_COMPILER_MSVC
  208|       |    unsigned long result = 0;
  209|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  210|       |      _BitScanReverse64(&result, val);
  211|       |    #elif (defined OJPH_ARCH_I386)
  212|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  213|       |      if (msb == 0)
  214|       |        _BitScanReverse(&result, lsb);
  215|       |      else {
  216|       |        _BitScanReverse(&result, msb);
  217|       |        result += 32;
  218|       |      }
  219|       |    #else
  220|       |      #error Error unsupport MSVC version
  221|       |    #endif
  222|       |    return 63 ^ (ui32)result;
  223|       |  #elif (defined OJPH_COMPILER_GNUC)
  224|       |    return (ui32)__builtin_clzll(val);
  225|       |  #else
  226|       |    val |= (val >> 1);
  227|       |    val |= (val >> 2);
  228|       |    val |= (val >> 4);
  229|       |    val |= (val >> 8);
  230|       |    val |= (val >> 16);
  231|       |    val |= (val >> 32);
  232|       |    return 64 - population_count64(val);
  233|       |  #endif
  234|  5.08M|  }
_ZN4ojph17calc_aligned_sizeINS_5local8precinctELj8EEEmm:
  302|   292k|  size_t calc_aligned_size(size_t size) {
  303|   292k|    size = size * sizeof(T) + N - 1;
  304|   292k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   292k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   292k|    return size;
  307|   292k|  }
_ZN4ojph17calc_aligned_sizeINS_11lifting_bufELj8EEEmm:
  302|   577k|  size_t calc_aligned_size(size_t size) {
  303|   577k|    size = size * sizeof(T) + N - 1;
  304|   577k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   577k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   577k|    return size;
  307|   577k|  }
_ZN4ojph17calc_aligned_sizeIlLj64EEEmm:
  302|  1.85M|  size_t calc_aligned_size(size_t size) {
  303|  1.85M|    size = size * sizeof(T) + N - 1;
  304|  1.85M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  1.85M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  1.85M|    return size;
  307|  1.85M|  }
_ZN4ojph9align_ptrINS_5local7subbandELj8EEEPT_S4_:
  312|   300k|  inline T *align_ptr(T *ptr) {
  313|   300k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   300k|    p += N - 1;
  315|   300k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   300k|    return reinterpret_cast<T *>(p);
  317|   300k|  }
_ZN4ojph9align_ptrINS_5local8precinctELj8EEEPT_S4_:
  312|   144k|  inline T *align_ptr(T *ptr) {
  313|   144k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   144k|    p += N - 1;
  315|   144k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   144k|    return reinterpret_cast<T *>(p);
  317|   144k|  }
_ZN4ojph9align_ptrINS_11lifting_bufELj8EEEPT_S3_:
  312|   275k|  inline T *align_ptr(T *ptr) {
  313|   275k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   275k|    p += N - 1;
  315|   275k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   275k|    return reinterpret_cast<T *>(p);
  317|   275k|  }
_ZN4ojph9align_ptrIlLj64EEEPT_S2_:
  312|   926k|  inline T *align_ptr(T *ptr) {
  313|   926k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   926k|    p += N - 1;
  315|   926k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   926k|    return reinterpret_cast<T *>(p);
  317|   926k|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  2.09M|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|  2.09M|  }
_ZN4ojph17calc_aligned_sizeINS_5local9codeblockELj8EEEmm:
  302|   350k|  size_t calc_aligned_size(size_t size) {
  303|   350k|    size = size * sizeof(T) + N - 1;
  304|   350k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   350k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   350k|    return size;
  307|   350k|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  1.40M|  {
  207|       |  #ifdef OJPH_COMPILER_MSVC
  208|       |    unsigned long result = 0;
  209|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  210|       |      _BitScanReverse64(&result, val);
  211|       |    #elif (defined OJPH_ARCH_I386)
  212|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  213|       |      if (msb == 0)
  214|       |        _BitScanReverse(&result, lsb);
  215|       |      else {
  216|       |        _BitScanReverse(&result, msb);
  217|       |        result += 32;
  218|       |      }
  219|       |    #else
  220|       |      #error Error unsupport MSVC version
  221|       |    #endif
  222|       |    return 63 ^ (ui32)result;
  223|       |  #elif (defined OJPH_COMPILER_GNUC)
  224|       |    return (ui32)__builtin_clzll(val);
  225|       |  #else
  226|       |    val |= (val >> 1);
  227|       |    val |= (val >> 2);
  228|       |    val |= (val >> 4);
  229|       |    val |= (val >> 8);
  230|       |    val |= (val >> 16);
  231|       |    val |= (val >> 32);
  232|       |    return 64 - population_count64(val);
  233|       |  #endif
  234|  1.40M|  }
_ZN4ojph17calc_aligned_sizeINS_5local15coded_cb_headerELj8EEEmm:
  302|   350k|  size_t calc_aligned_size(size_t size) {
  303|   350k|    size = size * sizeof(T) + N - 1;
  304|   350k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   350k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   350k|    return size;
  307|   350k|  }
_ZN4ojph9align_ptrINS_5local9codeblockELj8EEEPT_S4_:
  312|   172k|  inline T *align_ptr(T *ptr) {
  313|   172k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   172k|    p += N - 1;
  315|   172k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   172k|    return reinterpret_cast<T *>(p);
  317|   172k|  }
_ZN4ojph9align_ptrINS_5local15coded_cb_headerELj8EEEPT_S4_:
  312|   172k|  inline T *align_ptr(T *ptr) {
  313|   172k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   172k|    p += N - 1;
  315|   172k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   172k|    return reinterpret_cast<T *>(p);
  317|   172k|  }
ojph_arch.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_codeblock.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  6.90M|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|  6.90M|  }
_ZN4ojph17calc_aligned_sizeIjLj64EEEmm:
  302|  1.85M|  size_t calc_aligned_size(size_t size) {
  303|  1.85M|    size = size * sizeof(T) + N - 1;
  304|  1.85M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  1.85M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  1.85M|    return size;
  307|  1.85M|  }
ojph_codeblock.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  4.61M|  {
  207|       |  #ifdef OJPH_COMPILER_MSVC
  208|       |    unsigned long result = 0;
  209|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  210|       |      _BitScanReverse64(&result, val);
  211|       |    #elif (defined OJPH_ARCH_I386)
  212|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  213|       |      if (msb == 0)
  214|       |        _BitScanReverse(&result, lsb);
  215|       |      else {
  216|       |        _BitScanReverse(&result, msb);
  217|       |        result += 32;
  218|       |      }
  219|       |    #else
  220|       |      #error Error unsupport MSVC version
  221|       |    #endif
  222|       |    return 63 ^ (ui32)result;
  223|       |  #elif (defined OJPH_COMPILER_GNUC)
  224|       |    return (ui32)__builtin_clzll(val);
  225|       |  #else
  226|       |    val |= (val >> 1);
  227|       |    val |= (val >> 2);
  228|       |    val |= (val >> 4);
  229|       |    val |= (val >> 8);
  230|       |    val |= (val >> 16);
  231|       |    val |= (val >> 32);
  232|       |    return 64 - population_count64(val);
  233|       |  #endif
  234|  4.61M|  }
_ZN4ojph17calc_aligned_sizeImLj64EEEmm:
  302|  2.75M|  size_t calc_aligned_size(size_t size) {
  303|  2.75M|    size = size * sizeof(T) + N - 1;
  304|  2.75M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  2.75M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  2.75M|    return size;
  307|  2.75M|  }
_ZN4ojph9align_ptrIjLj64EEEPT_S2_:
  312|   913k|  inline T *align_ptr(T *ptr) {
  313|   913k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   913k|    p += N - 1;
  315|   913k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   913k|    return reinterpret_cast<T *>(p);
  317|   913k|  }
_ZN4ojph9align_ptrImLj64EEEPT_S2_:
  312|  1.37M|  inline T *align_ptr(T *ptr) {
  313|  1.37M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  1.37M|    p += N - 1;
  315|  1.37M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  1.37M|    return reinterpret_cast<T *>(p);
  317|  1.37M|  }
ojph_codeblock_fun.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_codestream_gen.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_precinct.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|   988k|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|   988k|  }
ojph_block_decoder32.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_block_decoder64.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_block_decoder64.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|   168k|  {
  207|       |  #ifdef OJPH_COMPILER_MSVC
  208|       |    unsigned long result = 0;
  209|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  210|       |      _BitScanReverse64(&result, val);
  211|       |    #elif (defined OJPH_ARCH_I386)
  212|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  213|       |      if (msb == 0)
  214|       |        _BitScanReverse(&result, lsb);
  215|       |      else {
  216|       |        _BitScanReverse(&result, msb);
  217|       |        result += 32;
  218|       |      }
  219|       |    #else
  220|       |      #error Error unsupport MSVC version
  221|       |    #endif
  222|       |    return 63 ^ (ui32)result;
  223|       |  #elif (defined OJPH_COMPILER_GNUC)
  224|       |    return (ui32)__builtin_clzll(val);
  225|       |  #else
  226|       |    val |= (val >> 1);
  227|       |    val |= (val >> 2);
  228|       |    val |= (val >> 4);
  229|       |    val |= (val >> 8);
  230|       |    val |= (val >> 16);
  231|       |    val |= (val >> 32);
  232|       |    return 64 - population_count64(val);
  233|       |  #endif
  234|   168k|  }
ojph_block_decoder64.cpp:_ZN4ojphL16population_countEj:
  157|  38.3k|  {
  158|       |  #if defined(OJPH_COMPILER_MSVC)  \
  159|       |    && (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  160|       |    return (ui32)__popcnt(val);
  161|       |  #elif (defined OJPH_COMPILER_GNUC)
  162|       |    return (ui32)__builtin_popcount(val);
  163|       |  #else
  164|       |    val -= ((val >> 1) & 0x55555555);
  165|       |    val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
  166|       |    val = (((val >> 4) + val) & 0x0f0f0f0f);
  167|       |    val += (val >> 8);
  168|       |    val += (val >> 16);
  169|       |    return (int)(val & 0x0000003f);
  170|       |  #endif
  171|  38.3k|  }
ojph_block_encoder.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_block_encoder.cpp:_ZN4ojphL16population_countEj:
  157|     16|  {
  158|       |  #if defined(OJPH_COMPILER_MSVC)  \
  159|       |    && (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  160|       |    return (ui32)__popcnt(val);
  161|       |  #elif (defined OJPH_COMPILER_GNUC)
  162|       |    return (ui32)__builtin_popcount(val);
  163|       |  #else
  164|       |    val -= ((val >> 1) & 0x55555555);
  165|       |    val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
  166|       |    val = (((val >> 4) + val) & 0x0f0f0f0f);
  167|       |    val += (val >> 8);
  168|       |    val += (val >> 16);
  169|       |    return (int)(val & 0x0000003f);
  170|       |  #endif
  171|     16|  }
ojph_codestream_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_codestream_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_block_decoder_ssse3.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_codestream_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_codestream_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_block_decoder_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  90.4k|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|  90.4k|  }
ojph_block_encoder_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_block_encoder_avx2.cpp:_ZN4ojphL16population_countEj:
  157|     16|  {
  158|       |  #if defined(OJPH_COMPILER_MSVC)  \
  159|       |    && (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  160|       |    return (ui32)__popcnt(val);
  161|       |  #elif (defined OJPH_COMPILER_GNUC)
  162|       |    return (ui32)__builtin_popcount(val);
  163|       |  #else
  164|       |    val -= ((val >> 1) & 0x55555555);
  165|       |    val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
  166|       |    val = (((val >> 4) + val) & 0x0f0f0f0f);
  167|       |    val += (val >> 8);
  168|       |    val += (val >> 16);
  169|       |    return (int)(val & 0x0000003f);
  170|       |  #endif
  171|     16|  }
ojph_block_encoder_avx512.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }

_ZN4ojph4sizeC2Ejj:
   49|  42.3M|    explicit size(ui32 w = 0, ui32 h = 0) : w(w), h(h) {}
_ZNK4ojph4size4areaEv:
   53|  3.29M|    ui64 area() const { return (ui64)w * (ui64)h; }
_ZN4ojph5pointC2Ejj:
   59|  49.1M|    explicit point(ui32 x = 0, ui32 y = 0) : x(x), y(y) {}

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

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

_ZN4ojph9param_sizC2EPNS_5local9param_sizE:
   73|  17.5k|    param_siz(local::param_siz *p) : state(p) {}
_ZN4ojph9param_codC2EPNS_5local9param_codE:
  106|  99.8k|    param_cod(local::param_cod* p) : state(p) {}

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

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

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

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

_ZN4ojph5local31init_colour_transform_functionsEv:
  110|  6.10k|    {
  111|  6.10k|      static std::once_flag colour_transform_functions_init_flag;
  112|  6.10k|      std::call_once(colour_transform_functions_init_flag, []() {
  113|  6.10k|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  114|       |
  115|  6.10k|        rev_convert = gen_rev_convert;
  116|  6.10k|        rev_convert_nlt_type3 = gen_rev_convert_nlt_type3;
  117|  6.10k|        irv_convert_to_integer = gen_irv_convert_to_integer;
  118|  6.10k|        irv_convert_to_float = gen_irv_convert_to_float;
  119|  6.10k|        irv_convert_to_integer_nlt_type3 = gen_irv_convert_to_integer_nlt_type3;
  120|  6.10k|        irv_convert_to_float_nlt_type3 = gen_irv_convert_to_float_nlt_type3;
  121|  6.10k|        rct_forward = gen_rct_forward;
  122|  6.10k|        rct_backward = gen_rct_backward;
  123|  6.10k|        ict_forward = gen_ict_forward;
  124|  6.10k|        ict_backward = gen_ict_backward;
  125|       |
  126|  6.10k|  #ifndef OJPH_DISABLE_SIMD
  127|       |
  128|  6.10k|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  129|       |
  130|  6.10k|      #ifndef OJPH_DISABLE_SSE
  131|  6.10k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  132|  6.10k|        {
  133|  6.10k|          ict_forward = sse_ict_forward;
  134|  6.10k|          ict_backward = sse_ict_backward;
  135|  6.10k|        }
  136|  6.10k|      #endif // !OJPH_DISABLE_SSE
  137|       |
  138|  6.10k|      #ifndef OJPH_DISABLE_SSE2
  139|  6.10k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2)
  140|  6.10k|        {
  141|  6.10k|          rev_convert = sse2_rev_convert;
  142|  6.10k|          rev_convert_nlt_type3 = sse2_rev_convert_nlt_type3;
  143|  6.10k|          irv_convert_to_integer = sse2_irv_convert_to_integer;
  144|  6.10k|          irv_convert_to_float = sse2_irv_convert_to_float;
  145|  6.10k|          irv_convert_to_integer_nlt_type3 =
  146|  6.10k|            sse2_irv_convert_to_integer_nlt_type3;
  147|  6.10k|          irv_convert_to_float_nlt_type3 =
  148|  6.10k|            sse2_irv_convert_to_float_nlt_type3;
  149|  6.10k|          rct_forward = sse2_rct_forward;
  150|  6.10k|          rct_backward = sse2_rct_backward;
  151|  6.10k|        }
  152|  6.10k|      #endif // !OJPH_DISABLE_SSE2
  153|       |
  154|  6.10k|      #ifndef OJPH_DISABLE_AVX
  155|  6.10k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  156|  6.10k|        {
  157|  6.10k|          ict_forward = avx_ict_forward;
  158|  6.10k|          ict_backward = avx_ict_backward;
  159|  6.10k|        }
  160|  6.10k|      #endif // !OJPH_DISABLE_AVX
  161|       |
  162|  6.10k|      #ifndef OJPH_DISABLE_AVX2
  163|  6.10k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2)
  164|  6.10k|        {
  165|  6.10k|          rev_convert = avx2_rev_convert;
  166|  6.10k|          rev_convert_nlt_type3 = avx2_rev_convert_nlt_type3;
  167|  6.10k|          irv_convert_to_integer = avx2_irv_convert_to_integer;
  168|  6.10k|          irv_convert_to_float = avx2_irv_convert_to_float;
  169|  6.10k|          irv_convert_to_integer_nlt_type3 =
  170|  6.10k|            avx2_irv_convert_to_integer_nlt_type3;
  171|  6.10k|          irv_convert_to_float_nlt_type3 =
  172|  6.10k|            avx2_irv_convert_to_float_nlt_type3;
  173|  6.10k|          rct_forward = avx2_rct_forward;
  174|  6.10k|          rct_backward = avx2_rct_backward;
  175|  6.10k|        }
  176|  6.10k|      #endif // !OJPH_DISABLE_AVX2
  177|       |
  178|       |    #elif defined(OJPH_ARCH_ARM)
  179|       |
  180|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  181|       |
  182|  6.10k|  #endif // !OJPH_DISABLE_SIMD
  183|       |
  184|       |#else // OJPH_ENABLE_WASM_SIMD
  185|       |
  186|       |        rev_convert = wasm_rev_convert;
  187|       |        rev_convert_nlt_type3 = wasm_rev_convert_nlt_type3;
  188|       |        irv_convert_to_integer = wasm_irv_convert_to_integer;
  189|       |        irv_convert_to_float = wasm_irv_convert_to_float;
  190|       |        irv_convert_to_integer_nlt_type3 = wasm_irv_convert_to_integer_nlt_type3;
  191|       |        irv_convert_to_float_nlt_type3 = wasm_irv_convert_to_float_nlt_type3;
  192|       |        rct_forward = wasm_rct_forward;
  193|       |        rct_backward = wasm_rct_backward;
  194|       |        ict_forward = wasm_ict_forward;
  195|       |        ict_backward = wasm_ict_backward;
  196|       |
  197|       |#endif // !OJPH_ENABLE_WASM_SIMD
  198|  6.10k|      });
  199|  6.10k|    }
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|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  181|       |
  182|      1|  #endif // !OJPH_DISABLE_SIMD
  183|       |
  184|       |#else // OJPH_ENABLE_WASM_SIMD
  185|       |
  186|       |        rev_convert = wasm_rev_convert;
  187|       |        rev_convert_nlt_type3 = wasm_rev_convert_nlt_type3;
  188|       |        irv_convert_to_integer = wasm_irv_convert_to_integer;
  189|       |        irv_convert_to_float = wasm_irv_convert_to_float;
  190|       |        irv_convert_to_integer_nlt_type3 = wasm_irv_convert_to_integer_nlt_type3;
  191|       |        irv_convert_to_float_nlt_type3 = wasm_irv_convert_to_float_nlt_type3;
  192|       |        rct_forward = wasm_rct_forward;
  193|       |        rct_backward = wasm_rct_backward;
  194|       |        ict_forward = wasm_ict_forward;
  195|       |        ict_backward = wasm_ict_backward;
  196|       |
  197|       |#endif // !OJPH_ENABLE_WASM_SIMD
  198|      1|      });

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

_ZN4ojph5local16avx2_rev_convertEPKNS_8line_bufEjPS1_jlj:
   72|  1.83M|    {
   73|  1.83M|      if (src_line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (73:11): [True: 589k, False: 1.24M]
  ------------------
   74|   589k|      {
   75|   589k|        if (dst_line->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (75:13): [True: 589k, False: 0]
  ------------------
   76|   589k|        {
   77|   589k|          const si32 *sp = src_line->i32 + src_line_offset;
   78|   589k|          si32 *dp = dst_line->i32 + dst_line_offset;
   79|   589k|          __m256i sh = _mm256_set1_epi32((si32)shift);
   80|  7.13M|          for (int i = (width + 7) >> 3; i > 0; --i, sp+=8, dp+=8)
  ------------------
  |  Branch (80:42): [True: 6.54M, False: 589k]
  ------------------
   81|  6.54M|          {
   82|  6.54M|            __m256i s = _mm256_loadu_si256((__m256i*)sp);
   83|  6.54M|            s = _mm256_add_epi32(s, sh);
   84|  6.54M|            _mm256_storeu_si256((__m256i*)dp, s);
   85|  6.54M|          }
   86|   589k|        }
   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|   589k|      }
  107|  1.24M|      else
  108|  1.24M|      {
  109|  1.24M|        assert(src_line->flags | line_buf::LFT_64BIT);
  110|  1.24M|        assert(dst_line->flags | line_buf::LFT_32BIT);
  111|  1.24M|        const si64 *sp = src_line->i64 + src_line_offset;
  112|  1.24M|        si32 *dp = dst_line->i32 + dst_line_offset;
  113|  1.24M|        __m256i low_bits = _mm256_set_epi64x(0, (si64)ULLONG_MAX,
  114|  1.24M|                                             0, (si64)ULLONG_MAX);
  115|  1.24M|        __m256i sh = _mm256_set1_epi64x(shift);
  116|  10.1M|        for (int i = (width + 7) >> 3; i > 0; --i, sp+=8, dp+=8)
  ------------------
  |  Branch (116:40): [True: 8.87M, False: 1.24M]
  ------------------
  117|  8.87M|        {
  118|  8.87M|          __m256i s, t;
  119|  8.87M|          s = _mm256_loadu_si256((__m256i*)sp);
  120|  8.87M|          s = _mm256_add_epi64(s, sh);
  121|       |
  122|  8.87M|          t = _mm256_shuffle_epi32(s, _MM_SHUFFLE(0, 0, 2, 0));
  123|  8.87M|          t = _mm256_and_si256(low_bits, t);
  124|       |
  125|  8.87M|          s = _mm256_loadu_si256((__m256i*)sp + 1);
  126|  8.87M|          s = _mm256_add_epi64(s, sh);
  127|       |
  128|  8.87M|          s = _mm256_shuffle_epi32(s, _MM_SHUFFLE(2, 0, 0, 0));
  129|  8.87M|          s = _mm256_andnot_si256(low_bits, s);
  130|       |
  131|  8.87M|          t = _mm256_or_si256(s, t);
  132|       |          t = _mm256_permute4x64_epi64(t, _MM_SHUFFLE(3, 1, 2, 0));
  133|  8.87M|          _mm256_storeu_si256((__m256i*)dp, t);
  134|  8.87M|        }
  135|  1.24M|      }
  136|  1.83M|    }
_ZN4ojph5local27avx2_irv_convert_to_integerEPKNS_8line_bufEPS1_jjbj:
  336|   186k|    {
  337|   186k|      local_avx2_irv_convert_to_integer<false>(src_line, dst_line, 
  338|   186k|        dst_line_offset, bit_depth, is_signed, width);
  339|   186k|    }
_ZN4ojph5local37avx2_irv_convert_to_integer_nlt_type3EPKNS_8line_bufEPS1_jjbj:
  345|    476|    {
  346|    476|      local_avx2_irv_convert_to_integer<true>(src_line, dst_line, 
  347|    476|        dst_line_offset, bit_depth, is_signed, width);
  348|    476|    }
_ZN4ojph5local17avx2_rct_backwardEPKNS_8line_bufES3_S3_PS1_S4_S4_j:
  515|  3.57k|    {
  516|  3.57k|      assert((y->flags  & line_buf::LFT_INTEGER) &&
  517|  3.57k|             (cb->flags & line_buf::LFT_INTEGER) &&
  518|  3.57k|             (cr->flags & line_buf::LFT_INTEGER) &&
  519|  3.57k|             (r->flags  & line_buf::LFT_INTEGER) &&
  520|  3.57k|             (g->flags  & line_buf::LFT_INTEGER) &&
  521|  3.57k|             (b->flags  & line_buf::LFT_INTEGER));
  522|       |
  523|  3.57k|      if (y->flags & line_buf::LFT_32BIT)
  ------------------
  |  Branch (523:11): [True: 1.72k, False: 1.84k]
  ------------------
  524|  1.72k|      {
  525|  1.72k|        assert((y->flags  & line_buf::LFT_32BIT) &&
  526|  1.72k|               (cb->flags & line_buf::LFT_32BIT) &&
  527|  1.72k|               (cr->flags & line_buf::LFT_32BIT) &&
  528|  1.72k|               (r->flags  & line_buf::LFT_32BIT) &&
  529|  1.72k|               (g->flags  & line_buf::LFT_32BIT) &&
  530|  1.72k|               (b->flags  & line_buf::LFT_32BIT));
  531|  1.72k|        const si32 *yp = y->i32, *cbp = cb->i32, *crp = cr->i32;
  532|  1.72k|        si32 *rp = r->i32, *gp = g->i32, *bp = b->i32;
  533|  4.28k|        for (int i = (repeat + 7) >> 3; i > 0; --i)
  ------------------
  |  Branch (533:41): [True: 2.56k, False: 1.72k]
  ------------------
  534|  2.56k|        {
  535|  2.56k|          __m256i my  = _mm256_load_si256((__m256i*)yp);
  536|  2.56k|          __m256i mcb = _mm256_load_si256((__m256i*)cbp);
  537|  2.56k|          __m256i mcr = _mm256_load_si256((__m256i*)crp);
  538|       |
  539|  2.56k|          __m256i t = _mm256_add_epi32(mcb, mcr);
  540|  2.56k|          t = _mm256_sub_epi32(my, _mm256_srai_epi32(t, 2));
  541|  2.56k|          _mm256_store_si256((__m256i*)gp, t);
  542|  2.56k|          __m256i u = _mm256_add_epi32(mcb, t);
  543|  2.56k|          _mm256_store_si256((__m256i*)bp, u);
  544|  2.56k|          u = _mm256_add_epi32(mcr, t);
  545|  2.56k|          _mm256_store_si256((__m256i*)rp, u);
  546|       |
  547|  2.56k|          yp += 8; cbp += 8; crp += 8;
  548|  2.56k|          rp += 8; gp += 8; bp += 8;
  549|  2.56k|        }
  550|  1.72k|      }
  551|  1.84k|      else
  552|  1.84k|      {
  553|  1.84k|        assert((y->flags  & line_buf::LFT_64BIT) &&
  554|  1.84k|               (cb->flags & line_buf::LFT_64BIT) &&
  555|  1.84k|               (cr->flags & line_buf::LFT_64BIT) &&
  556|  1.84k|               (r->flags  & line_buf::LFT_32BIT) &&
  557|  1.84k|               (g->flags  & line_buf::LFT_32BIT) &&
  558|  1.84k|               (b->flags  & line_buf::LFT_32BIT));
  559|  1.84k|        __m256i v2 = _mm256_set1_epi64x(1ULL << (63 - 2));
  560|  1.84k|        __m256i low_bits = _mm256_set_epi64x(0, (si64)ULLONG_MAX,
  561|  1.84k|                                             0, (si64)ULLONG_MAX);
  562|  1.84k|        const si64 *yp = y->i64, *cbp = cb->i64, *crp = cr->i64;
  563|  1.84k|        si32 *rp = r->i32, *gp = g->i32, *bp = b->i32;
  564|  4.65k|        for (int i = (repeat + 7) >> 3; i > 0; --i)
  ------------------
  |  Branch (564:41): [True: 2.80k, False: 1.84k]
  ------------------
  565|  2.80k|        {
  566|  2.80k|          __m256i my, mcb, mcr, tr, tg, tb;
  567|  2.80k|          my  = _mm256_load_si256((__m256i*)yp);
  568|  2.80k|          mcb = _mm256_load_si256((__m256i*)cbp);
  569|  2.80k|          mcr = _mm256_load_si256((__m256i*)crp);
  570|       |
  571|  2.80k|          tg = _mm256_add_epi64(mcb, mcr);
  572|  2.80k|          tg = _mm256_sub_epi64(my, avx2_mm256_srai_epi64(tg, 2, v2));
  573|  2.80k|          tb = _mm256_add_epi64(mcb, tg);
  574|  2.80k|          tr = _mm256_add_epi64(mcr, tg);
  575|       |
  576|  2.80k|          __m256i mr, mg, mb;
  577|  2.80k|          mr = _mm256_shuffle_epi32(tr, _MM_SHUFFLE(0, 0, 2, 0));
  578|  2.80k|          mr = _mm256_and_si256(low_bits, mr);
  579|  2.80k|          mg = _mm256_shuffle_epi32(tg, _MM_SHUFFLE(0, 0, 2, 0));
  580|  2.80k|          mg = _mm256_and_si256(low_bits, mg);
  581|  2.80k|          mb = _mm256_shuffle_epi32(tb, _MM_SHUFFLE(0, 0, 2, 0));
  582|  2.80k|          mb = _mm256_and_si256(low_bits, mb);
  583|       |
  584|  2.80k|          yp += 4; cbp += 4; crp += 4;
  585|       |
  586|  2.80k|          my  = _mm256_load_si256((__m256i*)yp);
  587|  2.80k|          mcb = _mm256_load_si256((__m256i*)cbp);
  588|  2.80k|          mcr = _mm256_load_si256((__m256i*)crp);
  589|       |
  590|  2.80k|          tg = _mm256_add_epi64(mcb, mcr);
  591|  2.80k|          tg = _mm256_sub_epi64(my, avx2_mm256_srai_epi64(tg, 2, v2));
  592|  2.80k|          tb = _mm256_add_epi64(mcb, tg);
  593|  2.80k|          tr = _mm256_add_epi64(mcr, tg);
  594|       |
  595|  2.80k|          tr = _mm256_shuffle_epi32(tr, _MM_SHUFFLE(2, 0, 0, 0));
  596|  2.80k|          tr = _mm256_andnot_si256(low_bits, tr);
  597|  2.80k|          mr = _mm256_or_si256(mr, tr);
  598|  2.80k|          mr = _mm256_permute4x64_epi64(mr, _MM_SHUFFLE(3, 1, 2, 0));
  599|       |
  600|  2.80k|          tg = _mm256_shuffle_epi32(tg, _MM_SHUFFLE(2, 0, 0, 0));
  601|  2.80k|          tg = _mm256_andnot_si256(low_bits, tg);
  602|  2.80k|          mg = _mm256_or_si256(mg, tg);
  603|  2.80k|          mg = _mm256_permute4x64_epi64(mg, _MM_SHUFFLE(3, 1, 2, 0));
  604|       |
  605|  2.80k|          tb = _mm256_shuffle_epi32(tb, _MM_SHUFFLE(2, 0, 0, 0));
  606|  2.80k|          tb = _mm256_andnot_si256(low_bits, tb);
  607|  2.80k|          mb = _mm256_or_si256(mb, tb);
  608|  2.80k|          mb = _mm256_permute4x64_epi64(mb, _MM_SHUFFLE(3, 1, 2, 0));
  609|       |
  610|  2.80k|          _mm256_store_si256((__m256i*)rp, mr);
  611|  2.80k|          _mm256_store_si256((__m256i*)gp, mg);
  612|  2.80k|          _mm256_store_si256((__m256i*)bp, mb);
  613|       |
  614|  2.80k|          yp += 4; cbp += 4; crp += 4;
  615|  2.80k|          rp += 8; gp += 8; bp += 8;
  616|  2.80k|        }
  617|  1.84k|      }
  618|  3.57k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL21avx2_mm256_srai_epi64EDv4_xiS1_:
   57|  5.61k|    {
   58|       |      // note than m must be obtained using
   59|       |      // __m256i m = _mm256_set1_epi64x(1ULL << (63 - amt));
   60|  5.61k|      __m256i x = _mm256_srli_epi64(a, amt);
   61|  5.61k|      x = _mm256_xor_si256(x, m);
   62|  5.61k|      __m256i result = _mm256_sub_epi64(x, m);
   63|  5.61k|      return result;
   64|  5.61k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL33local_avx2_irv_convert_to_integerILb0EEEvPKNS_8line_bufEPS2_jjbj:
  273|   186k|    {
  274|   186k|      assert((src_line->flags & line_buf::LFT_32BIT) &&
  275|   186k|             (src_line->flags & line_buf::LFT_INTEGER) == 0 &&
  276|   186k|             (dst_line->flags & line_buf::LFT_32BIT) &&
  277|   186k|             (dst_line->flags & line_buf::LFT_INTEGER));
  278|       |
  279|   186k|      assert(bit_depth <= 32);
  280|   186k|      const float* sp = src_line->f32;
  281|   186k|      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|   186k|      si32 neg_limit = (si32)INT_MIN >> (32 - bit_depth);
  289|   186k|      __m256 mul = _mm256_set1_ps((float)(1ull << bit_depth));
  290|   186k|      __m256 fl_up_lim = _mm256_set1_ps(-(float)neg_limit);  // val < upper
  291|   186k|      __m256 fl_low_lim = _mm256_set1_ps((float)neg_limit);  // val >= lower
  292|   186k|      __m256i s32_up_lim = _mm256_set1_epi32(INT_MAX >> (32 - bit_depth));
  293|   186k|      __m256i s32_low_lim = _mm256_set1_epi32(INT_MIN >> (32 - bit_depth));
  294|       |
  295|   186k|      if (is_signed)
  ------------------
  |  Branch (295:11): [True: 6.77k, False: 179k]
  ------------------
  296|  6.77k|      {
  297|  6.77k|        __m256i zero = _mm256_setzero_si256();
  298|  6.77k|        __m256i bias = 
  299|  6.77k|          _mm256_set1_epi32(-(si32)((1ULL << (bit_depth - 1)) + 1));
  300|  36.5k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (300:34): [True: 29.7k, False: 6.77k]
  ------------------
  301|  29.7k|          __m256 t = _mm256_loadu_ps(sp);
  302|  29.7k|          t = _mm256_mul_ps(t, mul);
  303|  29.7k|          __m256i u = _mm256_cvtps_epi32(t);
  304|  29.7k|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  305|  29.7k|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  306|  29.7k|          if (NLT_TYPE3)
  ------------------
  |  Branch (306:15): [Folded, False: 29.7k]
  ------------------
  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|  29.7k|          _mm256_storeu_si256((__m256i*)dp, u);
  315|  29.7k|        }
  316|  6.77k|      }
  317|   179k|      else
  318|   179k|      {
  319|   179k|        __m256i half = _mm256_set1_epi32((si32)(1ULL << (bit_depth - 1)));
  320|   769k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (320:34): [True: 589k, False: 179k]
  ------------------
  321|   589k|          __m256 t = _mm256_loadu_ps(sp);
  322|   589k|          t = _mm256_mul_ps(t, mul);
  323|   589k|          __m256i u = _mm256_cvtps_epi32(t);
  324|   589k|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  325|   589k|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  326|   589k|          u = _mm256_add_epi32(u, half);
  327|   589k|          _mm256_storeu_si256((__m256i*)dp, u);
  328|   589k|        }
  329|   179k|      }
  330|   186k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL23ojph_mm256_max_ge_epi32EDv4_xS1_Dv8_fS2_:
  244|   622k|    {
  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|   622k|      __m256i c = _mm256_castps_si256(ct);   // does not generate any code
  249|   622k|      __m256i d = _mm256_and_si256(c, a);    // keep only a, where x >= y
  250|   622k|      __m256i e = _mm256_andnot_si256(c, b); // keep only b, where x <  y
  251|   622k|      return _mm256_or_si256(d, e);          // combine
  252|   622k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL23ojph_mm256_min_lt_epi32EDv4_xS1_Dv8_fS2_:
  257|   622k|    {
  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|   622k|      __m256i c = _mm256_castps_si256(ct);   // does not generate any code
  262|   622k|      __m256i d = _mm256_and_si256(c, a);    // keep only a, where x <  y
  263|   622k|      __m256i e = _mm256_andnot_si256(c, b); // keep only b, where x >= y
  264|   622k|      return _mm256_or_si256(d, e);          // combine
  265|   622k|    }
ojph_colour_avx2.cpp:_ZN4ojph5localL33local_avx2_irv_convert_to_integerILb1EEEvPKNS_8line_bufEPS2_jjbj:
  273|    476|    {
  274|    476|      assert((src_line->flags & line_buf::LFT_32BIT) &&
  275|    476|             (src_line->flags & line_buf::LFT_INTEGER) == 0 &&
  276|    476|             (dst_line->flags & line_buf::LFT_32BIT) &&
  277|    476|             (dst_line->flags & line_buf::LFT_INTEGER));
  278|       |
  279|    476|      assert(bit_depth <= 32);
  280|    476|      const float* sp = src_line->f32;
  281|    476|      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|    476|      si32 neg_limit = (si32)INT_MIN >> (32 - bit_depth);
  289|    476|      __m256 mul = _mm256_set1_ps((float)(1ull << bit_depth));
  290|    476|      __m256 fl_up_lim = _mm256_set1_ps(-(float)neg_limit);  // val < upper
  291|    476|      __m256 fl_low_lim = _mm256_set1_ps((float)neg_limit);  // val >= lower
  292|    476|      __m256i s32_up_lim = _mm256_set1_epi32(INT_MAX >> (32 - bit_depth));
  293|    476|      __m256i s32_low_lim = _mm256_set1_epi32(INT_MIN >> (32 - bit_depth));
  294|       |
  295|    476|      if (is_signed)
  ------------------
  |  Branch (295:11): [True: 0, False: 476]
  ------------------
  296|      0|      {
  297|      0|        __m256i zero = _mm256_setzero_si256();
  298|      0|        __m256i bias = 
  299|      0|          _mm256_set1_epi32(-(si32)((1ULL << (bit_depth - 1)) + 1));
  300|      0|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (300:34): [True: 0, False: 0]
  ------------------
  301|      0|          __m256 t = _mm256_loadu_ps(sp);
  302|      0|          t = _mm256_mul_ps(t, mul);
  303|      0|          __m256i u = _mm256_cvtps_epi32(t);
  304|      0|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  305|      0|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  306|      0|          if (NLT_TYPE3)
  ------------------
  |  Branch (306:15): [True: 0, Folded]
  ------------------
  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|      0|          _mm256_storeu_si256((__m256i*)dp, u);
  315|      0|        }
  316|      0|      }
  317|    476|      else
  318|    476|      {
  319|    476|        __m256i half = _mm256_set1_epi32((si32)(1ULL << (bit_depth - 1)));
  320|  3.20k|        for (int i = (int)width; i > 0; i -= 8, sp += 8, dp += 8) {
  ------------------
  |  Branch (320:34): [True: 2.73k, False: 476]
  ------------------
  321|  2.73k|          __m256 t = _mm256_loadu_ps(sp);
  322|  2.73k|          t = _mm256_mul_ps(t, mul);
  323|  2.73k|          __m256i u = _mm256_cvtps_epi32(t);
  324|  2.73k|          u = ojph_mm256_max_ge_epi32(u, s32_low_lim, t, fl_low_lim);
  325|  2.73k|          u = ojph_mm256_min_lt_epi32(u,  s32_up_lim, t,  fl_up_lim);
  326|  2.73k|          u = _mm256_add_epi32(u, half);
  327|  2.73k|          _mm256_storeu_si256((__m256i*)dp, u);
  328|  2.73k|        }
  329|    476|      }
  330|    476|    }

_ZN4ojph5local32init_wavelet_transform_functionsEv:
   99|  6.10k|    {
  100|  6.10k|      static std::once_flag wavelet_transform_functions_init_flag;
  101|  6.10k|      std::call_once(wavelet_transform_functions_init_flag, [](){
  102|  6.10k|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  103|       |
  104|  6.10k|        rev_vert_step             = gen_rev_vert_step;
  105|  6.10k|        rev_horz_ana              = gen_rev_horz_ana;
  106|  6.10k|        rev_horz_syn              = gen_rev_horz_syn;
  107|       |
  108|  6.10k|        irv_vert_step             = gen_irv_vert_step;
  109|  6.10k|        irv_vert_times_K          = gen_irv_vert_times_K;
  110|  6.10k|        irv_horz_ana              = gen_irv_horz_ana;
  111|  6.10k|        irv_horz_syn              = gen_irv_horz_syn;
  112|       |
  113|  6.10k|  #ifndef OJPH_DISABLE_SIMD
  114|       |
  115|  6.10k|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  116|       |
  117|  6.10k|      #ifndef OJPH_DISABLE_SSE
  118|  6.10k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  119|  6.10k|        {
  120|  6.10k|          irv_vert_step             = sse_irv_vert_step;
  121|  6.10k|          irv_vert_times_K          = sse_irv_vert_times_K;
  122|  6.10k|          irv_horz_ana              = sse_irv_horz_ana;
  123|  6.10k|          irv_horz_syn              = sse_irv_horz_syn;
  124|  6.10k|        }
  125|  6.10k|      #endif // !OJPH_DISABLE_SSE
  126|       |
  127|  6.10k|      #ifndef OJPH_DISABLE_SSE2
  128|  6.10k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2)
  129|  6.10k|        {
  130|  6.10k|          rev_vert_step             = sse2_rev_vert_step;
  131|  6.10k|          rev_horz_ana              = sse2_rev_horz_ana;
  132|  6.10k|          rev_horz_syn              = sse2_rev_horz_syn;
  133|  6.10k|        }
  134|  6.10k|      #endif // !OJPH_DISABLE_SSE2
  135|       |
  136|  6.10k|      #ifndef OJPH_DISABLE_AVX
  137|  6.10k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  138|  6.10k|        {
  139|  6.10k|          irv_vert_step             = avx_irv_vert_step;
  140|  6.10k|          irv_vert_times_K          = avx_irv_vert_times_K;
  141|  6.10k|          irv_horz_ana              = avx_irv_horz_ana;      
  142|  6.10k|          irv_horz_syn              = avx_irv_horz_syn;
  143|  6.10k|        }
  144|  6.10k|      #endif // !OJPH_DISABLE_AVX
  145|       |
  146|  6.10k|      #ifndef OJPH_DISABLE_AVX2
  147|  6.10k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2)
  148|  6.10k|        {
  149|  6.10k|          rev_vert_step             = avx2_rev_vert_step;
  150|  6.10k|          rev_horz_ana              = avx2_rev_horz_ana;
  151|  6.10k|          rev_horz_syn              = avx2_rev_horz_syn;
  152|  6.10k|        }
  153|  6.10k|      #endif // !OJPH_DISABLE_AVX2
  154|       |
  155|  6.10k|      #if (defined(OJPH_ARCH_X86_64) && !defined(OJPH_DISABLE_AVX512))
  156|  6.10k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX512)
  157|  6.10k|        {
  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|  6.10k|          irv_vert_step             = avx512_irv_vert_step;
  163|  6.10k|          irv_vert_times_K          = avx512_irv_vert_times_K;
  164|  6.10k|          irv_horz_ana              = avx512_irv_horz_ana;
  165|  6.10k|          irv_horz_syn              = avx512_irv_horz_syn;
  166|  6.10k|        }
  167|  6.10k|      #endif // !OJPH_DISABLE_AVX512
  168|       |    
  169|       |    #elif defined(OJPH_ARCH_ARM)
  170|       |
  171|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  172|       |
  173|  6.10k|  #endif // !OJPH_DISABLE_SIMD
  174|       |
  175|       |#else // OJPH_ENABLE_WASM_SIMD
  176|       |        rev_vert_step             = wasm_rev_vert_step;
  177|       |        rev_horz_ana              = wasm_rev_horz_ana;
  178|       |        rev_horz_syn              = wasm_rev_horz_syn;
  179|       |        
  180|       |        irv_vert_step             = wasm_irv_vert_step;
  181|       |        irv_vert_times_K          = wasm_irv_vert_times_K;
  182|       |        irv_horz_ana              = wasm_irv_horz_ana;
  183|       |        irv_horz_syn              = wasm_irv_horz_syn;
  184|       |#endif // !OJPH_ENABLE_WASM_SIMD
  185|  6.10k|      });
  186|  6.10k|    }
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|       |    #endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  172|       |
  173|      1|  #endif // !OJPH_DISABLE_SIMD
  174|       |
  175|       |#else // OJPH_ENABLE_WASM_SIMD
  176|       |        rev_vert_step             = wasm_rev_vert_step;
  177|       |        rev_horz_ana              = wasm_rev_horz_ana;
  178|       |        rev_horz_syn              = wasm_rev_horz_syn;
  179|       |        
  180|       |        irv_vert_step             = wasm_irv_vert_step;
  181|       |        irv_vert_times_K          = wasm_irv_vert_times_K;
  182|       |        irv_horz_ana              = wasm_irv_horz_ana;
  183|       |        irv_horz_syn              = wasm_irv_horz_syn;
  184|       |#endif // !OJPH_ENABLE_WASM_SIMD
  185|      1|      });

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

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

