LLVMFuzzerTestOneInput:
   51|  4.18k|{
   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|  4.18k|  if (Size < 3)
  ------------------
  |  Branch (56:7): [True: 2, False: 4.18k]
  ------------------
   57|      2|    return 0;
   58|       |
   59|  4.18k|  uint8_t opts = Data[0];
   60|  4.18k|  uint8_t skip_res = Data[1] & 0x07;
   61|  4.18k|  Data += 2;
   62|  4.18k|  Size -= 2;
   63|       |
   64|  4.18k|  bool force_planar = (opts & 0x02) != 0;
   65|  4.18k|  bool force_interleaved = (opts & 0x04) != 0;
   66|       |
   67|  4.18k|  try
   68|  4.18k|  {
   69|  4.18k|    ojph::mem_infile infile;
   70|  4.18k|    infile.open(reinterpret_cast<const ojph::ui8 *>(Data), Size);
   71|       |
   72|  4.18k|    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|  4.18k|    cs.enable_resilience();
   77|       |
   78|  4.18k|    cs.read_headers(&infile);
   79|       |
   80|       |    // Guard against inputs that cause excessive decoding work.
   81|  4.18k|    {
   82|  4.18k|      ojph::param_siz siz = cs.access_siz();
   83|  4.18k|      ojph::point extent = siz.get_image_extent();
   84|  4.18k|      ojph::point offset = siz.get_image_offset();
   85|  4.18k|      ojph::ui64 w = extent.x - offset.x;
   86|  4.18k|      ojph::ui64 h = extent.y - offset.y;
   87|  4.18k|      if (w * h * siz.get_num_components() > 65536)
  ------------------
  |  Branch (87:11): [True: 32, False: 4.15k]
  ------------------
   88|     32|      {
   89|     32|        cs.close();
   90|     32|        return 0;
   91|     32|      }
   92|       |
   93|  4.15k|      ojph::param_cod cod = cs.access_cod();
   94|  4.15k|      if (cod.get_num_decompositions() > 5)
  ------------------
  |  Branch (94:11): [True: 2, False: 4.15k]
  ------------------
   95|      2|      {
   96|      2|        cs.close();
   97|      2|        return 0;
   98|      2|      }
   99|       |
  100|       |      // Large precincts cause huge internal buffers and very expensive
  101|       |      // per-row wavelet transforms even for small images.
  102|  22.1k|      for (ojph::ui32 lev = 0; lev <= cod.get_num_decompositions(); ++lev)
  ------------------
  |  Branch (102:32): [True: 17.9k, False: 4.14k]
  ------------------
  103|  17.9k|      {
  104|  17.9k|        ojph::size psiz = cod.get_precinct_size(lev);
  105|  17.9k|        if (psiz.w > 256 || psiz.h > 256)
  ------------------
  |  Branch (105:13): [True: 5, False: 17.9k]
  |  Branch (105:29): [True: 1, False: 17.9k]
  ------------------
  106|      6|        {
  107|      6|          cs.close();
  108|      6|          return 0;
  109|      6|        }
  110|  17.9k|      }
  111|  4.15k|    }
  112|       |
  113|  4.14k|    if (skip_res > 0)
  ------------------
  |  Branch (113:9): [True: 1.02k, False: 3.12k]
  ------------------
  114|  1.02k|      cs.restrict_input_resolution(skip_res, skip_res);
  115|       |
  116|  4.14k|    if (force_planar)
  ------------------
  |  Branch (116:9): [True: 1.58k, False: 2.56k]
  ------------------
  117|  1.58k|      cs.set_planar(true);
  118|  2.56k|    else if (force_interleaved)
  ------------------
  |  Branch (118:14): [True: 461, False: 2.10k]
  ------------------
  119|    461|      cs.set_planar(false);
  120|       |
  121|  4.14k|    cs.create();
  122|       |
  123|  4.14k|    ojph::param_siz siz = cs.access_siz();
  124|       |
  125|       |    // Second guard: cap reconstructed dimensions after create().
  126|  4.14k|    {
  127|  4.14k|      ojph::ui64 total_recon = 0;
  128|  7.34k|      for (ojph::ui32 c = 0; c < siz.get_num_components(); ++c)
  ------------------
  |  Branch (128:30): [True: 3.20k, False: 4.14k]
  ------------------
  129|  3.20k|        total_recon += (ojph::ui64)siz.get_recon_width(c)
  130|  3.20k|                     * (ojph::ui64)siz.get_recon_height(c);
  131|  4.14k|      if (total_recon > 65536)
  ------------------
  |  Branch (131:11): [True: 0, False: 4.14k]
  ------------------
  132|      0|      {
  133|      0|        cs.close();
  134|      0|        return 0;
  135|      0|      }
  136|  4.14k|    }
  137|       |
  138|       |    // Time budget: abort if decoding takes too long.
  139|  4.14k|    struct timespec start_ts;
  140|  4.14k|    clock_gettime(CLOCK_MONOTONIC, &start_ts);
  141|  4.14k|    ojph::ui32 pull_count = 0;
  142|  4.14k|    const ojph::ui32 MAX_SECONDS = 10;
  143|  4.14k|    bool timed_out = false;
  144|       |
  145|  4.14k|    if (cs.is_planar())
  ------------------
  |  Branch (145:9): [True: 2.36k, False: 1.78k]
  ------------------
  146|  2.36k|    {
  147|  5.04k|      for (ojph::ui32 c = 0; c < siz.get_num_components() && !timed_out; ++c)
  ------------------
  |  Branch (147:30): [True: 2.67k, False: 2.36k]
  |  Branch (147:62): [True: 2.67k, False: 0]
  ------------------
  148|  2.67k|      {
  149|  2.67k|        ojph::ui32 height = siz.get_recon_height(c);
  150|  1.21M|        for (ojph::ui32 i = height; i > 0 && !timed_out; --i)
  ------------------
  |  Branch (150:37): [True: 1.20M, False: 2.67k]
  |  Branch (150:46): [True: 1.20M, False: 0]
  ------------------
  151|  1.20M|        {
  152|  1.20M|          ojph::ui32 comp_num;
  153|  1.20M|          cs.pull(comp_num);
  154|  1.20M|          if (++pull_count % 64 == 0)
  ------------------
  |  Branch (154:15): [True: 18.3k, False: 1.19M]
  ------------------
  155|  18.3k|          {
  156|  18.3k|            struct timespec now;
  157|  18.3k|            clock_gettime(CLOCK_MONOTONIC, &now);
  158|  18.3k|            if ((ojph::ui32)(now.tv_sec - start_ts.tv_sec) >= MAX_SECONDS)
  ------------------
  |  Branch (158:17): [True: 0, False: 18.3k]
  ------------------
  159|      0|              timed_out = true;
  160|  18.3k|          }
  161|  1.20M|        }
  162|  2.67k|      }
  163|  2.36k|    }
  164|  1.78k|    else
  165|  1.78k|    {
  166|  1.78k|      ojph::ui32 height = siz.get_recon_height(0);
  167|   325k|      for (ojph::ui32 i = 0; i < height && !timed_out; ++i)
  ------------------
  |  Branch (167:30): [True: 323k, False: 1.78k]
  |  Branch (167:44): [True: 323k, False: 0]
  ------------------
  168|   323k|      {
  169|   650k|        for (ojph::ui32 c = 0; c < siz.get_num_components(); ++c)
  ------------------
  |  Branch (169:32): [True: 326k, False: 323k]
  ------------------
  170|   326k|        {
  171|   326k|          ojph::ui32 comp_num;
  172|   326k|          cs.pull(comp_num);
  173|   326k|          if (++pull_count % 64 == 0)
  ------------------
  |  Branch (173:15): [True: 5.01k, False: 321k]
  ------------------
  174|  5.01k|          {
  175|  5.01k|            struct timespec now;
  176|  5.01k|            clock_gettime(CLOCK_MONOTONIC, &now);
  177|  5.01k|            if ((ojph::ui32)(now.tv_sec - start_ts.tv_sec) >= MAX_SECONDS)
  ------------------
  |  Branch (177:17): [True: 0, False: 5.01k]
  ------------------
  178|      0|              timed_out = true;
  179|  5.01k|          }
  180|   326k|        }
  181|   323k|      }
  182|  1.78k|    }
  183|       |
  184|  4.14k|    cs.close();
  185|  4.14k|  }
  186|  4.18k|  catch (const std::exception &)
  187|  4.18k|  {
  188|  1.29k|  }
  189|       |
  190|  4.14k|  return 0;
  191|  4.18k|}

ojph_precinct.cpp:_ZN4ojph5localL7bb_initEPNS0_12bit_read_bufEjPNS_11infile_baseE:
   68|   349k|    {
   69|   349k|      bbp->avail_bits = 0;
   70|   349k|      bbp->file = file;
   71|   349k|      bbp->bytes_left = bytes_left;
   72|   349k|      bbp->tmp = 0;
   73|   349k|      bbp->unstuff = false;
   74|   349k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_skip_sopEPNS0_12bit_read_bufE:
  184|  32.6k|    {
  185|  32.6k|      if (bbp->bytes_left >= 2)
  ------------------
  |  Branch (185:11): [True: 32.2k, False: 455]
  ------------------
  186|  32.2k|      {
  187|  32.2k|        ui8 marker[2];
  188|  32.2k|        if (bbp->file->read(marker, 2) != 2)
  ------------------
  |  Branch (188:13): [True: 922, False: 31.2k]
  ------------------
  189|    922|          throw "error reading from file";
  190|  31.2k|        if ((int)marker[0] == (SOP >> 8) && (int)marker[1] == (SOP & 0xFF))
  ------------------
  |  Branch (190:13): [True: 3.62k, False: 27.6k]
  |  Branch (190:45): [True: 971, False: 2.65k]
  ------------------
  191|    971|        {
  192|    971|          bbp->bytes_left -= 2;
  193|    971|          if (bbp->bytes_left >= 4)
  ------------------
  |  Branch (193:15): [True: 903, False: 68]
  ------------------
  194|    903|          {
  195|    903|            ui16 com_len;
  196|    903|            if (bbp->file->read(&com_len, 2) != 2)
  ------------------
  |  Branch (196:17): [True: 255, False: 648]
  ------------------
  197|    255|              throw "error reading from file";
  198|    648|            com_len = swap_byte(com_len);
  199|    648|            if (com_len != 4)
  ------------------
  |  Branch (199:17): [True: 145, False: 503]
  ------------------
  200|    145|              throw "something is wrong with SOP length";
  201|    503|            int result = 
  202|    503|              bbp->file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
  203|    503|            if (result != 0)
  ------------------
  |  Branch (203:17): [True: 144, False: 359]
  ------------------
  204|    144|              throw "error seeking file";
  205|    359|            bbp->bytes_left -= com_len;
  206|    359|          }
  207|     68|          else
  208|     68|            throw "precinct truncated early";
  209|    359|          return true;
  210|    971|        }
  211|  30.3k|        else
  212|  30.3k|        {
  213|       |          //put the bytes back
  214|  30.3k|          if (bbp->file->seek(-2, infile_base::OJPH_SEEK_CUR) != 0)
  ------------------
  |  Branch (214:15): [True: 0, False: 30.3k]
  ------------------
  215|      0|            throw "error seeking file";
  216|  30.3k|          return false;
  217|  30.3k|        }
  218|  31.2k|      }
  219|       |
  220|    455|      return false;
  221|  32.6k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_read_bitEPNS0_12bit_read_bufERj:
  103|  1.90M|    {
  104|  1.90M|      bool result = true;
  105|  1.90M|      if (bbp->avail_bits == 0)
  ------------------
  |  Branch (105:11): [True: 509k, False: 1.39M]
  ------------------
  106|   509k|        result = bb_read(bbp);
  107|  1.90M|      bit = (bbp->tmp >> --bbp->avail_bits) & 1;
  108|  1.90M|      return result;
  109|  1.90M|    }
ojph_precinct.cpp:_ZN4ojph5localL7bb_readEPNS0_12bit_read_bufE:
   79|   808k|    {
   80|   808k|      if (bbp->bytes_left > 0)
  ------------------
  |  Branch (80:11): [True: 805k, False: 3.45k]
  ------------------
   81|   805k|      {
   82|   805k|        ui32 t = 0;
   83|   805k|        if (bbp->file->read(&t, 1) != 1)
  ------------------
  |  Branch (83:13): [True: 10.3k, False: 794k]
  ------------------
   84|  10.3k|          throw "error reading from file";
   85|   794k|        bbp->tmp = t;
   86|   794k|        bbp->avail_bits = 8 - bbp->unstuff;
   87|   794k|        bbp->unstuff = (t == 0xFF);
   88|   794k|        --bbp->bytes_left;
   89|   794k|        return true;
   90|   805k|      }
   91|  3.45k|      else
   92|  3.45k|      {
   93|  3.45k|        bbp->tmp = 0;
   94|  3.45k|        bbp->avail_bits = 8 - bbp->unstuff;
   95|  3.45k|        bbp->unstuff = false;
   96|  3.45k|        return false;
   97|  3.45k|      }
   98|   808k|    }
ojph_precinct.cpp:_ZN4ojph5localL12bb_terminateEPNS0_12bit_read_bufEb:
  169|   318k|    {
  170|   318k|      bool result = true;
  171|   318k|      if (bbp->unstuff)
  ------------------
  |  Branch (171:11): [True: 2.15k, False: 315k]
  ------------------
  172|  2.15k|        result = bb_read(bbp);
  173|   318k|      assert(bbp->unstuff == false);
  174|   318k|      if (uses_eph)
  ------------------
  |  Branch (174:11): [True: 4.04k, False: 314k]
  ------------------
  175|  4.04k|        bb_skip_eph(bbp);
  176|   318k|      bbp->tmp = 0;
  177|   318k|      bbp->avail_bits = 0;
  178|   318k|      return result;
  179|   318k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_skip_ephEPNS0_12bit_read_bufE:
  154|  4.04k|    {
  155|  4.04k|      if (bbp->bytes_left >= 2)
  ------------------
  |  Branch (155:11): [True: 3.17k, False: 870]
  ------------------
  156|  3.17k|      {
  157|  3.17k|        ui8 marker[2];
  158|  3.17k|        if (bbp->file->read(marker, 2) != 2)
  ------------------
  |  Branch (158:13): [True: 332, False: 2.84k]
  ------------------
  159|    332|          throw "error reading from file";
  160|  2.84k|        bbp->bytes_left -= 2;
  161|  2.84k|        if ((int)marker[0] != (EPH >> 8) || (int)marker[1] != (EPH & 0xFF))
  ------------------
  |  Branch (161:13): [True: 2.40k, False: 437]
  |  Branch (161:45): [True: 372, False: 65]
  ------------------
  162|  2.77k|          throw "should find EPH, but found something else";
  163|  2.84k|      }
  164|  4.04k|    }
ojph_precinct.cpp:_ZN4ojph5localL12bb_read_bitsEPNS0_12bit_read_bufEiRj:
  114|   319k|    {
  115|   319k|      assert(num_bits <= 32);
  116|       |
  117|   319k|      bits = 0;
  118|   319k|      bool result = true;
  119|   918k|      while (num_bits) {
  ------------------
  |  Branch (119:14): [True: 598k, False: 319k]
  ------------------
  120|   598k|        if (bbp->avail_bits == 0)
  ------------------
  |  Branch (120:13): [True: 296k, False: 302k]
  ------------------
  121|   296k|          result = bb_read(bbp);
  122|   598k|        int tx_bits = ojph_min(bbp->avail_bits, num_bits);
  ------------------
  |  |   76|   598k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 279k, False: 319k]
  |  |  ------------------
  ------------------
  123|   598k|        bits <<= tx_bits;
  124|   598k|        bbp->avail_bits -= tx_bits;
  125|   598k|        num_bits -= tx_bits;
  126|   598k|        bits |= (bbp->tmp >> bbp->avail_bits) & ((1 << tx_bits) - 1);
  127|   598k|      }
  128|   319k|      return result;
  129|   319k|    }
ojph_precinct.cpp:_ZN4ojph5localL13bb_read_chunkEPNS0_12bit_read_bufEjRPNS_11coded_listsEPNS_21mem_elastic_allocatorE:
  136|  77.6k|    {
  137|  77.6k|      assert(bbp->avail_bits == 0 && bbp->unstuff == false);
  138|  77.6k|      elastic->get_buffer(num_bytes + coded_cb_header::prefix_buf_size
  139|  77.6k|        + coded_cb_header::suffix_buf_size, cur_coded_list);
  140|  77.6k|      ui32 bytes = ojph_min(num_bytes, bbp->bytes_left);
  ------------------
  |  |   76|  77.6k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 76.0k, False: 1.58k]
  |  |  ------------------
  ------------------
  141|  77.6k|      ui32 bytes_read = (ui32)bbp->file->read(
  142|  77.6k|        cur_coded_list->buf + coded_cb_header::prefix_buf_size, bytes);
  143|  77.6k|      if (num_bytes > bytes_read)
  ------------------
  |  Branch (143:11): [True: 8.75k, False: 68.9k]
  ------------------
  144|  8.75k|        memset(
  145|  8.75k|          cur_coded_list->buf + coded_cb_header::prefix_buf_size + bytes_read,
  146|  8.75k|          0, num_bytes - bytes_read);
  147|  77.6k|      bbp->bytes_left -= bytes_read;
  148|  77.6k|      return bytes_read == bytes;
  149|  77.6k|    }

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

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

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

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

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

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

_ZN4ojph5local10codestreamC2Ev:
   57|  4.18k|    : precinct_scratch(NULL), allocator(NULL), elastic_alloc(NULL)
   58|  4.18k|    {
   59|  4.18k|      allocator = new mem_fixed_allocator;
   60|  4.18k|      elastic_alloc = new mem_elastic_allocator(1048576); // 1 megabyte
   61|       |
   62|  4.18k|      init_colour_transform_functions();
   63|  4.18k|      init_wavelet_transform_functions();
   64|       |
   65|  4.18k|      restart();
   66|  4.18k|    }
_ZN4ojph5local10codestreamD2Ev:
   70|  4.18k|    {
   71|  4.18k|      if (allocator)
  ------------------
  |  Branch (71:11): [True: 4.18k, False: 0]
  ------------------
   72|  4.18k|        delete allocator;
   73|  4.18k|      if (elastic_alloc)
  ------------------
  |  Branch (73:11): [True: 4.18k, False: 0]
  ------------------
   74|  4.18k|        delete elastic_alloc;
   75|  4.18k|    }
_ZN4ojph5local10codestream7restartEv:
   79|  4.18k|    {
   80|  4.18k|      tiles = NULL;
   81|  4.18k|      lines = NULL;
   82|  4.18k|      comp_size = NULL;
   83|  4.18k|      recon_comp_size = NULL;
   84|  4.18k|      outfile = NULL;
   85|  4.18k|      infile = NULL;
   86|       |
   87|  4.18k|      num_comps = 0;
   88|  4.18k|      employ_color_transform = false;
   89|  4.18k|      planar = -1;
   90|  4.18k|      profile = OJPH_PN_UNDEFINED;
   91|  4.18k|      tilepart_div = OJPH_TILEPART_NO_DIVISIONS;
   92|  4.18k|      need_tlm = false;
   93|       |
   94|  4.18k|      cur_comp = 0;
   95|  4.18k|      cur_line = 0;
   96|  4.18k|      cur_tile_row = 0;
   97|  4.18k|      resilient = false;
   98|  4.18k|      skipped_res_for_read = skipped_res_for_recon = 0;
   99|       |
  100|  4.18k|      precinct_scratch_needed_bytes = 0;
  101|       |
  102|  4.18k|      cod.restart();
  103|  4.18k|      qcd.restart();
  104|  4.18k|      nlt.restart();
  105|  4.18k|      dfs.restart();
  106|  4.18k|      atk.restart();
  107|       |
  108|  4.18k|      allocator->restart();
  109|  4.18k|      elastic_alloc->restart();
  110|  4.18k|    }
_ZN4ojph5local10codestream9pre_allocEv:
  114|  2.99k|    {
  115|  2.99k|      ojph::param_siz sz = access_siz();
  116|  2.99k|      num_tiles.w = sz.get_image_extent().x - sz.get_tile_offset().x;
  117|  2.99k|      num_tiles.w = ojph_div_ceil(num_tiles.w, sz.get_tile_size().w);
  ------------------
  |  |   70|  2.99k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  118|  2.99k|      num_tiles.h = sz.get_image_extent().y - sz.get_tile_offset().y;
  119|  2.99k|      num_tiles.h = ojph_div_ceil(num_tiles.h, sz.get_tile_size().h);
  ------------------
  |  |   70|  2.99k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  120|  2.99k|      if (num_tiles.area() > 65535)
  ------------------
  |  Branch (120:11): [True: 1, False: 2.99k]
  ------------------
  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|  2.99k|      if (num_tiles.area() == 0)
  ------------------
  |  Branch (122:11): [True: 2, False: 2.99k]
  ------------------
  123|      2|        OJPH_ERROR(0x00030012, "the number of tiles cannot be 0");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|       |
  125|       |      //allocate tiles
  126|  2.99k|      allocator->pre_alloc_obj<tile>((size_t)num_tiles.area());
  127|       |
  128|  2.99k|      ui32 num_tileparts = 0;
  129|  2.99k|      point index;
  130|  2.99k|      rect tile_rect, recon_tile_rect;
  131|  2.99k|      ui32 ds = 1 << skipped_res_for_recon;
  132|  77.8k|      for (index.y = 0; index.y < num_tiles.h; ++index.y)
  ------------------
  |  Branch (132:25): [True: 74.8k, False: 2.99k]
  ------------------
  133|  74.8k|      {
  134|  74.8k|        ui32 y0 = sz.get_tile_offset().y
  135|  74.8k|                + index.y * sz.get_tile_size().h;
  136|  74.8k|        ui32 y1 = y0 + sz.get_tile_size().h; //end of tile
  137|       |
  138|  74.8k|        tile_rect.org.y = ojph_max(y0, sz.get_image_offset().y);
  ------------------
  |  |   73|  74.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 71.8k, False: 2.99k]
  |  |  ------------------
  ------------------
  139|  74.8k|        tile_rect.siz.h =
  140|  74.8k|          ojph_min(y1, sz.get_image_extent().y) - tile_rect.org.y;
  ------------------
  |  |   76|  74.8k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 71.8k, False: 2.98k]
  |  |  ------------------
  ------------------
  141|       |
  142|  74.8k|        recon_tile_rect.org.y = ojph_max(ojph_div_ceil(y0, ds),
  ------------------
  |  |   73|  74.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 71.8k, False: 3.01k]
  |  |  ------------------
  ------------------
  143|  74.8k|          ojph_div_ceil(sz.get_image_offset().y, ds));
  144|  74.8k|        recon_tile_rect.siz.h = ojph_min(ojph_div_ceil(y1, ds),
  ------------------
  |  |   76|  74.8k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 71.8k, False: 3.05k]
  |  |  ------------------
  ------------------
  145|  74.8k|          ojph_div_ceil(sz.get_image_extent().y, ds))
  146|  74.8k|          - recon_tile_rect.org.y;
  147|       |
  148|   218k|        for (index.x = 0; index.x < num_tiles.w; ++index.x)
  ------------------
  |  Branch (148:27): [True: 143k, False: 74.8k]
  ------------------
  149|   143k|        {
  150|   143k|          ui32 x0 = sz.get_tile_offset().x
  151|   143k|                  + index.x * sz.get_tile_size().w;
  152|   143k|          ui32 x1 = x0 + sz.get_tile_size().w;
  153|       |
  154|   143k|          tile_rect.org.x = ojph_max(x0, sz.get_image_offset().x);
  ------------------
  |  |   73|   143k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 68.7k, False: 74.8k]
  |  |  ------------------
  ------------------
  155|   143k|          tile_rect.siz.w =
  156|   143k|            ojph_min(x1, sz.get_image_extent().x) - tile_rect.org.x;
  ------------------
  |  |   76|   143k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 68.7k, False: 74.8k]
  |  |  ------------------
  ------------------
  157|       |
  158|   143k|          recon_tile_rect.org.x = ojph_max(ojph_div_ceil(x0, ds),
  ------------------
  |  |   73|   143k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 68.6k, False: 74.8k]
  |  |  ------------------
  ------------------
  159|   143k|            ojph_div_ceil(sz.get_image_offset().x, ds));
  160|   143k|          recon_tile_rect.siz.w = ojph_min(ojph_div_ceil(x1, ds),
  ------------------
  |  |   76|   143k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 68.6k, False: 74.9k]
  |  |  ------------------
  ------------------
  161|   143k|            ojph_div_ceil(sz.get_image_extent().x, ds))
  162|   143k|            - recon_tile_rect.org.x;
  163|       |
  164|   143k|          ui32 tps = 0; // number of tileparts for this tile
  165|   143k|          tile::pre_alloc(this, tile_rect, recon_tile_rect, tps);
  166|   143k|          num_tileparts += tps;
  167|   143k|        }
  168|  74.8k|      }
  169|       |
  170|       |      //allocate lines
  171|       |      //These lines are used by codestream to exchange data with external
  172|       |      // world
  173|  2.99k|      ui32 num_comps = sz.get_num_components();
  174|  2.99k|      allocator->pre_alloc_obj<line_buf>(num_comps);
  175|  2.99k|      allocator->pre_alloc_obj<size>(num_comps); //for *comp_size
  176|  2.99k|      allocator->pre_alloc_obj<size>(num_comps); //for *recon_comp_size
  177|  6.42k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (177:24): [True: 3.42k, False: 2.99k]
  ------------------
  178|  3.42k|        allocator->pre_alloc_data<si32>(siz.get_recon_width(i), 0);
  179|       |
  180|       |      //allocate tlm
  181|  2.99k|      if (outfile != NULL && need_tlm)
  ------------------
  |  Branch (181:11): [True: 0, False: 2.99k]
  |  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|  2.99k|      ui32 num_decomps = cod.get_num_decompositions();
  186|  2.99k|      size log_cb = cod.get_log_block_dims();
  187|       |
  188|  2.99k|      size ratio;
  189|  20.8k|      for (ui32 r = 0; r <= num_decomps; ++r)
  ------------------
  |  Branch (189:24): [True: 17.8k, False: 2.99k]
  ------------------
  190|  17.8k|      {
  191|  17.8k|        size log_PP = cod.get_log_precinct_size(r);
  192|  17.8k|        ratio.w = ojph_max(ratio.w, log_PP.w - ojph_min(log_cb.w, log_PP.w));
  ------------------
  |  |   73|  35.6k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 3.20k, False: 14.6k]
  |  |  |  Branch (73:33): [True: 2.74k, False: 15.0k]
  |  |  |  Branch (73:46): [True: 2.12k, False: 12.5k]
  |  |  ------------------
  ------------------
  193|  17.8k|        ratio.h = ojph_max(ratio.h, log_PP.h - ojph_min(log_cb.h, log_PP.h));
  ------------------
  |  |   73|  35.6k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 707, False: 17.1k]
  |  |  |  Branch (73:33): [True: 1.04k, False: 16.7k]
  |  |  |  Branch (73:46): [True: 949, False: 16.1k]
  |  |  ------------------
  ------------------
  194|  17.8k|      }
  195|  2.99k|      ui32 max_ratio = ojph_max(ratio.w, ratio.h);
  ------------------
  |  |   73|  2.99k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.32k, False: 1.66k]
  |  |  ------------------
  ------------------
  196|  2.99k|      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|  2.99k|      precinct_scratch_needed_bytes =
  205|  2.99k|        4 * ((max_ratio * max_ratio * 4 + 2) / 3);
  206|       |
  207|  2.99k|      allocator->pre_alloc_obj<ui8>(precinct_scratch_needed_bytes);
  208|  2.99k|    }
_ZN4ojph5local10codestream14finalize_allocEv:
  212|  2.97k|    {
  213|  2.97k|      allocator->alloc();
  214|       |
  215|       |      //precinct scratch buffer
  216|  2.97k|      precinct_scratch =
  217|  2.97k|        allocator->post_alloc_obj<ui8>(precinct_scratch_needed_bytes);
  218|       |
  219|       |      //get tiles
  220|  2.97k|      tiles = this->allocator->post_alloc_obj<tile>((size_t)num_tiles.area());
  221|       |
  222|  2.97k|      ui32 num_tileparts = 0;
  223|  2.97k|      point index;
  224|  2.97k|      rect tile_rect;
  225|  2.97k|      ojph::param_siz sz = access_siz();
  226|  76.2k|      for (index.y = 0; index.y < num_tiles.h; ++index.y)
  ------------------
  |  Branch (226:25): [True: 73.2k, False: 2.97k]
  ------------------
  227|  73.2k|      {
  228|  73.2k|        ui32 y0 = sz.get_tile_offset().y
  229|  73.2k|                + index.y * sz.get_tile_size().h;
  230|  73.2k|        ui32 y1 = y0 + sz.get_tile_size().h; //end of tile
  231|       |
  232|  73.2k|        tile_rect.org.y = ojph_max(y0, sz.get_image_offset().y);
  ------------------
  |  |   73|  73.2k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 70.3k, False: 2.97k]
  |  |  ------------------
  ------------------
  233|  73.2k|        tile_rect.siz.h =
  234|  73.2k|          ojph_min(y1, sz.get_image_extent().y) - tile_rect.org.y;
  ------------------
  |  |   76|  73.2k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 70.3k, False: 2.94k]
  |  |  ------------------
  ------------------
  235|       |
  236|  73.2k|        ui32 offset = 0;
  237|   214k|        for (index.x = 0; index.x < num_tiles.w; ++index.x)
  ------------------
  |  Branch (237:27): [True: 141k, False: 73.2k]
  ------------------
  238|   141k|        {
  239|   141k|          ui32 x0 = sz.get_tile_offset().x
  240|   141k|                  + index.x * sz.get_tile_size().w;
  241|   141k|          ui32 x1 = x0 + sz.get_tile_size().w;
  242|       |
  243|   141k|          tile_rect.org.x = ojph_max(x0, sz.get_image_offset().x);
  ------------------
  |  |   73|   141k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 68.1k, False: 73.2k]
  |  |  ------------------
  ------------------
  244|   141k|          tile_rect.siz.w =
  245|   141k|            ojph_min(x1, sz.get_image_extent().x) - tile_rect.org.x;
  ------------------
  |  |   76|   141k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 68.1k, False: 73.2k]
  |  |  ------------------
  ------------------
  246|       |
  247|   141k|          ui32 tps = 0; // number of tileparts for this tile
  248|   141k|          ui32 idx = index.y * num_tiles.w + index.x;
  249|   141k|          tiles[idx].finalize_alloc(this, tile_rect, idx, offset, tps);
  250|   141k|          num_tileparts += tps;
  251|   141k|        }
  252|  73.2k|      }
  253|       |
  254|       |      //allocate lines
  255|       |      //These lines are used by codestream to exchange data with external
  256|       |      // world
  257|  2.97k|      this->num_comps = sz.get_num_components();
  258|  2.97k|      lines = allocator->post_alloc_obj<line_buf>(this->num_comps);
  259|  2.97k|      comp_size = allocator->post_alloc_obj<size>(this->num_comps);
  260|  2.97k|      recon_comp_size = allocator->post_alloc_obj<size>(this->num_comps);
  261|  2.97k|      employ_color_transform = cod.is_employing_color_transform();
  262|  6.19k|      for (ui32 i = 0; i < this->num_comps; ++i)
  ------------------
  |  Branch (262:24): [True: 3.21k, False: 2.97k]
  ------------------
  263|  3.21k|      {
  264|  3.21k|        comp_size[i].w = siz.get_width(i);
  265|  3.21k|        comp_size[i].h = siz.get_height(i);
  266|  3.21k|        ui32 cw = siz.get_recon_width(i);
  267|  3.21k|        recon_comp_size[i].w = cw;
  268|  3.21k|        recon_comp_size[i].h = siz.get_recon_height(i);
  269|  3.21k|        lines[i].wrap(allocator->post_alloc_data<si32>(cw, 0), cw, 0);
  270|  3.21k|      }
  271|       |
  272|  2.97k|      cur_comp = 0;
  273|  2.97k|      cur_line = 0;
  274|       |
  275|       |      //allocate tlm
  276|  2.97k|      if (outfile != NULL && need_tlm)
  ------------------
  |  Branch (276:11): [True: 0, False: 2.97k]
  |  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|  2.97k|    }
_ZN4ojph5local10codestream12read_headersEPNS_11infile_baseE:
  753|  4.18k|    {
  754|  4.18k|      ui16 marker_list[20] = { SOC, SIZ, CAP, PRF, CPF, COD, COC, QCD, QCC,
  755|  4.18k|        RGN, POC, PPM, TLM, PLM, CRG, COM, DFS, ATK, NLT, SOT };
  756|  4.18k|      find_marker(file, marker_list, 1); //find SOC
  757|  4.18k|      find_marker(file, marker_list + 1, 1); //find SIZ
  758|  4.18k|      siz.read(file);
  759|  4.18k|      int marker_idx = 0;
  760|  4.18k|      int received_markers = 0; //check that COD, & QCD received
  761|   437k|      while (true)
  ------------------
  |  Branch (761:14): [True: 436k, Folded]
  ------------------
  762|   436k|      {
  763|   436k|        marker_idx = find_marker(file, marker_list + 2, 18);
  764|   436k|        if (marker_idx == 0)
  ------------------
  |  Branch (764:13): [True: 531, False: 435k]
  ------------------
  765|    531|          cap.read(file);
  766|   435k|        else if (marker_idx == 1)
  ------------------
  |  Branch (766:18): [True: 278, False: 435k]
  ------------------
  767|       |          //Skipping PRF marker segment; this should not cause any issues
  768|    278|          skip_marker(file, "PRF", NULL, OJPH_MSG_NO_MSG, false);
  769|   435k|        else if (marker_idx == 2)
  ------------------
  |  Branch (769:18): [True: 252, False: 435k]
  ------------------
  770|       |          //Skipping CPF marker segment; this should not cause any issues
  771|    252|          skip_marker(file, "CPF", NULL, OJPH_MSG_NO_MSG, false);
  772|   435k|        else if (marker_idx == 3)
  ------------------
  |  Branch (772:18): [True: 4.36k, False: 430k]
  ------------------
  773|  4.36k|        {
  774|  4.36k|          cod.read(file);
  775|  4.36k|          received_markers |= 1;
  776|  4.36k|          ojph::param_cod c(&cod);
  777|  4.36k|          int num_qlayers = c.get_num_layers();
  778|  4.36k|          if (num_qlayers != 1)
  ------------------
  |  Branch (778:15): [True: 8, False: 4.35k]
  ------------------
  779|      8|            OJPH_ERROR(0x00030053, "The current implementation supports "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  780|  4.36k|              "1 quality layer only.  This codestream has %d quality layers",
  781|  4.36k|              num_qlayers);
  782|  4.36k|        }
  783|   430k|        else if (marker_idx == 4)
  ------------------
  |  Branch (783:18): [True: 491, False: 430k]
  ------------------
  784|    491|        {
  785|    491|          param_cod* p = cod.add_coc_object(param_cod::OJPH_COD_UNKNOWN);
  786|    491|          p->read_coc(file, siz.get_num_components(), &cod);
  787|    491|          if (p->get_comp_idx() >= siz.get_num_components())
  ------------------
  |  Branch (787:15): [True: 129, False: 362]
  ------------------
  788|    129|            OJPH_INFO(0x00030056, "The codestream carries a COC marker "
  ------------------
  |  |  285|    129|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    129|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 129, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  789|    491|              "segment for a component indexed by %d, which is more than the "
  790|    491|              "allowed index number, since the codestream has %d components",
  791|    491|              p->get_comp_idx(), num_comps);
  792|    491|          param_cod *q = cod.get_coc(p->get_comp_idx());
  793|    491|          if (p != q && p->get_comp_idx() == q->get_comp_idx())
  ------------------
  |  Branch (793:15): [True: 9, False: 482]
  |  Branch (793:25): [True: 9, False: 0]
  ------------------
  794|      9|            OJPH_ERROR(0x00030057, "The codestream has two COC marker "
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  795|    491|              "segments for one component of index %d",  p->get_comp_idx());
  796|    491|        }
  797|   430k|        else if (marker_idx == 5)
  ------------------
  |  Branch (797:18): [True: 4.20k, False: 426k]
  ------------------
  798|  4.20k|        {
  799|  4.20k|          qcd.read(file);
  800|  4.20k|          received_markers |= 2;
  801|  4.20k|        }
  802|   426k|        else if (marker_idx == 6)
  ------------------
  |  Branch (802:18): [True: 192, False: 425k]
  ------------------
  803|    192|        {
  804|    192|          param_qcd* p = qcd.add_qcc_object(param_qcd::OJPH_QCD_UNKNOWN);
  805|    192|          p->read_qcc(file, siz.get_num_components());
  806|    192|          if (p->get_comp_idx() >= siz.get_num_components())
  ------------------
  |  Branch (806:15): [True: 10, False: 182]
  ------------------
  807|     10|            OJPH_ERROR(0x00030054, "The codestream carries a QCC 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  808|    192|              "segment for a component indexed by %d, which is more than the "
  809|    192|              "allowed index number, since the codestream has %d components",
  810|    192|              p->get_comp_idx(), num_comps);
  811|    192|          param_qcd *q = qcd.get_qcc(p->get_comp_idx());
  812|    192|          if (p != q && p->get_comp_idx() == q->get_comp_idx())
  ------------------
  |  Branch (812:15): [True: 7, False: 185]
  |  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|    192|              "segments for one component of index %d", p->get_comp_idx());
  815|    192|        }
  816|   425k|        else if (marker_idx == 7)
  ------------------
  |  Branch (816:18): [True: 7.70k, False: 418k]
  ------------------
  817|  7.70k|          skip_marker(file, "RGN", "RGN is not supported yet",
  818|  7.70k|            OJPH_MSG_WARN, false);
  819|   418k|        else if (marker_idx == 8)
  ------------------
  |  Branch (819:18): [True: 127, False: 418k]
  ------------------
  820|    127|          skip_marker(file, "POC", "POC is not supported yet",
  821|    127|            OJPH_MSG_WARN, false);
  822|   418k|        else if (marker_idx == 9)
  ------------------
  |  Branch (822:18): [True: 353, False: 417k]
  ------------------
  823|    353|          skip_marker(file, "PPM", "PPM is not supported yet",
  824|    353|            OJPH_MSG_WARN, false);
  825|   417k|        else if (marker_idx == 10)
  ------------------
  |  Branch (825:18): [True: 132, False: 417k]
  ------------------
  826|       |          //Skipping TLM marker segment; this should not cause any issues
  827|    132|          skip_marker(file, "TLM", NULL, OJPH_MSG_NO_MSG, false);
  828|   417k|        else if (marker_idx == 11)
  ------------------
  |  Branch (828:18): [True: 224, False: 417k]
  ------------------
  829|       |          //Skipping PLM marker segment; this should not cause any issues
  830|    224|          skip_marker(file, "PLM", NULL, OJPH_MSG_NO_MSG, false);
  831|   417k|        else if (marker_idx == 12)
  ------------------
  |  Branch (831:18): [True: 268, False: 417k]
  ------------------
  832|       |          //Skipping CRG marker segment;
  833|    268|          skip_marker(file, "CRG", "CRG has been ignored; CRG is related to"
  834|    268|            " where the Cb and Cr colour components are co-sited or located"
  835|    268|            " with respect to the Y' luma component. Perhaps, it is better"
  836|    268|            " to get the individual components and assemble the samples"
  837|    268|            " according to your needs",
  838|    268|            OJPH_MSG_INFO, false);
  839|   417k|        else if (marker_idx == 13)
  ------------------
  |  Branch (839:18): [True: 320, False: 416k]
  ------------------
  840|    320|          skip_marker(file, "COM", NULL, OJPH_MSG_NO_MSG, false);
  841|   416k|        else if (marker_idx == 14)
  ------------------
  |  Branch (841:18): [True: 412k, False: 4.16k]
  ------------------
  842|   412k|          dfs.read(file);
  843|  4.16k|        else if (marker_idx == 15)
  ------------------
  |  Branch (843:18): [True: 206, False: 3.95k]
  ------------------
  844|    206|          atk.read(file);
  845|  3.95k|        else if (marker_idx == 16)
  ------------------
  |  Branch (845:18): [True: 722, False: 3.23k]
  ------------------
  846|    722|          nlt.read(file);
  847|  3.23k|        else if (marker_idx == 17)
  ------------------
  |  Branch (847:18): [True: 3.06k, False: 171]
  ------------------
  848|  3.06k|          break;
  849|    171|        else
  850|   433k|          OJPH_ERROR(0x00030051, "File ended before finding a tile segment");
  ------------------
  |  |  289|    171|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    171|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 171, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  851|   433k|      }
  852|       |
  853|  4.18k|      cod.update_atk(&atk);
  854|  4.18k|      siz.link(&cod);
  855|  4.18k|      if (dfs.exists())
  ------------------
  |  Branch (855:11): [True: 176, False: 4.01k]
  ------------------
  856|    176|        siz.link(&dfs);
  857|       |
  858|  4.18k|      if (received_markers != 3)
  ------------------
  |  Branch (858:11): [True: 18, False: 4.16k]
  ------------------
  859|     18|        OJPH_ERROR(0x00030052, "markers error, COD and QCD are required");
  ------------------
  |  |  289|     18|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     18|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 18, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  860|       |
  861|  4.18k|      this->infile = file;
  862|  4.18k|      planar = cod.is_employing_color_transform() ? 0 : 1;
  ------------------
  |  Branch (862:16): [True: 250, False: 3.93k]
  ------------------
  863|  4.18k|    }
_ZN4ojph5local10codestream25restrict_input_resolutionEjj:
  868|  1.02k|    {
  869|  1.02k|      if (skipped_res_for_read < skipped_res_for_recon)
  ------------------
  |  Branch (869:11): [True: 0, False: 1.02k]
  ------------------
  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.02k|          "skipped_resolution for data %d must be equal or smaller than "
  872|  1.02k|          " skipped_resolution for reconstruction %d\n",
  873|  1.02k|          skipped_res_for_read, skipped_res_for_recon);
  874|  1.02k|      if (skipped_res_for_read > cod.get_num_decompositions())
  ------------------
  |  Branch (874:11): [True: 1, False: 1.02k]
  ------------------
  875|      1|        OJPH_ERROR(0x000300A2,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  876|  1.02k|          "skipped_resolution for data %d must be smaller than "
  877|  1.02k|          " the number of decomposition levels %d\n",
  878|  1.02k|          skipped_res_for_read, cod.get_num_decompositions());
  879|       |
  880|  1.02k|      this->skipped_res_for_read = skipped_res_for_read;
  881|  1.02k|      this->skipped_res_for_recon = skipped_res_for_recon;
  882|  1.02k|      siz.set_skipped_resolutions(skipped_res_for_recon);
  883|  1.02k|    }
_ZN4ojph5local10codestream17enable_resilienceEv:
  887|  4.18k|    {
  888|  4.18k|      if (infile != NULL)
  ------------------
  |  Branch (888:11): [True: 0, False: 4.18k]
  ------------------
  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|  4.18k|          " reading file headers.\n");
  891|  4.18k|      this->resilient = true;
  892|  4.18k|    }
_ZN4ojph5local10codestream4readEv:
  896|  2.99k|    {
  897|  2.99k|      this->pre_alloc();
  898|  2.99k|      this->finalize_alloc();
  899|       |
  900|  64.6k|      while (true)
  ------------------
  |  Branch (900:14): [True: 64.5k, Folded]
  ------------------
  901|  64.5k|      {
  902|  64.5k|        param_sot sot;
  903|  64.5k|        if (sot.read(infile, resilient))
  ------------------
  |  Branch (903:13): [True: 53.9k, False: 10.6k]
  ------------------
  904|  53.9k|        {
  905|  53.9k|          ui64 tile_start_location = (ui64)infile->tell();
  906|  53.9k|          bool skip_tile = false;
  907|       |
  908|  53.9k|          if (sot.get_tile_index() >= (int)num_tiles.area())
  ------------------
  |  Branch (908:15): [True: 2.73k, False: 51.1k]
  ------------------
  909|  2.73k|          {
  910|  2.73k|            if (resilient) {
  ------------------
  |  Branch (910:17): [True: 2.73k, False: 0]
  ------------------
  911|  2.73k|              OJPH_INFO(0x00030061, "wrong tile index")
  ------------------
  |  |  285|  2.73k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  2.73k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2.73k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  912|  2.73k|              skip_tile = true; // skip the faulty tile
  913|  2.73k|            }
  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|  2.73k|          }
  917|       |
  918|  53.9k|          if (!skip_tile)
  ------------------
  |  Branch (918:15): [True: 51.1k, False: 2.73k]
  ------------------
  919|  51.1k|          {
  920|  51.1k|            if (sot.get_tile_part_index())
  ------------------
  |  Branch (920:17): [True: 27.0k, False: 24.1k]
  ------------------
  921|  27.0k|            { //tile part
  922|  27.0k|              if (sot.get_num_tile_parts() &&
  ------------------
  |  Branch (922:19): [True: 22.6k, False: 4.32k]
  ------------------
  923|  22.6k|                sot.get_tile_part_index() >= sot.get_num_tile_parts())
  ------------------
  |  Branch (923:17): [True: 2.47k, False: 20.2k]
  ------------------
  924|  2.47k|              {
  925|  2.47k|                if (resilient)
  ------------------
  |  Branch (925:21): [True: 2.47k, False: 0]
  ------------------
  926|  2.47k|                  OJPH_INFO(0x00030062,
  ------------------
  |  |  285|  2.47k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  2.47k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2.47k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  2.47k|                    "error in tile part number, should be smaller than total"
  928|  2.47k|                    " 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|  2.47k|                    "error in tile part number, should be smaller than total"
  932|  2.47k|                    " number of tile parts")
  933|  2.47k|              }
  934|       |
  935|  27.0k|              bool sod_found = false;
  936|  27.0k|              ui16 other_tile_part_markers[7] = { SOT, POC, PPT, PLT, COM,
  937|  27.0k|                NLT, SOD };
  938|  44.8k|              while (true)
  ------------------
  |  Branch (938:22): [True: 44.8k, Folded]
  ------------------
  939|  44.8k|              {
  940|  44.8k|                int marker_idx = 0;
  941|  44.8k|                int result = 0;
  942|  44.8k|                marker_idx = find_marker(infile, other_tile_part_markers+1, 6);
  943|  44.8k|                if (marker_idx == 0)
  ------------------
  |  Branch (943:21): [True: 6.23k, False: 38.6k]
  ------------------
  944|  6.23k|                  result = skip_marker(infile, "POC",
  945|  6.23k|                    "POC marker segment in a tile is not supported yet",
  946|  6.23k|                    OJPH_MSG_WARN, resilient);
  947|  38.6k|                else if (marker_idx == 1)
  ------------------
  |  Branch (947:26): [True: 694, False: 37.9k]
  ------------------
  948|    694|                  result = skip_marker(infile, "PPT",
  949|    694|                    "PPT marker segment in a tile is not supported yet",
  950|    694|                    OJPH_MSG_WARN, resilient);
  951|  37.9k|                else if (marker_idx == 2)
  ------------------
  |  Branch (951:26): [True: 6.49k, False: 31.4k]
  ------------------
  952|       |                  //Skipping PLT marker segment;this should not cause any issues
  953|  6.49k|                  result = skip_marker(infile, "PLT", NULL,
  954|  6.49k|                    OJPH_MSG_NO_MSG, resilient);
  955|  31.4k|                else if (marker_idx == 3)
  ------------------
  |  Branch (955:26): [True: 2.75k, False: 28.6k]
  ------------------
  956|  2.75k|                  result = skip_marker(infile, "COM", NULL,
  957|  2.75k|                    OJPH_MSG_NO_MSG, resilient);
  958|  28.6k|                else if (marker_idx == 4)
  ------------------
  |  Branch (958:26): [True: 1.67k, False: 27.0k]
  ------------------
  959|  1.67k|                  result = skip_marker(infile, "NLT",
  960|  1.67k|                    "NLT marker in tile is not supported yet",
  961|  1.67k|                    OJPH_MSG_WARN, resilient);
  962|  27.0k|                else if (marker_idx == 5)
  ------------------
  |  Branch (962:26): [True: 26.8k, False: 154]
  ------------------
  963|  26.8k|                {
  964|  26.8k|                  sod_found = true;
  965|  26.8k|                  break;
  966|  26.8k|                }
  967|       |
  968|  18.0k|                if (marker_idx == -1) //marker not found
  ------------------
  |  Branch (968:21): [True: 154, False: 17.8k]
  ------------------
  969|    154|                {
  970|    154|                  if (resilient)
  ------------------
  |  Branch (970:23): [True: 154, False: 0]
  ------------------
  971|    154|                    OJPH_INFO(0x00030063,
  ------------------
  |  |  285|    154|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    154|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 154, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|    154|                      "File terminated early before start of data is found"
  973|    154|                      " for tile indexed %d and tile part %d",
  974|    154|                      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|    154|                      "File terminated early before start of data is found"
  978|    154|                      " for tile indexed %d and tile part %d",
  979|    154|                      sot.get_tile_index(), sot.get_tile_part_index())
  980|    154|                  break;
  981|    154|                }
  982|  17.8k|                if (result == -1) //file terminated during marker seg. skipping
  ------------------
  |  Branch (982:21): [True: 10, False: 17.8k]
  ------------------
  983|     10|                {
  984|     10|                  if (resilient)
  ------------------
  |  Branch (984:23): [True: 10, False: 0]
  ------------------
  985|     10|                    OJPH_INFO(0x00030064,
  ------------------
  |  |  285|     10|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     10|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  986|     10|                      "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|     10|                      "File terminated during marker segment skipping")
  990|     10|                  break;
  991|     10|                }
  992|  17.8k|              }
  993|  27.0k|              if (sod_found)
  ------------------
  |  Branch (993:19): [True: 26.8k, False: 164]
  ------------------
  994|  26.8k|                tiles[sot.get_tile_index()].parse_tile_header(sot, infile,
  995|  26.8k|                  tile_start_location);
  996|  27.0k|            }
  997|  24.1k|            else
  998|  24.1k|            { //first tile part
  999|  24.1k|              bool sod_found = false;
 1000|  24.1k|              ui16 first_tile_part_markers[12] = { SOT, COD, COC, QCD, QCC, RGN,
 1001|  24.1k|                POC, PPT, PLT, COM, NLT, SOD };
 1002|   198k|              while (true)
  ------------------
  |  Branch (1002:22): [True: 198k, Folded]
  ------------------
 1003|   198k|              {
 1004|   198k|                int marker_idx = 0;
 1005|   198k|                int result = 0;
 1006|   198k|                marker_idx = find_marker(infile, first_tile_part_markers+1, 11);
 1007|   198k|                if (marker_idx == 0)
  ------------------
  |  Branch (1007:21): [True: 73.3k, False: 124k]
  ------------------
 1008|  73.3k|                  result = skip_marker(infile, "COD",
 1009|  73.3k|                    "COD marker segment in a tile is not supported yet",
 1010|  73.3k|                    OJPH_MSG_WARN, resilient);
 1011|   124k|                else if (marker_idx == 1)
  ------------------
  |  Branch (1011:26): [True: 1.36k, False: 123k]
  ------------------
 1012|  1.36k|                  result = skip_marker(infile, "COC",
 1013|  1.36k|                    "COC marker segment in a tile is not supported yet",
 1014|  1.36k|                    OJPH_MSG_WARN, resilient);
 1015|   123k|                else if (marker_idx == 2)
  ------------------
  |  Branch (1015:26): [True: 74.9k, False: 48.4k]
  ------------------
 1016|  74.9k|                  result = skip_marker(infile, "QCD",
 1017|  74.9k|                    "QCD marker segment in a tile is not supported yet",
 1018|  74.9k|                    OJPH_MSG_WARN, resilient);
 1019|  48.4k|                else if (marker_idx == 3)
  ------------------
  |  Branch (1019:26): [True: 1.69k, False: 46.7k]
  ------------------
 1020|  1.69k|                  result = skip_marker(infile, "QCC",
 1021|  1.69k|                    "QCC marker segment in a tile is not supported yet",
 1022|  1.69k|                    OJPH_MSG_WARN, resilient);
 1023|  46.7k|                else if (marker_idx == 4)
  ------------------
  |  Branch (1023:26): [True: 583, False: 46.1k]
  ------------------
 1024|    583|                  result = skip_marker(infile, "RGN",
 1025|    583|                    "RGN marker segment in a tile is not supported yet",
 1026|    583|                    OJPH_MSG_WARN, resilient);
 1027|  46.1k|                else if (marker_idx == 5)
  ------------------
  |  Branch (1027:26): [True: 3.72k, False: 42.4k]
  ------------------
 1028|  3.72k|                  result = skip_marker(infile, "POC",
 1029|  3.72k|                    "POC marker segment in a tile is not supported yet",
 1030|  3.72k|                    OJPH_MSG_WARN, resilient);
 1031|  42.4k|                else if (marker_idx == 6)
  ------------------
  |  Branch (1031:26): [True: 302, False: 42.1k]
  ------------------
 1032|    302|                  result = skip_marker(infile, "PPT",
 1033|    302|                    "PPT marker segment in a tile is not supported yet",
 1034|    302|                    OJPH_MSG_WARN, resilient);
 1035|  42.1k|                else if (marker_idx == 7)
  ------------------
  |  Branch (1035:26): [True: 3.73k, False: 38.4k]
  ------------------
 1036|       |                  //Skipping PLT marker segment;this should not cause any issues
 1037|  3.73k|                  result = skip_marker(infile, "PLT", NULL,
 1038|  3.73k|                    OJPH_MSG_NO_MSG, resilient);
 1039|  38.4k|                else if (marker_idx == 8)
  ------------------
  |  Branch (1039:26): [True: 10.3k, False: 28.0k]
  ------------------
 1040|  10.3k|                  result = skip_marker(infile, "COM", NULL,
 1041|  10.3k|                    OJPH_MSG_NO_MSG, resilient);
 1042|  28.0k|                else if (marker_idx == 9)
  ------------------
  |  Branch (1042:26): [True: 3.94k, False: 24.1k]
  ------------------
 1043|  3.94k|                  result = skip_marker(infile, "NLT",
 1044|  3.94k|                    "PPT marker segment in a tile is not supported yet",
 1045|  3.94k|                    OJPH_MSG_WARN, resilient);
 1046|  24.1k|                else if (marker_idx == 10)
  ------------------
  |  Branch (1046:26): [True: 23.9k, False: 213]
  ------------------
 1047|  23.9k|                {
 1048|  23.9k|                  sod_found = true;
 1049|  23.9k|                  break;
 1050|  23.9k|                }
 1051|       |
 1052|   174k|                if (marker_idx == -1) //marker not found
  ------------------
  |  Branch (1052:21): [True: 213, False: 174k]
  ------------------
 1053|    213|                {
 1054|    213|                  if (resilient)
  ------------------
  |  Branch (1054:23): [True: 213, False: 0]
  ------------------
 1055|    213|                    OJPH_INFO(0x00030065,
  ------------------
  |  |  285|    213|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    213|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 213, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1056|    213|                      "File terminated early before start of data is found"
 1057|    213|                      " for tile indexed %d and tile part %d",
 1058|    213|                      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|    213|                      "File terminated early before start of data is found"
 1062|    213|                      " for tile indexed %d and tile part %d",
 1063|    213|                      sot.get_tile_index(), sot.get_tile_part_index())
 1064|    213|                  break;
 1065|    213|                }
 1066|   174k|                if (result == -1) //file terminated during marker seg. skipping
  ------------------
  |  Branch (1066:21): [True: 32, False: 173k]
  ------------------
 1067|     32|                {
 1068|     32|                  if (resilient)
  ------------------
  |  Branch (1068:23): [True: 32, False: 0]
  ------------------
 1069|     32|                    OJPH_INFO(0x00030066,
  ------------------
  |  |  285|     32|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     32|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 32, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1070|     32|                      "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|     32|                      "File terminated during marker segment skipping")
 1074|     32|                  break;
 1075|     32|                }
 1076|   174k|              }
 1077|  24.1k|              if (sod_found)
  ------------------
  |  Branch (1077:19): [True: 23.9k, False: 245]
  ------------------
 1078|  23.9k|                tiles[sot.get_tile_index()].parse_tile_header(sot, infile,
 1079|  23.9k|                  tile_start_location);
 1080|  24.1k|            }
 1081|  51.1k|          }
 1082|  53.9k|        }
 1083|       |
 1084|       |        // check the next marker; either SOT or EOC,
 1085|       |        // if something is broken, just an end of file
 1086|  64.5k|        ui16 next_markers[2] = { SOT, EOC };
 1087|  64.5k|        int marker_idx = find_marker(infile, next_markers, 2);
 1088|  64.5k|        if (marker_idx == -1)
  ------------------
  |  Branch (1088:13): [True: 2.85k, False: 61.6k]
  ------------------
 1089|  2.85k|        {
 1090|  2.85k|          OJPH_INFO(0x00030067, "File terminated early");
  ------------------
  |  |  285|  2.85k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  2.85k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2.85k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1091|  2.85k|          break;
 1092|  2.85k|        }
 1093|  61.6k|        else if (marker_idx == 0)
  ------------------
  |  Branch (1093:18): [True: 61.6k, False: 7]
  ------------------
 1094|  61.6k|          ;
 1095|      7|        else if (marker_idx == 1)
  ------------------
  |  Branch (1095:18): [True: 2, False: 5]
  ------------------
 1096|      2|          break;
 1097|  64.5k|      }
 1098|  2.99k|    }
_ZN4ojph5local10codestream10set_planarEi:
 1102|  2.04k|    {
 1103|  2.04k|      this->planar = planar;
 1104|  2.04k|    }
_ZN4ojph5local10codestream5closeEv:
 1151|  2.89k|    {
 1152|  2.89k|      if (infile)
  ------------------
  |  Branch (1152:11): [True: 2.89k, False: 0]
  ------------------
 1153|  2.89k|        infile->close();
 1154|  2.89k|      if (outfile)
  ------------------
  |  Branch (1154:11): [True: 0, False: 2.89k]
  ------------------
 1155|      0|        outfile->close();
 1156|  2.89k|    }
_ZN4ojph5local10codestream4pullERj:
 1211|  1.53M|    {
 1212|  1.53M|      bool success = false;
 1213|  3.14M|      while (!success)
  ------------------
  |  Branch (1213:14): [True: 1.60M, False: 1.53M]
  ------------------
 1214|  1.60M|      {
 1215|  1.60M|        success = true;
 1216|  3.20M|        for (ui32 i = 0; i < num_tiles.w; ++i)
  ------------------
  |  Branch (1216:26): [True: 1.66M, False: 1.53M]
  ------------------
 1217|  1.66M|        {
 1218|  1.66M|          ui32 idx = i + cur_tile_row * num_tiles.w;
 1219|  1.66M|          if ((success &= tiles[idx].pull(lines + cur_comp, cur_comp)) == false)
  ------------------
  |  Branch (1219:15): [True: 69.9k, False: 1.59M]
  ------------------
 1220|  69.9k|            break;
 1221|  1.66M|        }
 1222|  1.60M|        cur_tile_row += success == false ? 1 : 0;
  ------------------
  |  Branch (1222:25): [True: 69.9k, False: 1.53M]
  ------------------
 1223|  1.60M|        if (cur_tile_row >= num_tiles.h)
  ------------------
  |  Branch (1223:13): [True: 0, False: 1.60M]
  ------------------
 1224|      0|          cur_tile_row = 0;
 1225|  1.60M|      }
 1226|  1.53M|      comp_num = cur_comp;
 1227|       |
 1228|  1.53M|      if (planar) //process one component at a time
  ------------------
  |  Branch (1228:11): [True: 1.20M, False: 326k]
  ------------------
 1229|  1.20M|      {
 1230|  1.20M|        if (++cur_line >= recon_comp_size[cur_comp].h)
  ------------------
  |  Branch (1230:13): [True: 2.59k, False: 1.20M]
  ------------------
 1231|  2.59k|        {
 1232|  2.59k|          cur_line = 0;
 1233|  2.59k|          cur_tile_row = 0;
 1234|  2.59k|          if (cur_comp++ >= num_comps)
  ------------------
  |  Branch (1234:15): [True: 0, False: 2.59k]
  ------------------
 1235|      0|          {
 1236|      0|            comp_num = 0;
 1237|      0|            return NULL;
 1238|      0|          }
 1239|  2.59k|        }
 1240|  1.20M|      }
 1241|   326k|      else //process all component for a line
 1242|   326k|      {
 1243|   326k|        if (++cur_comp >= num_comps)
  ------------------
  |  Branch (1243:13): [True: 323k, False: 2.70k]
  ------------------
 1244|   323k|        {
 1245|   323k|          cur_comp = 0;
 1246|   323k|          if (cur_line++ >= recon_comp_size[cur_comp].h)
  ------------------
  |  Branch (1246:15): [True: 0, False: 323k]
  ------------------
 1247|      0|          {
 1248|      0|            comp_num = 0;
 1249|      0|            return NULL;
 1250|      0|          }
 1251|   323k|        }
 1252|   326k|      }
 1253|       |
 1254|  1.53M|      return lines + comp_num;
 1255|  1.53M|    }
ojph_codestream_local.cpp:_ZN4ojph5localL11find_markerEPNS_11infile_baseEPKti:
  692|   752k|    {
  693|       |      //returns the marker index in char_list, or -1
  694|  59.5M|      while (!f->eof())
  ------------------
  |  Branch (694:14): [True: 59.5M, False: 3.30k]
  ------------------
  695|  59.5M|      {
  696|  59.5M|        ui8 new_char;
  697|  59.5M|        size_t num_bytes = f->read(&new_char, 1);
  698|  59.5M|        if (num_bytes != 1)
  ------------------
  |  Branch (698:13): [True: 0, False: 59.5M]
  ------------------
  699|      0|            return -1;
  700|  59.5M|        if (new_char == 0xFF)
  ------------------
  |  Branch (700:13): [True: 5.58M, False: 53.9M]
  ------------------
  701|  5.58M|        {
  702|  5.58M|          size_t num_bytes = f->read(&new_char, 1);
  703|       |
  704|  5.58M|          if (num_bytes != 1)
  ------------------
  |  Branch (704:15): [True: 227, False: 5.58M]
  ------------------
  705|    227|              return -1;
  706|       |
  707|  54.0M|          for (int i = 0; i < list_len; ++i)
  ------------------
  |  Branch (707:27): [True: 49.2M, False: 4.83M]
  ------------------
  708|  49.2M|            if (new_char == (char_list[i] & 0xFF))
  ------------------
  |  Branch (708:17): [True: 748k, False: 48.4M]
  ------------------
  709|   748k|              return i;
  710|  5.58M|        }
  711|  59.5M|      }
  712|  3.30k|      return -1;
  713|   752k|    }
ojph_codestream_local.cpp:_ZN4ojph5localL11skip_markerEPNS_11infile_baseEPKcS4_ib:
  719|   201k|    {
  720|   201k|      ojph_unused(marker);
  ------------------
  |  |   78|   201k|#define ojph_unused(x) (void)(x)
  ------------------
  721|   201k|      ui16 com_len;
  722|   201k|      if (file->read(&com_len, 2) != 2)
  ------------------
  |  Branch (722:11): [True: 64, False: 201k]
  ------------------
  723|     64|      {
  724|     64|        if (resilient)
  ------------------
  |  Branch (724:13): [True: 42, False: 22]
  ------------------
  725|     42|          return -1;
  726|     22|        else
  727|     22|          OJPH_ERROR(0x00030041, "error reading marker");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|     22|      }
  729|   201k|      com_len = swap_byte(com_len);
  730|   201k|      file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
  731|   201k|      if (msg != NULL && msg_level != OJPH_MSG_NO_MSG)
  ------------------
  |  Branch (731:11): [True: 176k, False: 24.5k]
  |  Branch (731:26): [True: 176k, False: 0]
  ------------------
  732|   176k|      {
  733|   176k|        if (msg_level == OJPH_MSG_INFO)
  ------------------
  |  Branch (733:13): [True: 264, False: 176k]
  ------------------
  734|    264|        {
  735|    264|          OJPH_INFO(0x00030001, "%s", msg);
  ------------------
  |  |  285|    264|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    264|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 264, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|    264|        }
  737|   176k|        else if (msg_level == OJPH_MSG_WARN)
  ------------------
  |  Branch (737:18): [True: 176k, False: 0]
  ------------------
  738|   176k|        {
  739|   176k|          OJPH_WARN(0x00030001, "%s", msg);
  ------------------
  |  |  287|   176k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|   176k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 176k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  740|   176k|        }
  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|   176k|      }
  748|   201k|      return 0;
  749|   201k|    }

_ZNK4ojph5local10codestream16get_tilepart_divEv:
  120|   426k|      ui32 get_tilepart_div() const { return tilepart_div; };
_ZNK4ojph5local10codestream13is_tlm_neededEv:
  121|   141k|      bool is_tlm_needed() const { return need_tlm; };
_ZNK4ojph5local10codestream9is_planarEv:
  118|  2.85k|      bool is_planar() const { return planar != 0; }
_ZN4ojph5local10codestream10access_sizEv:
   82|  5.97k|      { return ojph::param_siz(&siz); }
_ZN4ojph5local10codestream7get_sizEv:
   84|   366k|      { return &siz; }
_ZN4ojph5local10codestream10access_codEv:
   86|   141k|      { return ojph::param_cod(&cod); }
_ZN4ojph5local10codestream7get_codEv:
   88|   284k|      { return &cod; }
_ZN4ojph5local10codestream7get_cocEj:
   90|  4.30M|      { return cod.get_coc(comp_num); }
_ZN4ojph5local10codestream10access_qcdEv:
   92|  2.45M|      { return &qcd; }
_ZN4ojph5local10codestream10access_dfsEv:
   94|  25.5k|      { if (dfs.exists()) return &dfs; else return NULL; }
  ------------------
  |  Branch (94:13): [True: 25.5k, False: 1]
  ------------------
_ZN4ojph5local10codestream7get_nltEv:
   96|   141k|      { return &nlt; }
_ZN4ojph5local10codestream13get_allocatorEv:
   97|  7.16M|      mem_fixed_allocator* get_allocator() { return allocator; }
_ZN4ojph5local10codestream17get_elastic_allocEv:
   98|  1.75M|      mem_elastic_allocator* get_elastic_alloc() { return elastic_alloc; }
_ZN4ojph5local10codestream12is_resilientEv:
  105|  1.68M|      bool is_resilient() { return resilient; }
_ZNK4ojph5local10codestream11get_profileEv:
  119|   141k|      si32 get_profile() const { return profile; };
_ZN4ojph5local10codestream20get_precinct_scratchEv:
  126|  4.74M|      ui8* get_precinct_scratch() { return precinct_scratch; }
_ZN4ojph5local10codestream25get_skipped_res_for_reconEv:
  128|   989k|      { return skipped_res_for_recon; }
_ZN4ojph5local10codestream24get_skipped_res_for_readEv:
  130|   624k|      { return skipped_res_for_read; }
ojph_codestream_local.cpp:_ZN4ojph5localL9swap_byteEt:
   59|   201k|    {
   60|   201k|      return (ui16)((t << 8) | (t >> 8));
   61|   201k|    }
ojph_precinct.cpp:_ZN4ojph5localL9swap_byteEt:
   59|    648|    {
   60|    648|      return (ui16)((t << 8) | (t >> 8));
   61|    648|    }

_ZNK4ojph9param_siz16get_image_extentEv:
   97|   892k|  {
   98|   892k|    return point(state->Xsiz, state->Ysiz);
   99|   892k|  }
_ZNK4ojph9param_siz16get_image_offsetEv:
  103|   886k|  {
  104|   886k|    return point(state->XOsiz, state->YOsiz);
  105|   886k|  }
_ZNK4ojph9param_siz13get_tile_sizeEv:
  109|   878k|  {
  110|   878k|    return size(state->XTsiz, state->YTsiz);
  111|   878k|  }
_ZNK4ojph9param_siz15get_tile_offsetEv:
  115|   439k|  {
  116|   439k|    return point(state->XTOsiz, state->YTOsiz);
  117|   439k|  }
_ZNK4ojph9param_siz18get_num_componentsEv:
  121|   670k|  {
  122|   670k|    return state->Csiz;
  123|   670k|  }
_ZNK4ojph9param_siz15get_recon_widthEj:
  145|  3.20k|  {
  146|  3.20k|    return state->get_recon_width(comp_num);
  147|  3.20k|  }
_ZNK4ojph9param_siz16get_recon_heightEj:
  151|  6.37k|  {
  152|  6.37k|    return state->get_recon_height(comp_num);
  153|  6.37k|  }
_ZNK4ojph9param_cod22get_num_decompositionsEv:
  264|  23.9k|  {
  265|  23.9k|    return state->get_num_decompositions();
  266|  23.9k|  }
_ZNK4ojph9param_cod17get_precinct_sizeEj:
  288|  17.9k|  {
  289|  17.9k|    return state->get_precinct_size(level_num);
  290|  17.9k|  }
_ZNK4ojph9param_cod21get_progression_orderEv:
  300|   141k|  {
  301|   141k|    return state->SGCod.prog_order;
  302|   141k|  }
_ZNK4ojph9param_cod14get_num_layersEv:
  324|  4.27k|  {
  325|  4.27k|    return state->SGCod.num_layers;
  326|  4.27k|  }
_ZN4ojph5local9param_siz4readEPNS_11infile_baseE:
  681|  4.18k|    {
  682|  4.18k|      if (file->read(&Lsiz, 2) != 2)
  ------------------
  |  Branch (682:11): [True: 91, False: 4.09k]
  ------------------
  683|     91|        OJPH_ERROR(0x00050041, "error reading SIZ marker");
  ------------------
  |  |  289|     91|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     91|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 91, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  684|  4.18k|      Lsiz = swap_byte(Lsiz);
  685|  4.18k|      int num_comps = (Lsiz - 38) / 3;
  686|  4.18k|      if (Lsiz != 38 + 3 * num_comps)
  ------------------
  |  Branch (686:11): [True: 17, False: 4.16k]
  ------------------
  687|     17|        OJPH_ERROR(0x00050042, "error in SIZ marker length");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  688|  4.18k|      if (file->read(&Rsiz, 2) != 2)
  ------------------
  |  Branch (688:11): [True: 1, False: 4.18k]
  ------------------
  689|      1|        OJPH_ERROR(0x00050043, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  690|  4.18k|      Rsiz = swap_byte(Rsiz);
  691|  4.18k|      if ((Rsiz & 0x4000) == 0)
  ------------------
  |  Branch (691:11): [True: 2, False: 4.18k]
  ------------------
  692|      2|        OJPH_ERROR(0x00050044,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  693|  4.18k|          "Rsiz bit 14 is not set (this is not a JPH file)");
  694|  4.18k|      if ((Rsiz & 0x8000) != 0 && (Rsiz & 0xD5F) != 0)
  ------------------
  |  Branch (694:11): [True: 289, False: 3.89k]
  |  Branch (694:35): [True: 280, False: 9]
  ------------------
  695|    280|        OJPH_WARN(0x00050001, "Rsiz in SIZ has unimplemented fields");
  ------------------
  |  |  287|    280|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    280|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 280, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|  4.18k|      if (file->read(&Xsiz, 4) != 4)
  ------------------
  |  Branch (696:11): [True: 12, False: 4.17k]
  ------------------
  697|     12|        OJPH_ERROR(0x00050045, "error reading SIZ 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|  4.18k|      Xsiz = swap_byte(Xsiz);
  699|  4.18k|      if (file->read(&Ysiz, 4) != 4)
  ------------------
  |  Branch (699:11): [True: 5, False: 4.18k]
  ------------------
  700|      5|        OJPH_ERROR(0x00050046, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  701|  4.18k|      Ysiz = swap_byte(Ysiz);
  702|  4.18k|      ui32 t_XOsiz, t_YOsiz;
  703|  4.18k|      if (file->read(&t_XOsiz, 4) != 4)
  ------------------
  |  Branch (703:11): [True: 4, False: 4.18k]
  ------------------
  704|      4|        OJPH_ERROR(0x00050047, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  705|  4.18k|      if (file->read(&t_YOsiz, 4) != 4)
  ------------------
  |  Branch (705:11): [True: 3, False: 4.18k]
  ------------------
  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|  4.18k|      set_image_offset(point(swap_byte(t_XOsiz), swap_byte(t_YOsiz)));
  708|  4.18k|      ui32 t_XTsiz, t_YTsiz;
  709|  4.18k|      if (file->read(&t_XTsiz, 4) != 4)
  ------------------
  |  Branch (709:11): [True: 6, False: 4.18k]
  ------------------
  710|      6|        OJPH_ERROR(0x00050049, "error reading SIZ marker");
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  711|  4.18k|      if (file->read(&t_YTsiz, 4) != 4)
  ------------------
  |  Branch (711:11): [True: 4, False: 4.18k]
  ------------------
  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|  4.18k|      set_tile_size(size(swap_byte(t_XTsiz), swap_byte(t_YTsiz)));
  714|  4.18k|      ui32 t_XTOsiz, t_YTOsiz;
  715|  4.18k|      if (file->read(&t_XTOsiz, 4) != 4)
  ------------------
  |  Branch (715:11): [True: 3, False: 4.18k]
  ------------------
  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|  4.18k|      if (file->read(&t_YTOsiz, 4) != 4)
  ------------------
  |  Branch (717:11): [True: 3, False: 4.18k]
  ------------------
  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|  4.18k|      set_tile_offset(point(swap_byte(t_XTOsiz), swap_byte(t_YTOsiz)));
  720|  4.18k|      if (file->read(&Csiz, 2) != 2)
  ------------------
  |  Branch (720:11): [True: 3, False: 4.18k]
  ------------------
  721|      3|        OJPH_ERROR(0x0005004D, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  722|  4.18k|      Csiz = swap_byte(Csiz);
  723|  4.18k|      if (Csiz != num_comps)
  ------------------
  |  Branch (723:11): [True: 20, False: 4.16k]
  ------------------
  724|     20|        OJPH_ERROR(0x0005004E, "Csiz does not match the SIZ marker size");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  725|  4.18k|      set_num_components(Csiz);
  726|  16.9k|      for (int c = 0; c < Csiz; ++c)
  ------------------
  |  Branch (726:23): [True: 12.7k, False: 4.18k]
  ------------------
  727|  12.7k|      {
  728|  12.7k|        if (file->read(&cptr[c].SSiz, 1) != 1)
  ------------------
  |  Branch (728:13): [True: 3, False: 12.7k]
  ------------------
  729|      3|          OJPH_ERROR(0x00050051, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|  12.7k|        if (file->read(&cptr[c].XRsiz, 1) != 1)
  ------------------
  |  Branch (730:13): [True: 1, False: 12.7k]
  ------------------
  731|      1|          OJPH_ERROR(0x00050052, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  732|  12.7k|        if (file->read(&cptr[c].YRsiz, 1) != 1)
  ------------------
  |  Branch (732:13): [True: 2, False: 12.7k]
  ------------------
  733|      2|          OJPH_ERROR(0x00050053, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  734|  12.7k|        if ((cptr[c].SSiz & 0x7F) > 37)
  ------------------
  |  Branch (734:13): [True: 7, False: 12.7k]
  ------------------
  735|      7|          OJPH_ERROR(0x00050054, "Wrong SIZ-SSiz value of %d", cptr[c].SSiz);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|  12.7k|        if (cptr[c].XRsiz == 0)
  ------------------
  |  Branch (736:13): [True: 4, False: 12.7k]
  ------------------
  737|      4|          OJPH_ERROR(0x00050055, "Wrong SIZ-XRsiz value of %d", cptr[c].XRsiz);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|  12.7k|        if (cptr[c].YRsiz == 0)
  ------------------
  |  Branch (738:13): [True: 3, False: 12.7k]
  ------------------
  739|      3|          OJPH_ERROR(0x00050056, "Wrong SIZ-YRsiz value of %d", cptr[c].YRsiz);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  740|  12.7k|      }
  741|       |
  742|  4.18k|      ws_kern_support_needed = (Rsiz & 0x20) != 0;
  743|  4.18k|      dfs_support_needed = (Rsiz & 0x80) != 0;
  744|       |
  745|  4.18k|      check_validity();
  746|  4.18k|    }
_ZNK4ojph5local9param_siz22get_recon_downsamplingEj:
  750|   100k|    {
  751|   100k|      assert(comp_num < get_num_components());
  752|       |
  753|   100k|      point factor(1u << skipped_resolutions, 1u << skipped_resolutions);
  754|   100k|      const param_cod* cdp = cod->get_coc(comp_num);
  755|   100k|      if (dfs && cdp && cdp->is_dfs_defined()) {
  ------------------
  |  Branch (755:11): [True: 2.75k, False: 97.6k]
  |  Branch (755:18): [True: 2.75k, False: 0]
  |  Branch (755:25): [True: 1.90k, False: 855]
  ------------------
  756|  1.90k|        const param_dfs* d = dfs->get_dfs(cdp->get_dfs_index());
  757|  1.90k|        factor = d->get_res_downsamp(skipped_resolutions);
  758|  1.90k|      }
  759|   100k|      factor.x *= (ui32)cptr[comp_num].XRsiz;
  760|   100k|      factor.y *= (ui32)cptr[comp_num].YRsiz;
  761|   100k|      return factor;
  762|   100k|    }
_ZNK4ojph5local9param_siz14get_recon_sizeEj:
  766|  19.4k|    {
  767|  19.4k|      assert(comp_num < get_num_components());
  768|       |
  769|  19.4k|      point factor = get_recon_downsampling(comp_num);
  770|  19.4k|      point r;
  771|  19.4k|      r.x = ojph_div_ceil(Xsiz, factor.x) - ojph_div_ceil(XOsiz, factor.x);
  ------------------
  |  |   70|  19.4k|#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|  19.4k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  772|  19.4k|      r.y = ojph_div_ceil(Ysiz, factor.y) - ojph_div_ceil(YOsiz, factor.y);
  ------------------
  |  |   70|  19.4k|#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|  19.4k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  773|  19.4k|      return r;
  774|  19.4k|    }
_ZN4ojph5local9param_cap4readEPNS_11infile_baseE:
  810|    531|    {
  811|    531|      if (file->read(&Lcap, 2) != 2)
  ------------------
  |  Branch (811:11): [True: 3, False: 528]
  ------------------
  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|    531|      Lcap = swap_byte(Lcap);
  814|    531|      if (file->read(&Pcap, 4) != 4)
  ------------------
  |  Branch (814:11): [True: 3, False: 528]
  ------------------
  815|      3|        OJPH_ERROR(0x00050062, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|    531|      Pcap = swap_byte(Pcap);
  817|    531|      ui32 count = population_count(Pcap);
  818|    531|      if (Pcap & 0xFFFDFFFF)
  ------------------
  |  Branch (818:11): [True: 19, False: 512]
  ------------------
  819|     19|        OJPH_ERROR(0x00050063,
  ------------------
  |  |  289|     19|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     19|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 19, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  820|    531|          "error Pcap in CAP has options that are not supported");
  821|    531|      if ((Pcap & 0x00020000) == 0)
  ------------------
  |  Branch (821:11): [True: 2, False: 529]
  ------------------
  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|    531|          "error Pcap should have its 15th MSB set, Pcap^15. "
  824|    531|          " This is not a JPH file");
  825|  1.03k|      for (ui32 i = 0; i < count; ++i)
  ------------------
  |  Branch (825:24): [True: 504, False: 531]
  ------------------
  826|    504|        if (file->read(Ccap+i, 2) != 2)
  ------------------
  |  Branch (826:13): [True: 3, False: 501]
  ------------------
  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|    531|      if (Lcap != 6 + 2 * count)
  ------------------
  |  Branch (828:11): [True: 9, False: 522]
  ------------------
  829|      9|        OJPH_ERROR(0x00050066, "error in CAP marker length");
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  830|    531|    }
_ZNK4ojph5local9param_cod13is_reversibleEv:
  842|  1.63M|    {
  843|  1.63M|      if (SPcod.wavelet_trans <= 1)
  ------------------
  |  Branch (843:11): [True: 1.63M, False: 0]
  ------------------
  844|  1.63M|        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|  1.63M|    }
_ZN4ojph5local9param_cod4readEPNS_11infile_baseE:
  956|  4.36k|    {
  957|  4.36k|      assert(type == COD_MAIN);
  958|       |
  959|  4.36k|      if (file->read(&Lcod, 2) != 2)
  ------------------
  |  Branch (959:11): [True: 6, False: 4.35k]
  ------------------
  960|      6|        OJPH_ERROR(0x00050071, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  961|  4.36k|      Lcod = swap_byte(Lcod);
  962|  4.36k|      if (file->read(&Scod, 1) != 1)
  ------------------
  |  Branch (962:11): [True: 1, False: 4.36k]
  ------------------
  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|  4.36k|      if (file->read(&SGCod.prog_order, 1) != 1)
  ------------------
  |  Branch (964:11): [True: 1, False: 4.36k]
  ------------------
  965|      1|        OJPH_ERROR(0x00050073, "error reading COD segment");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  966|  4.36k|      if (file->read(&SGCod.num_layers, 2) != 2)
  ------------------
  |  Branch (966:11): [True: 3, False: 4.35k]
  ------------------
  967|      3|      { OJPH_ERROR(0x00050074, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  968|  4.35k|      else
  969|  4.35k|        SGCod.num_layers = swap_byte(SGCod.num_layers);
  970|  4.36k|      if (file->read(&SGCod.mc_trans, 1) != 1)
  ------------------
  |  Branch (970:11): [True: 2, False: 4.35k]
  ------------------
  971|      2|        OJPH_ERROR(0x00050075, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|  4.36k|      if (file->read(&SPcod.num_decomp, 1) != 1)
  ------------------
  |  Branch (972:11): [True: 3, False: 4.35k]
  ------------------
  973|      3|        OJPH_ERROR(0x00050076, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  974|  4.36k|      if (file->read(&SPcod.block_width, 1) != 1)
  ------------------
  |  Branch (974:11): [True: 3, False: 4.35k]
  ------------------
  975|      3|        OJPH_ERROR(0x00050077, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  976|  4.36k|      if (file->read(&SPcod.block_height, 1) != 1)
  ------------------
  |  Branch (976:11): [True: 5, False: 4.35k]
  ------------------
  977|      5|        OJPH_ERROR(0x00050078, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  4.36k|      if (file->read(&SPcod.block_style, 1) != 1)
  ------------------
  |  Branch (978:11): [True: 4, False: 4.35k]
  ------------------
  979|      4|        OJPH_ERROR(0x00050079, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  980|  4.36k|      if (file->read(&SPcod.wavelet_trans, 1) != 1)
  ------------------
  |  Branch (980:11): [True: 1, False: 4.36k]
  ------------------
  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|  4.36k|      if (get_num_decompositions() > 32
  ------------------
  |  Branch (983:11): [True: 36, False: 4.32k]
  ------------------
  984|  4.32k|        || SPcod.block_width > 8
  ------------------
  |  Branch (984:12): [True: 3, False: 4.32k]
  ------------------
  985|  4.32k|        || SPcod.block_height > 8
  ------------------
  |  Branch (985:12): [True: 6, False: 4.31k]
  ------------------
  986|  4.31k|        || SPcod.block_width + SPcod.block_height > 8
  ------------------
  |  Branch (986:12): [True: 1, False: 4.31k]
  ------------------
  987|  4.31k|        || (SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (987:12): [True: 4, False: 4.31k]
  ------------------
  988|  4.31k|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (988:12): [True: 4, False: 4.30k]
  ------------------
  989|     25|        OJPH_ERROR(0x0005007D, "wrong settings in a COD-SPcod parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  990|  4.36k|      if ((SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (990:11): [True: 54, False: 4.30k]
  ------------------
  991|  4.30k|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (991:12): [True: 0, False: 4.30k]
  ------------------
  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|  4.36k|      ui8 num_decompositions =  get_num_decompositions();
  995|  4.36k|      if (Scod & 1) {
  ------------------
  |  Branch (995:11): [True: 3.72k, False: 635]
  ------------------
  996|  25.5k|        for (int i = 0; i <= num_decompositions; ++i) {
  ------------------
  |  Branch (996:25): [True: 21.8k, False: 3.72k]
  ------------------
  997|  21.8k|          if (file->read(&SPcod.precinct_size[i], 1) != 1)
  ------------------
  |  Branch (997:15): [True: 3, False: 21.8k]
  ------------------
  998|      3|            OJPH_ERROR(0x0005007B, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  999|  21.8k|          if (i)
  ------------------
  |  Branch (999:15): [True: 18.1k, False: 3.72k]
  ------------------
 1000|  18.1k|            if ((SPcod.precinct_size[i] & 0x0F) == 0 ||
  ------------------
  |  Branch (1000:17): [True: 12, False: 18.1k]
  ------------------
 1001|  18.1k|              (SPcod.precinct_size[i] >> 4) == 0)
  ------------------
  |  Branch (1001:15): [True: 3, False: 18.1k]
  ------------------
 1002|     15|              OJPH_ERROR(0x0005007F,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1003|  21.8k|                "Precinct width or height for resolutions other than the"
 1004|  21.8k|                " coarsest must be larger than 1; here, they are %d and %d,"
 1005|  21.8k|                " respectively.",
 1006|  21.8k|                1 << (SPcod.precinct_size[i] & 0x0F),
 1007|  21.8k|                1 << (SPcod.precinct_size[i] >> 4));
 1008|  21.8k|        }
 1009|  3.72k|      }
 1010|  4.36k|      if (Lcod != 12 + ((Scod & 1) ? 1 + SPcod.num_decomp : 0))
  ------------------
  |  Branch (1010:11): [True: 17, False: 4.34k]
  |  Branch (1010:25): [True: 3.70k, False: 653]
  ------------------
 1011|     17|        OJPH_ERROR(0x0005007C, "error in COD segment length");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1012|  4.36k|    }
_ZN4ojph5local9param_cod8read_cocEPNS_11infile_baseEjPS1_:
 1017|    491|    {
 1018|    491|      assert(type == COC_MAIN);
 1019|    491|      assert(top_cod != NULL);
 1020|       |
 1021|    491|      this->SGCod = top_cod->SGCod;
 1022|    491|      this->top_cod = top_cod;
 1023|    491|      if (file->read(&Lcod, 2) != 2)
  ------------------
  |  Branch (1023:11): [True: 1, False: 490]
  ------------------
 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|    491|      Lcod = swap_byte(Lcod);
 1026|    491|      if (num_comps < 257) {
  ------------------
  |  Branch (1026:11): [True: 489, False: 2]
  ------------------
 1027|    489|        ui8 t;
 1028|    489|        if (file->read(&t, 1) != 1)
  ------------------
  |  Branch (1028:13): [True: 2, False: 487]
  ------------------
 1029|      2|          OJPH_ERROR(0x00050122, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1030|    489|        comp_idx = t;
 1031|    489|      }
 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|    491|      if (file->read(&Scod, 1) != 1)
  ------------------
  |  Branch (1037:11): [True: 4, False: 487]
  ------------------
 1038|      4|        OJPH_ERROR(0x00050124, "error reading COC segment");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1039|    491|      if (Scod & 0xF8)
  ------------------
  |  Branch (1039:11): [True: 406, False: 85]
  ------------------
 1040|    406|        OJPH_WARN(0x00050011,
  ------------------
  |  |  287|    406|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    406|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 406, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1041|    491|          "Unsupported options in Scoc field of the COC segment");
 1042|    491|      if (file->read(&SPcod.num_decomp, 1) != 1)
  ------------------
  |  Branch (1042:11): [True: 7, False: 484]
  ------------------
 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|    491|      if (file->read(&SPcod.block_width, 1) != 1)
  ------------------
  |  Branch (1044:11): [True: 3, False: 488]
  ------------------
 1045|      3|        OJPH_ERROR(0x00050126, "error reading COC segment");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1046|    491|      if (file->read(&SPcod.block_height, 1) != 1)
  ------------------
  |  Branch (1046:11): [True: 0, False: 491]
  ------------------
 1047|      0|        OJPH_ERROR(0x00050127, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|    491|      if (file->read(&SPcod.block_style, 1) != 1)
  ------------------
  |  Branch (1048:11): [True: 3, False: 488]
  ------------------
 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|    491|      if (file->read(&SPcod.wavelet_trans, 1) != 1)
  ------------------
  |  Branch (1050:11): [True: 4, False: 487]
  ------------------
 1051|      4|        OJPH_ERROR(0x00050129, "error reading COC segment");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1052|       |
 1053|    491|      if (get_num_decompositions() > 32
  ------------------
  |  Branch (1053:11): [True: 28, False: 463]
  ------------------
 1054|    463|        || SPcod.block_width > 8
  ------------------
  |  Branch (1054:12): [True: 7, False: 456]
  ------------------
 1055|    456|        || SPcod.block_height > 8
  ------------------
  |  Branch (1055:12): [True: 2, False: 454]
  ------------------
 1056|    454|        || SPcod.block_width + SPcod.block_height > 8
  ------------------
  |  Branch (1056:12): [True: 1, False: 453]
  ------------------
 1057|    453|        || (SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1057:12): [True: 2, False: 451]
  ------------------
 1058|    451|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1058:12): [True: 3, False: 448]
  ------------------
 1059|     19|        OJPH_ERROR(0x0005012C, "wrong settings in a COC-SPcoc parameter");
  ------------------
  |  |  289|     19|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     19|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 19, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1060|    491|      if ((SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1060:11): [True: 43, False: 448]
  ------------------
 1061|    448|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1061:12): [True: 0, False: 448]
  ------------------
 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|    491|      ui8 num_decompositions =  get_num_decompositions();
 1065|    491|      if (Scod & 1) {
  ------------------
  |  Branch (1065:11): [True: 220, False: 271]
  ------------------
 1066|    505|        for (int i = 0; i <= num_decompositions; ++i) {
  ------------------
  |  Branch (1066:25): [True: 285, False: 220]
  ------------------
 1067|    285|          if (file->read(&SPcod.precinct_size[i], 1) != 1)
  ------------------
  |  Branch (1067:15): [True: 6, False: 279]
  ------------------
 1068|      6|            OJPH_ERROR(0x0005012A, "error reading COC segment");
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1069|    285|          if (i)
  ------------------
  |  Branch (1069:15): [True: 61, False: 224]
  ------------------
 1070|     61|            if ((SPcod.precinct_size[i] & 0x0F) == 0 ||
  ------------------
  |  Branch (1070:17): [True: 3, False: 58]
  ------------------
 1071|     58|              (SPcod.precinct_size[i] >> 4) == 0)
  ------------------
  |  Branch (1071:15): [True: 5, False: 53]
  ------------------
 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|    285|                "Precinct width or height for resolutions other than the"
 1074|    285|                " coarsest must be larger than 1; here, they are %d and %d,"
 1075|    285|                " respectively.",
 1076|    285|                1 << (SPcod.precinct_size[i] & 0x0F),
 1077|    285|                1 << (SPcod.precinct_size[i] >> 4));
 1078|    285|        }
 1079|    220|      }
 1080|    491|      ui32 t = 9;
 1081|    491|      t += num_comps < 257 ? 0 : 1;
  ------------------
  |  Branch (1081:12): [True: 434, False: 57]
  ------------------
 1082|    491|      t += (Scod & 1) ? 1 + num_decompositions : 0;
  ------------------
  |  Branch (1082:12): [True: 206, False: 285]
  ------------------
 1083|    491|      if (Lcod != t)
  ------------------
  |  Branch (1083:11): [True: 10, False: 481]
  ------------------
 1084|     10|        OJPH_ERROR(0x0005012B, "error in COC segment length");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1085|    491|    }
_ZN4ojph5local9param_cod10update_atkEPNS0_9param_atkE:
 1089|  3.06k|    {
 1090|  3.06k|      assert(type == COD_MAIN);
 1091|  3.06k|      this->atk = atk->get_atk(SPcod.wavelet_trans);
 1092|  3.06k|      if (this->atk == NULL)
  ------------------
  |  Branch (1092:11): [True: 6, False: 3.05k]
  ------------------
 1093|      6|        OJPH_ERROR(0x00050131, "A COD segment employs the DWT kernel "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1094|  3.06k|          "atk = %d, but a corresponding ATK segment cannot be found.",
 1095|  3.06k|          SPcod.wavelet_trans);
 1096|  3.06k|      param_cod *p = next;
 1097|  3.36k|      while (p)
  ------------------
  |  Branch (1097:14): [True: 305, False: 3.06k]
  ------------------
 1098|    305|      {
 1099|    305|        p->atk = atk->get_atk(p->SPcod.wavelet_trans);
 1100|    305|        if (p->atk == NULL)
  ------------------
  |  Branch (1100:13): [True: 2, False: 303]
  ------------------
 1101|      2|          OJPH_ERROR(0x00050132, "A COC segment employs the DWT kernel "
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1102|    305|            "atk = %d, but a corresponding ATK segment cannot be found",
 1103|    305|            SPcod.wavelet_trans);
 1104|    305|        p = p->next;
 1105|    305|      }
 1106|  3.06k|    }
_ZNK4ojph5local9param_cod7get_cocEj:
 1110|  6.86M|    {
 1111|  6.86M|      assert(this->type == COD_MAIN || this->top_cod->type == COD_MAIN);
 1112|  6.86M|      const param_cod *p, *q;
 1113|  6.86M|      if (this->type == COD_MAIN)
  ------------------
  |  Branch (1113:11): [True: 6.83M, False: 27.0k]
  ------------------
 1114|  6.83M|        q = p = this;
 1115|  27.0k|      else
 1116|  27.0k|        q = p = this->top_cod;
 1117|  11.3M|      while (p && p->comp_idx != comp_idx)
  ------------------
  |  Branch (1117:14): [True: 6.99M, False: 4.32M]
  |  Branch (1117:19): [True: 4.46M, False: 2.53M]
  ------------------
 1118|  4.46M|        p = p->next;
 1119|  6.86M|      return p ? p : q;
  ------------------
  |  Branch (1119:14): [True: 2.53M, False: 4.32M]
  ------------------
 1120|  6.86M|    }
_ZN4ojph5local9param_cod7get_cocEj:
 1124|  4.30M|    {
 1125|       |      // cast object to constant
 1126|  4.30M|      const param_cod* const_p = const_cast<const param_cod*>(this);
 1127|       |      // call using the constant object, then cast to non-const
 1128|  4.30M|      return const_cast<param_cod*>(const_p->get_coc(comp_idx));
 1129|  4.30M|    }
_ZN4ojph5local9param_cod14add_coc_objectEj:
 1133|    491|    {
 1134|    491|      assert(type == COD_MAIN);
 1135|    491|      param_cod *p = this;
 1136|    872|      while (p->next != NULL)
  ------------------
  |  Branch (1136:14): [True: 381, False: 491]
  ------------------
 1137|    381|        p = p->next;
 1138|    491|      if (avail)
  ------------------
  |  Branch (1138:11): [True: 0, False: 491]
  ------------------
 1139|      0|      {
 1140|      0|        p->next = avail;
 1141|      0|        avail = avail->next;
 1142|      0|        p->next->init(this, (ui16)comp_idx);
 1143|      0|      }
 1144|    491|      else
 1145|    491|        p->next = new param_cod(this, (ui16)comp_idx);
 1146|    491|      return p->next;
 1147|    491|    }
_ZNK4ojph5local9param_qcd15get_irrev_deltaEPKNS0_9param_dfsEjjjj:
 1444|  42.2k|    {
 1445|  42.2k|      float arr[] = { 1.0f, 2.0f, 2.0f, 4.0f };
 1446|  42.2k|      if ((Sqcd & 0x1F) != 2)
  ------------------
  |  Branch (1446:11): [True: 119, False: 42.1k]
  ------------------
 1447|    119|        OJPH_ERROR(0x00050101, "There is something wrong in the configuration "
  ------------------
  |  |  289|    119|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    119|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 119, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1448|  42.2k|          "of the codestream; for component %d, the codestream defines an "
 1449|  42.2k|          "irreversible transform, for which the codestream provides a "
 1450|  42.2k|          "reversible (no quantization) step sizes in Sqcd/Sqcc.", comp_num);
 1451|       |
 1452|  42.2k|      ui32 idx;
 1453|  42.2k|      if (dfs != NULL && dfs->exists())
  ------------------
  |  Branch (1453:11): [True: 4.90k, False: 37.3k]
  |  Branch (1453:26): [True: 4.83k, False: 73]
  ------------------
 1454|  4.83k|        idx = dfs->get_subband_idx(num_decompositions, resolution, subband);
 1455|  37.3k|      else
 1456|  37.3k|        idx = resolution ? (resolution - 1) * 3 + subband : 0;
  ------------------
  |  Branch (1456:15): [True: 34.4k, False: 2.91k]
  ------------------
 1457|  42.2k|      if (idx >= num_subbands) {
  ------------------
  |  Branch (1457:11): [True: 13.7k, False: 28.4k]
  ------------------
 1458|  13.7k|        OJPH_INFO(0x00050101, "Trying to access quantization step size for "
  ------------------
  |  |  285|  13.7k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  13.7k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1459|  13.7k|          "subband %d when the QCD/QCC marker segment specifies "
 1460|  13.7k|          "quantization step sizes for %d subbands only.  To continue "
 1461|  13.7k|          "decoding, we are using the step size for subband %d, which can "
 1462|  13.7k|          "produce incorrect results",
 1463|  13.7k|          idx + 1, num_subbands, num_subbands - 1);
 1464|  13.7k|        idx = num_subbands - 1;
 1465|  13.7k|      }
 1466|  42.2k|      int eps = SPqcd.u16[idx] >> 11;
 1467|  42.2k|      float mantissa;
 1468|  42.2k|      mantissa = (float)((SPqcd.u16[idx] & 0x7FF) | 0x800) * arr[subband];
 1469|  42.2k|      mantissa /= (float)(1 << 11);
 1470|  42.2k|      mantissa /= (float)(1u << eps);
 1471|  42.2k|      return mantissa;
 1472|  42.2k|    }
_ZNK4ojph5local9param_qcd17propose_precisionEPKNS0_9param_codE:
 1476|  2.45M|    {
 1477|  2.45M|      ui32 comp_idx = cod->get_comp_idx();
 1478|  2.45M|      ui32 precision = 0;
 1479|  2.45M|      const param_cod *main =
 1480|  2.45M|        cod->get_coc(param_cod::OJPH_COD_DEFAULT);
 1481|  2.45M|      if (main->is_employing_color_transform() && comp_idx < 3)
  ------------------
  |  Branch (1481:11): [True: 48.1k, False: 2.41M]
  |  Branch (1481:51): [True: 11.5k, False: 36.6k]
  ------------------
 1482|  11.5k|      {
 1483|  46.0k|        for (ui32 i = 0; i < 3; ++i) {
  ------------------
  |  Branch (1483:26): [True: 34.5k, False: 11.5k]
  ------------------
 1484|  34.5k|          const param_qcd* p = this->get_qcc(i);
 1485|  34.5k|          precision = ojph_max(precision, p->get_largest_Kmax());
  ------------------
  |  |   73|  34.5k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 976, False: 33.5k]
  |  |  ------------------
  ------------------
 1486|  34.5k|        }
 1487|  11.5k|      }
 1488|  2.44M|      else {
 1489|  2.44M|        precision = get_largest_Kmax();
 1490|  2.44M|      }
 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|  2.45M|      return precision + 1 + 1;
 1497|  2.45M|    }
_ZNK4ojph5local9param_qcd18get_num_guard_bitsEv:
 1501|  3.78M|    {
 1502|  3.78M|      return (Sqcd >> 5);
 1503|  3.78M|    }
_ZNK4ojph5local9param_qcd8get_KmaxEPKNS0_9param_dfsEjjj:
 1508|  1.27M|    {
 1509|  1.27M|      ui32 idx;
 1510|  1.27M|      if (dfs != NULL && dfs->exists())
  ------------------
  |  Branch (1510:11): [True: 7.25k, False: 1.26M]
  |  Branch (1510:26): [True: 7.16k, False: 90]
  ------------------
 1511|  7.16k|        idx = dfs->get_subband_idx(num_decompositions, resolution, subband);
 1512|  1.26M|      else
 1513|  1.26M|        idx = resolution ? (resolution - 1) * 3 + subband : 0;
  ------------------
  |  Branch (1513:15): [True: 1.18M, False: 79.6k]
  ------------------
 1514|  1.27M|      if (idx >= num_subbands) {
  ------------------
  |  Branch (1514:11): [True: 31.3k, False: 1.23M]
  ------------------
 1515|  31.3k|        OJPH_INFO(0x00050111, "Trying to access quantization step size for "
  ------------------
  |  |  285|  31.3k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  31.3k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 31.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1516|  31.3k|          "subband %d when the QCD/QCC marker segment specifies "
 1517|  31.3k|          "quantization step sizes for %d subbands only.  To continue "
 1518|  31.3k|          "decoding, we are using the step size for subband %d, which can "
 1519|  31.3k|          "produce incorrect results",
 1520|  31.3k|          idx + 1, num_subbands, num_subbands - 1);
 1521|  31.3k|        idx = num_subbands - 1;
 1522|  31.3k|      }
 1523|       |
 1524|  1.27M|      int irrev = Sqcd & 0x1F;
 1525|  1.27M|      ui32 num_bits = 0;
 1526|  1.27M|      if (irrev == 0) // reversible; this is (10.22) from the J2K book
  ------------------
  |  Branch (1526:11): [True: 1.16M, False: 107k]
  ------------------
 1527|  1.16M|      {
 1528|  1.16M|        num_bits = decode_SPqcd(SPqcd.u8[idx]);
 1529|  1.16M|        num_bits = num_bits == 0 ? 0 : num_bits - 1;
  ------------------
  |  Branch (1529:20): [True: 239k, False: 923k]
  ------------------
 1530|  1.16M|      }
 1531|   107k|      else if (irrev == 1)
  ------------------
  |  Branch (1531:16): [True: 0, False: 107k]
  ------------------
 1532|   107k|        assert(0);
 1533|   107k|      else if (irrev == 2) //scalar expounded
  ------------------
  |  Branch (1533:16): [True: 107k, False: 0]
  ------------------
 1534|   107k|        num_bits = (SPqcd.u16[idx] >> 11) - 1;
 1535|      0|      else
 1536|   107k|        assert(0);
 1537|       |
 1538|  1.27M|      return num_bits + get_num_guard_bits();
 1539|  1.27M|    }
_ZNK4ojph5local9param_qcd16get_largest_KmaxEv:
 1543|  2.51M|    {
 1544|  2.51M|      int irrev = Sqcd & 0x1F;
 1545|  2.51M|      ui32 num_bits = 0;
 1546|  2.51M|      if (irrev == 0) // reversible; this is (10.22) from the J2K book
  ------------------
  |  Branch (1546:11): [True: 2.27M, False: 242k]
  ------------------
 1547|  2.27M|      {
 1548|  38.2M|        for (ui32 i = 0; i < num_subbands; ++i) {
  ------------------
  |  Branch (1548:26): [True: 35.9M, False: 2.27M]
  ------------------
 1549|  35.9M|          ui32 t = decode_SPqcd(SPqcd.u8[i]);
 1550|  35.9M|          num_bits = ojph_max(num_bits, t == 0 ? 0 : t - 1);
  ------------------
  |  |   73|  71.9M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 22.3M, False: 13.6M]
  |  |  |  Branch (73:33): [True: 7.66M, False: 28.3M]
  |  |  |  Branch (73:46): [True: 3.34M, False: 10.3M]
  |  |  ------------------
  ------------------
 1551|  35.9M|        }
 1552|  2.27M|      }
 1553|   242k|      else if (irrev == 1)
  ------------------
  |  Branch (1553:16): [True: 0, False: 242k]
  ------------------
 1554|   242k|        assert(0);
 1555|   242k|      else if (irrev == 2) //scalar expounded
  ------------------
  |  Branch (1555:16): [True: 242k, False: 0]
  ------------------
 1556|   242k|      {
 1557|  3.24M|        for (ui32 i = 0; i < num_subbands; ++i) {
  ------------------
  |  Branch (1557:26): [True: 3.00M, False: 242k]
  ------------------
 1558|  3.00M|          ui32 t = (SPqcd.u16[i] >> 11) - 1;
 1559|  3.00M|          num_bits = ojph_max(num_bits, t);
  ------------------
  |  |   73|  3.00M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.32M, False: 1.67M]
  |  |  ------------------
  ------------------
 1560|  3.00M|        }
 1561|   242k|      }
 1562|      0|      else
 1563|   242k|        assert(0);
 1564|       |
 1565|  2.51M|      return num_bits + get_num_guard_bits();
 1566|  2.51M|    }
_ZN4ojph5local9param_qcd4readEPNS_11infile_baseE:
 1693|  4.20k|    {
 1694|  4.20k|      if (file->read(&Lqcd, 2) != 2)
  ------------------
  |  Branch (1694:11): [True: 6, False: 4.19k]
  ------------------
 1695|      6|        OJPH_ERROR(0x00050081, "error reading QCD marker");
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1696|  4.20k|      Lqcd = swap_byte(Lqcd);
 1697|  4.20k|      if (file->read(&Sqcd, 1) != 1)
  ------------------
  |  Branch (1697:11): [True: 2, False: 4.19k]
  ------------------
 1698|      2|        OJPH_ERROR(0x00050082, "error reading QCD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1699|  4.20k|      if ((Sqcd & 0x1F) == 0)
  ------------------
  |  Branch (1699:11): [True: 3.33k, False: 866]
  ------------------
 1700|  3.33k|      {
 1701|  3.33k|        num_subbands = (Lqcd - 3);
 1702|  3.33k|        if (num_subbands == 0)
  ------------------
  |  Branch (1702:13): [True: 1, False: 3.33k]
  ------------------
 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|  3.33k|            "quantization informtion");
 1705|  3.33k|        if (num_subbands > 97 || Lqcd != 3 + num_subbands)
  ------------------
  |  Branch (1705:13): [True: 11, False: 3.32k]
  |  Branch (1705:34): [True: 0, False: 3.32k]
  ------------------
 1706|     10|          OJPH_ERROR(0x00050083, "wrong Lqcd value of %d in QCD marker", Lqcd);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1707|  52.7k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1707:26): [True: 49.3k, False: 3.33k]
  ------------------
 1708|  49.3k|          if (file->read(&SPqcd.u8[i], 1) != 1)
  ------------------
  |  Branch (1708:15): [True: 11, False: 49.3k]
  ------------------
 1709|     11|            OJPH_ERROR(0x00050084, "error reading QCD marker");
  ------------------
  |  |  289|     11|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     11|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1710|  3.33k|      }
 1711|    866|      else if ((Sqcd & 0x1F) == 1)
  ------------------
  |  Branch (1711:16): [True: 2, False: 864]
  ------------------
 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|    864|      else if ((Sqcd & 0x1F) == 2)
  ------------------
  |  Branch (1719:16): [True: 848, False: 16]
  ------------------
 1720|    848|      {
 1721|    848|        num_subbands = (Lqcd - 3) / 2;
 1722|    848|        if (num_subbands == 0)
  ------------------
  |  Branch (1722:13): [True: 1, False: 847]
  ------------------
 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|    848|            "quantization informtion");
 1725|    848|        if (num_subbands > 97 || Lqcd != 3 + 2 * num_subbands)
  ------------------
  |  Branch (1725:13): [True: 12, False: 836]
  |  Branch (1725:34): [True: 5, False: 831]
  ------------------
 1726|     16|          OJPH_ERROR(0x00050086, "wrong Lqcd value of %d in QCD 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1727|  8.29k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1727:26): [True: 7.44k, False: 848]
  ------------------
 1728|  7.44k|        {
 1729|  7.44k|          if (file->read(&SPqcd.u16[i], 2) != 2)
  ------------------
  |  Branch (1729:15): [True: 12, False: 7.43k]
  ------------------
 1730|     12|            OJPH_ERROR(0x00050087, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1731|  7.44k|          SPqcd.u16[i] = swap_byte(SPqcd.u16[i]);
 1732|  7.44k|        }
 1733|    848|      }
 1734|     16|      else
 1735|     16|        OJPH_ERROR(0x00050088, "wrong Sqcd value in QCD marker");
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1736|  4.20k|    }
_ZN4ojph5local9param_qcd8read_qccEPNS_11infile_baseEj:
 1740|    192|    {
 1741|    192|      if (file->read(&Lqcd, 2) != 2)
  ------------------
  |  Branch (1741:11): [True: 2, False: 190]
  ------------------
 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|    192|      Lqcd = swap_byte(Lqcd);
 1744|    192|      if (num_comps < 257)
  ------------------
  |  Branch (1744:11): [True: 183, False: 9]
  ------------------
 1745|    183|      {
 1746|    183|        ui8 v;
 1747|    183|        if (file->read(&v, 1) != 1)
  ------------------
  |  Branch (1747:13): [True: 1, False: 182]
  ------------------
 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|    183|        comp_idx = v;
 1750|    183|      }
 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|    192|      if (file->read(&Sqcd, 1) != 1)
  ------------------
  |  Branch (1757:11): [True: 1, False: 191]
  ------------------
 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|    192|      ui32 offset = num_comps < 257 ? 4 : 5;
  ------------------
  |  Branch (1759:21): [True: 181, False: 11]
  ------------------
 1760|    192|      if ((Sqcd & 0x1F) == 0)
  ------------------
  |  Branch (1760:11): [True: 90, False: 102]
  ------------------
 1761|     90|      {
 1762|     90|        num_subbands = (Lqcd - offset);
 1763|     90|        if (num_subbands == 0)
  ------------------
  |  Branch (1763:13): [True: 1, False: 89]
  ------------------
 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|     90|            "quantization informtion");
 1766|     90|        if (num_subbands > 97 || Lqcd != offset + num_subbands)
  ------------------
  |  Branch (1766:13): [True: 13, False: 77]
  |  Branch (1766:34): [True: 0, False: 77]
  ------------------
 1767|     12|          OJPH_ERROR(0x000500A5, "wrong Lqcd value of %d in QCC marker", Lqcd);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1768|  1.63k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1768:26): [True: 1.54k, False: 90]
  ------------------
 1769|  1.54k|          if (file->read(&SPqcd.u8[i], 1) != 1)
  ------------------
  |  Branch (1769:15): [True: 12, False: 1.53k]
  ------------------
 1770|     12|            OJPH_ERROR(0x000500A6, "error reading QCC marker");
  ------------------
  |  |  289|     12|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     12|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1771|     90|      }
 1772|    102|      else if ((Sqcd & 0x1F) == 1)
  ------------------
  |  Branch (1772:16): [True: 1, False: 101]
  ------------------
 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|    101|      else if ((Sqcd & 0x1F) == 2)
  ------------------
  |  Branch (1780:16): [True: 90, False: 11]
  ------------------
 1781|     90|      {
 1782|     90|        num_subbands = (Lqcd - offset) / 2;
 1783|     90|        if (num_subbands == 0)
  ------------------
  |  Branch (1783:13): [True: 1, False: 89]
  ------------------
 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|     90|            "quantization informtion");
 1786|     90|        if (num_subbands > 97 || Lqcd != offset + 2 * num_subbands)
  ------------------
  |  Branch (1786:13): [True: 6, False: 84]
  |  Branch (1786:34): [True: 1, False: 83]
  ------------------
 1787|      6|          OJPH_ERROR(0x000500A8, "wrong Lqcc value of %d in QCC marker", Lqcd);
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1788|  1.06k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1788:26): [True: 971, False: 90]
  ------------------
 1789|    971|        {
 1790|    971|          if (file->read(&SPqcd.u16[i], 2) != 2)
  ------------------
  |  Branch (1790:15): [True: 15, False: 956]
  ------------------
 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|    971|          SPqcd.u16[i] = swap_byte(SPqcd.u16[i]);
 1793|    971|        }
 1794|     90|      }
 1795|     11|      else
 1796|     11|        OJPH_ERROR(0x000500AA, "wrong Sqcc value in QCC marker");
  ------------------
  |  |  289|     11|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     11|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1797|    192|    }
_ZN4ojph5local9param_qcd7get_qccEj:
 1801|    123|    {
 1802|       |      // cast object to constant
 1803|    123|      const param_qcd* const_p = const_cast<const param_qcd*>(this);
 1804|       |      // call using the constant object, then cast to non-const
 1805|    123|      return const_cast<param_qcd*>(const_p->get_qcc(comp_idx));
 1806|    123|    }
_ZNK4ojph5local9param_qcd7get_qccEj:
 1810|  2.49M|    {
 1811|  2.49M|      assert(this->type == QCD_MAIN || this->top_qcd->type == QCD_MAIN);
 1812|  2.49M|      const param_qcd *p, *q;
 1813|  2.49M|      if (this->type == QCD_MAIN)
  ------------------
  |  Branch (1813:11): [True: 2.49M, False: 2.75k]
  ------------------
 1814|  2.49M|        q = p = this;
 1815|  2.75k|      else
 1816|  2.75k|        q = p = this->top_qcd;
 1817|  5.01M|      while (p && p->comp_idx != comp_idx)
  ------------------
  |  Branch (1817:14): [True: 2.53M, False: 2.48M]
  |  Branch (1817:19): [True: 2.52M, False: 7.48k]
  ------------------
 1818|  2.52M|        p = p->next;
 1819|  2.49M|      return p ? p : q;
  ------------------
  |  Branch (1819:14): [True: 7.48k, False: 2.48M]
  ------------------
 1820|  2.49M|    }
_ZN4ojph5local9param_qcd14add_qcc_objectEj:
 1824|    192|    {
 1825|    192|      assert(type == QCD_MAIN);
 1826|    192|      param_qcd *p = this;
 1827|    226|      while (p->next != NULL)
  ------------------
  |  Branch (1827:14): [True: 34, False: 192]
  ------------------
 1828|     34|        p = p->next;
 1829|    192|      if (avail)
  ------------------
  |  Branch (1829:11): [True: 0, False: 192]
  ------------------
 1830|      0|      {
 1831|      0|        p->next = avail;
 1832|      0|        avail = avail->next;
 1833|      0|        p->next->init(this, (ui16)comp_idx);
 1834|      0|      }
 1835|    192|      else
 1836|    192|        p->next = new param_qcd(this, (ui16)comp_idx);
 1837|    192|      return p->next;
 1838|    192|    }
_ZNK4ojph5local9param_nlt23get_nonlinear_transformEjRhRbS2_:
 1956|  80.8k|    {
 1957|  80.8k|      assert(Cnlt == special_comp_num::ALL_COMPS);
 1958|  80.8k|      const param_nlt* p = get_nlt_object(comp_num);
 1959|  80.8k|      p = (p && p->enabled) ? p : this;
  ------------------
  |  Branch (1959:12): [True: 19, False: 80.8k]
  |  Branch (1959:17): [True: 19, False: 0]
  ------------------
 1960|  80.8k|      if (p->enabled)
  ------------------
  |  Branch (1960:11): [True: 19, False: 80.8k]
  ------------------
 1961|     19|      {
 1962|     19|        bit_depth = (ui8)((p->BDnlt & 0x7F) + 1);
 1963|     19|        bit_depth = bit_depth <= 38 ? bit_depth : 38;
  ------------------
  |  Branch (1963:21): [True: 19, False: 0]
  ------------------
 1964|     19|        is_signed = (p->BDnlt & 0x80) == 0x80;
 1965|     19|        nl_type = (nonlinearity)p->Tnlt;
 1966|     19|        return true;
 1967|     19|      }
 1968|  80.8k|      return false;
 1969|  80.8k|    }
_ZN4ojph5local9param_nlt4readEPNS_11infile_baseE:
 2001|    722|    {
 2002|    722|      ui8 buf[6];
 2003|       |
 2004|    722|      if (file->read(buf, 6) != 6)
  ------------------
  |  Branch (2004:11): [True: 9, False: 713]
  ------------------
 2005|      9|        OJPH_ERROR(0x00050141, "error reading NLT marker segment");
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2006|       |
 2007|    722|      ui16 length = swap_byte(*(ui16*)buf);
 2008|    722|      if (length != 6 || (buf[5] != 3 && buf[5] != 0)) // wrong length or type
  ------------------
  |  Branch (2008:11): [True: 24, False: 698]
  |  Branch (2008:27): [True: 460, False: 238]
  |  Branch (2008:42): [True: 4, False: 456]
  ------------------
 2009|     19|        OJPH_ERROR(0x00050142, "Unsupported NLT type %d\n", buf[5]);
  ------------------
  |  |  289|     19|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     19|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 19, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2010|       |
 2011|    722|      ui16 comp = swap_byte(*(ui16*)(buf + 2));
 2012|    722|      param_nlt* p = get_nlt_object(comp);
 2013|    722|      if (p == NULL)
  ------------------
  |  Branch (2013:11): [True: 268, False: 454]
  ------------------
 2014|    268|        p = add_object(comp);
 2015|    722|      p->enabled = true;
 2016|    722|      p->Cnlt = comp;
 2017|    722|      p->BDnlt = buf[4];
 2018|    722|      p->Tnlt = buf[5];
 2019|    722|    }
_ZN4ojph5local9param_nlt14get_nlt_objectEj:
 2023|    694|    {
 2024|       |      // cast object to constant
 2025|    694|      const param_nlt* const_p = const_cast<const param_nlt*>(this);
 2026|       |      // call using the constant object, then cast to non-const
 2027|    694|      return const_cast<param_nlt*>(const_p->get_nlt_object(comp_num));
 2028|    694|    }
_ZNK4ojph5local9param_nlt14get_nlt_objectEj:
 2032|  81.5k|    {
 2033|  81.5k|      const param_nlt* p = this;
 2034|   165k|      while (p && p->Cnlt != comp_num)
  ------------------
  |  Branch (2034:14): [True: 84.1k, False: 81.1k]
  |  Branch (2034:19): [True: 83.7k, False: 445]
  ------------------
 2035|  83.7k|        p = p->next;
 2036|  81.5k|      return p;
 2037|  81.5k|    }
_ZN4ojph5local9param_nlt10add_objectEj:
 2041|    268|    {
 2042|    268|      assert(comp_num != special_comp_num::ALL_COMPS);
 2043|    268|      assert(Cnlt == special_comp_num::ALL_COMPS);
 2044|    268|      param_nlt* p = this;
 2045|  1.03k|      while (p->next != NULL) {
  ------------------
  |  Branch (2045:14): [True: 769, False: 268]
  ------------------
 2046|    769|        assert(p->Cnlt != comp_num);
 2047|    769|        p = p->next;
 2048|    769|      }
 2049|    268|      if (avail)
  ------------------
  |  Branch (2049:11): [True: 0, False: 268]
  ------------------
 2050|      0|      {
 2051|      0|        p->next = avail;
 2052|      0|        avail = avail->next;
 2053|      0|        p->next->init();
 2054|      0|      }
 2055|    268|      else
 2056|    268|        p->next = new param_nlt;
 2057|    268|      p = p->next;
 2058|    268|      p->Cnlt = (ui16)comp_num;
 2059|    268|      return p;
 2060|    268|    }
_ZN4ojph5local9param_sot4readEPNS_11infile_baseEb:
 2142|  64.5k|    {
 2143|  64.5k|      if (resilient)
  ------------------
  |  Branch (2143:11): [True: 64.5k, False: 0]
  ------------------
 2144|  64.5k|      {
 2145|  64.5k|        if (file->read(&Lsot, 2) != 2)
  ------------------
  |  Branch (2145:13): [True: 81, False: 64.4k]
  ------------------
 2146|     81|        {
 2147|     81|          OJPH_INFO(0x00050091, "error reading SOT marker");
  ------------------
  |  |  285|     81|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     81|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 81, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2148|     81|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2149|     81|          return false;
 2150|     81|        }
 2151|  64.4k|        Lsot = swap_byte(Lsot);
 2152|  64.4k|        if (Lsot != 10)
  ------------------
  |  Branch (2152:13): [True: 9.92k, False: 54.5k]
  ------------------
 2153|  9.92k|        {
 2154|  9.92k|          OJPH_INFO(0x00050092, "error in SOT length");
  ------------------
  |  |  285|  9.92k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  9.92k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9.92k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2155|  9.92k|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2156|  9.92k|          return false;
 2157|  9.92k|        }
 2158|  54.5k|        if (file->read(&Isot, 2) != 2)
  ------------------
  |  Branch (2158:13): [True: 26, False: 54.4k]
  ------------------
 2159|     26|        {
 2160|     26|          OJPH_INFO(0x00050093, "error reading tile index");
  ------------------
  |  |  285|     26|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     26|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 26, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2161|     26|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2162|     26|          return false;
 2163|     26|        }
 2164|  54.4k|        Isot = swap_byte(Isot);
 2165|  54.4k|        if (Isot == 0xFFFF)
  ------------------
  |  Branch (2165:13): [True: 525, False: 53.9k]
  ------------------
 2166|    525|        {
 2167|    525|          OJPH_INFO(0x00050094, "tile index in SOT marker cannot be 0xFFFF");
  ------------------
  |  |  285|    525|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    525|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 525, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2168|    525|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2169|    525|          return false;
 2170|    525|        }
 2171|  53.9k|        if (file->read(&Psot, 4) != 4)
  ------------------
  |  Branch (2171:13): [True: 31, False: 53.9k]
  ------------------
 2172|     31|        {
 2173|     31|          OJPH_INFO(0x00050095, "error reading SOT marker");
  ------------------
  |  |  285|     31|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     31|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 31, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2174|     31|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2175|     31|          return false;
 2176|     31|        }
 2177|  53.9k|        Psot = swap_byte(Psot);
 2178|  53.9k|        if (file->read(&TPsot, 1) != 1)
  ------------------
  |  Branch (2178:13): [True: 9, False: 53.9k]
  ------------------
 2179|      9|        {
 2180|      9|          OJPH_INFO(0x00050096, "error reading SOT marker");
  ------------------
  |  |  285|      9|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2181|      9|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2182|      9|          return false;
 2183|      9|        }
 2184|  53.9k|        if (file->read(&TNsot, 1) != 1)
  ------------------
  |  Branch (2184:13): [True: 17, False: 53.9k]
  ------------------
 2185|     17|        {
 2186|     17|          OJPH_INFO(0x00050097, "error reading SOT marker");
  ------------------
  |  |  285|     17|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     17|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 17, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2187|     17|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2188|     17|          return false;
 2189|     17|        }
 2190|  53.9k|      }
 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|  53.9k|      return true;
 2212|  64.5k|    }
_ZNK4ojph5local9param_dfs7get_dfsEi:
 2281|  27.4k|    {
 2282|  27.4k|      const param_dfs* p = this;
 2283|  44.5k|      while (p && p->Sdfs != index)
  ------------------
  |  Branch (2283:14): [True: 44.5k, False: 5]
  |  Branch (2283:19): [True: 17.0k, False: 27.4k]
  ------------------
 2284|  17.0k|        p = p->next;
 2285|  27.4k|      return p;
 2286|  27.4k|    }
_ZNK4ojph5local9param_dfs12get_dwt_typeEj:
 2290|  49.9k|    {
 2291|  49.9k|      decomp_level = ojph_min(decomp_level, Ids);
  ------------------
  |  |   76|  49.9k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 39.7k, False: 10.2k]
  |  |  ------------------
  ------------------
 2292|  49.9k|      ui32 d = decomp_level - 1;          // decomp_level starts from 1
 2293|  49.9k|      ui32 idx = d >> 2;                  // complete bytes
 2294|  49.9k|      ui32 bits = d & 0x3;                // bit within the bytes
 2295|  49.9k|      ui32 val = (Ddfs[idx] >> (6 - 2 * bits)) & 0x3;
 2296|  49.9k|      return (dfs_dwt_type)val;
 2297|  49.9k|    }
_ZNK4ojph5local9param_dfs15get_subband_idxEjjj:
 2302|  12.0k|    {
 2303|  12.0k|      assert((resolution == 0 && subband == 0) ||
 2304|  12.0k|              (resolution > 0 && subband > 0 && subband < 4));
 2305|       |
 2306|  12.0k|      ui32 ns[4] = { 0, 3, 1, 1 };
 2307|       |
 2308|  12.0k|      ui32 idx = 0;
 2309|  12.0k|      if (resolution > 0)
  ------------------
  |  Branch (2309:11): [True: 9.75k, False: 2.25k]
  ------------------
 2310|  9.75k|      {
 2311|  9.75k|        idx = 0;
 2312|  9.75k|        ui32 i = 1;
 2313|  26.6k|        for (; i < resolution; ++i)
  ------------------
  |  Branch (2313:16): [True: 16.8k, False: 9.75k]
  ------------------
 2314|  16.8k|          idx += ns[get_dwt_type(num_decompositions - i + 1)];
 2315|  9.75k|        dfs_dwt_type t = get_dwt_type(num_decompositions - i + 1);
 2316|  9.75k|        idx += subband;
 2317|  9.75k|        if (t == VERT_DWT && subband == 2)
  ------------------
  |  Branch (2317:13): [True: 4.06k, False: 5.68k]
  |  Branch (2317:30): [True: 4.06k, False: 0]
  ------------------
 2318|  4.06k|          --idx;
 2319|  9.75k|      }
 2320|       |
 2321|  12.0k|      return idx;
 2322|  12.0k|    }
_ZNK4ojph5local9param_dfs16get_res_downsampEj:
 2326|  1.90k|    {
 2327|  1.90k|      point factor(1, 1);
 2328|  1.90k|      ui32 decomp_level = 1;
 2329|  6.94k|      while (skipped_resolutions > 0)
  ------------------
  |  Branch (2329:14): [True: 5.04k, False: 1.90k]
  ------------------
 2330|  5.04k|      {
 2331|  5.04k|        param_dfs::dfs_dwt_type type = get_dwt_type(decomp_level);
 2332|  5.04k|        if (type == BIDIR_DWT)
  ------------------
  |  Branch (2332:13): [True: 542, False: 4.50k]
  ------------------
 2333|    542|        { factor.x *= 2; factor.y *= 2; }
 2334|  4.50k|        else if (type == HORZ_DWT)
  ------------------
  |  Branch (2334:18): [True: 1.34k, False: 3.15k]
  ------------------
 2335|  1.34k|          factor.x *= 2;
 2336|  3.15k|        else if (type == VERT_DWT)
  ------------------
  |  Branch (2336:18): [True: 1.49k, False: 1.66k]
  ------------------
 2337|  1.49k|          factor.y *= 2;
 2338|       |
 2339|  5.04k|        ++decomp_level;
 2340|  5.04k|        --skipped_resolutions;
 2341|  5.04k|      }
 2342|  1.90k|      return factor;
 2343|  1.90k|    }
_ZN4ojph5local9param_dfs4readEPNS_11infile_baseE:
 2347|   824k|    {
 2348|   824k|      if (Ldfs != 0) { // this param_dfs is used
  ------------------
  |  Branch (2348:11): [True: 411k, False: 412k]
  ------------------
 2349|   411k|        param_dfs* p = this;
 2350|  5.04G|        while (p->next != NULL)
  ------------------
  |  Branch (2350:16): [True: 5.04G, False: 411k]
  ------------------
 2351|  5.04G|          p = p->next;
 2352|   411k|        if (avail)
  ------------------
  |  Branch (2352:13): [True: 0, False: 411k]
  ------------------
 2353|      0|        {
 2354|      0|          p->next = avail;
 2355|      0|          avail = avail->next;
 2356|      0|          p->next->init();
 2357|      0|        }
 2358|   411k|        else
 2359|   411k|          p->next = new param_dfs;
 2360|   411k|        p = p->next;
 2361|   411k|        return p->read(file);
 2362|   411k|      }
 2363|       |
 2364|   412k|      if (file->read(&Ldfs, 2) != 2)
  ------------------
  |  Branch (2364:11): [True: 14, False: 412k]
  ------------------
 2365|     14|        OJPH_ERROR(0x000500D1, "error reading DFS-Ldfs 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2366|   412k|      Ldfs = swap_byte(Ldfs);
 2367|   412k|      if (file->read(&Sdfs, 2) != 2)
  ------------------
  |  Branch (2367:11): [True: 16, False: 412k]
  ------------------
 2368|     16|        OJPH_ERROR(0x000500D2, "error reading DFS-Sdfs 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2369|   412k|      Sdfs = swap_byte(Sdfs);
 2370|   412k|      if (Sdfs > 15)
  ------------------
  |  Branch (2370:11): [True: 31, False: 412k]
  ------------------
 2371|     31|        OJPH_ERROR(0x000500D3, "The DFS-Sdfs parameter is %d, which is "
  ------------------
  |  |  289|     31|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     31|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 31, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2372|   412k|          "larger than the permissible 15", Sdfs);
 2373|   412k|      ui8 t, l_Ids = 0;
 2374|   412k|      if (file->read(&l_Ids, 1) != 1)
  ------------------
  |  Branch (2374:11): [True: 7, False: 412k]
  ------------------
 2375|      7|        OJPH_ERROR(0x000500D4, "error reading DFS-Ids parameter");
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2376|   412k|      constexpr int max_Ddfs = sizeof(Ddfs) * 4;
 2377|   412k|      if (l_Ids > max_Ddfs)
  ------------------
  |  Branch (2377:11): [True: 1.24k, False: 411k]
  ------------------
 2378|  1.24k|        OJPH_INFO(0x000500D5, "The DFS-Ids parameter is %d; while this is "
  ------------------
  |  |  285|  1.24k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  1.24k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1.24k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2379|   412k|          "valid, the number is unnessarily large -- you do not need more "
 2380|   412k|          "than %d.  Please contact me regarding this issue.",
 2381|   412k|          l_Ids, max_Ddfs);
 2382|   412k|      Ids = l_Ids < max_Ddfs ? l_Ids : max_Ddfs;
  ------------------
  |  Branch (2382:13): [True: 410k, False: 2.35k]
  ------------------
 2383|   460k|      for (int i = 0; i < Ids; i += 4)
  ------------------
  |  Branch (2383:23): [True: 48.2k, False: 412k]
  ------------------
 2384|  48.2k|        if (file->read(&Ddfs[i / 4], 1) != 1)
  ------------------
  |  Branch (2384:13): [True: 14, False: 48.2k]
  ------------------
 2385|     14|          OJPH_ERROR(0x000500D6, "error reading DFS-Ddfs parameters");
  ------------------
  |  |  289|   412k|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     14|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2386|   425k|      for (int i = Ids; i < l_Ids; i += 4)
  ------------------
  |  Branch (2386:25): [True: 13.0k, False: 412k]
  ------------------
 2387|  13.0k|        if (file->read(&t, 1) != 1)
  ------------------
  |  Branch (2387:13): [True: 15, False: 13.0k]
  ------------------
 2388|     15|          OJPH_ERROR(0x000500D7, "error reading DFS-Ddfs parameters");
  ------------------
  |  |  289|   412k|  { 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|   412k|      return true;
 2390|   824k|    }
_ZN4ojph5local9param_atk7get_atkEi:
 2402|  3.43k|    {
 2403|  3.43k|      assert(top_atk == NULL);
 2404|       |
 2405|  3.43k|      if (Latk == 0)
  ------------------
  |  Branch (2405:11): [True: 3.05k, False: 378]
  ------------------
 2406|  3.05k|      {
 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|  3.05k|        if (index == 0) { this->init_irv97(); return this; }
  ------------------
  |  Branch (2411:13): [True: 569, False: 2.48k]
  ------------------
 2412|  2.48k|        else if (index == 1) { this->init_rev53(); return this; }
  ------------------
  |  Branch (2412:18): [True: 2.48k, False: 6]
  ------------------
 2413|  3.05k|      }
 2414|       |
 2415|    384|      param_atk* p = this;
 2416|    726|      while (p && p->get_index() != index)
  ------------------
  |  Branch (2416:14): [True: 565, False: 161]
  |  Branch (2416:19): [True: 342, False: 223]
  ------------------
 2417|    342|        p = p->next;
 2418|       |
 2419|    384|      if (p == NULL && (index == 0 || index == 1))
  ------------------
  |  Branch (2419:11): [True: 161, False: 223]
  |  Branch (2419:25): [True: 41, False: 120]
  |  Branch (2419:39): [True: 53, False: 67]
  ------------------
 2420|     94|      {
 2421|       |        // The index was not found, add an atk object only if the index is
 2422|       |        // either 0 or 1
 2423|     94|        p = add_object();
 2424|     94|        if (index == 0)
  ------------------
  |  Branch (2424:13): [True: 41, False: 53]
  ------------------
 2425|     41|          p->init_irv97();
 2426|     53|        else if (index == 1)
  ------------------
  |  Branch (2426:18): [True: 53, False: 0]
  ------------------
 2427|     53|          p->init_rev53();
 2428|     94|      }
 2429|       |
 2430|    384|      return p;
 2431|  3.43k|    }
_ZN4ojph5local9param_atk16read_coefficientEPNS_11infile_baseERfRi:
 2435|  1.15k|    {
 2436|  1.15k|      int coeff_type = get_coeff_type();
 2437|  1.15k|      if (coeff_type == 0) { // 8bit
  ------------------
  |  Branch (2437:11): [True: 57, False: 1.09k]
  ------------------
 2438|     57|        ui8 v;
 2439|     57|        if (file->read(&v, 1) != 1) return false;
  ------------------
  |  Branch (2439:13): [True: 1, False: 56]
  ------------------
 2440|     56|        bytes -= 1;
 2441|     56|        K = v;
 2442|     56|      }
 2443|  1.09k|      else if (coeff_type == 1) { // 16bit
  ------------------
  |  Branch (2443:16): [True: 97, False: 1.00k]
  ------------------
 2444|     97|        ui16 v;
 2445|     97|        if (file->read(&v, 2) != 2) return false;
  ------------------
  |  Branch (2445:13): [True: 4, False: 93]
  ------------------
 2446|     93|        bytes -= 2;
 2447|     93|        K = swap_byte(v);
 2448|     93|      }
 2449|  1.00k|      else if (coeff_type == 2) { // float
  ------------------
  |  Branch (2449:16): [True: 355, False: 645]
  ------------------
 2450|    355|        union {
 2451|    355|          float f;
 2452|    355|          ui32 i;
 2453|    355|        } v;
 2454|    355|        if (file->read(&v.i, 4) != 4) return false;
  ------------------
  |  Branch (2454:13): [True: 2, False: 353]
  ------------------
 2455|    353|        bytes -= 4;
 2456|    353|        v.i = swap_byte(v.i);
 2457|    353|        K = v.f;
 2458|    353|      }
 2459|    645|      else if (coeff_type == 3) { // double
  ------------------
  |  Branch (2459:16): [True: 334, False: 311]
  ------------------
 2460|    334|        union {
 2461|    334|          double d;
 2462|    334|          ui64 i;
 2463|    334|        } v;
 2464|    334|        if (file->read(&v.i, 8) != 8) return false;
  ------------------
  |  Branch (2464:13): [True: 5, False: 329]
  ------------------
 2465|    329|        bytes -= 8;
 2466|    329|        v.i = swap_byte(v.i);
 2467|    329|        K = (float)v.d;
 2468|    329|      }
 2469|    311|      else if (coeff_type == 4) { // 128 bit float
  ------------------
  |  Branch (2469:16): [True: 80, False: 231]
  ------------------
 2470|     80|        ui64 v, v1;
 2471|     80|        if (file->read(&v, 8) != 8) return false;
  ------------------
  |  Branch (2471:13): [True: 3, False: 77]
  ------------------
 2472|     77|        bytes -= 8;
 2473|     77|        if (file->read(&v1, 8) != 8) return false; // v1 not needed
  ------------------
  |  Branch (2473:13): [True: 4, 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.13k|      return true;
 2496|  1.15k|    }
_ZN4ojph5local9param_atk16read_coefficientEPNS_11infile_baseERsRi:
 2501|    420|    {
 2502|    420|      int coeff_type = get_coeff_type();
 2503|    420|      if (coeff_type == 0) {
  ------------------
  |  Branch (2503:11): [True: 94, False: 326]
  ------------------
 2504|     94|        si8 v;
 2505|     94|        if (file->read(&v, 1) != 1) return false;
  ------------------
  |  Branch (2505:13): [True: 2, False: 92]
  ------------------
 2506|     92|        bytes -= 1;
 2507|     92|        K = v;
 2508|     92|      }
 2509|    326|      else if (coeff_type == 1) {
  ------------------
  |  Branch (2509:16): [True: 326, False: 0]
  ------------------
 2510|    326|        si16 v;
 2511|    326|        if (file->read(&v, 2) != 2) return false;
  ------------------
  |  Branch (2511:13): [True: 3, False: 323]
  ------------------
 2512|    323|        bytes -= 2;
 2513|    323|        K = (si16)swap_byte((ui16)v);
 2514|    323|      }
 2515|      0|      else
 2516|      0|        return false;
 2517|    415|      return true;
 2518|    420|    }
_ZN4ojph5local9param_atk4readEPNS_11infile_baseE:
 2522|    276|    {
 2523|    276|      if (Latk != 0) // this param_atk is used
  ------------------
  |  Branch (2523:11): [True: 70, False: 206]
  ------------------
 2524|     70|        return add_object()->read(file);
 2525|       |
 2526|    206|      if (file->read(&Latk, 2) != 2)
  ------------------
  |  Branch (2526:11): [True: 2, False: 204]
  ------------------
 2527|      2|        OJPH_ERROR(0x000500E1, "error reading ATK-Latk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2528|    206|      Latk = swap_byte(Latk);
 2529|    206|      si32 bytes = Latk - 2;
 2530|    206|      ojph::ui16 temp_Satk;
 2531|    206|      if (file->read(&temp_Satk, 2) != 2)
  ------------------
  |  Branch (2531:11): [True: 3, False: 203]
  ------------------
 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|    206|      bytes -= 2;
 2534|    206|      temp_Satk = swap_byte(temp_Satk);
 2535|    206|      int tmp_idx = temp_Satk & 0xFF;
 2536|    206|      if ((top_atk && top_atk->get_atk(tmp_idx) != NULL)
  ------------------
  |  Branch (2536:12): [True: 68, False: 138]
  |  Branch (2536:23): [True: 9, False: 59]
  ------------------
 2537|    192|        || tmp_idx == 0 || tmp_idx == 1)
  ------------------
  |  Branch (2537:12): [True: 1, False: 191]
  |  Branch (2537:28): [True: 0, False: 191]
  ------------------
 2538|     10|        OJPH_ERROR(0x000500F3, "ATK-Satk parameter sets ATK marker index to "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2539|    206|          "the illegal value of %d. ATK-Satk should be in (2-255) and, I "
 2540|    206|          "believe, must not be repeated; otherwise, it would be unclear "
 2541|    206|          "what marker segment must be employed when an index is repeated.",
 2542|    206|          tmp_idx);
 2543|    206|      Satk = temp_Satk;
 2544|    206|      if (is_m_init0() == false)  // only even-indexed is supported
  ------------------
  |  Branch (2544:11): [True: 1, False: 205]
  ------------------
 2545|      1|        OJPH_ERROR(0x000500E3, "ATK-Satk parameter sets m_init to 1, "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2546|    206|          "requiring odd-indexed subsequence in first reconstruction step, "
 2547|    206|          "which is not supported yet.");
 2548|    206|      if (is_whole_sample() == false)  // ARB filter not supported
  ------------------
  |  Branch (2548:11): [True: 3, False: 203]
  ------------------
 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|    206|          "which is not supported yet.");
 2551|    206|      if (is_reversible() && get_coeff_type() >= 2) // reversible & float
  ------------------
  |  Branch (2551:11): [True: 68, False: 138]
  |  Branch (2551:30): [True: 2, False: 66]
  ------------------
 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|    206|          "It employs floats with reversible filtering.");
 2554|    206|      if (is_using_ws_extension() == false)  // only sym. ext is supported
  ------------------
  |  Branch (2554:11): [True: 1, False: 205]
  ------------------
 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|    206|          "boundary extension, which is not supported yet.");
 2557|    206|      if (is_reversible() == false)
  ------------------
  |  Branch (2557:11): [True: 118, False: 88]
  ------------------
 2558|    118|        if (read_coefficient(file, Katk, bytes) == false)
  ------------------
  |  Branch (2558:13): [True: 8, False: 110]
  ------------------
 2559|      8|          OJPH_ERROR(0x000500E7, "error reading ATK-Katk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2560|    206|      if (file->read(&Natk, 1) != 1)
  ------------------
  |  Branch (2560:11): [True: 6, False: 200]
  ------------------
 2561|      6|        OJPH_ERROR(0x000500E8, "error reading ATK-Natk parameter");
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2562|    206|      bytes -= 1;
 2563|    206|      if (Natk > max_steps) {
  ------------------
  |  Branch (2563:11): [True: 71, False: 135]
  ------------------
 2564|     71|        if (d != d_store) // was this allocated -- very unlikely
  ------------------
  |  Branch (2564:13): [True: 0, False: 71]
  ------------------
 2565|      0|          delete[] d;
 2566|     71|        d = new lifting_step[Natk];
 2567|     71|        max_steps = Natk;
 2568|     71|      }
 2569|       |
 2570|    206|      if (is_reversible())
  ------------------
  |  Branch (2570:11): [True: 66, False: 140]
  ------------------
 2571|     66|      {
 2572|    515|        for (int s = 0; s < Natk; ++s)
  ------------------
  |  Branch (2572:25): [True: 449, False: 66]
  ------------------
 2573|    449|        {
 2574|    449|          if (file->read(&d[s].rev.Eatk, 1) != 1)
  ------------------
  |  Branch (2574:15): [True: 10, False: 439]
  ------------------
 2575|     10|            OJPH_ERROR(0x000500E9, "error reading ATK-Eatk parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2576|    449|          bytes -= 1;
 2577|    449|          if (file->read(&d[s].rev.Batk, 2) != 2)
  ------------------
  |  Branch (2577:15): [True: 7, False: 442]
  ------------------
 2578|      7|            OJPH_ERROR(0x000500EA, "error reading ATK-Batk parameter");
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2579|    449|          bytes -= 2;
 2580|    449|          d[s].rev.Batk = (si16)swap_byte((ui16)d[s].rev.Batk);
 2581|    449|          ui8 LCatk;
 2582|    449|          if (file->read(&LCatk, 1) != 1)
  ------------------
  |  Branch (2582:15): [True: 4, False: 445]
  ------------------
 2583|      4|            OJPH_ERROR(0x000500EB, "error reading ATK-LCatk parameter");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2584|    449|          bytes -= 1;
 2585|    449|          if (LCatk == 0)
  ------------------
  |  Branch (2585:15): [True: 3, False: 446]
  ------------------
 2586|      3|            OJPH_ERROR(0x000500EC, "Encountered a ATK-LCatk value of zero; "
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2587|    449|              "something is wrong.");
 2588|    449|          if (LCatk > 1)
  ------------------
  |  Branch (2588:15): [True: 5, False: 444]
  ------------------
 2589|      5|            OJPH_ERROR(0x000500ED, "ATK-LCatk value greater than 1; "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2590|    449|              "that is, a multitap filter is not supported");
 2591|    449|          if (read_coefficient(file, d[s].rev.Aatk, bytes) == false)
  ------------------
  |  Branch (2591:15): [True: 5, False: 444]
  ------------------
 2592|      5|            OJPH_ERROR(0x000500EE, "Error reding ATK-Aatk parameter");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2593|    449|        }
 2594|     66|      }
 2595|    140|      else
 2596|    140|      {
 2597|  1.20k|        for (int s = 0; s < Natk; ++s)
  ------------------
  |  Branch (2597:25): [True: 1.06k, False: 140]
  ------------------
 2598|  1.06k|        {
 2599|  1.06k|          ui8 LCatk;
 2600|  1.06k|          if (file->read(&LCatk, 1) != 1)
  ------------------
  |  Branch (2600:15): [True: 15, False: 1.04k]
  ------------------
 2601|     15|            OJPH_ERROR(0x000500EF, "error reading ATK-LCatk parameter");
  ------------------
  |  |  289|     15|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     15|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2602|  1.06k|          bytes -= 1;
 2603|  1.06k|          if (LCatk == 0)
  ------------------
  |  Branch (2603:15): [True: 3, False: 1.06k]
  ------------------
 2604|      3|            OJPH_ERROR(0x000500F0, "Encountered a ATK-LCatk value of zero; "
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2605|  1.06k|              "something is wrong.");
 2606|  1.06k|          if (LCatk > 1)
  ------------------
  |  Branch (2606:15): [True: 10, False: 1.05k]
  ------------------
 2607|     10|            OJPH_ERROR(0x000500F1, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2608|  1.06k|              "that is, a multitap filter is not supported.");
 2609|  1.06k|          if (read_coefficient(file, d[s].irv.Aatk, bytes) == false)
  ------------------
  |  Branch (2609:15): [True: 11, False: 1.05k]
  ------------------
 2610|     11|            OJPH_ERROR(0x000500F2, "Error reding ATK-Aatk parameter");
  ------------------
  |  |  289|     11|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     11|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2611|  1.06k|        }
 2612|    140|      }
 2613|    206|      if (bytes != 0)
  ------------------
  |  Branch (2613:11): [True: 14, False: 192]
  ------------------
 2614|     14|        OJPH_ERROR(0x000500F3, "The length of an ATK 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2615|    206|          "(ATK-Latk) is not correct");
 2616|       |
 2617|    206|      return true;
 2618|    276|    }
_ZN4ojph5local9param_atk10init_irv97Ev:
 2622|    610|    {
 2623|    610|      Satk = 0x4a00;     // illegal because ATK = 0
 2624|    610|      Katk = (float)1.230174104914001;
 2625|    610|      Natk = 4;
 2626|       |      // next is (A-4) in T.801 second line
 2627|    610|      Latk = (ui16)(5 + Natk + sizeof(float) * (1 + Natk));
 2628|    610|      d[0].irv.Aatk = (float)0.443506852043971;
 2629|    610|      d[1].irv.Aatk = (float)0.882911075530934;
 2630|    610|      d[2].irv.Aatk = (float)-0.052980118572961;
 2631|    610|      d[3].irv.Aatk = (float)-1.586134342059924;
 2632|    610|    }
_ZN4ojph5local9param_atk10init_rev53Ev:
 2636|  2.53k|    {
 2637|  2.53k|      Satk = 0x5801;     // illegal because ATK = 1
 2638|  2.53k|      Natk = 2;
 2639|       |      // next is (A-4) in T.801 fourth line
 2640|  2.53k|      Latk = (ui16)(5 + 2 * Natk + sizeof(ui8) * (Natk + Natk));
 2641|  2.53k|      d[0].rev.Aatk = 1;
 2642|  2.53k|      d[0].rev.Batk = 2;
 2643|  2.53k|      d[0].rev.Eatk = 2;
 2644|  2.53k|      d[1].rev.Aatk = -1;
 2645|  2.53k|      d[1].rev.Batk = 1;
 2646|  2.53k|      d[1].rev.Eatk = 1;
 2647|  2.53k|    }
_ZN4ojph5local9param_atk10add_objectEv:
 2651|    164|    {
 2652|    164|      assert(top_atk == NULL);
 2653|    164|      param_atk *p = this;
 2654|    296|      while (p->next != NULL)
  ------------------
  |  Branch (2654:14): [True: 132, False: 164]
  ------------------
 2655|    132|        p = p->next;
 2656|    164|      if (avail)
  ------------------
  |  Branch (2656:11): [True: 0, False: 164]
  ------------------
 2657|      0|      {
 2658|      0|        p->next = avail;
 2659|      0|        avail = avail->next;
 2660|      0|      }
 2661|    164|      else
 2662|    164|        p->next = new param_atk;
 2663|    164|      p = p->next;
 2664|    164|      p->init(this);
 2665|    164|      return p;
 2666|    164|    }
ojph_params.cpp:_ZN4ojph5localL9swap_byteEt:
  491|  1.15M|    {
  492|  1.15M|      return (ui16)((t << 8) | (t >> 8));
  493|  1.15M|    }
ojph_params.cpp:_ZN4ojph5localL9swap_byteEj:
  498|  88.0k|    {
  499|  88.0k|      ui32 u = swap_byte((ui16)(t & 0xFFFFu));
  500|  88.0k|      u <<= 16;
  501|  88.0k|      u |= swap_byte((ui16)(t >> 16));
  502|  88.0k|      return u;
  503|  88.0k|    }
ojph_params.cpp:_ZN4ojph5localL9swap_byteEm:
  508|    402|    {
  509|    402|      ui64 u = swap_byte((ui32)(t & 0xFFFFFFFFu));
  510|    402|      u <<= 32;
  511|    402|      u |= swap_byte((ui32)(t >> 32));
  512|    402|      return u;
  513|    402|    }

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

_ZN4ojph5local8precinct5parseEiPjPNS_21mem_elastic_allocatorERjPNS_11infile_baseEb:
  332|   349k|    {
  333|   349k|      assert(data_left > 0);
  334|   349k|      bit_read_buf bb;
  335|   349k|      bb_init(&bb, data_left, file);
  336|   349k|      if (may_use_sop)
  ------------------
  |  Branch (336:11): [True: 32.6k, False: 316k]
  ------------------
  337|  32.6k|        bb_skip_sop(&bb);
  338|       |
  339|   349k|      bool empty_packet = true;
  340|   919k|      for (int s = 0; s < 4; ++s)
  ------------------
  |  Branch (340:23): [True: 841k, False: 77.7k]
  ------------------
  341|   841k|      {
  342|   841k|        if (bands[s].empty)
  ------------------
  |  Branch (342:13): [True: 354k, False: 487k]
  ------------------
  343|   354k|          continue;
  344|       |
  345|   487k|        if (cb_idxs[s].siz.w == 0 || cb_idxs[s].siz.h == 0)
  ------------------
  |  Branch (345:13): [True: 4.32k, False: 482k]
  |  Branch (345:38): [True: 7.12k, False: 475k]
  ------------------
  346|  11.4k|          continue;
  347|       |
  348|   475k|        if (empty_packet) //one bit to check if the packet is empty
  ------------------
  |  Branch (348:13): [True: 347k, False: 128k]
  ------------------
  349|   347k|        {
  350|   347k|          ui32 bit;
  351|   347k|          bb_read_bit(&bb, bit);
  352|   347k|          if (bit == 0) //empty packet
  ------------------
  |  Branch (352:15): [True: 251k, False: 95.4k]
  ------------------
  353|   251k|          { bb_terminate(&bb, uses_eph); data_left = bb.bytes_left; return; }
  354|  95.4k|          empty_packet = false;
  355|  95.4k|        }
  356|       |
  357|   223k|        ui32 num_levels = 1 +
  358|   223k|          ojph_max(log2ceil(cb_idxs[s].siz.w), log2ceil(cb_idxs[s].siz.h));
  ------------------
  |  |   73|   223k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 3.23k, False: 220k]
  |  |  ------------------
  ------------------
  359|       |
  360|       |        //create quad trees for inclusion and missing msbs
  361|   223k|        tag_tree inc_tag, inc_tag_flags, mmsb_tag, mmsb_tag_flags;
  362|   223k|        inc_tag.init(scratch, lev_idx, num_levels, cb_idxs[s].siz, 0);
  363|   223k|        *inc_tag.get(0, 0, num_levels) = 0;
  364|   223k|        inc_tag_flags.init(scratch + tag_tree_size, lev_idx, num_levels,
  365|   223k|          cb_idxs[s].siz, 0);
  366|   223k|        *inc_tag_flags.get(0, 0, num_levels) = 0;
  367|   223k|        mmsb_tag.init(scratch + (tag_tree_size<<1), lev_idx, num_levels,
  368|   223k|          cb_idxs[s].siz, 0);
  369|   223k|        *mmsb_tag.get(0, 0, num_levels) = 0;
  370|   223k|        mmsb_tag_flags.init(scratch + (tag_tree_size<<1) + tag_tree_size,
  371|   223k|          lev_idx, num_levels, cb_idxs[s].siz, 0);
  372|   223k|        *mmsb_tag_flags.get(0, 0, num_levels) = 0;
  373|       |
  374|       |        //
  375|   223k|        ui32 band_width = bands[s].num_blocks.w;
  376|   223k|        ui32 width = cb_idxs[s].siz.w;
  377|   223k|        ui32 height = cb_idxs[s].siz.h;
  378|   425k|        for (ui32 y = 0; y < height; ++y)
  ------------------
  |  Branch (378:26): [True: 222k, False: 203k]
  ------------------
  379|   222k|        {
  380|   222k|          coded_cb_header *cp = bands[s].coded_cbs;
  381|   222k|          cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
  382|   439k|          for (ui32 x = 0; x < width; ++x, ++cp)
  ------------------
  |  Branch (382:28): [True: 237k, False: 202k]
  ------------------
  383|   237k|          {
  384|       |            //process inclusion
  385|   237k|            bool empty_cb = false;
  386|   387k|            for (ui32 cl = num_levels; cl > 0; --cl)
  ------------------
  |  Branch (386:40): [True: 272k, False: 114k]
  ------------------
  387|   272k|            {
  388|   272k|              ui32 cur_lev = cl - 1;
  389|   272k|              empty_cb = *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) == 1;
  390|   272k|              if (empty_cb)
  ------------------
  |  Branch (390:19): [True: 15.6k, False: 257k]
  ------------------
  391|  15.6k|                break;
  392|       |              //check received
  393|   257k|              if (*inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
  ------------------
  |  Branch (393:19): [True: 230k, False: 27.2k]
  ------------------
  394|   230k|              {
  395|   230k|                ui32 bit;
  396|   230k|                if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (396:21): [True: 170, False: 229k]
  ------------------
  397|    170|                { data_left = 0; throw "error reading from file p1"; }
  398|   229k|                empty_cb = (bit == 0);
  399|   229k|                *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)(1 - bit);
  400|   229k|                *inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
  401|   229k|              }
  402|   257k|              if (empty_cb)
  ------------------
  |  Branch (402:19): [True: 107k, False: 149k]
  ------------------
  403|   107k|                break;
  404|   257k|            }
  405|       |
  406|   237k|            if (empty_cb)
  ------------------
  |  Branch (406:17): [True: 122k, False: 114k]
  ------------------
  407|   122k|              continue;
  408|       |
  409|       |            //process missing msbs
  410|   114k|            ui32 mmsbs = 0;
  411|   237k|            for (ui32 levp1 = num_levels; levp1 > 0; --levp1)
  ------------------
  |  Branch (411:43): [True: 122k, False: 114k]
  ------------------
  412|   122k|            {
  413|   122k|              ui32 cur_lev = levp1 - 1;
  414|   122k|              mmsbs = *mmsb_tag.get(x>>levp1, y>>levp1, levp1);
  415|       |              //check received
  416|   122k|              if (*mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
  ------------------
  |  Branch (416:19): [True: 120k, False: 2.43k]
  ------------------
  417|   120k|              {
  418|   120k|                ui32 bit = 0;
  419|   350k|                while (bit == 0)
  ------------------
  |  Branch (419:24): [True: 230k, False: 120k]
  ------------------
  420|   230k|                {
  421|   230k|                  if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (421:23): [True: 101, False: 230k]
  ------------------
  422|    101|                  { data_left = 0; throw "error reading from file p2"; }
  423|   230k|                  mmsbs += 1 - bit;
  424|   230k|                }
  425|   120k|                *mmsb_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)mmsbs;
  426|   120k|                *mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
  427|   120k|              }
  428|   122k|            }
  429|       |
  430|   114k|            if (mmsbs > cp->Kmax)
  ------------------
  |  Branch (430:17): [True: 3.75k, False: 110k]
  ------------------
  431|  3.75k|              throw "error in parsing a tile header; "
  432|  3.75k|              "missing msbs are larger or equal to Kmax. The most likely "
  433|  3.75k|              "cause is a corruption in the bitstream.";
  434|   110k|            cp->missing_msbs = mmsbs;
  435|       |
  436|       |            //get number of passes
  437|   110k|            ui32 bit, num_passes = 1;
  438|   110k|            if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (438:17): [True: 289, False: 110k]
  ------------------
  439|    289|            { data_left = 0; throw "error reading from file p3"; }
  440|   110k|            if (bit)
  ------------------
  |  Branch (440:17): [True: 93.5k, False: 16.7k]
  ------------------
  441|  93.5k|            {
  442|  93.5k|              num_passes = 2;
  443|  93.5k|              if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (443:19): [True: 409, False: 93.1k]
  ------------------
  444|    409|              { data_left = 0; throw "error reading from file p4"; }
  445|  93.1k|              if (bit)
  ------------------
  |  Branch (445:19): [True: 72.6k, False: 20.4k]
  ------------------
  446|  72.6k|              {
  447|  72.6k|                if (bb_read_bits(&bb, 2, bit) == false)
  ------------------
  |  Branch (447:21): [True: 292, False: 72.3k]
  ------------------
  448|    292|                { data_left = 0; throw "error reading from file p5";  }
  449|  72.3k|                num_passes = 3 + bit;
  450|  72.3k|                if (bit == 3)
  ------------------
  |  Branch (450:21): [True: 57.9k, False: 14.4k]
  ------------------
  451|  57.9k|                {
  452|  57.9k|                  if (bb_read_bits(&bb, 5, bit) == false)
  ------------------
  |  Branch (452:23): [True: 388, False: 57.5k]
  ------------------
  453|    388|                  { data_left = 0; throw "error reading from file p6"; }
  454|  57.5k|                  num_passes = 6 + bit;
  455|  57.5k|                  if (bit == 31)
  ------------------
  |  Branch (455:23): [True: 10.9k, False: 46.6k]
  ------------------
  456|  10.9k|                  {
  457|  10.9k|                    if (bb_read_bits(&bb, 7, bit) == false)
  ------------------
  |  Branch (457:25): [True: 262, False: 10.6k]
  ------------------
  458|    262|                    { data_left = 0; throw "error reading from file p7"; }
  459|  10.6k|                    num_passes = 37 + bit;
  460|  10.6k|                  }
  461|  57.5k|                }
  462|  72.3k|              }
  463|  93.1k|            }
  464|   108k|            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|   108k|            ui32 num_phld_passes = (num_passes - 1) / 3;
  476|   108k|            cp->missing_msbs += num_phld_passes;
  477|       |
  478|   108k|            num_phld_passes *= 3;
  479|   108k|            cp->num_passes = num_passes - num_phld_passes;
  480|   108k|            cp->pass_length[0] = cp->pass_length[1] = 0;
  481|       |
  482|   108k|            int Lblock = 3;
  483|   108k|            bit = 1;
  484|  1.00M|            while (bit)
  ------------------
  |  Branch (484:20): [True: 892k, False: 108k]
  ------------------
  485|   892k|            {
  486|       |              // add any extra bits here
  487|   892k|              if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (487:19): [True: 334, False: 891k]
  ------------------
  488|    334|              { data_left = 0; throw "error reading from file p8"; }
  489|   891k|              Lblock += bit;
  490|   891k|            }
  491|       |
  492|   108k|            int bits = Lblock + 31 -
  493|   108k|              (int)count_leading_zeros(num_phld_passes + 1);
  494|   108k|            if (bb_read_bits(&bb, bits, bit) == false)
  ------------------
  |  Branch (494:17): [True: 278, False: 108k]
  ------------------
  495|    278|            { data_left = 0; throw "error reading from file p9"; }
  496|   108k|            if (bit < 2)
  ------------------
  |  Branch (496:17): [True: 8.75k, False: 99.5k]
  ------------------
  497|  8.75k|              throw "The cleanup segment of an HT codeblock cannot contain "
  498|  8.75k|                "less than 2 bytes";
  499|  99.5k|            if (bit >= 65535)
  ------------------
  |  Branch (499:17): [True: 4.25k, False: 95.2k]
  ------------------
  500|  4.25k|              throw "The cleanup segment of an HT codeblock must contain "
  501|  4.25k|                "less than 65535 bytes";
  502|  95.2k|            cp->pass_length[0] = bit;
  503|       |
  504|  95.2k|            if (cp->num_passes > 1)
  ------------------
  |  Branch (504:17): [True: 71.0k, False: 24.2k]
  ------------------
  505|  71.0k|            {
  506|       |              //bits = Lblock + 31 - count_leading_zeros(cp->num_passes - 1);
  507|       |              // The following is simpler than the above, I think?
  508|  71.0k|              bits = Lblock + (cp->num_passes > 2 ? 1 : 0);
  ------------------
  |  Branch (508:32): [True: 36.9k, False: 34.0k]
  ------------------
  509|  71.0k|              if (bb_read_bits(&bb, bits, bit) == false)
  ------------------
  |  Branch (509:19): [True: 223, False: 70.8k]
  ------------------
  510|    223|              { data_left = 0; throw "error reading from file p10"; }
  511|  70.8k|              if (bit >= 2047)
  ------------------
  |  Branch (511:19): [True: 460, False: 70.3k]
  ------------------
  512|    460|                throw "The refinement segment (SigProp and MagRep passes) of "
  513|    460|                  "an HT codeblock must contain less than 2047 bytes";
  514|  70.3k|              cp->pass_length[1] = bit;
  515|  70.3k|            }
  516|  95.2k|          }
  517|   222k|        }
  518|   223k|      }
  519|  77.7k|      if (empty_packet)
  ------------------
  |  Branch (519:11): [True: 691, False: 77.0k]
  ------------------
  520|    691|      { // all subbands are empty
  521|    691|        ui32 bit = 0;
  522|    691|        bb_read_bit(&bb, bit);
  523|       |        //assert(bit == 0);
  524|    691|      }
  525|  77.7k|      bb_terminate(&bb, uses_eph);
  526|       |      //read codeblock data
  527|   338k|      for (int s = 0; s < 4; ++s)
  ------------------
  |  Branch (527:23): [True: 261k, False: 77.7k]
  ------------------
  528|   261k|      {
  529|   261k|        if (bands[s].empty)
  ------------------
  |  Branch (529:13): [True: 73.6k, False: 187k]
  ------------------
  530|  73.6k|          continue;
  531|       |
  532|   187k|        ui32 band_width = bands[s].num_blocks.w;
  533|   187k|        ui32 width = cb_idxs[s].siz.w;
  534|   187k|        ui32 height = cb_idxs[s].siz.h;
  535|   375k|        for (ui32 y = 0; y < height; ++y)
  ------------------
  |  Branch (535:26): [True: 188k, False: 187k]
  ------------------
  536|   188k|        {
  537|   188k|          coded_cb_header *cp = bands[s].coded_cbs;
  538|   188k|          cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
  539|   383k|          for (ui32 x = 0; x < width; ++x, ++cp)
  ------------------
  |  Branch (539:28): [True: 195k, False: 188k]
  ------------------
  540|   195k|          {
  541|   195k|            ui32 num_bytes = cp->pass_length[0] + cp->pass_length[1];
  542|   195k|            if (data_left)
  ------------------
  |  Branch (542:17): [True: 185k, False: 10.0k]
  ------------------
  543|   185k|            {
  544|   185k|              if (num_bytes)
  ------------------
  |  Branch (544:19): [True: 82.1k, False: 102k]
  ------------------
  545|  82.1k|              {
  546|  82.1k|                if (skipped)
  ------------------
  |  Branch (546:21): [True: 4.47k, False: 77.6k]
  ------------------
  547|  4.47k|                { //no need to read
  548|  4.47k|                  si64 cur_loc = file->tell();
  549|  4.47k|                  ui32 t = ojph_min(num_bytes, bb.bytes_left);
  ------------------
  |  |   76|  4.47k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 3.91k, False: 566]
  |  |  ------------------
  ------------------
  550|  4.47k|                  file->seek(t, infile_base::OJPH_SEEK_CUR);
  551|  4.47k|                  ui32 bytes_read = (ui32)(file->tell() - cur_loc);
  552|  4.47k|                  cp->pass_length[0] = cp->pass_length[1] = 0;
  553|  4.47k|                  bb.bytes_left -= bytes_read;
  554|  4.47k|                  assert(bytes_read == t || bb.bytes_left == 0);
  555|  4.47k|                }
  556|  77.6k|                else
  557|  77.6k|                {
  558|  77.6k|                  if (!bb_read_chunk(&bb, num_bytes, cp->next_coded, elastic))
  ------------------
  |  Branch (558:23): [True: 7.18k, False: 70.4k]
  ------------------
  559|  7.18k|                  {
  560|       |                    //no need to decode a broken codeblock
  561|  7.18k|                    cp->pass_length[0] = cp->pass_length[1] = 0;
  562|  7.18k|                    data_left = 0;
  563|  7.18k|                  }
  564|  77.6k|                }
  565|  82.1k|              }
  566|   185k|            }
  567|  10.0k|            else
  568|  10.0k|              cp->pass_length[0] = cp->pass_length[1] = 0;
  569|   195k|          }
  570|   188k|        }
  571|   187k|      }
  572|  77.7k|      data_left = bb.bytes_left;
  573|  77.7k|    }
ojph_precinct.cpp:_ZN4ojph5localL8log2ceilEj:
   88|   649k|    {
   89|   649k|      ui32 t = 31 - count_leading_zeros(x);
   90|   649k|      return t + (x & (x - 1) ? 1 : 0);
  ------------------
  |  Branch (90:19): [True: 1.74k, False: 648k]
  ------------------
   91|   649k|    }
_ZN4ojph5local8tag_tree4initEPhPjjNS_4sizeEi:
   61|   866k|      {
   62|  2.64M|        for (ui32 i = 0; i <= num_levels; ++i) //on extra level
  ------------------
  |  Branch (62:26): [True: 1.77M, False: 866k]
  ------------------
   63|  1.77M|          levs[i] = buf + lev_idx[i];
   64|  12.9M|        for (ui32 i = num_levels + 1; i < 16; ++i)
  ------------------
  |  Branch (64:39): [True: 12.0M, False: 866k]
  ------------------
   65|  12.0M|          levs[i] = (ui8*)INT_MAX; //make it crash on error
   66|   866k|        width = s.w;
   67|   866k|        height = s.h;
   68|  1.77M|        for (ui32 i = 0; i < num_levels; ++i)
  ------------------
  |  Branch (68:26): [True: 909k, False: 866k]
  ------------------
   69|   909k|        {
   70|   909k|          ui32 size = 1u << ((num_levels - 1 - i) << 1);
   71|   909k|          memset(levs[i], init_val, size);
   72|   909k|        }
   73|   866k|        *levs[num_levels] = 0;
   74|   866k|        this->num_levels = num_levels;
   75|   866k|      }
_ZN4ojph5local8tag_tree3getEjjj:
   78|  2.34M|      {
   79|  2.34M|        return levs[lev] + (x + y * ((width + (1 << lev) - 1) >> lev));
   80|  2.34M|      }

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

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

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

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

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

_ZN4ojph5local4tile9pre_allocEPNS0_10codestreamERKNS_4rectES6_Rj:
   58|   143k|    {
   59|   143k|      mem_fixed_allocator* allocator = codestream->get_allocator();
   60|       |
   61|       |      //allocate tiles_comp
   62|   143k|      const param_siz *szp = codestream->get_siz();
   63|   143k|      ui32 num_comps = szp->get_num_components();
   64|   143k|      allocator->pre_alloc_obj<tile_comp>(num_comps);
   65|   143k|      allocator->pre_alloc_obj<rect>(num_comps); //for comp_rects
   66|   143k|      allocator->pre_alloc_obj<rect>(num_comps); //for recon_comp_rects
   67|   143k|      allocator->pre_alloc_obj<ui32>(num_comps); //for line_offsets
   68|   143k|      allocator->pre_alloc_obj<ui32>(num_comps); //for num_bits
   69|   143k|      allocator->pre_alloc_obj<bool>(num_comps); //for is_signed
   70|   143k|      allocator->pre_alloc_obj<bool>(num_comps); //for reversible
   71|   143k|      allocator->pre_alloc_obj<ui8>(num_comps);  //for nlt_type3
   72|   143k|      allocator->pre_alloc_obj<ui32>(num_comps); //for cur_line
   73|       |
   74|   143k|      {
   75|   143k|        ui32 tilepart_div = codestream->get_tilepart_div();
   76|   143k|        ui32 t = tilepart_div & OJPH_TILEPART_MASK;
   77|   143k|        if (t == OJPH_TILEPART_NO_DIVISIONS)
  ------------------
  |  Branch (77:13): [True: 143k, False: 0]
  ------------------
   78|   143k|          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|   143k|        if (num_tileparts > 255)
  ------------------
  |  Branch (98:13): [True: 0, False: 143k]
  ------------------
   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|   143k|            "cannot have more than 255 tile parts.", num_tileparts);
  101|   143k|      }
  102|       |
  103|   143k|      ui32 tx0 = tile_rect.org.x;
  104|   143k|      ui32 ty0 = tile_rect.org.y;
  105|   143k|      ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
  106|   143k|      ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
  107|   143k|      ui32 recon_tx0 = recon_tile_rect.org.x;
  108|   143k|      ui32 recon_ty0 = recon_tile_rect.org.y;
  109|   143k|      ui32 recon_tx1 = recon_tile_rect.org.x + recon_tile_rect.siz.w;
  110|   143k|      ui32 recon_ty1 = recon_tile_rect.org.y + recon_tile_rect.siz.h;
  111|       |
  112|   143k|      ui32 width = 0;
  113|   228k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (113:24): [True: 85.2k, False: 143k]
  ------------------
  114|  85.2k|      {
  115|  85.2k|        point downsamp = szp->get_downsampling(i);
  116|       |
  117|  85.2k|        ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
  ------------------
  |  |   70|  85.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  118|  85.2k|        ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
  ------------------
  |  |   70|  85.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  119|  85.2k|        ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
  ------------------
  |  |   70|  85.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  120|  85.2k|        ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
  ------------------
  |  |   70|  85.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  121|  85.2k|        ui32 recon_tcx0 = ojph_div_ceil(recon_tx0, downsamp.x);
  ------------------
  |  |   70|  85.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  122|  85.2k|        ui32 recon_tcy0 = ojph_div_ceil(recon_ty0, downsamp.y);
  ------------------
  |  |   70|  85.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  123|  85.2k|        ui32 recon_tcx1 = ojph_div_ceil(recon_tx1, downsamp.x);
  ------------------
  |  |   70|  85.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  124|  85.2k|        ui32 recon_tcy1 = ojph_div_ceil(recon_ty1, downsamp.y);
  ------------------
  |  |   70|  85.2k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  125|       |
  126|  85.2k|        rect comp_rect;
  127|  85.2k|        comp_rect.org.x = tcx0;
  128|  85.2k|        comp_rect.org.y = tcy0;
  129|  85.2k|        comp_rect.siz.w = tcx1 - tcx0;
  130|  85.2k|        comp_rect.siz.h = tcy1 - tcy0;
  131|       |
  132|  85.2k|        rect recon_comp_rect;
  133|  85.2k|        recon_comp_rect.org.x = recon_tcx0;
  134|  85.2k|        recon_comp_rect.org.y = recon_tcy0;
  135|  85.2k|        recon_comp_rect.siz.w = recon_tcx1 - recon_tcx0;
  136|  85.2k|        recon_comp_rect.siz.h = recon_tcy1 - recon_tcy0;
  137|       |
  138|  85.2k|        tile_comp::pre_alloc(codestream, i, comp_rect, recon_comp_rect);
  139|  85.2k|        width = ojph_max(width, recon_comp_rect.siz.w);
  ------------------
  |  |   73|  85.2k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 3.01k, False: 82.2k]
  |  |  ------------------
  ------------------
  140|  85.2k|      }
  141|       |
  142|       |      //allocate lines
  143|   143k|      const param_cod* cdp = codestream->get_cod();
  144|   143k|      if (cdp->is_employing_color_transform())
  ------------------
  |  Branch (144:11): [True: 2.76k, False: 140k]
  ------------------
  145|  2.76k|      {
  146|  2.76k|        bool reversible[3];
  147|  11.0k|        for (ui32 i = 0; i < 3; ++i)
  ------------------
  |  Branch (147:26): [True: 8.29k, False: 2.76k]
  ------------------
  148|  8.29k|          reversible[i] = codestream->get_coc(i)->is_reversible();
  149|  2.76k|        if (reversible[0] != reversible[1] || reversible[1] != reversible[2])
  ------------------
  |  Branch (149:13): [True: 9, False: 2.75k]
  |  Branch (149:47): [True: 0, False: 2.75k]
  ------------------
  150|      9|          OJPH_ERROR(0x000300A2, "When the colour transform is employed. "
  ------------------
  |  |  289|     54|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (289:52): [True: 8, False: 1]
  |  |  |  Branch (289:52): [True: 1, False: 8]
  |  |  |  Branch (289:52): [True: 1, False: 8]
  |  |  ------------------
  ------------------
  151|  2.76k|            "all colour components must undergo either reversible or "
  152|  2.76k|            "irreversible wavelet transform; if not, then it is not clear "
  153|  2.76k|            "what colour transform should be used (reversible or "
  154|  2.76k|            "irreversible).  Here we found that the first three colour "
  155|  2.76k|            "components uses %s, %s, and %s transforms, respectively.",
  156|  2.76k|            reversible[0] ? "reversible" : "irreversible",
  157|  2.76k|            reversible[1] ? "reversible" : "irreversible",
  158|  2.76k|            reversible[2] ? "reversible" : "irreversible");
  159|       |
  160|  2.76k|        allocator->pre_alloc_obj<line_buf>(3);
  161|  2.76k|        if (reversible[0])
  ------------------
  |  Branch (161:13): [True: 337, False: 2.42k]
  ------------------
  162|  1.34k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (162:27): [True: 1.01k, False: 337]
  ------------------
  163|  1.01k|            allocator->pre_alloc_data<si32>(width, 0);
  164|  2.42k|        else
  165|  9.68k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (165:27): [True: 7.25k, False: 2.42k]
  ------------------
  166|  7.25k|            allocator->pre_alloc_data<float>(width, 0);
  167|  2.76k|      }
  168|   143k|    }
_ZN4ojph5local4tile14finalize_allocEPNS0_10codestreamERKNS_4rectEjRjS7_:
  174|   141k|    {
  175|       |      //this->parent = codestream;
  176|   141k|      mem_fixed_allocator* allocator = codestream->get_allocator();
  177|       |
  178|   141k|      sot.init(0, (ui16)tile_idx, 0, 1);
  179|   141k|      prog_order = codestream->access_cod().get_progression_order();
  180|       |
  181|       |      //allocate tiles_comp
  182|   141k|      const param_siz *szp = codestream->get_siz();
  183|   141k|      const param_nlt *nlp = codestream->get_nlt();
  184|       |
  185|   141k|      this->num_bytes = 0;
  186|   141k|      num_comps = szp->get_num_components();
  187|   141k|      skipped_res_for_read = codestream->get_skipped_res_for_read();
  188|   141k|      comps = allocator->post_alloc_obj<tile_comp>(num_comps);
  189|   141k|      comp_rects = allocator->post_alloc_obj<rect>(num_comps);
  190|   141k|      recon_comp_rects = allocator->post_alloc_obj<rect>(num_comps);
  191|   141k|      line_offsets = allocator->post_alloc_obj<ui32>(num_comps);
  192|   141k|      num_bits = allocator->post_alloc_obj<ui32>(num_comps);
  193|   141k|      is_signed = allocator->post_alloc_obj<bool>(num_comps);
  194|   141k|      reversible = allocator->post_alloc_obj<bool>(num_comps);
  195|   141k|      nlt_type3 = allocator->post_alloc_obj<ui8>(num_comps);
  196|   141k|      cur_line = allocator->post_alloc_obj<ui32>(num_comps);
  197|       |
  198|   141k|      profile = codestream->get_profile();
  199|   141k|      tilepart_div = codestream->get_tilepart_div();
  200|   141k|      need_tlm = codestream->is_tlm_needed();
  201|   141k|      {
  202|   141k|        ui32 tilepart_div = codestream->get_tilepart_div();
  203|   141k|        ui32 t = tilepart_div & OJPH_TILEPART_MASK;
  204|   141k|        if (t == OJPH_TILEPART_NO_DIVISIONS)
  ------------------
  |  Branch (204:13): [True: 141k, False: 0]
  ------------------
  205|   141k|          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|   141k|        if (num_tileparts > 255)
  ------------------
  |  Branch (225:13): [True: 0, False: 141k]
  ------------------
  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|   141k|          "cannot have more than 255 tile parts.", num_tileparts);
  228|   141k|      }
  229|       |
  230|   141k|      this->resilient = codestream->is_resilient();
  231|   141k|      this->tile_rect = tile_rect;
  232|       |
  233|   141k|      ui32 tx0 = tile_rect.org.x;
  234|   141k|      ui32 ty0 = tile_rect.org.y;
  235|   141k|      ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
  236|   141k|      ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
  237|       |
  238|   141k|      ui32 width = 0;
  239|   222k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (239:24): [True: 81.0k, False: 141k]
  ------------------
  240|  81.0k|      {
  241|  81.0k|        ui8 bd; bool is; // used for nlt_type3
  242|       |
  243|  81.0k|        point downsamp = szp->get_downsampling(i);
  244|  81.0k|        point recon_downsamp = szp->get_recon_downsampling(i);
  245|       |
  246|  81.0k|        ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
  ------------------
  |  |   70|  81.0k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  247|  81.0k|        ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
  ------------------
  |  |   70|  81.0k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  248|  81.0k|        ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
  ------------------
  |  |   70|  81.0k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  249|  81.0k|        ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
  ------------------
  |  |   70|  81.0k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  250|  81.0k|        ui32 recon_tcx0 = ojph_div_ceil(tx0, recon_downsamp.x);
  ------------------
  |  |   70|  81.0k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  251|  81.0k|        ui32 recon_tcy0 = ojph_div_ceil(ty0, recon_downsamp.y);
  ------------------
  |  |   70|  81.0k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  252|  81.0k|        ui32 recon_tcx1 = ojph_div_ceil(tx1, recon_downsamp.x);
  ------------------
  |  |   70|  81.0k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  253|  81.0k|        ui32 recon_tcy1 = ojph_div_ceil(ty1, recon_downsamp.y);
  ------------------
  |  |   70|  81.0k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  254|       |
  255|  81.0k|        line_offsets[i] =
  256|  81.0k|          recon_tcx0 - ojph_div_ceil(tx0 - offset, recon_downsamp.x);
  ------------------
  |  |   70|  81.0k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  257|  81.0k|        comp_rects[i].org.x = tcx0;
  258|  81.0k|        comp_rects[i].org.y = tcy0;
  259|  81.0k|        comp_rects[i].siz.w = tcx1 - tcx0;
  260|  81.0k|        comp_rects[i].siz.h = tcy1 - tcy0;
  261|  81.0k|        recon_comp_rects[i].org.x = recon_tcx0;
  262|  81.0k|        recon_comp_rects[i].org.y = recon_tcy0;
  263|  81.0k|        recon_comp_rects[i].siz.w = recon_tcx1 - recon_tcx0;
  264|  81.0k|        recon_comp_rects[i].siz.h = recon_tcy1 - recon_tcy0;
  265|       |
  266|  81.0k|        comps[i].finalize_alloc(codestream, this, i, comp_rects[i],
  267|  81.0k|          recon_comp_rects[i]);
  268|  81.0k|        width = ojph_max(width, recon_comp_rects[i].siz.w);
  ------------------
  |  |   73|  81.0k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.73k, False: 79.2k]
  |  |  ------------------
  ------------------
  269|       |
  270|  81.0k|        num_bits[i] = szp->get_bit_depth(i);
  271|  81.0k|        is_signed[i] = szp->is_signed(i);
  272|  81.0k|        bool result = nlp->get_nonlinear_transform(i, bd, is, nlt_type3[i]);
  273|  81.0k|        if (result == true && (bd != num_bits[i] || is != is_signed[i]))
  ------------------
  |  Branch (273:13): [True: 19, False: 80.9k]
  |  Branch (273:32): [True: 0, False: 19]
  |  Branch (273:53): [True: 0, False: 19]
  ------------------
  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|  81.0k|            "is_signed = %s) from SIZ marker segment, and BDnlt "
  276|  81.0k|            "(bit_depth = %d, is_signed = %s) from NLT marker segment, "
  277|  81.0k|            "for component %d", i, num_bits[i],
  278|  81.0k|            is_signed[i] ? "True" : "False", bd, is ? "True" : "False");
  279|  81.0k|        if (result == false)
  ------------------
  |  Branch (279:13): [True: 80.8k, False: 138]
  ------------------
  280|  80.8k|          nlt_type3[i] = param_nlt::nonlinearity::OJPH_NLT_NO_NLT;
  281|  81.0k|        cur_line[i] = 0;
  282|  81.0k|        reversible[i] = codestream->get_coc(i)->is_reversible();
  283|  81.0k|      }
  284|       |
  285|   141k|      offset += tile_rect.siz.w;
  286|       |
  287|       |      //allocate lines
  288|   141k|      const param_cod* cdp = codestream->get_cod();
  289|   141k|      this->employ_color_transform = cdp->is_employing_color_transform();
  290|   141k|      if (this->employ_color_transform)
  ------------------
  |  Branch (290:11): [True: 1.33k, False: 140k]
  ------------------
  291|  1.33k|      {
  292|  1.33k|        num_lines = 3;
  293|  1.33k|        lines = allocator->post_alloc_obj<line_buf>(num_lines);
  294|  1.33k|        if (reversible[0])
  ------------------
  |  Branch (294:13): [True: 346, False: 990]
  ------------------
  295|  1.38k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (295:27): [True: 1.03k, False: 346]
  ------------------
  296|  1.03k|            lines[i].wrap(
  297|  1.03k|              allocator->post_alloc_data<si32>(width, 0), width, 0);
  298|    990|        else
  299|  3.96k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (299:27): [True: 2.97k, False: 990]
  ------------------
  300|  2.97k|            lines[i].wrap(
  301|  2.97k|              allocator->post_alloc_data<float>(width, 0), width, 0);
  302|  1.33k|      }
  303|   140k|      else
  304|   140k|      {
  305|       |        lines = NULL;
  306|   140k|        num_lines = 0;
  307|   140k|      }
  308|   141k|      next_tile_part = 0;
  309|   141k|    }
_ZN4ojph5local4tile4pullEPNS_8line_bufEj:
  406|  1.66M|    {
  407|  1.66M|      constexpr ui8 type3 =
  408|  1.66M|        param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
  409|       |
  410|  1.66M|      assert(comp_num < num_comps);
  411|  1.66M|      if (cur_line[comp_num] >= recon_comp_rects[comp_num].siz.h)
  ------------------
  |  Branch (411:11): [True: 69.9k, False: 1.59M]
  ------------------
  412|  69.9k|        return false;
  413|       |
  414|  1.59M|      cur_line[comp_num]++;
  415|       |
  416|  1.59M|      ui32 comp_width = recon_comp_rects[comp_num].siz.w;
  417|  1.59M|      if (comp_width == 0)
  ------------------
  |  Branch (417:11): [True: 22.6k, False: 1.57M]
  ------------------
  418|  22.6k|        return true; // nothing to pull, but not an error
  419|       |
  420|  1.57M|      if (!employ_color_transform || num_comps == 1)
  ------------------
  |  Branch (420:11): [True: 1.50M, False: 67.0k]
  |  Branch (420:38): [True: 51.9k, False: 15.0k]
  ------------------
  421|  1.56M|      {
  422|  1.56M|        line_buf *src_line = comps[comp_num].pull_line();
  423|  1.56M|        if (reversible[comp_num])
  ------------------
  |  Branch (423:13): [True: 1.33M, False: 221k]
  ------------------
  424|  1.33M|        {
  425|  1.33M|          si64 shift = (si64)1 << (num_bits[comp_num] - 1);
  426|  1.33M|          if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (426:15): [True: 5.81k, False: 1.33M]
  |  Branch (426:38): [True: 0, False: 5.81k]
  ------------------
  427|      0|            rev_convert_nlt_type3(src_line, 0, tgt_line,
  428|      0|              line_offsets[comp_num], shift + 1, comp_width);
  429|  1.33M|          else {
  430|  1.33M|            shift = is_signed[comp_num] ? 0 : shift;
  ------------------
  |  Branch (430:21): [True: 5.81k, False: 1.33M]
  ------------------
  431|  1.33M|            rev_convert(src_line, 0, tgt_line,
  432|  1.33M|              line_offsets[comp_num], shift, comp_width);
  433|  1.33M|          }
  434|  1.33M|        }
  435|   221k|        else
  436|   221k|        {
  437|   221k|          if (nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (437:15): [True: 823, False: 220k]
  ------------------
  438|    823|            irv_convert_to_integer_nlt_type3(src_line, tgt_line,
  439|    823|              line_offsets[comp_num], num_bits[comp_num],
  440|    823|              is_signed[comp_num], comp_width);
  441|   220k|          else
  442|   220k|            irv_convert_to_integer(src_line, tgt_line,
  443|   220k|              line_offsets[comp_num], num_bits[comp_num],
  444|   220k|              is_signed[comp_num], comp_width);
  445|   221k|        }
  446|  1.56M|      }
  447|  15.0k|      else
  448|  15.0k|      {
  449|  15.0k|        assert(num_comps >= 3);
  450|  15.0k|        if (comp_num == 0)
  ------------------
  |  Branch (450:13): [True: 2.07k, False: 12.9k]
  ------------------
  451|  2.07k|        {
  452|  2.07k|          if (reversible[comp_num])
  ------------------
  |  Branch (452:15): [True: 973, False: 1.10k]
  ------------------
  453|    973|            rct_backward(comps[0].pull_line(), comps[1].pull_line(),
  454|    973|              comps[2].pull_line(), lines + 0, lines + 1,
  455|    973|              lines + 2, comp_width);
  456|  1.10k|          else
  457|  1.10k|            ict_backward(comps[0].pull_line()->f32, comps[1].pull_line()->f32,
  458|  1.10k|              comps[2].pull_line()->f32, lines[0].f32, lines[1].f32,
  459|  1.10k|              lines[2].f32, comp_width);
  460|  2.07k|        }
  461|  15.0k|        if (reversible[comp_num])
  ------------------
  |  Branch (461:13): [True: 8.92k, False: 6.14k]
  ------------------
  462|  8.92k|        {
  463|  8.92k|          si64 shift = (si64)1 << (num_bits[comp_num] - 1);
  464|  8.92k|          line_buf* src_line;
  465|  8.92k|          if (comp_num < 3)
  ------------------
  |  Branch (465:15): [True: 8.92k, False: 0]
  ------------------
  466|  8.92k|            src_line = lines + comp_num;
  467|      0|          else
  468|      0|            src_line = comps[comp_num].pull_line();
  469|  8.92k|          if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (469:15): [True: 3.06k, False: 5.86k]
  |  Branch (469:38): [True: 0, False: 3.06k]
  ------------------
  470|      0|            rev_convert_nlt_type3(src_line, 0, tgt_line,
  471|      0|              line_offsets[comp_num], shift + 1, comp_width);
  472|  8.92k|          else {
  473|  8.92k|            shift = is_signed[comp_num] ? 0 : shift;
  ------------------
  |  Branch (473:21): [True: 3.06k, False: 5.86k]
  ------------------
  474|  8.92k|            rev_convert(src_line, 0, tgt_line,
  475|  8.92k|              line_offsets[comp_num], shift, comp_width);
  476|  8.92k|          }
  477|  8.92k|        }
  478|  6.14k|        else
  479|  6.14k|        {
  480|  6.14k|          line_buf* lbp;
  481|  6.14k|          if (comp_num < 3)
  ------------------
  |  Branch (481:15): [True: 6.14k, False: 0]
  ------------------
  482|  6.14k|            lbp = lines + comp_num;
  483|      0|          else
  484|      0|            lbp = comps[comp_num].pull_line();
  485|  6.14k|          if (nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (485:15): [True: 0, False: 6.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|  6.14k|          else
  490|  6.14k|            irv_convert_to_integer(lbp, tgt_line,
  491|  6.14k|              line_offsets[comp_num], num_bits[comp_num],
  492|  6.14k|              is_signed[comp_num], comp_width);
  493|  6.14k|        }
  494|  15.0k|      }
  495|       |
  496|  1.57M|      return true;
  497|  1.59M|    }
_ZN4ojph5local4tile17parse_tile_headerERKNS0_9param_sotEPNS_11infile_baseERKm:
  759|  50.7k|    {
  760|  50.7k|      if (sot.get_tile_part_index() != next_tile_part)
  ------------------
  |  Branch (760:11): [True: 49.1k, False: 1.58k]
  ------------------
  761|  49.1k|      {
  762|  49.1k|        if (resilient)
  ------------------
  |  Branch (762:13): [True: 49.1k, False: 4]
  ------------------
  763|  49.1k|          OJPH_INFO(0x00030091, "wrong tile part index")
  ------------------
  |  |  285|  49.1k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  49.1k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 49.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  764|      4|        else
  765|      4|          OJPH_ERROR(0x00030091, "wrong tile part index")
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  766|  49.1k|      }
  767|  50.7k|      ++next_tile_part;
  768|       |
  769|       |      //tile_end_location used on failure
  770|  50.7k|      ui64 tile_end_location = tile_start_location + sot.get_payload_length();
  771|       |
  772|  50.7k|      ui32 data_left = sot.get_payload_length(); //bytes left to parse
  773|  50.7k|      data_left -= (ui32)((ui64)file->tell() - tile_start_location);
  774|       |
  775|  50.7k|      if (data_left == 0)
  ------------------
  |  Branch (775:11): [True: 91, False: 50.6k]
  ------------------
  776|     91|        return;
  777|       |
  778|  50.6k|      ui32 max_decompositions = 0;
  779|   106k|      for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (779:24): [True: 55.4k, False: 50.6k]
  ------------------
  780|  55.4k|        max_decompositions = ojph_max(max_decompositions,
  ------------------
  |  |   73|   106k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 239, False: 55.2k]
  |  |  ------------------
  ------------------
  781|  50.6k|          comps[c].get_num_decompositions());
  782|       |
  783|  50.6k|      try
  784|  50.6k|      {
  785|       |        //sequence the reading of precincts according to progression order
  786|  50.6k|        if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
  ------------------
  |  Branch (786:13): [True: 6.82k, False: 43.8k]
  |  Branch (786:43): [True: 3.66k, False: 40.1k]
  ------------------
  787|  10.4k|        {
  788|  10.4k|          max_decompositions -= skipped_res_for_read;
  789|  8.58G|          for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (789:28): [True: 8.58G, False: 10.4k]
  ------------------
  790|  8.59G|            for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (790:30): [True: 58.4k, False: 8.58G]
  ------------------
  791|  58.4k|              if (data_left > 0)
  ------------------
  |  Branch (791:19): [True: 56.6k, False: 1.83k]
  ------------------
  792|  56.6k|                comps[c].parse_precincts(r, data_left, file);
  793|  10.4k|        }
  794|  40.1k|        else if (prog_order == OJPH_PO_RPCL)
  ------------------
  |  Branch (794:18): [True: 9.44k, False: 30.7k]
  ------------------
  795|  9.44k|        {
  796|  9.44k|          max_decompositions -= skipped_res_for_read;
  797|  52.4k|          for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (797:28): [True: 42.9k, False: 9.44k]
  ------------------
  798|  42.9k|          {
  799|   126k|            while (true)
  ------------------
  |  Branch (799:20): [True: 117k, Folded]
  ------------------
  800|   117k|            {
  801|   117k|              bool found = false;
  802|   117k|              ui32 comp_num = 0;
  803|   117k|              point smallest(INT_MAX, INT_MAX), cur;
  804|   247k|              for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (804:32): [True: 129k, False: 117k]
  ------------------
  805|   129k|              {
  806|   129k|                if (!comps[c].get_top_left_precinct(r, cur))
  ------------------
  |  Branch (806:21): [True: 39.3k, False: 89.7k]
  ------------------
  807|  39.3k|                  continue;
  808|  89.7k|                else
  809|  89.7k|                  found = true;
  810|       |
  811|  89.7k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (811:21): [True: 84.2k, False: 5.49k]
  ------------------
  812|  84.2k|                { smallest = cur; comp_num = c; }
  813|  5.49k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (813:26): [True: 4.21k, False: 1.27k]
  |  Branch (813:49): [True: 2.22k, False: 1.99k]
  ------------------
  814|  2.22k|                { smallest = cur; comp_num = c; }
  815|  89.7k|              }
  816|   117k|              if (found == true && data_left > 0)
  ------------------
  |  Branch (816:19): [True: 83.4k, False: 34.5k]
  |  Branch (816:36): [True: 83.0k, False: 417]
  ------------------
  817|  83.0k|                comps[comp_num].parse_one_precinct(r, data_left, file);
  818|  34.9k|              else
  819|  34.9k|                break;
  820|   117k|            }
  821|  42.9k|          }
  822|  9.44k|        }
  823|  30.7k|        else if (prog_order == OJPH_PO_PCRL)
  ------------------
  |  Branch (823:18): [True: 17.2k, False: 13.5k]
  ------------------
  824|  17.2k|        {
  825|   120k|          while (true)
  ------------------
  |  Branch (825:18): [True: 112k, Folded]
  ------------------
  826|   112k|          {
  827|   112k|            bool found = false;
  828|   112k|            ui32 comp_num = 0;
  829|   112k|            ui32 res_num = 0;
  830|   112k|            point smallest(INT_MAX, INT_MAX), cur;
  831|   243k|            for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (831:30): [True: 131k, False: 112k]
  ------------------
  832|   131k|            {
  833|   917k|              for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
  ------------------
  |  Branch (833:32): [True: 786k, False: 131k]
  ------------------
  834|   786k|              {
  835|   786k|                if (!comps[c].get_top_left_precinct(r, cur))
  ------------------
  |  Branch (835:21): [True: 265k, False: 520k]
  ------------------
  836|   265k|                  continue;
  837|   520k|                else
  838|   520k|                  found = true;
  839|       |
  840|   520k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (840:21): [True: 270k, False: 249k]
  ------------------
  841|   270k|                { smallest = cur; comp_num = c; res_num = r; }
  842|   249k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (842:26): [True: 227k, False: 22.3k]
  |  Branch (842:49): [True: 85.2k, False: 142k]
  ------------------
  843|  85.2k|                { smallest = cur; comp_num = c; res_num = r; }
  844|   164k|                else if (cur.y == smallest.y && cur.x == smallest.x &&
  ------------------
  |  Branch (844:26): [True: 142k, False: 22.3k]
  |  Branch (844:49): [True: 133k, False: 9.06k]
  ------------------
  845|   133k|                         c < comp_num)
  ------------------
  |  Branch (845:26): [True: 0, False: 133k]
  ------------------
  846|      0|                { smallest = cur; comp_num = c; res_num = r; }
  847|   164k|                else if (cur.y == smallest.y && cur.x == smallest.x &&
  ------------------
  |  Branch (847:26): [True: 142k, False: 22.3k]
  |  Branch (847:49): [True: 133k, False: 9.06k]
  ------------------
  848|   133k|                         c == comp_num && r < res_num)
  ------------------
  |  Branch (848:26): [True: 124k, False: 9.16k]
  |  Branch (848:43): [True: 0, False: 124k]
  ------------------
  849|      0|                { smallest = cur; comp_num = c; res_num = r; }
  850|   520k|              }
  851|   131k|            }
  852|   112k|            if (found == true && data_left > 0)
  ------------------
  |  Branch (852:17): [True: 103k, False: 9.07k]
  |  Branch (852:34): [True: 103k, False: 267]
  ------------------
  853|   103k|              comps[comp_num].parse_one_precinct(res_num, data_left, file);
  854|  9.34k|            else
  855|  9.34k|              break;
  856|   112k|          }
  857|  17.2k|        }
  858|  13.5k|        else if (prog_order == OJPH_PO_CPRL)
  ------------------
  |  Branch (858:18): [True: 13.2k, False: 220]
  ------------------
  859|  13.2k|        {
  860|  27.4k|          for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (860:28): [True: 14.1k, False: 13.2k]
  ------------------
  861|  14.1k|          {
  862|   105k|            while (true)
  ------------------
  |  Branch (862:20): [True: 94.4k, Folded]
  ------------------
  863|  94.4k|            {
  864|  94.4k|              bool found = false;
  865|  94.4k|              ui32 res_num = 0;
  866|  94.4k|              point smallest(INT_MAX, INT_MAX), cur;
  867|   666k|              for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (867:32): [True: 571k, False: 94.4k]
  ------------------
  868|   571k|              {
  869|   571k|                if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
  ------------------
  |  Branch (869:21): [True: 116k, False: 455k]
  ------------------
  870|   116k|                  continue;
  871|   455k|                else
  872|   455k|                  found = true;
  873|       |
  874|   455k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (874:21): [True: 222k, False: 232k]
  ------------------
  875|   222k|                { smallest = cur; res_num = r; }
  876|   232k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (876:26): [True: 202k, False: 29.5k]
  |  Branch (876:49): [True: 50.3k, False: 152k]
  ------------------
  877|  50.3k|                { smallest = cur; res_num = r; }
  878|   455k|              }
  879|  94.4k|              if (found == true && data_left > 0)
  ------------------
  |  Branch (879:19): [True: 92.1k, False: 2.29k]
  |  Branch (879:36): [True: 91.4k, False: 674]
  ------------------
  880|  91.4k|                comps[c].parse_one_precinct(res_num, data_left, file);
  881|  2.97k|              else
  882|  2.97k|                break;
  883|  94.4k|            }
  884|  14.1k|          }
  885|  13.2k|        }
  886|    220|        else
  887|  13.5k|          assert(0);
  888|       |
  889|  50.6k|      }
  890|  50.6k|      catch (const char *error)
  891|  50.6k|      {
  892|  34.9k|        if (resilient)
  ------------------
  |  Branch (892:13): [True: 34.9k, False: 1]
  ------------------
  893|  34.9k|          OJPH_INFO(0x00030092, "%s", error)
  ------------------
  |  |  285|  34.9k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  34.9k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 34.9k, 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|  34.9k|      }
  897|  50.6k|      file->seek((si64)tile_end_location, infile_base::OJPH_SEEK_SET);
  898|  50.6k|    }

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

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

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

_ZN4ojph5local23ojph_decode_codeblock64EPhPmjjjjjjjb:
  771|  36.1k|    {
  772|       |      // static bool insufficient_precision = false;
  773|       |      // static bool modify_code = false;
  774|       |      // static bool truncate_spp_mrp = false;
  775|       |
  776|  36.1k|      if (num_passes > 1 && lengths2 == 0)
  ------------------
  |  Branch (776:11): [True: 27.8k, False: 8.30k]
  |  Branch (776:29): [True: 5.07k, False: 22.7k]
  ------------------
  777|  5.07k|      {
  778|  5.07k|        OJPH_WARN(0x00010001, "A malformed codeblock that has more than "
  ------------------
  |  |  287|  5.07k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  5.07k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5.07k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  779|  5.07k|                              "one coding pass, but zero length for "
  780|  5.07k|                              "2nd and potential 3rd pass.");
  781|  5.07k|        num_passes = 1;
  782|  5.07k|      }
  783|       |
  784|  36.1k|      if (num_passes > 3)
  ------------------
  |  Branch (784:11): [True: 0, False: 36.1k]
  ------------------
  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|  36.1k|      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|  36.1k|      if (lengths1 < 2)
  ------------------
  |  Branch (831:11): [True: 0, False: 36.1k]
  ------------------
  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|  36.1k|      int lcup, scup;
  839|  36.1k|      lcup = (int)lengths1;  // length of CUP
  840|       |      //scup is the length of MEL + VLC
  841|  36.1k|      scup = (((int)coded_data[lcup-1]) << 4) + (coded_data[lcup-2] & 0xF);
  842|  36.1k|      if (scup < 2 || scup > lcup || scup > 4079) //something is wrong
  ------------------
  |  Branch (842:11): [True: 5.01k, False: 31.0k]
  |  Branch (842:23): [True: 13.0k, False: 18.0k]
  |  Branch (842:38): [True: 229, False: 17.8k]
  ------------------
  843|  18.2k|        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|  17.8k|      ui16 scratch[8 * 513] = {0};       // 8 kB
  861|       |
  862|       |      // We need an extra two entries (one inf and one u_q) beyond
  863|       |      // the last column. 
  864|       |      // If the block width is 4 (2 quads), then we use sstr of 8 
  865|       |      // (enough for 4 quads). If width is 8 (4 quads) we use 
  866|       |      // sstr is 16 (enough for 8 quads). For a width of 16 (8 
  867|       |      // quads), we use 24 (enough for 12 quads).
  868|  17.8k|      ui32 sstr = ((width + 2u) + 7u) & ~7u; // multiples of 8
  869|       |
  870|  17.8k|      ui32 mmsbp2 = missing_msbs + 2;
  871|       |
  872|       |      // The cleanup pass is decoded in two steps; in step one,
  873|       |      // the VLC and MEL segments are decoded, generating a record that 
  874|       |      // has 2 bytes per quad. The 2 bytes contain, u, rho, e^1 & e^k.
  875|       |      // This information should be sufficient for the next step.
  876|       |      // In step 2, we decode the MagSgn segment.
  877|       |
  878|       |      // step 1 decoding VLC and MEL segments
  879|  17.8k|      {
  880|       |        // init structures
  881|  17.8k|        dec_mel_st mel;
  882|  17.8k|        mel_init(&mel, coded_data, lcup, scup);
  883|  17.8k|        rev_struct vlc;
  884|  17.8k|        rev_init8(&vlc, coded_data, lcup, scup);
  885|       |
  886|  17.8k|        int run = mel_get_run(&mel); // decode runs of events from MEL bitstrm
  887|       |                                     // data represented as runs of 0 events
  888|       |                                     // See mel_decode description
  889|       |
  890|  17.8k|        ui64 vlc_val;
  891|  17.8k|        ui32 c_q = 0;
  892|  17.8k|        ui16 *sp = scratch;
  893|       |        //initial quad row
  894|  89.3k|        for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (894:26): [True: 71.5k, False: 17.8k]
  ------------------
  895|  71.5k|        {
  896|       |          // decode VLC
  897|       |          /////////////
  898|       |
  899|       |          // first quad
  900|  71.5k|          vlc_val = rev_fetch64(&vlc);
  901|       |
  902|       |          //decode VLC using the context c_q and the head of VLC bitstream
  903|  71.5k|          ui16 t0 = vlc_tbl0[ c_q + (vlc_val & 0x7F) ];
  904|       |
  905|       |          // if context is zero, use one MEL event
  906|  71.5k|          if (c_q == 0) //zero context
  ------------------
  |  Branch (906:15): [True: 42.7k, False: 28.8k]
  ------------------
  907|  42.7k|          {
  908|  42.7k|            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|  42.7k|            t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (913:18): [True: 26.1k, False: 16.5k]
  ------------------
  914|       |
  915|       |            // is run -1 or -2? this means a run has been consumed
  916|  42.7k|            if (run < 0) 
  ------------------
  |  Branch (916:17): [True: 39.9k, False: 2.77k]
  ------------------
  917|  39.9k|              run = mel_get_run(&mel);  // get another run
  918|  42.7k|          }
  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|  71.5k|          sp[0] = t0;
  924|  71.5k|          x += 2;
  925|       |
  926|       |          // prepare context for the next quad; eqn. 1 in ITU T.814
  927|  71.5k|          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|  71.5k|          vlc_val = rev_advance64(&vlc, t0 & 0x7);
  931|       |
  932|       |          //second quad
  933|  71.5k|          ui16 t1 = 0;
  934|       |
  935|       |          //decode VLC using the context c_q and the head of VLC bitstream
  936|  71.5k|          t1 = vlc_tbl0[c_q + (vlc_val & 0x7F)]; 
  937|       |
  938|       |          // if context is zero, use one MEL event
  939|  71.5k|          if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (939:15): [True: 22.9k, False: 48.5k]
  |  Branch (939:27): [True: 19.9k, False: 2.97k]
  ------------------
  940|  19.9k|          {
  941|  19.9k|            run -= 2; //subtract 2, since events number if multiplied by 2
  942|       |
  943|       |            // if event is 0, discard decoded t1
  944|  19.9k|            t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (944:18): [True: 6.60k, False: 13.3k]
  ------------------
  945|       |
  946|  19.9k|            if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (946:17): [True: 11.7k, False: 8.25k]
  ------------------
  947|  11.7k|              run = mel_get_run(&mel); // if yes, then get another run
  948|  19.9k|          }
  949|  71.5k|          t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (949:16): [True: 60.0k, False: 11.5k]
  ------------------
  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|  71.5k|          sp[2] = t1;
  955|  71.5k|          x += 2;
  956|       |
  957|       |          //prepare context for the next quad, eqn. 1 in ITU T.814
  958|  71.5k|          c_q = ((t1 & 0x10U) << 3) | ((t1 & 0xE0U) << 2);
  959|       |
  960|       |          //remove data from vlc stream, if qinf is not used, cwdlen is 0
  961|  71.5k|          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|  71.5k|          ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
  967|  71.5k|          if (uvlc_mode == 0xc0)// if both u_offset are set, get an event from
  ------------------
  |  Branch (967:15): [True: 18.9k, False: 52.6k]
  ------------------
  968|  18.9k|          {                     // the MEL run of events
  969|  18.9k|            run -= 2; //subtract 2, since events number if multiplied by 2
  970|       |
  971|  18.9k|            uvlc_mode += (run == -1) ? 0x40 : 0; // increment uvlc_mode by
  ------------------
  |  Branch (971:26): [True: 9.42k, False: 9.48k]
  ------------------
  972|       |                                                 // is 0x40
  973|       |
  974|  18.9k|            if (run < 0)//if run is consumed (run is -1 or -2), get another run
  ------------------
  |  Branch (974:17): [True: 16.3k, False: 2.58k]
  ------------------
  975|  16.3k|              run = mel_get_run(&mel);
  976|  18.9k|          }
  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|  71.5k|          ui32 idx = uvlc_mode + (ui32)(vlc_val & 0x3F);
  984|  71.5k|          ui32 uvlc_entry = uvlc_tbl0[idx];
  985|  71.5k|          ui16 u_bias = uvlc_bias[idx];          
  986|       |          //remove total prefix length
  987|  71.5k|          vlc_val = rev_advance64(&vlc, uvlc_entry & 0x7); 
  988|  71.5k|          uvlc_entry >>= 3; 
  989|       |          //extract suffixes for quad 0 and 1
  990|  71.5k|          ui32 len = uvlc_entry & 0xF;             // suffix length for 2 quads
  991|  71.5k|          ui32 tmp = (ui32)(vlc_val&((1<<len)-1)); // suffix value for 2 quads
  992|  71.5k|          vlc_val = rev_advance64(&vlc, len);
  993|  71.5k|          uvlc_entry >>= 4;
  994|       |          // quad 0 length
  995|  71.5k|          len = uvlc_entry & 0x7; // quad 0 suffix length
  996|  71.5k|          uvlc_entry >>= 3;
  997|  71.5k|          ui16 u_q0 = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
  998|  71.5k|          ui16 u_q1 = (ui16)((uvlc_entry >> 3) + (tmp >> len));
  999|       |
 1000|       |          // decode u_q extensions, which is needed only when u_q > 32
 1001|  71.5k|          ui16 u_ext; bool cond0, cond1;
 1002|  71.5k|          cond0 = u_q0 - (u_bias & 0x3) > 32;
 1003|  71.5k|          u_ext = (ui16)(cond0 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1003:26): [True: 67, False: 71.4k]
  ------------------
 1004|  71.5k|          vlc_val = rev_advance64(&vlc, cond0 ? 4 : 0);
  ------------------
  |  Branch (1004:41): [True: 67, False: 71.4k]
  ------------------
 1005|  71.5k|          u_q0 = (ui16)(u_q0 + (u_ext << 2));
 1006|  71.5k|          sp[1] = (ui16)(u_q0 + 1); // kappa = 1
 1007|  71.5k|          cond1 = u_q1 - (u_bias >> 2) > 32;
 1008|  71.5k|          u_ext = (ui16)(cond1 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1008:26): [True: 243, False: 71.2k]
  ------------------
 1009|  71.5k|          vlc_val = rev_advance64(&vlc, cond1 ? 4 : 0);
  ------------------
  |  Branch (1009:41): [True: 243, False: 71.2k]
  ------------------
 1010|  71.5k|          u_q1 = (ui16)(u_q1 + (u_ext << 2));
 1011|  71.5k|          sp[3] = (ui16)(u_q1 + 1); // kappa = 1
 1012|  71.5k|        }
 1013|  17.8k|        sp[0] = sp[1] = 0;
 1014|       |
 1015|       |        //non initial quad rows
 1016|  54.0k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1016:26): [True: 36.2k, False: 17.8k]
  ------------------
 1017|  36.2k|        {
 1018|  36.2k|          c_q = 0;                                // context
 1019|  36.2k|          ui16 *sp = scratch + (y >> 1) * sstr;   // this row of quads
 1020|       |
 1021|   124k|          for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1021:28): [True: 88.1k, False: 36.2k]
  ------------------
 1022|  88.1k|          {
 1023|       |            // decode VLC
 1024|       |            /////////////
 1025|       |
 1026|       |            // sigma_q (n, ne, nf)
 1027|  88.1k|            c_q |= ((sp[0 - (si32)sstr] & 0xA0U) << 2);
 1028|  88.1k|            c_q |= ((sp[2 - (si32)sstr] & 0x20U) << 4);
 1029|       |
 1030|       |            // first quad
 1031|  88.1k|            vlc_val = rev_fetch64(&vlc);
 1032|       |
 1033|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1034|  88.1k|            ui16 t0 = vlc_tbl1[ c_q + (vlc_val & 0x7F) ];
 1035|       |
 1036|       |            // if context is zero, use one MEL event
 1037|  88.1k|            if (c_q == 0) //zero context
  ------------------
  |  Branch (1037:17): [True: 53.3k, False: 34.7k]
  ------------------
 1038|  53.3k|            {
 1039|  53.3k|              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|  53.3k|              t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1044:20): [True: 21.7k, False: 31.5k]
  ------------------
 1045|       |
 1046|       |              // is run -1 or -2? this means a run has been consumed
 1047|  53.3k|              if (run < 0) 
  ------------------
  |  Branch (1047:19): [True: 33.2k, False: 20.1k]
  ------------------
 1048|  33.2k|                run = mel_get_run(&mel);  // get another run
 1049|  53.3k|            }
 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|  88.1k|            sp[0] = t0;
 1055|  88.1k|            x += 2;
 1056|       |
 1057|       |            // prepare context for the next quad; eqn. 2 in ITU T.814
 1058|       |            // sigma_q (w, sw)
 1059|  88.1k|            c_q = ((t0 & 0x40U) << 2) | ((t0 & 0x80U) << 1);
 1060|       |            // sigma_q (nw)
 1061|  88.1k|            c_q |= sp[0 - (si32)sstr] & 0x80;
 1062|       |            // sigma_q (n, ne, nf)
 1063|  88.1k|            c_q |= ((sp[2 - (si32)sstr] & 0xA0U) << 2);
 1064|  88.1k|            c_q |= ((sp[4 - (si32)sstr] & 0x20U) << 4);
 1065|       |
 1066|       |            //remove data from vlc stream (0 bits are removed if vlc is unused)
 1067|  88.1k|            vlc_val = rev_advance64(&vlc, t0 & 0x7);
 1068|       |
 1069|       |            //second quad
 1070|  88.1k|            ui16 t1 = 0;
 1071|       |
 1072|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1073|  88.1k|            t1 = vlc_tbl1[ c_q + (vlc_val & 0x7F)]; 
 1074|       |
 1075|       |            // if context is zero, use one MEL event
 1076|  88.1k|            if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1076:17): [True: 52.1k, False: 36.0k]
  |  Branch (1076:29): [True: 38.0k, False: 14.0k]
  ------------------
 1077|  38.0k|            {
 1078|  38.0k|              run -= 2; //subtract 2, since events number if multiplied by 2
 1079|       |
 1080|       |              // if event is 0, discard decoded t1
 1081|  38.0k|              t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1081:20): [True: 12.5k, False: 25.4k]
  ------------------
 1082|       |
 1083|  38.0k|              if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1083:19): [True: 18.6k, False: 19.3k]
  ------------------
 1084|  18.6k|                run = mel_get_run(&mel); // if yes, then get another run
 1085|  38.0k|            }
 1086|  88.1k|            t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1086:18): [True: 69.0k, False: 19.1k]
  ------------------
 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|  88.1k|            sp[2] = t1;
 1092|  88.1k|            x += 2;
 1093|       |
 1094|       |            // partial c_q, will be completed when we process the next quad
 1095|       |            // sigma_q (w, sw)
 1096|  88.1k|            c_q = ((t1 & 0x40U) << 2) | ((t1 & 0x80U) << 1);
 1097|       |            // sigma_q (nw)
 1098|  88.1k|            c_q |= sp[2 - (si32)sstr] & 0x80;
 1099|       |
 1100|       |            //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1101|  88.1k|            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|  88.1k|            ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1107|  88.1k|            ui32 uvlc_entry = uvlc_tbl1[uvlc_mode + (vlc_val & 0x3F)];
 1108|       |            //remove total prefix length
 1109|  88.1k|            vlc_val = rev_advance64(&vlc, uvlc_entry & 0x7);
 1110|  88.1k|            uvlc_entry >>= 3;
 1111|       |            //extract suffixes for quad 0 and 1
 1112|  88.1k|            ui32 len = uvlc_entry & 0xF;             //suffix length for 2 quads
 1113|  88.1k|            ui32 tmp = (ui32)(vlc_val&((1<<len)-1)); //suffix value for 2 quads
 1114|  88.1k|            vlc_val = rev_advance64(&vlc, len);
 1115|  88.1k|            uvlc_entry >>= 4;
 1116|       |            // quad 0 length
 1117|  88.1k|            len = uvlc_entry & 0x7; // quad 0 suffix length
 1118|  88.1k|            uvlc_entry >>= 3;
 1119|  88.1k|            ui16 u_q0 = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
 1120|  88.1k|            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|  88.1k|            ui16 u_ext; bool cond0, cond1;
 1124|  88.1k|            cond0 = u_q0 > 32;
 1125|  88.1k|            u_ext = (ui16)(cond0 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1125:28): [True: 65, False: 88.0k]
  ------------------
 1126|  88.1k|            vlc_val = rev_advance64(&vlc, cond0 ? 4 : 0);
  ------------------
  |  Branch (1126:43): [True: 65, False: 88.0k]
  ------------------
 1127|  88.1k|            u_q0 = (ui16)(u_q0 + (u_ext << 2));
 1128|  88.1k|            sp[1] = u_q0;
 1129|  88.1k|            cond1 = u_q1 > 32;
 1130|  88.1k|            u_ext = (ui16)(cond1 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1130:28): [True: 93, False: 88.0k]
  ------------------
 1131|  88.1k|            vlc_val = rev_advance64(&vlc, cond1 ? 4 : 0);
  ------------------
  |  Branch (1131:43): [True: 93, False: 88.0k]
  ------------------
 1132|  88.1k|            u_q1 = (ui16)(u_q1 + (u_ext << 2));
 1133|  88.1k|            sp[3] = u_q1;
 1134|  88.1k|          }
 1135|  36.2k|          sp[0] = sp[1] = 0;
 1136|  36.2k|        }
 1137|  17.8k|      }
 1138|       |
 1139|       |      // step2 we decode magsgn
 1140|  17.8k|      {
 1141|       |        // We allocate a scratch row for storing v_n values.
 1142|       |        // We have 512 quads horizontally.
 1143|       |        // We need an extra entry to handle the case of vp[1]
 1144|       |        // when vp is at the last column.
 1145|       |        // Here, we allocate 4 instead of 1 to make the buffer size
 1146|       |        // a multipled of 16 bytes.
 1147|  17.8k|        const int v_n_size = 512 + 4;
 1148|  17.8k|        ui64 v_n_scratch[v_n_size] = {0};  // 4+ kB
 1149|       |
 1150|  17.8k|        frwd_struct64 magsgn;
 1151|  17.8k|        frwd_init8<0xFF>(&magsgn, coded_data, lcup - scup);
 1152|       |
 1153|  17.8k|        const ui16 *sp = scratch;
 1154|  17.8k|        ui64 *vp = v_n_scratch;
 1155|  17.8k|        ui64 *dp = decoded_data;
 1156|       |
 1157|  17.8k|        ui64 prev_v_n = 0;
 1158|   119k|        for (ui32 x = 0; x < width; sp += 2, ++vp)
  ------------------
  |  Branch (1158:26): [True: 112k, False: 7.30k]
  ------------------
 1159|   112k|        {
 1160|   112k|          ui32 inf = sp[0];
 1161|   112k|          ui32 U_q = sp[1];
 1162|   112k|          if (U_q > mmsbp2)
  ------------------
  |  Branch (1162:15): [True: 1.75k, False: 110k]
  ------------------
 1163|  1.75k|            return false;
 1164|       |
 1165|   110k|          ui64 v_n;
 1166|   110k|          ui64 val = 0;
 1167|   110k|          ui32 bit = 0;
 1168|   110k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1168:15): [True: 29.1k, False: 81.1k]
  ------------------
 1169|  29.1k|          {
 1170|       |            //get 32 bits of magsgn data
 1171|  29.1k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1172|  29.1k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1173|  29.1k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1174|       |
 1175|  29.1k|            val = ms_val << 63;                           // get sign bit
 1176|  29.1k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1177|  29.1k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1178|  29.1k|            v_n |= 1;                                     // add center of bin    
 1179|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1180|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1181|  29.1k|            val |= (v_n + 2) << (p - 1);
 1182|  29.1k|          }
 1183|   110k|          dp[0] = val;
 1184|       |
 1185|   110k|          v_n = 0;
 1186|   110k|          val = 0;
 1187|   110k|          bit = 1;
 1188|   110k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1188:15): [True: 47.2k, False: 63.0k]
  ------------------
 1189|  47.2k|          {
 1190|       |            //get 32 bits of magsgn data
 1191|  47.2k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1192|  47.2k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1193|  47.2k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1194|       |
 1195|  47.2k|            val = ms_val << 63;                           // get sign bit
 1196|  47.2k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1197|  47.2k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1198|  47.2k|            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|  47.2k|            val |= (v_n + 2) << (p - 1);
 1202|  47.2k|          }
 1203|   110k|          dp[stride] = val;
 1204|   110k|          vp[0] = prev_v_n | v_n;
 1205|   110k|          prev_v_n = 0;
 1206|   110k|          ++dp;
 1207|   110k|          if (++x >= width)
  ------------------
  |  Branch (1207:15): [True: 8.77k, False: 101k]
  ------------------
 1208|  8.77k|          { ++vp; break; }
 1209|       |
 1210|   101k|          val = 0;
 1211|   101k|          bit = 2;
 1212|   101k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1212:15): [True: 28.3k, False: 73.1k]
  ------------------
 1213|  28.3k|          {
 1214|       |            //get 32 bits of magsgn data
 1215|  28.3k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1216|  28.3k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1217|  28.3k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1218|       |
 1219|  28.3k|            val = ms_val << 63;                           // get sign bit
 1220|  28.3k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1221|  28.3k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1222|  28.3k|            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|  28.3k|            val |= (v_n + 2) << (p - 1);
 1226|  28.3k|          }
 1227|   101k|          dp[0] = val;
 1228|       |
 1229|   101k|          v_n = 0;
 1230|   101k|          val = 0;
 1231|   101k|          bit = 3;
 1232|   101k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1232:15): [True: 25.7k, False: 75.8k]
  ------------------
 1233|  25.7k|          {
 1234|       |            //get 32 bits of magsgn data
 1235|  25.7k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1236|  25.7k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1237|  25.7k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1238|       |
 1239|  25.7k|            val = ms_val << 63;                           // get sign bit
 1240|  25.7k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1241|  25.7k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1242|  25.7k|            v_n |= 1;                                     // add center of bin    
 1243|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1244|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1245|  25.7k|            val |= (v_n + 2) << (p - 1);
 1246|  25.7k|          }
 1247|   101k|          dp[stride] = val;
 1248|   101k|          prev_v_n = v_n;
 1249|   101k|          ++dp;
 1250|   101k|          ++x;
 1251|   101k|        }
 1252|  16.0k|        vp[0] = prev_v_n;
 1253|       |
 1254|  48.4k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1254:26): [True: 33.0k, False: 15.3k]
  ------------------
 1255|  33.0k|        {
 1256|  33.0k|          const ui16 *sp = scratch + (y >> 1) * sstr;
 1257|  33.0k|          ui64 *vp = v_n_scratch;
 1258|  33.0k|          ui64 *dp = decoded_data + y * stride;
 1259|       |
 1260|  33.0k|          prev_v_n = 0;
 1261|   145k|          for (ui32 x = 0; x < width; sp += 2, ++vp)
  ------------------
  |  Branch (1261:28): [True: 127k, False: 18.0k]
  ------------------
 1262|   127k|          {
 1263|   127k|            ui32 inf = sp[0];
 1264|   127k|            ui32 u_q = sp[1];
 1265|       |
 1266|   127k|            ui32 gamma = inf & 0xF0; gamma &= gamma - 0x10; //is gamma_q 1?
 1267|   127k|            ui32 emax = 63 - count_leading_zeros(2 | vp[0] | vp[1]); // emax-1
 1268|   127k|            ui32 kappa = gamma ? emax : 1;
  ------------------
  |  Branch (1268:26): [True: 10.5k, False: 116k]
  ------------------
 1269|       |
 1270|   127k|            ui32 U_q = u_q + kappa;
 1271|   127k|            if (U_q > mmsbp2)
  ------------------
  |  Branch (1271:17): [True: 741, False: 126k]
  ------------------
 1272|    741|              return false;
 1273|       |
 1274|   126k|            ui64 v_n;
 1275|   126k|            ui64 val = 0;
 1276|   126k|            ui32 bit = 0;
 1277|   126k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1277:17): [True: 31.7k, False: 94.9k]
  ------------------
 1278|  31.7k|            {
 1279|       |              //get 32 bits of magsgn data
 1280|  31.7k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1281|  31.7k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1282|  31.7k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1283|       |
 1284|  31.7k|              val = ms_val << 63;                         // get sign bit
 1285|  31.7k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1286|  31.7k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1287|  31.7k|              v_n |= 1;                                   // add center of bin    
 1288|       |              //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1289|       |              //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1290|  31.7k|              val |= (v_n + 2) << (p - 1);
 1291|  31.7k|            }
 1292|   126k|            dp[0] = val;
 1293|       |
 1294|   126k|            v_n = 0;
 1295|   126k|            val = 0;
 1296|   126k|            bit = 1;
 1297|   126k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1297:17): [True: 9.82k, False: 116k]
  ------------------
 1298|  9.82k|            {
 1299|       |              //get 32 bits of magsgn data
 1300|  9.82k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1301|  9.82k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1302|  9.82k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1303|       |
 1304|  9.82k|              val = ms_val << 63;                         // get sign bit
 1305|  9.82k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1306|  9.82k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1307|  9.82k|              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|  9.82k|              val |= (v_n + 2) << (p - 1);
 1311|  9.82k|            }
 1312|   126k|            dp[stride] = val;
 1313|   126k|            vp[0] = prev_v_n | v_n;
 1314|   126k|            prev_v_n = 0;
 1315|   126k|            ++dp;
 1316|   126k|            if (++x >= width)
  ------------------
  |  Branch (1316:17): [True: 14.3k, False: 112k]
  ------------------
 1317|  14.3k|            { ++vp; break; }
 1318|       |
 1319|   112k|            val = 0;
 1320|   112k|            bit = 2;
 1321|   112k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1321:17): [True: 8.32k, False: 104k]
  ------------------
 1322|  8.32k|            {
 1323|       |              //get 32 bits of magsgn data
 1324|  8.32k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1325|  8.32k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1326|  8.32k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1327|       |
 1328|  8.32k|              val = ms_val << 63;                         // get sign bit
 1329|  8.32k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1330|  8.32k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1331|  8.32k|              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|  8.32k|              val |= (v_n + 2) << (p - 1);
 1335|  8.32k|            }
 1336|   112k|            dp[0] = val;
 1337|       |
 1338|   112k|            v_n = 0;
 1339|   112k|            val = 0;
 1340|   112k|            bit = 3;
 1341|   112k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1341:17): [True: 7.25k, False: 105k]
  ------------------
 1342|  7.25k|            {
 1343|       |              //get 32 bits of magsgn data
 1344|  7.25k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1345|  7.25k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1346|  7.25k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1347|       |
 1348|  7.25k|              val = ms_val << 63;                         // get sign bit
 1349|  7.25k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1350|  7.25k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1351|  7.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|  7.25k|              val |= (v_n + 2) << (p - 1);
 1355|  7.25k|            }
 1356|   112k|            dp[stride] = val;
 1357|   112k|            prev_v_n = v_n;
 1358|   112k|            ++dp;
 1359|   112k|            ++x;
 1360|   112k|          }
 1361|  32.3k|          vp[0] = prev_v_n;
 1362|  32.3k|        }
 1363|  16.0k|      }
 1364|       |
 1365|  15.3k|      if (num_passes > 1)
  ------------------
  |  Branch (1365:11): [True: 11.6k, False: 3.65k]
  ------------------
 1366|  11.6k|      {
 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|  11.6k|        ui16* const sigma = scratch;
 1372|       |
 1373|  11.6k|        ui32 mstr = (width + 3u) >> 2;   // divide by 4, since each
 1374|       |                                         // ui16 contains 4 columns
 1375|  11.6k|        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|  11.6k|        {
 1381|  11.6k|          ui32 y;
 1382|  33.8k|          for (y = 0; y < height; y += 4)
  ------------------
  |  Branch (1382:23): [True: 22.1k, False: 11.6k]
  ------------------
 1383|  22.1k|          {
 1384|  22.1k|            ui16* sp = scratch + (y >> 1) * sstr;
 1385|  22.1k|            ui16* dp = sigma + (y >> 2) * mstr;
 1386|  83.6k|            for (ui32 x = 0; x < width; x += 4, sp += 4, ++dp) {
  ------------------
  |  Branch (1386:30): [True: 61.4k, False: 22.1k]
  ------------------
 1387|  61.4k|              ui32 t0 = 0, t1 = 0;
 1388|  61.4k|              t0  = ((sp[0     ] & 0x30u) >> 4)  | ((sp[0     ] & 0xC0u) >> 2);
 1389|  61.4k|              t0 |= ((sp[2     ] & 0x30u) << 4)  | ((sp[2     ] & 0xC0u) << 6);
 1390|  61.4k|              t1  = ((sp[0+sstr] & 0x30u) >> 2)  | ((sp[0+sstr] & 0xC0u)     );
 1391|  61.4k|              t1 |= ((sp[2+sstr] & 0x30u) << 6)  | ((sp[2+sstr] & 0xC0u) << 8);
 1392|  61.4k|              dp[0] = (ui16)(t0 | t1);
 1393|  61.4k|            }
 1394|  22.1k|            dp[0] = 0; // set an extra entry on the right with 0
 1395|  22.1k|          }
 1396|  11.6k|          {
 1397|       |            // reset one row after the codeblock
 1398|  11.6k|            ui16* dp = sigma + (y >> 2) * mstr;
 1399|  56.0k|            for (ui32 x = 0; x < width; x += 4, ++dp)
  ------------------
  |  Branch (1399:30): [True: 44.3k, False: 11.6k]
  ------------------
 1400|  44.3k|              dp[0] = 0;
 1401|  11.6k|            dp[0] = 0; // set an extra entry on the right with 0
 1402|  11.6k|          }
 1403|  11.6k|        }
 1404|       |
 1405|       |        // We perform Significance Propagation Pass here
 1406|  11.6k|        {
 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|  11.6k|          ui16 prev_row_sig[256 + 8] = {0}; // 528 Bytes
 1417|       |
 1418|  11.6k|          frwd_struct64 sigprop;
 1419|  11.6k|          frwd_init<0>(&sigprop, coded_data + lengths1, (int)lengths2);
 1420|       |
 1421|  33.8k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1421:28): [True: 22.1k, False: 11.6k]
  ------------------
 1422|  22.1k|          {
 1423|  22.1k|            ui32 pattern = 0xFFFFu; // a pattern needed samples
 1424|  22.1k|            if (height - y < 4) {
  ------------------
  |  Branch (1424:17): [True: 5.87k, False: 16.3k]
  ------------------
 1425|  5.87k|              pattern = 0x7777u;
 1426|  5.87k|              if (height - y < 3) {
  ------------------
  |  Branch (1426:19): [True: 5.29k, False: 583]
  ------------------
 1427|  5.29k|                pattern = 0x3333u;
 1428|  5.29k|                if (height - y < 2)
  ------------------
  |  Branch (1428:21): [True: 1.49k, False: 3.79k]
  ------------------
 1429|  1.49k|                  pattern = 0x1111u;
 1430|  5.29k|              }
 1431|  5.87k|            }
 1432|       |
 1433|       |            // prev holds sign. info. for the previous quad, together
 1434|       |            // with the rows on top of it and below it.
 1435|  22.1k|            ui32 prev = 0;
 1436|  22.1k|            ui16 *prev_sig = prev_row_sig;
 1437|  22.1k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1438|  22.1k|            ui64 *dpp = decoded_data + y * stride;
 1439|  83.6k|            for (ui32 x = 0; x < width; x += 4, ++cur_sig, ++prev_sig)
  ------------------
  |  Branch (1439:30): [True: 61.4k, False: 22.1k]
  ------------------
 1440|  61.4k|            {
 1441|       |              // only rows and columns inside the stripe are included
 1442|  61.4k|              si32 s = (si32)x + 4 - (si32)width;
 1443|  61.4k|              s = ojph_max(s, 0);
  ------------------
  |  |   73|  61.4k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 13.7k, False: 47.7k]
  |  |  ------------------
  ------------------
 1444|  61.4k|              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|  61.4k|              ui32 ps = *(ui32*)prev_sig;
 1459|  61.4k|              ui32 ns = *(ui32*)(cur_sig + mstr);
 1460|  61.4k|              ui32 u = (ps & 0x88888888) >> 3; // the row on top
 1461|  61.4k|              if (!stripe_causal)
  ------------------
  |  Branch (1461:19): [True: 59.5k, False: 1.90k]
  ------------------
 1462|  59.5k|                u |= (ns & 0x11111111) << 3;   // the row below
 1463|       |
 1464|  61.4k|              ui32 cs = *(ui32*)cur_sig;
 1465|       |              // vertical integration
 1466|  61.4k|              ui32 mbr =  cs;                // this sig. info.
 1467|  61.4k|              mbr |= (cs & 0x77777777) << 1; //above neighbors
 1468|  61.4k|              mbr |= (cs & 0xEEEEEEEE) >> 1; //below neighbors
 1469|  61.4k|              mbr |= u;
 1470|       |              // horizontal integration
 1471|  61.4k|              ui32 t = mbr;
 1472|  61.4k|              mbr |= t << 4;      // neighbors on the left
 1473|  61.4k|              mbr |= t >> 4;      // neighbors on the right
 1474|  61.4k|              mbr |= prev >> 12;  // significance of previous group
 1475|       |
 1476|       |              // remove outside samples, and already significant samples
 1477|  61.4k|              mbr &= pattern;
 1478|  61.4k|              mbr &= ~cs;
 1479|       |
 1480|       |              // find samples that become significant during the SPP
 1481|  61.4k|              ui32 new_sig = mbr;
 1482|  61.4k|              if (new_sig)
  ------------------
  |  Branch (1482:19): [True: 45.6k, False: 15.7k]
  ------------------
 1483|  45.6k|              {
 1484|  45.6k|                ui64 cwd = frwd_fetch<0>(&sigprop);
 1485|       |
 1486|  45.6k|                ui32 cnt = 0;
 1487|  45.6k|                ui32 col_mask = 0xFu;
 1488|  45.6k|                ui32 inv_sig = ~cs & pattern;
 1489|   228k|                for (int i = 0; i < 16; i += 4, col_mask <<= 4)
  ------------------
  |  Branch (1489:33): [True: 182k, False: 45.6k]
  ------------------
 1490|   182k|                {
 1491|   182k|                  if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1491:23): [True: 44.9k, False: 137k]
  ------------------
 1492|  44.9k|                    continue;
 1493|       |
 1494|       |                  //scan one column
 1495|   137k|                  ui32 sample_mask = 0x1111u & col_mask;
 1496|   137k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1496:23): [True: 88.2k, False: 49.5k]
  ------------------
 1497|  88.2k|                  {
 1498|  88.2k|                    new_sig &= ~sample_mask;
 1499|  88.2k|                    if (cwd & 1)
  ------------------
  |  Branch (1499:25): [True: 36.7k, False: 51.4k]
  ------------------
 1500|  36.7k|                    {
 1501|  36.7k|                      ui32 t = 0x33u << i;
 1502|  36.7k|                      new_sig |= t & inv_sig;
 1503|  36.7k|                    }
 1504|  88.2k|                    cwd >>= 1; ++cnt;
 1505|  88.2k|                  }
 1506|       |
 1507|   137k|                  sample_mask <<= 1;
 1508|   137k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1508:23): [True: 73.6k, False: 64.0k]
  ------------------
 1509|  73.6k|                  {
 1510|  73.6k|                    new_sig &= ~sample_mask;
 1511|  73.6k|                    if (cwd & 1)
  ------------------
  |  Branch (1511:25): [True: 21.4k, False: 52.2k]
  ------------------
 1512|  21.4k|                    {
 1513|  21.4k|                      ui32 t = 0x76u << i;
 1514|  21.4k|                      new_sig |= t & inv_sig;
 1515|  21.4k|                    }
 1516|  73.6k|                    cwd >>= 1; ++cnt;
 1517|  73.6k|                  }
 1518|       |
 1519|   137k|                  sample_mask <<= 1;
 1520|   137k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1520:23): [True: 82.0k, False: 55.7k]
  ------------------
 1521|  82.0k|                  {
 1522|  82.0k|                    new_sig &= ~sample_mask;
 1523|  82.0k|                    if (cwd & 1)
  ------------------
  |  Branch (1523:25): [True: 29.2k, False: 52.8k]
  ------------------
 1524|  29.2k|                    {
 1525|  29.2k|                      ui32 t = 0xECu << i;
 1526|  29.2k|                      new_sig |= t & inv_sig;
 1527|  29.2k|                    }
 1528|  82.0k|                    cwd >>= 1; ++cnt;
 1529|  82.0k|                  }
 1530|       |
 1531|   137k|                  sample_mask <<= 1;
 1532|   137k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1532:23): [True: 66.7k, False: 70.9k]
  ------------------
 1533|  66.7k|                  {
 1534|  66.7k|                    new_sig &= ~sample_mask;
 1535|  66.7k|                    if (cwd & 1)
  ------------------
  |  Branch (1535:25): [True: 28.6k, False: 38.0k]
  ------------------
 1536|  28.6k|                    {
 1537|  28.6k|                      ui32 t = 0xC8u << i;
 1538|  28.6k|                      new_sig |= t & inv_sig;
 1539|  28.6k|                    }
 1540|  66.7k|                    cwd >>= 1; ++cnt;
 1541|  66.7k|                  }
 1542|   137k|                }
 1543|       |
 1544|  45.6k|                if (new_sig)
  ------------------
  |  Branch (1544:21): [True: 24.3k, False: 21.3k]
  ------------------
 1545|  24.3k|                {
 1546|       |                  // new_sig has newly-discovered sig. samples during SPP
 1547|       |                  // find the signs and update decoded_data
 1548|  24.3k|                  ui64 *dp = dpp + x;
 1549|  24.3k|                  ui64 val = 3u << (p - 2);
 1550|  24.3k|                  col_mask = 0xFu;
 1551|   121k|                  for (int i = 0; i < 4; ++i, ++dp, col_mask <<= 4)
  ------------------
  |  Branch (1551:35): [True: 97.5k, False: 24.3k]
  ------------------
 1552|  97.5k|                  {
 1553|  97.5k|                    if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1553:25): [True: 40.4k, False: 57.0k]
  ------------------
 1554|  40.4k|                      continue;
 1555|       |
 1556|       |                    //scan 4 signs
 1557|  57.0k|                    ui32 sample_mask = 0x1111u & col_mask;
 1558|  57.0k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1558:25): [True: 36.7k, False: 20.2k]
  ------------------
 1559|  36.7k|                    {
 1560|  36.7k|                      assert(dp[0] == 0);
 1561|  36.7k|                      dp[0] = (cwd << 63) | val;
 1562|  36.7k|                      cwd >>= 1; ++cnt;
 1563|  36.7k|                    }
 1564|       |
 1565|  57.0k|                    sample_mask += sample_mask;
 1566|  57.0k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1566:25): [True: 21.4k, False: 35.6k]
  ------------------
 1567|  21.4k|                    {
 1568|  21.4k|                      assert(dp[stride] == 0);
 1569|  21.4k|                      dp[stride] = (cwd << 63) | val;
 1570|  21.4k|                      cwd >>= 1; ++cnt;
 1571|  21.4k|                    }
 1572|       |
 1573|  57.0k|                    sample_mask += sample_mask;
 1574|  57.0k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1574:25): [True: 29.2k, False: 27.8k]
  ------------------
 1575|  29.2k|                    {
 1576|  29.2k|                      assert(dp[2 * stride] == 0);
 1577|  29.2k|                      dp[2 * stride] = (cwd << 63) | val;
 1578|  29.2k|                      cwd >>= 1; ++cnt;
 1579|  29.2k|                    }
 1580|       |
 1581|  57.0k|                    sample_mask += sample_mask;
 1582|  57.0k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1582:25): [True: 28.6k, False: 28.3k]
  ------------------
 1583|  28.6k|                    {
 1584|  28.6k|                      assert(dp[3 * stride] == 0);
 1585|  28.6k|                      dp[3 * stride] = (cwd << 63) | val;
 1586|  28.6k|                      cwd >>= 1; ++cnt;
 1587|  28.6k|                    }
 1588|  57.0k|                  }
 1589|  24.3k|                }
 1590|  45.6k|                frwd_advance(&sigprop, cnt);
 1591|  45.6k|              }
 1592|       |
 1593|  61.4k|              new_sig |= cs;
 1594|  61.4k|              *prev_sig = (ui16)(new_sig);
 1595|       |
 1596|       |              // vertical integration for the new sig. info.
 1597|  61.4k|              t = new_sig;
 1598|  61.4k|              new_sig |= (t & 0x7777) << 1; //above neighbors
 1599|  61.4k|              new_sig |= (t & 0xEEEE) >> 1; //below neighbors
 1600|       |              // add sig. info. from the row on top and below
 1601|  61.4k|              prev = new_sig | u;
 1602|       |              // we need only the bits in 0xF000
 1603|  61.4k|              prev &= 0xF000;
 1604|  61.4k|            }
 1605|  22.1k|          }
 1606|  11.6k|        }
 1607|       |
 1608|       |        // We perform Magnitude Refinement Pass here
 1609|  11.6k|        if (num_passes > 2)
  ------------------
  |  Branch (1609:13): [True: 9.11k, False: 2.56k]
  ------------------
 1610|  9.11k|        {
 1611|  9.11k|          rev_struct magref;
 1612|  9.11k|          rev_init_mrp(&magref, coded_data, (int)lengths1, (int)lengths2);
 1613|       |
 1614|  26.4k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1614:28): [True: 17.2k, False: 9.11k]
  ------------------
 1615|  17.2k|          {
 1616|  17.2k|            ui32 *cur_sig = (ui32*)(sigma + (y >> 2) * mstr);
 1617|  17.2k|            ui64 *dpp = decoded_data + y * stride;
 1618|  17.2k|            ui64 half = 1ULL << (p - 2);
 1619|  49.6k|            for (ui32 i = 0; i < width; i += 8)
  ------------------
  |  Branch (1619:30): [True: 32.3k, False: 17.2k]
  ------------------
 1620|  32.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|  32.3k|              ui32 cwd = rev_fetch_mrp(&magref); // get 32 bit data
 1625|  32.3k|              ui32 sig = *cur_sig++; // 32 bit that will be processed now
 1626|  32.3k|              ui32 col_mask = 0xFu;  // a mask for a column in sig
 1627|  32.3k|              if (sig) // if any of the 32 bits are set
  ------------------
  |  Branch (1627:19): [True: 25.8k, False: 6.56k]
  ------------------
 1628|  25.8k|              {
 1629|   232k|                for (int j = 0; j < 8; ++j) //one column at a time
  ------------------
  |  Branch (1629:33): [True: 206k, False: 25.8k]
  ------------------
 1630|   206k|                {
 1631|   206k|                  if (sig & col_mask) // lowest nibble
  ------------------
  |  Branch (1631:23): [True: 83.8k, False: 122k]
  ------------------
 1632|  83.8k|                  {
 1633|  83.8k|                    ui64 *dp = dpp + i + j; // next column in decoded samples
 1634|  83.8k|                    ui32 sample_mask = 0x11111111u & col_mask; //LSB
 1635|       |
 1636|   419k|                    for (int k = 0; k < 4; ++k) {
  ------------------
  |  Branch (1636:37): [True: 335k, False: 83.8k]
  ------------------
 1637|   335k|                      if (sig & sample_mask) //if LSB is set
  ------------------
  |  Branch (1637:27): [True: 141k, False: 194k]
  ------------------
 1638|   141k|                      {
 1639|   141k|                        assert(dp[0] != 0); // decoded value cannot be zero
 1640|   141k|                        assert((dp[0] & half) == 0); // no half
 1641|   141k|                        ui64 sym = cwd & 1;          // get it value
 1642|   141k|                        sym = (1 - sym) << (p - 1); // previous center of bin
 1643|   141k|                        sym |= half;            // put half the center of bin
 1644|   141k|                        dp[0] ^= sym;    // remove old bin center and put new
 1645|   141k|                        cwd >>= 1;       // consume word
 1646|   141k|                      }
 1647|   335k|                      sample_mask += sample_mask; //next row
 1648|   335k|                      dp += stride; // next samples row
 1649|   335k|                    }
 1650|  83.8k|                  }
 1651|   206k|                  col_mask <<= 4; //next column
 1652|   206k|                }
 1653|  25.8k|              }
 1654|       |              // consume data according to the number of bits set
 1655|  32.3k|              rev_advance_mrp(&magref, population_count(sig));
 1656|  32.3k|            }
 1657|  17.2k|          }
 1658|  9.11k|        }
 1659|  11.6k|      }
 1660|  15.3k|      return true;
 1661|  16.0k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL8mel_initEPNS0_10dec_mel_stEPhii:
  222|  17.8k|    {
  223|  17.8k|      melp->data = bbuf + lcup - scup; // move the pointer to the start of MEL
  224|  17.8k|      melp->bits = 0;                  // 0 bits in tmp
  225|  17.8k|      melp->tmp = 0;                   //
  226|  17.8k|      melp->unstuff = false;           // no unstuffing
  227|  17.8k|      melp->size = scup - 1;           // size is the length of MEL+VLC-1
  228|  17.8k|      melp->k = 0;                     // 0 for state 
  229|  17.8k|      melp->num_runs = 0;              // num_runs is 0
  230|  17.8k|      melp->runs = 0;                  //
  231|       |
  232|       |      //This code is borrowed; original is for a different architecture
  233|       |      //These few lines take care of the case where data is not at a multiple
  234|       |      // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the MEL segment
  235|  17.8k|      int num = 4 - (int)(intptr_t(melp->data) & 0x3);
  236|  65.1k|      for (int i = 0; i < num; ++i) { // this code is similar to mel_read
  ------------------
  |  Branch (236:23): [True: 47.2k, False: 17.8k]
  ------------------
  237|  47.2k|        assert(melp->unstuff == false || melp->data[0] <= 0x8F);
  238|  47.2k|        ui64 d = (melp->size > 0) ? *melp->data : 0xFF;//if buffer is consumed
  ------------------
  |  Branch (238:18): [True: 42.2k, False: 5.02k]
  ------------------
  239|       |                                                       //set data to 0xFF
  240|  47.2k|        if (melp->size == 1) d |= 0xF; //if this is MEL+VLC-1, set LSBs to 0xF
  ------------------
  |  Branch (240:13): [True: 5.35k, False: 41.9k]
  ------------------
  241|       |                                       // see the standard
  242|  47.2k|        melp->data += melp->size-- > 0; //increment if the end is not reached
  243|  47.2k|        int d_bits = 8 - melp->unstuff; //if unstuffing is needed, reduce by 1
  244|  47.2k|        melp->tmp = (melp->tmp << d_bits) | d; //store bits in tmp
  245|  47.2k|        melp->bits += d_bits;  //increment tmp by number of bits
  246|  47.2k|        melp->unstuff = ((d & 0xFF) == 0xFF); //true of next byte needs 
  247|       |                                              //unstuffing
  248|  47.2k|      }
  249|  17.8k|      melp->tmp <<= (64 - melp->bits); //push all the way up so the first bit
  250|       |                                       // is the MSB
  251|  17.8k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL9rev_init8EPNS0_10rev_structEPhii:
  344|  17.8k|    {
  345|       |      //first byte has only the upper 4 bits
  346|  17.8k|      vlcp->data = data + lcup - 2;
  347|       |
  348|       |      //size can not be larger than this, in fact it should be smaller
  349|  17.8k|      vlcp->size = scup - 2;
  350|       |
  351|  17.8k|      ui8 val = *vlcp->data--; // read one byte (this is a half byte)
  352|       |
  353|       |      // the first byte is treated different to other bytes, because only
  354|       |      // the MSB nibble is part of the VLC code.
  355|  17.8k|      val = (ui8)(val >> 4);
  356|  17.8k|      ui8 t = ((val & 0x7) == 0x7) ? 1 : 0; // unstuffing is needed
  ------------------
  |  Branch (356:15): [True: 3.83k, False: 14.0k]
  ------------------
  357|  17.8k|      val = (ui8)(val & (0xFU >> t)); // protect against erroneous 1 in MSB
  358|  17.8k|      vlcp->tmp = val;
  359|  17.8k|      vlcp->bits = 4 - t;
  360|  17.8k|      vlcp->unstuff = val > 0x8; //this is useful for the next byte
  361|  17.8k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL11mel_get_runEPNS0_10dec_mel_stE:
  261|   137k|    {
  262|   137k|      if (melp->num_runs == 0)  //if no runs, decode more bit from MEL segment
  ------------------
  |  Branch (262:11): [True: 30.3k, False: 107k]
  ------------------
  263|  30.3k|        mel_decode(melp);
  264|       |
  265|   137k|      int t = melp->runs & 0x7F; //retrieve one run
  266|   137k|      melp->runs >>= 7;  // remove the retrieved run
  267|   137k|      melp->num_runs--;
  268|   137k|      return t; // return run
  269|   137k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10mel_decodeEPNS0_10dec_mel_stE:
  171|  30.3k|    {
  172|  30.3k|      static const int mel_exp[13] = { //MEL exponents
  173|  30.3k|        0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5
  174|  30.3k|      };
  175|       |
  176|  30.3k|      if (melp->bits < 6) // if there are less than 6 bits in tmp
  ------------------
  |  Branch (176:11): [True: 4.23k, False: 26.1k]
  ------------------
  177|  4.23k|        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|   240k|      while (melp->bits >= 6 && melp->num_runs < 8)
  ------------------
  |  Branch (182:14): [True: 233k, False: 7.05k]
  |  Branch (182:33): [True: 210k, False: 23.3k]
  ------------------
  183|   210k|      {
  184|   210k|        int eval = mel_exp[melp->k]; // number of bits associated with state
  185|   210k|        int run = 0;
  186|   210k|        if (melp->tmp & (1ull<<63)) //The next bit to decode (stored in MSB)
  ------------------
  |  Branch (186:13): [True: 83.3k, False: 127k]
  ------------------
  187|  83.3k|        { //one is found
  188|  83.3k|          run = 1 << eval;  
  189|  83.3k|          run--; // consecutive runs of 0 events - 1
  190|  83.3k|          melp->k = melp->k + 1 < 12 ? melp->k + 1 : 12;//increment, max is 12
  ------------------
  |  Branch (190:21): [True: 79.7k, False: 3.63k]
  ------------------
  191|  83.3k|          melp->tmp <<= 1; // consume one bit from tmp
  192|  83.3k|          melp->bits -= 1;
  193|  83.3k|          run = run << 1; // a stretch of zeros not terminating in one
  194|  83.3k|        }
  195|   127k|        else
  196|   127k|        { //0 is found
  197|   127k|          run = (int)(melp->tmp >> (63 - eval)) & ((1 << eval) - 1);
  198|   127k|          melp->k = melp->k - 1 > 0 ? melp->k - 1 : 0; //decrement, min is 0
  ------------------
  |  Branch (198:21): [True: 14.8k, False: 112k]
  ------------------
  199|   127k|          melp->tmp <<= eval + 1; //consume eval + 1 bits (max is 6)
  200|   127k|          melp->bits -= eval + 1;
  201|   127k|          run = (run << 1) + 1; // a stretch of zeros terminating with one
  202|   127k|        }
  203|   210k|        eval = melp->num_runs * 7;           // 7 bits per run
  204|   210k|        melp->runs &= ~((ui64)0x3F << eval); // 6 bits are sufficient
  205|   210k|        melp->runs |= ((ui64)run) << eval;   // store the value in runs
  206|   210k|        melp->num_runs++;                    // increment count  
  207|   210k|      }
  208|  30.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL8mel_readEPNS0_10dec_mel_stE:
   94|  4.23k|    {
   95|  4.23k|      if (melp->bits > 32)  //there are enough bits in the tmp variable
  ------------------
  |  Branch (95:11): [True: 0, False: 4.23k]
  ------------------
   96|      0|        return;             // return without reading new data
   97|       |
   98|  4.23k|      ui32 val = 0xFFFFFFFF;       // feed in 0xFF if buffer is exhausted
   99|  4.23k|      if (melp->size > 4) {        // if there is data in the MEL segment
  ------------------
  |  Branch (99:11): [True: 2.05k, False: 2.17k]
  ------------------
  100|  2.05k|        val = *(ui32*)melp->data;  // read 32 bits from MEL data
  101|  2.05k|        melp->data += 4;           // advance pointer
  102|  2.05k|        melp->size -= 4;           // reduce counter
  103|  2.05k|      }
  104|  2.17k|      else if (melp->size > 0)
  ------------------
  |  Branch (104:16): [True: 1.37k, False: 802]
  ------------------
  105|  1.37k|      { // 4 or less
  106|  1.37k|        int i = 0;
  107|  2.43k|        while (melp->size > 1) {   
  ------------------
  |  Branch (107:16): [True: 1.06k, False: 1.37k]
  ------------------
  108|  1.06k|          ui32 v = *melp->data++;    // read one byte at a time
  109|  1.06k|          ui32 m = ~(0xFFu << i);    // mask of location
  110|  1.06k|          val = (val & m) | (v << i);// put one byte in its correct location
  111|  1.06k|          --melp->size;
  112|  1.06k|          i += 8;
  113|  1.06k|        }
  114|       |        // size equal to 1
  115|  1.37k|        ui32 v = *melp->data++;    // the one before the last is different 
  116|  1.37k|        v |= 0xF;                  // MEL and VLC segments can overlap
  117|  1.37k|        ui32 m = ~(0xFFu << i);
  118|  1.37k|        val = (val & m) | (v << i);
  119|  1.37k|        --melp->size;
  120|  1.37k|      }
  121|       |      
  122|       |      // next we unstuff them before adding them to the buffer
  123|  4.23k|      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|  4.23k|      ui32 t = val & 0xFF; 
  130|  4.23k|      bool unstuff = ((val & 0xFF) == 0xFF); // true if we need unstuffing
  131|  4.23k|      bits -= unstuff; // there is one less bit in t if unstuffing is needed
  132|  4.23k|      t = t << (8 - unstuff); // move up to make room for the next byte
  133|       |
  134|       |      //this is a repeat of the above
  135|  4.23k|      t |= (val>>8) & 0xFF;
  136|  4.23k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  137|  4.23k|      bits -= unstuff;
  138|  4.23k|      t = t << (8 - unstuff);
  139|       |
  140|  4.23k|      t |= (val>>16) & 0xFF;
  141|  4.23k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  142|  4.23k|      bits -= unstuff;
  143|  4.23k|      t = t << (8 - unstuff);
  144|       |
  145|  4.23k|      t |= (val>>24) & 0xFF;
  146|  4.23k|      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|  4.23k|      melp->tmp |= ((ui64)t) << (64 - bits - melp->bits);
  151|  4.23k|      melp->bits += bits; //increment the number of bits in tmp
  152|  4.23k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL11rev_fetch64EPNS0_10rev_structE:
  372|   159k|    {
  373|   392k|      while (vlcp->bits <= 56)
  ------------------
  |  Branch (373:14): [True: 233k, False: 159k]
  ------------------
  374|   233k|        rev_read8(vlcp); // read 8 bits, but unstuffing might reduce this
  375|   159k|      return vlcp->tmp;  // return unstuff decoded bits
  376|   159k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL9rev_read8EPNS0_10rev_structE:
  306|   233k|    {
  307|       |      // process 1 bytes
  308|   233k|      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|   233k|      if (vlcp->size > 0)  // if there are more than 3 bytes left in VLC
  ------------------
  |  Branch (314:11): [True: 112k, False: 120k]
  ------------------
  315|   112k|      {
  316|   112k|        val = *vlcp->data; // then read 8 bits
  317|   112k|        --vlcp->data;      // increment data pointer
  318|   112k|        --vlcp->size;      // decrement number of bytes in the buffer
  319|   112k|      }
  320|       |
  321|       |      // accumulate in tmp, and increment bits, check if unstuffing is needed
  322|   233k|      ui8 t = (vlcp->unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0;
  ------------------
  |  Branch (322:16): [True: 26.0k, False: 207k]
  |  Branch (322:33): [True: 7.51k, False: 18.4k]
  ------------------
  323|   233k|      val = (ui8)(val & (0xFFU >> t)); // protect against erroneous 1 in MSB
  324|   233k|      vlcp->tmp |= (ui64)val << vlcp->bits;
  325|   233k|      vlcp->bits += 8 - t;
  326|   233k|      vlcp->unstuff = val > 0x8F;
  327|   233k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL13rev_advance64EPNS0_10rev_structEj:
  386|   957k|    {
  387|       |      assert(num_bits <= vlcp->bits); // vlcp->tmp must have more than num_bits
  388|   957k|      vlcp->tmp >>= num_bits;         // remove bits
  389|   957k|      vlcp->bits -= num_bits;         // decrement the number of bits
  390|   957k|      return vlcp->tmp;
  391|   957k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL12frwd_advanceEPNS0_13frwd_struct64Ej:
  707|   233k|    {
  708|       |      assert(num_bits <= msp->bits);
  709|   233k|      msp->tmp >>= num_bits;  // consume num_bits
  710|   233k|      msp->bits -= num_bits;
  711|   233k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12rev_init_mrpEPNS0_10rev_structEPhii:
  470|  9.11k|    {
  471|  9.11k|      mrp->data = data + lcup + len2 - 1;
  472|  9.11k|      mrp->size = len2;
  473|  9.11k|      mrp->unstuff = true;
  474|  9.11k|      mrp->bits = 0;
  475|  9.11k|      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.11k|      int num = 1 + (int)(intptr_t(mrp->data) & 0x3);
  482|  32.1k|      for (int i = 0; i < num; ++i) {
  ------------------
  |  Branch (482:23): [True: 22.9k, False: 9.11k]
  ------------------
  483|  22.9k|        ui64 d;
  484|       |        //read a byte, 0 if no more data
  485|  22.9k|        d = (mrp->size-- > 0) ? *mrp->data-- : 0; 
  ------------------
  |  Branch (485:13): [True: 21.3k, False: 1.66k]
  ------------------
  486|       |        //check if unstuffing is needed
  487|  22.9k|        ui32 d_bits = 8 - ((mrp->unstuff && ((d & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (487:29): [True: 13.2k, False: 9.76k]
  |  Branch (487:45): [True: 3.17k, False: 10.0k]
  ------------------
  488|  22.9k|        mrp->tmp |= d << mrp->bits; // move data to vlcp->tmp
  489|  22.9k|        mrp->bits += d_bits;
  490|  22.9k|        mrp->unstuff = d > 0x8F; // for next byte
  491|  22.9k|      }
  492|  9.11k|      rev_read_mrp(mrp);
  493|  9.11k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12rev_read_mrpEPNS0_10rev_structE:
  406|  12.4k|    {
  407|       |      //process 4 bytes at a time
  408|  12.4k|      if (mrp->bits > 32)
  ------------------
  |  Branch (408:11): [True: 0, False: 12.4k]
  ------------------
  409|      0|        return;
  410|  12.4k|      ui32 val = 0;
  411|  12.4k|      if (mrp->size > 3) // If there are 3 byte or more
  ------------------
  |  Branch (411:11): [True: 9.00k, False: 3.43k]
  ------------------
  412|  9.00k|      { // (mrp->data - 3) move pointer back to read 32 bits at once
  413|  9.00k|        val = *(ui32*)(mrp->data - 3); // read 32 bits
  414|  9.00k|        mrp->data -= 4;                // move back pointer
  415|  9.00k|        mrp->size -= 4;                // reduce count
  416|  9.00k|      }
  417|  3.43k|      else if (mrp->size > 0)
  ------------------
  |  Branch (417:16): [True: 1.54k, False: 1.89k]
  ------------------
  418|  1.54k|      {
  419|  1.54k|        int i = 24;
  420|  4.95k|        while (mrp->size > 0) {   
  ------------------
  |  Branch (420:16): [True: 3.40k, False: 1.54k]
  ------------------
  421|  3.40k|          ui32 v = *mrp->data--; // read one byte at a time
  422|  3.40k|          val |= (v << i);       // put byte in its correct location
  423|  3.40k|          --mrp->size;
  424|  3.40k|          i -= 8;
  425|  3.40k|        }
  426|  1.54k|      }
  427|       |
  428|       |      //accumulate in tmp, and keep count in bits
  429|  12.4k|      ui32 bits, tmp = val >> 24;
  430|       |
  431|       |      //test if the last byte > 0x8F (unstuff must be true) and this is 0x7F
  432|  12.4k|      bits = 8 - ((mrp->unstuff && (((val >> 24) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (432:20): [True: 4.73k, False: 7.70k]
  |  Branch (432:36): [True: 2.94k, False: 1.79k]
  ------------------
  433|  12.4k|      bool unstuff = (val >> 24) > 0x8F;
  434|       |
  435|       |      //process the next byte
  436|  12.4k|      tmp |= ((val >> 16) & 0xFF) << bits;
  437|  12.4k|      bits += 8 - ((unstuff && (((val >> 16) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (437:21): [True: 5.00k, False: 7.43k]
  |  Branch (437:32): [True: 3.32k, False: 1.67k]
  ------------------
  438|  12.4k|      unstuff = ((val >> 16) & 0xFF) > 0x8F;
  439|       |
  440|  12.4k|      tmp |= ((val >> 8) & 0xFF) << bits;
  441|  12.4k|      bits += 8 - ((unstuff && (((val >> 8) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (441:21): [True: 4.85k, False: 7.58k]
  |  Branch (441:32): [True: 2.48k, False: 2.37k]
  ------------------
  442|  12.4k|      unstuff = ((val >> 8) & 0xFF) > 0x8F;
  443|       |
  444|  12.4k|      tmp |= (val & 0xFF) << bits;
  445|  12.4k|      bits += 8 - ((unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (445:21): [True: 4.46k, False: 7.98k]
  |  Branch (445:32): [True: 2.94k, False: 1.51k]
  ------------------
  446|  12.4k|      unstuff = (val & 0xFF) > 0x8F;
  447|       |
  448|  12.4k|      mrp->tmp |= (ui64)tmp << mrp->bits; // move data to mrp pointer
  449|  12.4k|      mrp->bits += bits;
  450|  12.4k|      mrp->unstuff = unstuff;             // next byte
  451|  12.4k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL13rev_fetch_mrpEPNS0_10rev_structE:
  504|  32.3k|    {
  505|  32.3k|      if (mrp->bits < 32) // if there are less than 32 bits in mrp->tmp
  ------------------
  |  Branch (505:11): [True: 3.05k, False: 29.3k]
  ------------------
  506|  3.05k|      {
  507|  3.05k|        rev_read_mrp(mrp);    // read 30-32 bits from mrp
  508|  3.05k|        if (mrp->bits < 32)   // if there is a space of 32 bits
  ------------------
  |  Branch (508:13): [True: 265, False: 2.79k]
  ------------------
  509|    265|          rev_read_mrp(mrp);  // read more
  510|  3.05k|      }
  511|  32.3k|      return (ui32)mrp->tmp;  // return the head of mrp->tmp
  512|  32.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL15rev_advance_mrpEPNS0_10rev_structEj:
  522|  32.3k|    {
  523|       |      assert(num_bits <= mrp->bits); // we must not consume more than mrp->bits
  524|  32.3k|      mrp->tmp >>= num_bits;  // discard the lowest num_bits bits
  525|  32.3k|      mrp->bits -= num_bits;
  526|  32.3k|      return (ui32)mrp->tmp;  // return data after consumption
  527|  32.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_init8ILh255EEEvPNS0_13frwd_struct64EPKhi:
  690|  17.8k|    {
  691|  17.8k|      msp->data = data;
  692|  17.8k|      msp->tmp = 0;
  693|  17.8k|      msp->bits = 0;
  694|  17.8k|      msp->unstuff = 0;
  695|  17.8k|      msp->size = size;
  696|  17.8k|      frwd_read8<X>(msp); // read 8 bits
  697|  17.8k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_read8ILh255EEEvPNS0_13frwd_struct64E:
  626|   186k|    {
  627|   186k|      ui8 val = X;
  628|   186k|      if (msp->size > 0) {
  ------------------
  |  Branch (628:11): [True: 143k, False: 43.6k]
  ------------------
  629|   143k|        val = *msp->data;  // read 8 bits
  630|   143k|        ++msp->data;      // increment pointer
  631|   143k|        --msp->size;      // reduce size
  632|   143k|      }
  633|       |
  634|       |      // unstuff and accumulate
  635|   186k|      ui8 t = msp->unstuff ? 1 : 0;
  ------------------
  |  Branch (635:15): [True: 36.4k, False: 150k]
  ------------------
  636|   186k|      val = (ui8)(val & (0xFFU >> t));
  637|   186k|      msp->unstuff = (val == 0xFF);
  638|   186k|      msp->tmp |= ((ui64)val) << msp->bits;  // move data to msp->tmp
  639|   186k|      msp->bits += 8 - t;
  640|   186k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12frwd_fetch64ILh255EEEmPNS0_13frwd_struct64E:
  743|   187k|    {
  744|   356k|      while (msp->bits <= 56)
  ------------------
  |  Branch (744:14): [True: 168k, False: 187k]
  ------------------
  745|   168k|        frwd_read8<X>(msp);
  746|   187k|      return msp->tmp;
  747|   187k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL9frwd_initILi0EEEvPNS0_13frwd_struct64EPKhi:
  654|  11.6k|    {
  655|  11.6k|      msp->data = data;
  656|  11.6k|      msp->tmp = 0;
  657|  11.6k|      msp->bits = 0;
  658|  11.6k|      msp->unstuff = 0;
  659|  11.6k|      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|  11.6k|      int num = 4 - (int)(intptr_t(msp->data) & 0x3);
  666|  40.6k|      for (int i = 0; i < num; ++i)
  ------------------
  |  Branch (666:23): [True: 29.0k, False: 11.6k]
  ------------------
  667|  29.0k|      {
  668|  29.0k|        ui64 d;
  669|       |        //read a byte if the buffer is not exhausted, otherwise set it to X
  670|  29.0k|        d = msp->size-- > 0 ? *msp->data++ : X;
  ------------------
  |  Branch (670:13): [True: 27.1k, False: 1.86k]
  ------------------
  671|  29.0k|        msp->tmp |= (d << msp->bits);      // store data in msp->tmp
  672|  29.0k|        msp->bits += 8 - msp->unstuff;     // number of bits added to msp->tmp
  673|  29.0k|        msp->unstuff = ((d & 0xFF) == 0xFF); // unstuffing for next byte
  674|  29.0k|      }
  675|  11.6k|      frwd_read<X>(msp); // read 32 bits more
  676|  11.6k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL9frwd_readILi0EEEvPNS0_13frwd_struct64E:
  562|  23.2k|    {
  563|  23.2k|      assert(msp->bits <= 32); // assert that there is a space for 32 bits
  564|       |
  565|  23.2k|      ui32 val = 0;
  566|  23.2k|      if (msp->size > 3) {
  ------------------
  |  Branch (566:11): [True: 12.9k, False: 10.3k]
  ------------------
  567|  12.9k|        val = *(ui32*)msp->data;  // read 32 bits
  568|  12.9k|        msp->data += 4;           // increment pointer
  569|  12.9k|        msp->size -= 4;           // reduce size
  570|  12.9k|      }
  571|  10.3k|      else if (msp->size > 0)
  ------------------
  |  Branch (571:16): [True: 4.32k, False: 5.97k]
  ------------------
  572|  4.32k|      {
  573|  4.32k|        int i = 0;
  574|  4.32k|        val = X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (574:15): [Folded, False: 4.32k]
  ------------------
  575|  12.5k|        while (msp->size > 0) {   
  ------------------
  |  Branch (575:16): [True: 8.25k, False: 4.32k]
  ------------------
  576|  8.25k|          ui32 v = *msp->data++;    // read one byte at a time
  577|  8.25k|          ui32 m = ~(0xFFu << i);    // mask of location
  578|  8.25k|          val = (val & m) | (v << i);// put one byte in its correct location
  579|  8.25k|          --msp->size;
  580|  8.25k|          i += 8;          
  581|  8.25k|        }
  582|  4.32k|      }
  583|  5.97k|      else
  584|  5.97k|        val = X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (584:15): [Folded, False: 5.97k]
  ------------------
  585|       |
  586|       |      // we accumulate in t and keep a count of the number of bits in bits
  587|  23.2k|      ui32 bits = 8 - msp->unstuff;        
  588|  23.2k|      ui32 t = val & 0xFF;
  589|  23.2k|      bool unstuff = ((val & 0xFF) == 0xFF);  // Do we need unstuffing next?
  590|       |
  591|  23.2k|      t |= ((val >> 8) & 0xFF) << bits;
  592|  23.2k|      bits += 8 - unstuff;
  593|  23.2k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  594|       |
  595|  23.2k|      t |= ((val >> 16) & 0xFF) << bits;
  596|  23.2k|      bits += 8 - unstuff;
  597|  23.2k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  598|       |
  599|  23.2k|      t |= ((val >> 24) & 0xFF) << bits;
  600|  23.2k|      bits += 8 - unstuff;
  601|  23.2k|      msp->unstuff = (((val >> 24) & 0xFF) == 0xFF); // for next byte
  602|       |
  603|  23.2k|      msp->tmp |= ((ui64)t) << msp->bits;  // move data to msp->tmp
  604|  23.2k|      msp->bits += bits;
  605|  23.2k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_fetchILi0EEEjPNS0_13frwd_struct64E:
  723|  45.6k|    {
  724|  45.6k|      if (msp->bits < 32)
  ------------------
  |  Branch (724:11): [True: 11.2k, False: 34.4k]
  ------------------
  725|  11.2k|      {
  726|  11.2k|        frwd_read<X>(msp);
  727|  11.2k|        if (msp->bits < 32) //need to test
  ------------------
  |  Branch (727:13): [True: 296, False: 10.9k]
  ------------------
  728|    296|          frwd_read<X>(msp);
  729|  11.2k|      }
  730|  45.6k|      return (ui32)msp->tmp;
  731|  45.6k|    }

_ZN4ojph5local26ojph_decode_codeblock_avx2EPhPjjjjjjjjb:
 1073|  34.3k|    {
 1074|  34.3k|      static bool insufficient_precision = false;
 1075|  34.3k|      static bool modify_code = false;
 1076|  34.3k|      static bool truncate_spp_mrp = false;
 1077|       |
 1078|  34.3k|      if (num_passes > 1 && lengths2 == 0)
  ------------------
  |  Branch (1078:11): [True: 28.1k, False: 6.22k]
  |  Branch (1078:29): [True: 5.33k, False: 22.7k]
  ------------------
 1079|  5.33k|      {
 1080|  5.33k|        OJPH_WARN(0x00010001, "A malformed codeblock that has more than "
  ------------------
  |  |  287|  5.33k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  5.33k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5.33k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1081|  5.33k|                              "one coding pass, but zero length for "
 1082|  5.33k|                              "2nd and potential 3rd pass.");
 1083|  5.33k|        num_passes = 1;
 1084|  5.33k|      }
 1085|       |
 1086|  34.3k|      if (num_passes > 3)
  ------------------
  |  Branch (1086:11): [True: 0, False: 34.3k]
  ------------------
 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|  34.3k|      if (missing_msbs > 30) // p < 0
  ------------------
  |  Branch (1094:11): [True: 703, False: 33.6k]
  ------------------
 1095|    703|      {
 1096|    703|        if (insufficient_precision == false)
  ------------------
  |  Branch (1096:13): [True: 1, False: 702]
  ------------------
 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|    703|        return false;
 1104|    703|      }
 1105|  33.6k|      else if (missing_msbs == 30) // p == 0
  ------------------
  |  Branch (1105:16): [True: 353, False: 33.3k]
  ------------------
 1106|    353|      { // not enough precision to decode and set the bin center to 1
 1107|    353|        if (modify_code == false) {
  ------------------
  |  Branch (1107:13): [True: 1, False: 352]
  ------------------
 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|    353|         return false;         // 32 bits are not enough to decode this
 1115|    353|       }
 1116|  33.3k|      else if (missing_msbs == 29) // if p is 1, then num_passes must be 1
  ------------------
  |  Branch (1116:16): [True: 631, False: 32.6k]
  ------------------
 1117|    631|      {
 1118|    631|        if (num_passes > 1) {
  ------------------
  |  Branch (1118:13): [True: 297, False: 334]
  ------------------
 1119|    297|          num_passes = 1;
 1120|    297|          if (truncate_spp_mrp == false) {
  ------------------
  |  Branch (1120:15): [True: 1, False: 296]
  ------------------
 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|    297|        }
 1128|    631|      }
 1129|  33.3k|      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|  33.3k|      if (lengths1 < 2)
  ------------------
  |  Branch (1133:11): [True: 0, False: 33.3k]
  ------------------
 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|  33.3k|      int lcup, scup;
 1141|  33.3k|      lcup = (int)lengths1;  // length of CUP
 1142|       |      //scup is the length of MEL + VLC
 1143|  33.3k|      scup = (((int)coded_data[lcup-1]) << 4) + (coded_data[lcup-2] & 0xF);
 1144|  33.3k|      if (scup < 2 || scup > lcup || scup > 4079) //something is wrong
  ------------------
  |  Branch (1144:11): [True: 3.70k, False: 29.5k]
  |  Branch (1144:23): [True: 14.0k, False: 15.5k]
  |  Branch (1144:38): [True: 60, False: 15.4k]
  ------------------
 1145|  17.8k|        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|  15.4k|      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|  15.4k|      ui32 sstr = ((width + 2u) + 7u) & ~7u; // multiples of 8
 1171|       |
 1172|  15.4k|      assert((stride & 0x3) == 0);
 1173|       |
 1174|  15.4k|      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|  15.4k|      {
 1184|       |        // init structures
 1185|  15.4k|        dec_mel_st mel;
 1186|  15.4k|        mel_init(&mel, coded_data, lcup, scup);
 1187|  15.4k|        rev_struct vlc;
 1188|  15.4k|        rev_init(&vlc, coded_data, lcup, scup);
 1189|       |
 1190|  15.4k|        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|  15.4k|        ui32 vlc_val;
 1195|  15.4k|        ui32 c_q = 0;
 1196|  15.4k|        ui16 *sp = scratch;
 1197|       |        //initial quad row
 1198|  77.2k|        for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1198:26): [True: 61.7k, False: 15.4k]
  ------------------
 1199|  61.7k|        {
 1200|       |          // decode VLC
 1201|       |          /////////////
 1202|       |
 1203|       |          // first quad
 1204|  61.7k|          vlc_val = rev_fetch(&vlc);
 1205|       |
 1206|       |          //decode VLC using the context c_q and the head of VLC bitstream
 1207|  61.7k|          ui16 t0 = vlc_tbl0[ c_q + (vlc_val & 0x7F) ];
 1208|       |
 1209|       |          // if context is zero, use one MEL event
 1210|  61.7k|          if (c_q == 0) //zero context
  ------------------
  |  Branch (1210:15): [True: 37.6k, False: 24.0k]
  ------------------
 1211|  37.6k|          {
 1212|  37.6k|            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|  37.6k|            t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1217:18): [True: 22.1k, False: 15.4k]
  ------------------
 1218|       |
 1219|       |            // is run -1 or -2? this means a run has been consumed
 1220|  37.6k|            if (run < 0)
  ------------------
  |  Branch (1220:17): [True: 34.8k, False: 2.77k]
  ------------------
 1221|  34.8k|              run = mel_get_run(&mel);  // get another run
 1222|  37.6k|          }
 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|  61.7k|          sp[0] = t0;
 1228|  61.7k|          x += 2;
 1229|       |
 1230|       |          // prepare context for the next quad; eqn. 1 in ITU T.814
 1231|  61.7k|          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|  61.7k|          vlc_val = rev_advance(&vlc, t0 & 0x7);
 1235|       |
 1236|       |          //second quad
 1237|  61.7k|          ui16 t1 = 0;
 1238|       |
 1239|       |          //decode VLC using the context c_q and the head of VLC bitstream
 1240|  61.7k|          t1 = vlc_tbl0[c_q + (vlc_val & 0x7F)];
 1241|       |
 1242|       |          // if context is zero, use one MEL event
 1243|  61.7k|          if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1243:15): [True: 21.1k, False: 40.6k]
  |  Branch (1243:27): [True: 17.6k, False: 3.44k]
  ------------------
 1244|  17.6k|          {
 1245|  17.6k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1246|       |
 1247|       |            // if event is 0, discard decoded t1
 1248|  17.6k|            t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1248:18): [True: 6.26k, False: 11.3k]
  ------------------
 1249|       |
 1250|  17.6k|            if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1250:17): [True: 11.0k, False: 6.59k]
  ------------------
 1251|  11.0k|              run = mel_get_run(&mel); // if yes, then get another run
 1252|  17.6k|          }
 1253|  61.7k|          t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1253:16): [True: 52.3k, False: 9.36k]
  ------------------
 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|  61.7k|          sp[2] = t1;
 1259|  61.7k|          x += 2;
 1260|       |
 1261|       |          //prepare context for the next quad, eqn. 1 in ITU T.814
 1262|  61.7k|          c_q = ((t1 & 0x10U) << 3) | ((t1 & 0xE0U) << 2);
 1263|       |
 1264|       |          //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1265|  61.7k|          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|  61.7k|          ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1271|  61.7k|          if (uvlc_mode == 0xc0)// if both u_offset are set, get an event from
  ------------------
  |  Branch (1271:15): [True: 14.3k, False: 47.3k]
  ------------------
 1272|  14.3k|          {                     // the MEL run of events
 1273|  14.3k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1274|       |
 1275|  14.3k|            uvlc_mode += (run == -1) ? 0x40 : 0; // increment uvlc_mode by
  ------------------
  |  Branch (1275:26): [True: 7.64k, False: 6.71k]
  ------------------
 1276|       |                                                 // is 0x40
 1277|       |
 1278|  14.3k|            if (run < 0)//if run is consumed (run is -1 or -2), get another run
  ------------------
  |  Branch (1278:17): [True: 12.2k, False: 2.14k]
  ------------------
 1279|  12.2k|              run = mel_get_run(&mel);
 1280|  14.3k|          }
 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|  61.7k|          ui32 uvlc_entry = uvlc_tbl0[uvlc_mode + (vlc_val & 0x3F)];
 1288|       |          //remove total prefix length
 1289|  61.7k|          vlc_val = rev_advance(&vlc, uvlc_entry & 0x7);
 1290|  61.7k|          uvlc_entry >>= 3;
 1291|       |          //extract suffixes for quad 0 and 1
 1292|  61.7k|          ui32 len = uvlc_entry & 0xF;           //suffix length for 2 quads
 1293|  61.7k|          ui32 tmp = vlc_val & ((1 << len) - 1); //suffix value for 2 quads
 1294|  61.7k|          vlc_val = rev_advance(&vlc, len);
 1295|  61.7k|          ojph_unused(vlc_val); //static code analysis: unused value
  ------------------
  |  |   78|  61.7k|#define ojph_unused(x) (void)(x)
  ------------------
 1296|  61.7k|          uvlc_entry >>= 4;
 1297|       |          // quad 0 length
 1298|  61.7k|          len = uvlc_entry & 0x7; // quad 0 suffix length
 1299|  61.7k|          uvlc_entry >>= 3;
 1300|  61.7k|          ui16 u_q = (ui16)(1 + (uvlc_entry&7) + (tmp&~(0xFFU<<len))); //kap. 1
 1301|  61.7k|          sp[1] = u_q;
 1302|  61.7k|          u_q = (ui16)(1 + (uvlc_entry >> 3) + (tmp >> len));  //kappa == 1
 1303|  61.7k|          sp[3] = u_q;
 1304|  61.7k|        }
 1305|  15.4k|        sp[0] = sp[1] = 0;
 1306|       |
 1307|       |        //non initial quad rows
 1308|  43.1k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1308:26): [True: 27.6k, False: 15.4k]
  ------------------
 1309|  27.6k|        {
 1310|  27.6k|          c_q = 0;                                // context
 1311|  27.6k|          ui16 *sp = scratch + (y >> 1) * sstr;   // this row of quads
 1312|       |
 1313|   120k|          for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1313:28): [True: 92.6k, False: 27.6k]
  ------------------
 1314|  92.6k|          {
 1315|       |            // decode VLC
 1316|       |            /////////////
 1317|       |
 1318|       |            // sigma_q (n, ne, nf)
 1319|  92.6k|            c_q |= ((sp[0 - (si32)sstr] & 0xA0U) << 2);
 1320|  92.6k|            c_q |= ((sp[2 - (si32)sstr] & 0x20U) << 4);
 1321|       |
 1322|       |            // first quad
 1323|  92.6k|            vlc_val = rev_fetch(&vlc);
 1324|       |
 1325|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1326|  92.6k|            ui16 t0 = vlc_tbl1[ c_q + (vlc_val & 0x7F) ];
 1327|       |
 1328|       |            // if context is zero, use one MEL event
 1329|  92.6k|            if (c_q == 0) //zero context
  ------------------
  |  Branch (1329:17): [True: 63.2k, False: 29.4k]
  ------------------
 1330|  63.2k|            {
 1331|  63.2k|              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|  63.2k|              t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1336:20): [True: 17.1k, False: 46.0k]
  ------------------
 1337|       |
 1338|       |              // is run -1 or -2? this means a run has been consumed
 1339|  63.2k|              if (run < 0)
  ------------------
  |  Branch (1339:19): [True: 26.3k, False: 36.8k]
  ------------------
 1340|  26.3k|                run = mel_get_run(&mel);  // get another run
 1341|  63.2k|            }
 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|  92.6k|            sp[0] = t0;
 1347|  92.6k|            x += 2;
 1348|       |
 1349|       |            // prepare context for the next quad; eqn. 2 in ITU T.814
 1350|       |            // sigma_q (w, sw)
 1351|  92.6k|            c_q = ((t0 & 0x40U) << 2) | ((t0 & 0x80U) << 1);
 1352|       |            // sigma_q (nw)
 1353|  92.6k|            c_q |= sp[0 - (si32)sstr] & 0x80;
 1354|       |            // sigma_q (n, ne, nf)
 1355|  92.6k|            c_q |= ((sp[2 - (si32)sstr] & 0xA0U) << 2);
 1356|  92.6k|            c_q |= ((sp[4 - (si32)sstr] & 0x20U) << 4);
 1357|       |
 1358|       |            //remove data from vlc stream (0 bits are removed if vlc is unused)
 1359|  92.6k|            vlc_val = rev_advance(&vlc, t0 & 0x7);
 1360|       |
 1361|       |            //second quad
 1362|  92.6k|            ui16 t1 = 0;
 1363|       |
 1364|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1365|  92.6k|            t1 = vlc_tbl1[ c_q + (vlc_val & 0x7F)];
 1366|       |
 1367|       |            // if context is zero, use one MEL event
 1368|  92.6k|            if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1368:17): [True: 62.9k, False: 29.6k]
  |  Branch (1368:29): [True: 54.6k, False: 8.27k]
  ------------------
 1369|  54.6k|            {
 1370|  54.6k|              run -= 2; //subtract 2, since events number if multiplied by 2
 1371|       |
 1372|       |              // if event is 0, discard decoded t1
 1373|  54.6k|              t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1373:20): [True: 10.8k, False: 43.7k]
  ------------------
 1374|       |
 1375|  54.6k|              if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1375:19): [True: 19.6k, False: 35.0k]
  ------------------
 1376|  19.6k|                run = mel_get_run(&mel); // if yes, then get another run
 1377|  54.6k|            }
 1378|  92.6k|            t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1378:18): [True: 80.6k, False: 11.9k]
  ------------------
 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|  92.6k|            sp[2] = t1;
 1384|  92.6k|            x += 2;
 1385|       |
 1386|       |            // partial c_q, will be completed when we process the next quad
 1387|       |            // sigma_q (w, sw)
 1388|  92.6k|            c_q = ((t1 & 0x40U) << 2) | ((t1 & 0x80U) << 1);
 1389|       |            // sigma_q (nw)
 1390|  92.6k|            c_q |= sp[2 - (si32)sstr] & 0x80;
 1391|       |
 1392|       |            //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1393|  92.6k|            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|  92.6k|            ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1399|  92.6k|            ui32 uvlc_entry = uvlc_tbl1[uvlc_mode + (vlc_val & 0x3F)];
 1400|       |            //remove total prefix length
 1401|  92.6k|            vlc_val = rev_advance(&vlc, uvlc_entry & 0x7);
 1402|  92.6k|            uvlc_entry >>= 3;
 1403|       |            //extract suffixes for quad 0 and 1
 1404|  92.6k|            ui32 len = uvlc_entry & 0xF;           //suffix length for 2 quads
 1405|  92.6k|            ui32 tmp = vlc_val & ((1 << len) - 1); //suffix value for 2 quads
 1406|  92.6k|            vlc_val = rev_advance(&vlc, len);
 1407|  92.6k|            ojph_unused(vlc_val); //static code analysis: unused value
  ------------------
  |  |   78|  92.6k|#define ojph_unused(x) (void)(x)
  ------------------
 1408|  92.6k|            uvlc_entry >>= 4;
 1409|       |            // quad 0 length
 1410|  92.6k|            len = uvlc_entry & 0x7; // quad 0 suffix length
 1411|  92.6k|            uvlc_entry >>= 3;
 1412|  92.6k|            ui16 u_q = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
 1413|  92.6k|            sp[1] = u_q;
 1414|  92.6k|            u_q = (ui16)((uvlc_entry >> 3) + (tmp >> len)); // u_q
 1415|  92.6k|            sp[3] = u_q;
 1416|  92.6k|          }
 1417|  27.6k|          sp[0] = sp[1] = 0;
 1418|  27.6k|        }
 1419|  15.4k|      }
 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|  15.4k|      if (mmsbp2 >= 16)
  ------------------
  |  Branch (1429:11): [True: 2.68k, False: 12.8k]
  ------------------
 1430|  2.68k|      {
 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|  2.68k|        const int v_n_size = 512 + 16;
 1438|  2.68k|        ui32 v_n_scratch[2 * v_n_size] = {0}; // 4+ kB
 1439|       |
 1440|  2.68k|        frwd_struct_avx2 magsgn;
 1441|  2.68k|        frwd_init<0xFF>(&magsgn, coded_data, lcup - scup);
 1442|       |
 1443|  2.68k|        const __m256i avx_mmsbp2 = _mm256_set1_epi32((int)mmsbp2);
 1444|       |
 1445|  2.68k|        {
 1446|  2.68k|          ui16 *sp = scratch;
 1447|  2.68k|          ui32 *vp = v_n_scratch;
 1448|  2.68k|          ui32 *dp = decoded_data;
 1449|  2.68k|          vp[0] = 2; // for easy calculation of emax
 1450|       |
 1451|  13.3k|          for (ui32 x = 0; x < width; x += 4, sp += 4, vp += 2, dp += 4)
  ------------------
  |  Branch (1451:28): [True: 10.8k, False: 2.56k]
  ------------------
 1452|  10.8k|          {
 1453|  10.8k|            __m128i vn = _mm_set1_epi32(2);
 1454|       |
 1455|  10.8k|            __m256i inf_u_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)sp));
 1456|  10.8k|            inf_u_q = _mm256_permutevar8x32_epi32(inf_u_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1457|       |
 1458|  10.8k|            __m256i U_q = _mm256_srli_epi32(inf_u_q, 16);
 1459|  10.8k|            __m256i w = _mm256_cmpgt_epi32(U_q, avx_mmsbp2);
 1460|  10.8k|            if (!_mm256_testz_si256(w, w)) {
  ------------------
  |  Branch (1460:17): [True: 121, False: 10.6k]
  ------------------
 1461|    121|                return false;
 1462|    121|            }
 1463|       |
 1464|  10.6k|            __m256i row = decode_two_quad32_avx2(inf_u_q, U_q, &magsgn, p, vn);
 1465|  10.6k|            row = _mm256_permutevar8x32_epi32(row, _mm256_setr_epi32(0, 2, 4, 6, 1, 3, 5, 7));
 1466|  10.6k|            _mm_store_si128((__m128i*)dp, _mm256_castsi256_si128(row));
 1467|  10.6k|            _mm_store_si128((__m128i*)(dp + stride), _mm256_extracti128_si256(row, 0x1));
 1468|       |
 1469|  10.6k|            __m128i w0 = _mm_cvtsi32_si128(*(int const*)vp);
 1470|  10.6k|            w0 = _mm_or_si128(w0, vn);
 1471|  10.6k|            _mm_storeu_si128((__m128i*)vp, w0);
 1472|  10.6k|          }
 1473|  2.68k|        }
 1474|       |
 1475|  7.07k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1475:26): [True: 4.73k, False: 2.33k]
  ------------------
 1476|  4.73k|        {
 1477|  4.73k|          {
 1478|       |            // perform 31 - count_leading_zeros(*vp) here
 1479|  4.73k|            ui32 *vp = v_n_scratch;
 1480|  4.73k|            ui16* sp = scratch + (y >> 1) * sstr;
 1481|       |
 1482|  4.73k|            const __m256i avx_31 = _mm256_set1_epi32(31);
 1483|  4.73k|            const __m256i avx_f0 = _mm256_set1_epi32(0xF0);
 1484|  4.73k|            const __m256i avx_1 = _mm256_set1_epi32(1);
 1485|  4.73k|            const __m256i avx_0 = _mm256_setzero_si256();
 1486|       |
 1487|  11.3k|            for (ui32 x = 0; x <= width; x += 16, vp += 8, sp += 16) {
  ------------------
  |  Branch (1487:30): [True: 6.82k, False: 4.51k]
  ------------------
 1488|  6.82k|              __m256i v = _mm256_loadu_si256((__m256i*)vp);
 1489|  6.82k|              __m256i v_p1 = _mm256_loadu_si256((__m256i*)(vp + 1));
 1490|  6.82k|              v = _mm256_or_si256(v, v_p1);
 1491|  6.82k|              v = avx2_lzcnt_epi32(v);
 1492|  6.82k|              v = _mm256_sub_epi32(avx_31, v);
 1493|       |
 1494|  6.82k|              __m256i inf_u_q = _mm256_loadu_si256((__m256i*)sp);
 1495|  6.82k|              __m256i gamma = _mm256_and_si256(inf_u_q, avx_f0);
 1496|  6.82k|              __m256i w0 = _mm256_sub_epi32(gamma, avx_1);
 1497|  6.82k|              gamma = _mm256_and_si256(gamma, w0);
 1498|  6.82k|              gamma = _mm256_cmpeq_epi32(gamma, avx_0);
 1499|       |
 1500|  6.82k|              v = _mm256_andnot_si256(gamma, v);
 1501|  6.82k|              v = _mm256_max_epi32(v, avx_1);
 1502|       |
 1503|  6.82k|              inf_u_q = _mm256_srli_epi32(inf_u_q, 16);
 1504|  6.82k|              v = _mm256_add_epi32(inf_u_q, v);
 1505|       |
 1506|  6.82k|              w0 = _mm256_cmpgt_epi32(v, avx_mmsbp2);
 1507|  6.82k|              if (!_mm256_testz_si256(w0, w0)) {
  ------------------
  |  Branch (1507:19): [True: 223, False: 6.59k]
  ------------------
 1508|    223|                  return false;
 1509|    223|              }
 1510|       |
 1511|  6.59k|              _mm256_storeu_si256((__m256i*)(vp + v_n_size), v);
 1512|  6.59k|            }
 1513|  4.73k|          }
 1514|       |
 1515|  4.51k|          ui32 *vp = v_n_scratch;
 1516|  4.51k|          ui16 *sp = scratch + (y >> 1) * sstr;
 1517|  4.51k|          ui32 *dp = decoded_data + y * stride;
 1518|  4.51k|          vp[0] = 2; // for easy calculation of emax
 1519|       |
 1520|  18.0k|          for (ui32 x = 0; x < width; x += 4, sp += 4, vp += 2, dp += 4) {
  ------------------
  |  Branch (1520:28): [True: 13.5k, False: 4.51k]
  ------------------
 1521|       |            //process two quads
 1522|  13.5k|            __m128i vn = _mm_set1_epi32(2);
 1523|       |
 1524|  13.5k|            __m256i inf_u_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)sp));
 1525|  13.5k|            inf_u_q = _mm256_permutevar8x32_epi32(inf_u_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1526|       |
 1527|  13.5k|            __m256i U_q = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)(vp + v_n_size)));
 1528|  13.5k|            U_q = _mm256_permutevar8x32_epi32(U_q, _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1));
 1529|       |
 1530|  13.5k|            __m256i row = decode_two_quad32_avx2(inf_u_q, U_q,  &magsgn, p, vn);
 1531|  13.5k|            row = _mm256_permutevar8x32_epi32(row, _mm256_setr_epi32(0, 2, 4, 6, 1, 3, 5, 7));
 1532|  13.5k|            _mm_store_si128((__m128i*)dp, _mm256_castsi256_si128(row));
 1533|  13.5k|            _mm_store_si128((__m128i*)(dp + stride), _mm256_extracti128_si256(row, 0x1));
 1534|       |
 1535|  13.5k|            __m128i w0 = _mm_cvtsi32_si128(*(int const*)vp);
 1536|  13.5k|            w0 = _mm_or_si128(w0, vn);
 1537|  13.5k|            _mm_storeu_si128((__m128i*)vp, w0);
 1538|  13.5k|          }
 1539|  4.51k|        }
 1540|  2.56k|      }
 1541|  12.8k|      else {
 1542|       |
 1543|       |        // reduce bitplane by 16 because we now have 16 bits instead of 32
 1544|  12.8k|        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|  12.8k|        const int v_n_size = 512 + 16;
 1553|  12.8k|        ui16 v_n_scratch[v_n_size] = {0}; // 1+ kB
 1554|  12.8k|        ui32 v_n_scratch_32[v_n_size] = {0}; // 2+ kB
 1555|       |
 1556|  12.8k|        frwd_struct_avx2 magsgn;
 1557|  12.8k|        frwd_init<0xFF>(&magsgn, coded_data, lcup - scup);
 1558|       |
 1559|  12.8k|        {
 1560|  12.8k|          ui16 *sp = scratch;
 1561|  12.8k|          ui16 *vp = v_n_scratch;
 1562|  12.8k|          ui32 *dp = decoded_data;
 1563|  12.8k|          vp[0] = 2; // for easy calculation of emax
 1564|       |
 1565|  38.9k|          for (ui32 x = 0; x < width; x += 8, sp += 8, vp += 4, dp += 8) {
  ------------------
  |  Branch (1565:28): [True: 27.3k, False: 11.5k]
  ------------------
 1566|       |              ////process four quads
 1567|  27.3k|              __m128i inf_u_q = _mm_loadu_si128((__m128i*)sp);
 1568|  27.3k|              __m128i U_q = _mm_srli_epi32(inf_u_q, 16);
 1569|  27.3k|              __m128i w = _mm_cmpgt_epi32(U_q, _mm_set1_epi32((int)mmsbp2));
 1570|  27.3k|              if (!_mm_testz_si128(w, w)) {
  ------------------
  |  Branch (1570:19): [True: 1.25k, False: 26.1k]
  ------------------
 1571|  1.25k|                  return false;
 1572|  1.25k|              }
 1573|       |
 1574|  26.1k|              __m128i vn = _mm_set1_epi16(2);
 1575|  26.1k|              __m256i row = decode_four_quad16(inf_u_q, U_q, &magsgn, p, vn);
 1576|       |
 1577|  26.1k|              w = _mm_cvtsi32_si128(*(unsigned short const*)(vp));
 1578|  26.1k|              _mm_storeu_si128((__m128i*)vp, _mm_or_si128(w, vn));
 1579|       |
 1580|  26.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));
 1581|  26.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));
 1582|       |
 1583|  26.1k|              _mm256_storeu_si256((__m256i*)dp, w0);
 1584|  26.1k|              _mm256_storeu_si256((__m256i*)(dp + stride), w1);
 1585|  26.1k|          }
 1586|  12.8k|        }
 1587|       |
 1588|  30.4k|        for (ui32 y = 2; y < height; y += 2) {
  ------------------
  |  Branch (1588:26): [True: 19.4k, False: 11.0k]
  ------------------
 1589|  19.4k|          {
 1590|       |            // perform 15 - count_leading_zeros(*vp) here
 1591|  19.4k|            ui16 *vp = v_n_scratch;
 1592|  19.4k|            ui32 *vp_32 = v_n_scratch_32;
 1593|       |
 1594|  19.4k|            ui16* sp = scratch + (y >> 1) * sstr;
 1595|  19.4k|            const __m256i avx_mmsbp2 = _mm256_set1_epi32((int)mmsbp2);
 1596|  19.4k|            const __m256i avx_31 = _mm256_set1_epi32(31);
 1597|  19.4k|            const __m256i avx_f0 = _mm256_set1_epi32(0xF0);
 1598|  19.4k|            const __m256i avx_1 = _mm256_set1_epi32(1);
 1599|  19.4k|            const __m256i avx_0 = _mm256_setzero_si256();
 1600|       |
 1601|  45.5k|            for (ui32 x = 0; x <= width; x += 16, vp += 8, sp += 16, vp_32 += 8) {
  ------------------
  |  Branch (1601:30): [True: 26.5k, False: 18.9k]
  ------------------
 1602|  26.5k|              __m128i v = _mm_loadu_si128((__m128i*)vp);
 1603|  26.5k|              __m128i v_p1 = _mm_loadu_si128((__m128i*)(vp + 1));
 1604|  26.5k|              v = _mm_or_si128(v, v_p1);
 1605|       |
 1606|  26.5k|              __m256i v_avx = _mm256_cvtepu16_epi32(v);
 1607|  26.5k|              v_avx = avx2_lzcnt_epi32(v_avx);
 1608|  26.5k|              v_avx = _mm256_sub_epi32(avx_31, v_avx);
 1609|       |
 1610|  26.5k|              __m256i inf_u_q = _mm256_loadu_si256((__m256i*)sp);
 1611|  26.5k|              __m256i gamma = _mm256_and_si256(inf_u_q, avx_f0);
 1612|  26.5k|              __m256i w0 = _mm256_sub_epi32(gamma, avx_1);
 1613|  26.5k|              gamma = _mm256_and_si256(gamma, w0);
 1614|  26.5k|              gamma = _mm256_cmpeq_epi32(gamma, avx_0);
 1615|       |
 1616|  26.5k|              v_avx = _mm256_andnot_si256(gamma, v_avx);
 1617|  26.5k|              v_avx = _mm256_max_epi32(v_avx, avx_1);
 1618|       |
 1619|  26.5k|              inf_u_q = _mm256_srli_epi32(inf_u_q, 16);
 1620|  26.5k|              v_avx = _mm256_add_epi32(inf_u_q, v_avx);
 1621|       |
 1622|  26.5k|              w0 = _mm256_cmpgt_epi32(v_avx, avx_mmsbp2);
 1623|  26.5k|              if (!_mm256_testz_si256(w0, w0)) {
  ------------------
  |  Branch (1623:19): [True: 521, False: 26.0k]
  ------------------
 1624|    521|                  return false;
 1625|    521|              }
 1626|       |
 1627|  26.0k|              _mm256_storeu_si256((__m256i*)vp_32, v_avx);
 1628|  26.0k|            }
 1629|  19.4k|          }
 1630|       |
 1631|  18.9k|          ui16 *vp = v_n_scratch;
 1632|  18.9k|          ui32* vp_32 = v_n_scratch_32;
 1633|  18.9k|          ui16 *sp = scratch + (y >> 1) * sstr;
 1634|  18.9k|          ui32 *dp = decoded_data + y * stride;
 1635|  18.9k|          vp[0] = 2; // for easy calculation of emax
 1636|       |
 1637|  51.6k|          for (ui32 x = 0; x < width; x += 8, sp += 8, vp += 4, dp += 8, vp_32 += 4) {
  ------------------
  |  Branch (1637:28): [True: 32.7k, False: 18.9k]
  ------------------
 1638|       |            ////process four quads
 1639|  32.7k|              __m128i inf_u_q = _mm_loadu_si128((__m128i*)sp);
 1640|  32.7k|              __m128i U_q = _mm_loadu_si128((__m128i*)vp_32);
 1641|       |
 1642|  32.7k|            __m128i vn = _mm_set1_epi16(2);
 1643|  32.7k|            __m256i row = decode_four_quad16(inf_u_q, U_q, &magsgn, p, vn);
 1644|       |
 1645|  32.7k|            __m128i w = _mm_cvtsi32_si128(*(unsigned short const*)(vp));
 1646|  32.7k|            _mm_storeu_si128((__m128i*)vp, _mm_or_si128(w, vn));
 1647|       |
 1648|  32.7k|            __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|  32.7k|            __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|  32.7k|            _mm256_storeu_si256((__m256i*)dp, w0);
 1652|  32.7k|            _mm256_storeu_si256((__m256i*)(dp + stride), w1);
 1653|  32.7k|          }
 1654|  18.9k|        }
 1655|       |
 1656|       |        // increase bitplane back by 16 because we need to process 32 bits
 1657|  11.0k|        p += 16;
 1658|  11.0k|      }
 1659|       |
 1660|  13.3k|      if (num_passes > 1)
  ------------------
  |  Branch (1660:11): [True: 10.0k, False: 3.29k]
  ------------------
 1661|  10.0k|      {
 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|  10.0k|        ui16* const sigma = scratch;
 1667|       |
 1668|  10.0k|        ui32 mstr = (width + 3u) >> 2;   // divide by 4, since each
 1669|       |                                         // ui16 contains 4 columns
 1670|  10.0k|        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|  10.0k|        {
 1676|  10.0k|          ui32 y;
 1677|       |
 1678|  10.0k|          const __m128i mask_3 = _mm_set1_epi32(0x30);
 1679|  10.0k|          const __m128i mask_C = _mm_set1_epi32(0xC0);
 1680|  10.0k|          const __m128i shuffle_mask = _mm_set_epi32(-1, -1, -1, 0x0C080400);
 1681|  26.6k|          for (y = 0; y < height; y += 4)
  ------------------
  |  Branch (1681:23): [True: 16.5k, False: 10.0k]
  ------------------
 1682|  16.5k|          {
 1683|  16.5k|            ui16* sp = scratch + (y >> 1) * sstr;
 1684|  16.5k|            ui16* dp = sigma + (y >> 2) * mstr;
 1685|  51.7k|            for (ui32 x = 0; x < width; x += 8, sp += 8, dp += 2)
  ------------------
  |  Branch (1685:30): [True: 35.2k, False: 16.5k]
  ------------------
 1686|  35.2k|            {
 1687|  35.2k|              __m128i s0, s1, u3, uC, t0, t1;
 1688|       |
 1689|  35.2k|              s0 = _mm_loadu_si128((__m128i*)(sp));
 1690|  35.2k|              u3 = _mm_and_si128(s0, mask_3);
 1691|  35.2k|              u3 = _mm_srli_epi32(u3, 4);
 1692|  35.2k|              uC = _mm_and_si128(s0, mask_C);
 1693|  35.2k|              uC = _mm_srli_epi32(uC, 2);
 1694|  35.2k|              t0 = _mm_or_si128(u3, uC);
 1695|       |
 1696|  35.2k|              s1 = _mm_loadu_si128((__m128i*)(sp + sstr));
 1697|  35.2k|              u3 = _mm_and_si128(s1, mask_3);
 1698|  35.2k|              u3 = _mm_srli_epi32(u3, 2);
 1699|  35.2k|              uC = _mm_and_si128(s1, mask_C);
 1700|  35.2k|              t1 = _mm_or_si128(u3, uC);
 1701|       |
 1702|  35.2k|              __m128i r = _mm_or_si128(t0, t1);
 1703|  35.2k|              r = _mm_shuffle_epi8(r, shuffle_mask);
 1704|       |
 1705|  35.2k|              *(ui32*)dp = (ui32)_mm_extract_epi32(r, 0);
 1706|  35.2k|            }
 1707|  16.5k|            dp[0] = 0; // set an extra entry on the right with 0
 1708|  16.5k|          }
 1709|  10.0k|          {
 1710|       |            // reset one row after the codeblock
 1711|  10.0k|            ui16* dp = sigma + (y >> 2) * mstr;
 1712|  10.0k|            __m128i zero = _mm_setzero_si128();
 1713|  21.9k|            for (ui32 x = 0; x < width; x += 32, dp += 8)
  ------------------
  |  Branch (1713:30): [True: 11.8k, False: 10.0k]
  ------------------
 1714|  11.8k|              _mm_storeu_si128((__m128i*)dp, zero);
 1715|  10.0k|            dp[0] = 0; // set an extra entry on the right with 0
 1716|  10.0k|          }
 1717|  10.0k|        }
 1718|       |
 1719|       |        // We perform Significance Propagation Pass here
 1720|  10.0k|        {
 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|  10.0k|          ui16 prev_row_sig[256 + 8] = {0}; // 528 Bytes
 1731|       |
 1732|  10.0k|          frwd_struct_avx2 sigprop;
 1733|  10.0k|          frwd_init<0>(&sigprop, coded_data + lengths1, (int)lengths2);
 1734|       |
 1735|  26.6k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1735:28): [True: 16.5k, False: 10.0k]
  ------------------
 1736|  16.5k|          {
 1737|  16.5k|            ui32 pattern = 0xFFFFu; // a pattern needed samples
 1738|  16.5k|            if (height - y < 4) {
  ------------------
  |  Branch (1738:17): [True: 4.61k, False: 11.9k]
  ------------------
 1739|  4.61k|              pattern = 0x7777u;
 1740|  4.61k|              if (height - y < 3) {
  ------------------
  |  Branch (1740:19): [True: 4.26k, False: 351]
  ------------------
 1741|  4.26k|                pattern = 0x3333u;
 1742|  4.26k|                if (height - y < 2)
  ------------------
  |  Branch (1742:21): [True: 1.53k, False: 2.72k]
  ------------------
 1743|  1.53k|                  pattern = 0x1111u;
 1744|  4.26k|              }
 1745|  4.61k|            }
 1746|       |
 1747|       |            // prev holds sign. info. for the previous quad, together
 1748|       |            // with the rows on top of it and below it.
 1749|  16.5k|            ui32 prev = 0;
 1750|  16.5k|            ui16 *prev_sig = prev_row_sig;
 1751|  16.5k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1752|  16.5k|            ui32 *dpp = decoded_data + y * stride;
 1753|  77.3k|            for (ui32 x = 0; x < width; x += 4, dpp += 4, ++cur_sig, ++prev_sig)
  ------------------
  |  Branch (1753:30): [True: 60.7k, False: 16.5k]
  ------------------
 1754|  60.7k|            {
 1755|       |              // only rows and columns inside the stripe are included
 1756|  60.7k|              si32 s = (si32)x + 4 - (si32)width;
 1757|  60.7k|              s = ojph_max(s, 0);
  ------------------
  |  |   73|  60.7k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 9.45k, False: 51.3k]
  |  |  ------------------
  ------------------
 1758|  60.7k|              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|  60.7k|              ui32 ps = *(ui32*)prev_sig;
 1773|  60.7k|              ui32 ns = *(ui32*)(cur_sig + mstr);
 1774|  60.7k|              ui32 u = (ps & 0x88888888) >> 3; // the row on top
 1775|  60.7k|              if (!stripe_causal)
  ------------------
  |  Branch (1775:19): [True: 60.2k, False: 555]
  ------------------
 1776|  60.2k|                u |= (ns & 0x11111111) << 3;   // the row below
 1777|       |
 1778|  60.7k|              ui32 cs = *(ui32*)cur_sig;
 1779|       |              // vertical integration
 1780|  60.7k|              ui32 mbr =  cs;                // this sig. info.
 1781|  60.7k|              mbr |= (cs & 0x77777777) << 1; //above neighbors
 1782|  60.7k|              mbr |= (cs & 0xEEEEEEEE) >> 1; //below neighbors
 1783|  60.7k|              mbr |= u;
 1784|       |              // horizontal integration
 1785|  60.7k|              ui32 t = mbr;
 1786|  60.7k|              mbr |= t << 4;      // neighbors on the left
 1787|  60.7k|              mbr |= t >> 4;      // neighbors on the right
 1788|  60.7k|              mbr |= prev >> 12;  // significance of previous group
 1789|       |
 1790|       |              // remove outside samples, and already significant samples
 1791|  60.7k|              mbr &= pattern;
 1792|  60.7k|              mbr &= ~cs;
 1793|       |
 1794|       |              // find samples that become significant during the SPP
 1795|  60.7k|              ui32 new_sig = mbr;
 1796|  60.7k|              if (new_sig)
  ------------------
  |  Branch (1796:19): [True: 39.7k, False: 20.9k]
  ------------------
 1797|  39.7k|              {
 1798|  39.7k|                __m128i cwd_vec = frwd_fetch<0>(&sigprop);
 1799|  39.7k|                ui32 cwd = (ui32)_mm_extract_epi16(cwd_vec, 0);
 1800|       |
 1801|  39.7k|                ui32 cnt = 0;
 1802|  39.7k|                ui32 col_mask = 0xFu;
 1803|  39.7k|                ui32 inv_sig = ~cs & pattern;
 1804|   198k|                for (int i = 0; i < 16; i += 4, col_mask <<= 4)
  ------------------
  |  Branch (1804:33): [True: 159k, False: 39.7k]
  ------------------
 1805|   159k|                {
 1806|   159k|                  if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1806:23): [True: 36.2k, False: 122k]
  ------------------
 1807|  36.2k|                    continue;
 1808|       |
 1809|       |                  //scan one column
 1810|   122k|                  ui32 sample_mask = 0x1111u & col_mask;
 1811|   122k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1811:23): [True: 77.4k, False: 45.5k]
  ------------------
 1812|  77.4k|                  {
 1813|  77.4k|                    new_sig &= ~sample_mask;
 1814|  77.4k|                    if (cwd & 1)
  ------------------
  |  Branch (1814:25): [True: 26.0k, False: 51.4k]
  ------------------
 1815|  26.0k|                    {
 1816|  26.0k|                      ui32 t = 0x33u << i;
 1817|  26.0k|                      new_sig |= t & inv_sig;
 1818|  26.0k|                    }
 1819|  77.4k|                    cwd >>= 1; ++cnt;
 1820|  77.4k|                  }
 1821|       |
 1822|   122k|                  sample_mask <<= 1;
 1823|   122k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1823:23): [True: 56.6k, False: 66.2k]
  ------------------
 1824|  56.6k|                  {
 1825|  56.6k|                    new_sig &= ~sample_mask;
 1826|  56.6k|                    if (cwd & 1)
  ------------------
  |  Branch (1826:25): [True: 11.8k, False: 44.8k]
  ------------------
 1827|  11.8k|                    {
 1828|  11.8k|                      ui32 t = 0x76u << i;
 1829|  11.8k|                      new_sig |= t & inv_sig;
 1830|  11.8k|                    }
 1831|  56.6k|                    cwd >>= 1; ++cnt;
 1832|  56.6k|                  }
 1833|       |
 1834|   122k|                  sample_mask <<= 1;
 1835|   122k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1835:23): [True: 69.7k, False: 53.2k]
  ------------------
 1836|  69.7k|                  {
 1837|  69.7k|                    new_sig &= ~sample_mask;
 1838|  69.7k|                    if (cwd & 1)
  ------------------
  |  Branch (1838:25): [True: 18.3k, False: 51.3k]
  ------------------
 1839|  18.3k|                    {
 1840|  18.3k|                      ui32 t = 0xECu << i;
 1841|  18.3k|                      new_sig |= t & inv_sig;
 1842|  18.3k|                    }
 1843|  69.7k|                    cwd >>= 1; ++cnt;
 1844|  69.7k|                  }
 1845|       |
 1846|   122k|                  sample_mask <<= 1;
 1847|   122k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1847:23): [True: 51.6k, False: 71.3k]
  ------------------
 1848|  51.6k|                  {
 1849|  51.6k|                    new_sig &= ~sample_mask;
 1850|  51.6k|                    if (cwd & 1)
  ------------------
  |  Branch (1850:25): [True: 16.6k, False: 34.9k]
  ------------------
 1851|  16.6k|                    {
 1852|  16.6k|                      ui32 t = 0xC8u << i;
 1853|  16.6k|                      new_sig |= t & inv_sig;
 1854|  16.6k|                    }
 1855|  51.6k|                    cwd >>= 1; ++cnt;
 1856|  51.6k|                  }
 1857|   122k|                }
 1858|       |
 1859|  39.7k|                if (new_sig)
  ------------------
  |  Branch (1859:21): [True: 20.3k, False: 19.4k]
  ------------------
 1860|  20.3k|                {
 1861|  20.3k|                  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|  20.3k|                  __m128i new_sig_vec = _mm_set1_epi16((si16)new_sig);
 1866|  20.3k|                  new_sig_vec = _mm_shuffle_epi8(new_sig_vec,
 1867|  20.3k|                    _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1868|  20.3k|                  new_sig_vec = _mm_and_si128(new_sig_vec,
 1869|  20.3k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1870|  20.3k|                  new_sig_vec = _mm_cmpeq_epi8(new_sig_vec,
 1871|  20.3k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1872|       |
 1873|       |                  // find cumulative sums
 1874|       |                  // to find which bit in cwd we should extract
 1875|  20.3k|                  __m128i inc_sum = new_sig_vec; // inclusive scan
 1876|  20.3k|                  inc_sum = _mm_abs_epi8(inc_sum); // cvrt to 0 or 1
 1877|  20.3k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 1));
 1878|  20.3k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 2));
 1879|  20.3k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 4));
 1880|  20.3k|                  inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 8));
 1881|  20.3k|                  cnt += (ui32)_mm_extract_epi16(inc_sum, 7) >> 8;
 1882|       |                  // exclusive scan
 1883|  20.3k|                  __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|  20.3k|                  cwd_vec = _mm_set1_epi16((si16)cwd);
 1888|  20.3k|                  cwd_vec = _mm_shuffle_epi8(cwd_vec,
 1889|  20.3k|                    _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1890|  20.3k|                  cwd_vec = _mm_and_si128(cwd_vec,
 1891|  20.3k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1892|  20.3k|                  cwd_vec = _mm_cmpeq_epi8(cwd_vec,
 1893|  20.3k|                    _mm_set1_epi64x((si64)0x8040201008040201));
 1894|  20.3k|                  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|  20.3k|                  __m128i v = _mm_shuffle_epi8(cwd_vec, ex_sum);
 1899|       |
 1900|       |                  // load data and set spp coefficients
 1901|  20.3k|                  __m128i m =
 1902|  20.3k|                    _mm_set_epi8(-1,-1,-1,12,-1,-1,-1,8,-1,-1,-1,4,-1,-1,-1,0);
 1903|  20.3k|                  __m128i val = _mm_set1_epi32(3 << (p - 2));
 1904|  20.3k|                  ui32 *dp = dpp;
 1905|   101k|                  for (int c = 0; c < 4; ++ c) {
  ------------------
  |  Branch (1905:35): [True: 81.2k, False: 20.3k]
  ------------------
 1906|  81.2k|                    __m128i s0, s0_ns, s0_val;
 1907|       |                    // load coefficients
 1908|  81.2k|                    s0 = _mm_load_si128((__m128i*)dp);
 1909|       |
 1910|       |                    // epi32 is -1 only for coefficient that
 1911|       |                    // are changed during the SPP
 1912|  81.2k|                    s0_ns = _mm_shuffle_epi8(new_sig_vec, m);
 1913|  81.2k|                    s0_ns = _mm_cmpeq_epi32(s0_ns, _mm_set1_epi32(0xFF));
 1914|       |
 1915|       |                    // obtain sign for coefficients in SPP
 1916|  81.2k|                    s0_val = _mm_shuffle_epi8(v, m);
 1917|  81.2k|                    s0_val = _mm_slli_epi32(s0_val, 31);
 1918|  81.2k|                    s0_val = _mm_or_si128(s0_val, val);
 1919|  81.2k|                    s0_val = _mm_and_si128(s0_val, s0_ns);
 1920|       |
 1921|       |                    // update vector
 1922|  81.2k|                    s0 = _mm_or_si128(s0, s0_val);
 1923|       |                    // store coefficients
 1924|  81.2k|                    _mm_store_si128((__m128i*)dp, s0);
 1925|       |                    // prepare for next row
 1926|  81.2k|                    dp += stride;
 1927|  81.2k|                    m = _mm_add_epi32(m, _mm_set1_epi32(1));
 1928|  81.2k|                  }
 1929|  20.3k|                }
 1930|  39.7k|                frwd_advance(&sigprop, cnt);
 1931|  39.7k|              }
 1932|       |
 1933|  60.7k|              new_sig |= cs;
 1934|  60.7k|              *prev_sig = (ui16)(new_sig);
 1935|       |
 1936|       |              // vertical integration for the new sig. info.
 1937|  60.7k|              t = new_sig;
 1938|  60.7k|              new_sig |= (t & 0x7777) << 1; //above neighbors
 1939|  60.7k|              new_sig |= (t & 0xEEEE) >> 1; //below neighbors
 1940|       |              // add sig. info. from the row on top and below
 1941|  60.7k|              prev = new_sig | u;
 1942|       |              // we need only the bits in 0xF000
 1943|  60.7k|              prev &= 0xF000;
 1944|  60.7k|            }
 1945|  16.5k|          }
 1946|  10.0k|        }
 1947|       |
 1948|       |        // We perform Magnitude Refinement Pass here
 1949|  10.0k|        if (num_passes > 2)
  ------------------
  |  Branch (1949:13): [True: 8.26k, False: 1.80k]
  ------------------
 1950|  8.26k|        {
 1951|  8.26k|          rev_struct magref;
 1952|  8.26k|          rev_init_mrp(&magref, coded_data, (int)lengths1, (int)lengths2);
 1953|       |
 1954|  21.0k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1954:28): [True: 12.7k, False: 8.26k]
  ------------------
 1955|  12.7k|          {
 1956|  12.7k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1957|  12.7k|            ui32 *dpp = decoded_data + y * stride;
 1958|  61.3k|            for (ui32 i = 0; i < width; i += 4, dpp += 4)
  ------------------
  |  Branch (1958:30): [True: 48.5k, False: 12.7k]
  ------------------
 1959|  48.5k|            {
 1960|       |              //Process one entry from sigma array at a time
 1961|       |              // Each nibble (4 bits) in the sigma array represents 4 rows,
 1962|  48.5k|              ui32 cwd = rev_fetch_mrp(&magref); // get 32 bit data
 1963|  48.5k|              ui16 sig = *cur_sig++; // 16 bit that will be processed now
 1964|  48.5k|              int total_bits = 0;
 1965|  48.5k|              if (sig) // if any of the 32 bits are set
  ------------------
  |  Branch (1965:19): [True: 37.4k, False: 11.1k]
  ------------------
 1966|  37.4k|              {
 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|  37.4k|                __m128i sig_vec = _mm_set1_epi16((si16)sig);
 1972|  37.4k|                sig_vec = _mm_shuffle_epi8(sig_vec,
 1973|  37.4k|                  _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1974|  37.4k|                sig_vec = _mm_and_si128(sig_vec,
 1975|  37.4k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1976|  37.4k|                sig_vec = _mm_cmpeq_epi8(sig_vec,
 1977|  37.4k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 1978|  37.4k|                sig_vec = _mm_abs_epi8(sig_vec);
 1979|       |
 1980|       |                // find cumulative sums
 1981|       |                // to find which bit in cwd we should extract
 1982|  37.4k|                __m128i inc_sum = sig_vec; // inclusive scan
 1983|  37.4k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 1));
 1984|  37.4k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 2));
 1985|  37.4k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 4));
 1986|  37.4k|                inc_sum = _mm_add_epi8(inc_sum, _mm_bslli_si128(inc_sum, 8));
 1987|  37.4k|                total_bits = _mm_extract_epi16(inc_sum, 7) >> 8;
 1988|  37.4k|                __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|  37.4k|                __m128i cwd_vec = _mm_set1_epi16((si16)cwd);
 1996|  37.4k|                cwd_vec = _mm_shuffle_epi8(cwd_vec,
 1997|  37.4k|                  _mm_set_epi8(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0));
 1998|  37.4k|                cwd_vec = _mm_and_si128(cwd_vec,
 1999|  37.4k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 2000|  37.4k|                cwd_vec = _mm_cmpeq_epi8(cwd_vec,
 2001|  37.4k|                  _mm_set1_epi64x((si64)0x8040201008040201));
 2002|  37.4k|                cwd_vec = _mm_add_epi8(cwd_vec, _mm_set1_epi8(1));
 2003|  37.4k|                cwd_vec = _mm_add_epi8(cwd_vec, cwd_vec);
 2004|  37.4k|                cwd_vec = _mm_or_si128(cwd_vec, _mm_set1_epi8(1));
 2005|       |
 2006|       |                // load data and insert the mrp bit
 2007|  37.4k|                __m128i m =
 2008|  37.4k|                  _mm_set_epi8(-1,-1,-1,12,-1,-1,-1,8,-1,-1,-1,4,-1,-1,-1,0);
 2009|  37.4k|                ui32 *dp = dpp;
 2010|   187k|                for (int c = 0; c < 4; ++c) {
  ------------------
  |  Branch (2010:33): [True: 149k, False: 37.4k]
  ------------------
 2011|   149k|                  __m128i s0, s0_sig, s0_idx, s0_val;
 2012|       |                  // load coefficients
 2013|   149k|                  s0 = _mm_load_si128((__m128i*)dp);
 2014|       |                  // find significant samples in this row
 2015|   149k|                  s0_sig = _mm_shuffle_epi8(sig_vec, m);
 2016|   149k|                  s0_sig = _mm_cmpeq_epi8(s0_sig, _mm_setzero_si128());
 2017|       |                  // get MRP bit index, and MRP pattern
 2018|   149k|                  s0_idx = _mm_shuffle_epi8(ex_sum, m);
 2019|   149k|                  s0_val = _mm_shuffle_epi8(cwd_vec, s0_idx);
 2020|       |                  // keep data from significant samples only
 2021|   149k|                  s0_val = _mm_andnot_si128(s0_sig, s0_val);
 2022|       |                  // move mrp bits to correct position, and employ
 2023|   149k|                  s0_val = _mm_slli_epi32(s0_val, (si32)p - 2);
 2024|   149k|                  s0 = _mm_xor_si128(s0, s0_val);
 2025|       |                  // store coefficients
 2026|   149k|                  _mm_store_si128((__m128i*)dp, s0);
 2027|       |                  // prepare for next row
 2028|   149k|                  dp += stride;
 2029|   149k|                  m = _mm_add_epi32(m, _mm_set1_epi32(1));
 2030|   149k|                }
 2031|  37.4k|              }
 2032|       |              // consume data according to the number of bits set
 2033|  48.5k|              rev_advance_mrp(&magref, (ui32)total_bits);
 2034|  48.5k|            }
 2035|  12.7k|          }
 2036|  8.26k|        }
 2037|  10.0k|      }
 2038|       |
 2039|  13.3k|      return true;
 2040|  15.4k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8mel_initEPNS0_10dec_mel_stEPhii:
  225|  15.4k|    {
  226|  15.4k|      melp->data = bbuf + lcup - scup; // move the pointer to the start of MEL
  227|  15.4k|      melp->bits = 0;                  // 0 bits in tmp
  228|  15.4k|      melp->tmp = 0;                   //
  229|  15.4k|      melp->unstuff = false;           // no unstuffing
  230|  15.4k|      melp->size = scup - 1;           // size is the length of MEL+VLC-1
  231|  15.4k|      melp->k = 0;                     // 0 for state
  232|  15.4k|      melp->num_runs = 0;              // num_runs is 0
  233|  15.4k|      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|  15.4k|      int num = 4 - (int)(intptr_t(melp->data) & 0x3);
  239|  57.2k|      for (int i = 0; i < num; ++i) { // this code is similar to mel_read
  ------------------
  |  Branch (239:23): [True: 41.7k, False: 15.4k]
  ------------------
  240|  41.7k|        assert(melp->unstuff == false || melp->data[0] <= 0x8F);
  241|  41.7k|        ui64 d = (melp->size > 0) ? *melp->data : 0xFF;//if buffer is consumed
  ------------------
  |  Branch (241:18): [True: 38.2k, False: 3.48k]
  ------------------
  242|       |                                                       //set data to 0xFF
  243|  41.7k|        if (melp->size == 1) d |= 0xF; //if this is MEL+VLC-1, set LSBs to 0xF
  ------------------
  |  Branch (243:13): [True: 3.36k, False: 38.4k]
  ------------------
  244|       |                                       // see the standard
  245|  41.7k|        melp->data += melp->size-- > 0; //increment if the end is not reached
  246|  41.7k|        int d_bits = 8 - melp->unstuff; //if unstuffing is needed, reduce by 1
  247|  41.7k|        melp->tmp = (melp->tmp << d_bits) | d; //store bits in tmp
  248|  41.7k|        melp->bits += d_bits;  //increment tmp by number of bits
  249|  41.7k|        melp->unstuff = ((d & 0xFF) == 0xFF); //true of next byte needs
  250|       |                                              //unstuffing
  251|  41.7k|      }
  252|  15.4k|      melp->tmp <<= (64 - melp->bits); //push all the way up so the first bit
  253|       |                                       // is the MSB
  254|  15.4k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8rev_initEPNS0_10rev_structEPhii:
  382|  15.4k|    {
  383|       |      //first byte has only the upper 4 bits
  384|  15.4k|      vlcp->data = data + lcup - 2;
  385|       |
  386|       |      //size can not be larger than this, in fact it should be smaller
  387|  15.4k|      vlcp->size = scup - 2;
  388|       |
  389|  15.4k|      ui32 d = *vlcp->data--; // read one byte (this is a half byte)
  390|  15.4k|      vlcp->tmp = d >> 4;    // both initialize and set
  391|  15.4k|      vlcp->bits = 4 - ((vlcp->tmp & 7) == 7); //check standard
  392|  15.4k|      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|  15.4k|      int num = 1 + (int)(intptr_t(vlcp->data) & 0x3);
  400|  15.4k|      int tnum = num < vlcp->size ? num : vlcp->size;
  ------------------
  |  Branch (400:18): [True: 10.7k, False: 4.70k]
  ------------------
  401|  50.9k|      for (int i = 0; i < tnum; ++i) {
  ------------------
  |  Branch (401:23): [True: 35.4k, False: 15.4k]
  ------------------
  402|  35.4k|        ui64 d;
  403|  35.4k|        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|  35.4k|        ui32 d_bits = 8 - ((vlcp->unstuff && ((d & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (405:29): [True: 13.7k, False: 21.7k]
  |  Branch (405:46): [True: 4.57k, False: 9.16k]
  ------------------
  406|  35.4k|        vlcp->tmp |= d << vlcp->bits; // move data to vlcp->tmp
  407|  35.4k|        vlcp->bits += d_bits;
  408|  35.4k|        vlcp->unstuff = d > 0x8F; // for next byte
  409|  35.4k|      }
  410|  15.4k|      vlcp->size -= tnum;
  411|  15.4k|      rev_read(vlcp);  // read another 32 buts
  412|  15.4k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8rev_readEPNS0_10rev_structE:
  312|  38.6k|    {
  313|       |      //process 4 bytes at a time
  314|  38.6k|      if (vlcp->bits > 32)  // if there are more than 32 bits in tmp, then
  ------------------
  |  Branch (314:11): [True: 3.27k, False: 35.3k]
  ------------------
  315|  3.27k|        return;             // reading 32 bits can overflow vlcp->tmp
  316|  35.3k|      ui32 val = 0;
  317|       |      //the next line (the if statement) needs to be tested first
  318|  35.3k|      if (vlcp->size > 3)  // if there are more than 3 bytes left in VLC
  ------------------
  |  Branch (318:11): [True: 15.0k, False: 20.3k]
  ------------------
  319|  15.0k|      {
  320|       |        // (vlcp->data - 3) move pointer back to read 32 bits at once
  321|  15.0k|        val = *(ui32*)(vlcp->data - 3); // then read 32 bits
  322|  15.0k|        vlcp->data -= 4;          // move data pointer back by 4
  323|  15.0k|        vlcp->size -= 4;          // reduce available byte by 4
  324|  15.0k|      }
  325|  20.3k|      else if (vlcp->size > 0)
  ------------------
  |  Branch (325:16): [True: 3.10k, False: 17.2k]
  ------------------
  326|  3.10k|      { // 4 or less
  327|  3.10k|        int i = 24;
  328|  10.0k|        while (vlcp->size > 0) {
  ------------------
  |  Branch (328:16): [True: 6.91k, False: 3.10k]
  ------------------
  329|  6.91k|          ui32 v = *vlcp->data--; // read one byte at a time
  330|  6.91k|          val |= (v << i);        // put byte in its correct location
  331|  6.91k|          --vlcp->size;
  332|  6.91k|          i -= 8;
  333|  6.91k|        }
  334|  3.10k|      }
  335|       |
  336|  35.3k|      __m128i tmp_vec = _mm_set1_epi32((int32_t)val);
  337|  35.3k|      tmp_vec = _mm_srlv_epi32(tmp_vec, _mm_setr_epi32(24, 16, 8, 0));
  338|  35.3k|      tmp_vec = _mm_and_si128(tmp_vec, _mm_set1_epi32(0xff));
  339|       |
  340|  35.3k|      __m128i unstuff_vec = _mm_cmpgt_epi32(tmp_vec, _mm_set1_epi32(0x8F));
  341|  35.3k|      bool unstuff_next = _mm_extract_epi32(unstuff_vec, 3);
  342|  35.3k|      unstuff_vec = _mm_slli_si128(unstuff_vec, 4);
  343|  35.3k|      unstuff_vec = _mm_insert_epi32(unstuff_vec, vlcp->unstuff * 0xffffffff, 0);
  344|       |
  345|  35.3k|      __m128i val_7f = _mm_set1_epi32(0x7F);
  346|  35.3k|      __m128i this_byte_7f = _mm_cmpeq_epi32(_mm_and_si128(tmp_vec, val_7f), val_7f);
  347|  35.3k|      unstuff_vec = _mm_and_si128(unstuff_vec, this_byte_7f);
  348|  35.3k|      unstuff_vec = _mm_srli_epi32(unstuff_vec, 31);
  349|       |
  350|  35.3k|      __m128i inc_sum = _mm_sub_epi32(_mm_set1_epi32(8), unstuff_vec);
  351|  35.3k|      inc_sum = _mm_add_epi32(inc_sum, _mm_bslli_si128(inc_sum, 4));
  352|  35.3k|      inc_sum = _mm_add_epi32(inc_sum, _mm_bslli_si128(inc_sum, 8));
  353|  35.3k|      ui32 total_bits = (ui32)_mm_extract_epi32(inc_sum, 3);
  354|       |
  355|  35.3k|      __m128i final_shift = _mm_slli_si128(inc_sum, 4);
  356|  35.3k|      tmp_vec = _mm_sllv_epi32(tmp_vec, final_shift);
  357|  35.3k|      tmp_vec = _mm_or_si128(tmp_vec, _mm_bsrli_si128(tmp_vec, 8));
  358|       |
  359|  35.3k|      ui64 tmp = (ui32)_mm_cvtsi128_si32(tmp_vec) | (ui32)_mm_extract_epi32(tmp_vec, 1);
  360|       |
  361|  35.3k|      vlcp->unstuff = unstuff_next;
  362|  35.3k|      vlcp->tmp |= tmp << vlcp->bits;
  363|  35.3k|      vlcp->bits += total_bits;
  364|  35.3k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11mel_get_runEPNS0_10dec_mel_stE:
  264|   119k|    {
  265|   119k|      if (melp->num_runs == 0)  //if no runs, decode more bit from MEL segment
  ------------------
  |  Branch (265:11): [True: 26.3k, False: 93.2k]
  ------------------
  266|  26.3k|        mel_decode(melp);
  267|       |
  268|   119k|      int t = melp->runs & 0x7F; //retrieve one run
  269|   119k|      melp->runs >>= 7;  // remove the retrieved run
  270|   119k|      melp->num_runs--;
  271|   119k|      return t; // return run
  272|   119k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL10mel_decodeEPNS0_10dec_mel_stE:
  174|  26.3k|    {
  175|  26.3k|      static const int mel_exp[13] = { //MEL exponents
  176|  26.3k|        0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5
  177|  26.3k|      };
  178|       |
  179|  26.3k|      if (melp->bits < 6) // if there are less than 6 bits in tmp
  ------------------
  |  Branch (179:11): [True: 3.71k, False: 22.6k]
  ------------------
  180|  3.71k|        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|   212k|      while (melp->bits >= 6 && melp->num_runs < 8)
  ------------------
  |  Branch (185:14): [True: 206k, False: 5.51k]
  |  Branch (185:33): [True: 185k, False: 20.8k]
  ------------------
  186|   185k|      {
  187|   185k|        int eval = mel_exp[melp->k]; // number of bits associated with state
  188|   185k|        int run = 0;
  189|   185k|        if (melp->tmp & (1ull<<63)) //The next bit to decode (stored in MSB)
  ------------------
  |  Branch (189:13): [True: 78.7k, False: 106k]
  ------------------
  190|  78.7k|        { //one is found
  191|  78.7k|          run = 1 << eval;
  192|  78.7k|          run--; // consecutive runs of 0 events - 1
  193|  78.7k|          melp->k = melp->k + 1 < 12 ? melp->k + 1 : 12;//increment, max is 12
  ------------------
  |  Branch (193:21): [True: 74.1k, False: 4.63k]
  ------------------
  194|  78.7k|          melp->tmp <<= 1; // consume one bit from tmp
  195|  78.7k|          melp->bits -= 1;
  196|  78.7k|          run = run << 1; // a stretch of zeros not terminating in one
  197|  78.7k|        }
  198|   106k|        else
  199|   106k|        { //0 is found
  200|   106k|          run = (int)(melp->tmp >> (63 - eval)) & ((1 << eval) - 1);
  201|   106k|          melp->k = melp->k - 1 > 0 ? melp->k - 1 : 0; //decrement, min is 0
  ------------------
  |  Branch (201:21): [True: 13.6k, False: 93.2k]
  ------------------
  202|   106k|          melp->tmp <<= eval + 1; //consume eval + 1 bits (max is 6)
  203|   106k|          melp->bits -= eval + 1;
  204|   106k|          run = (run << 1) + 1; // a stretch of zeros terminating with one
  205|   106k|        }
  206|   185k|        eval = melp->num_runs * 7;           // 7 bits per run
  207|   185k|        melp->runs &= ~((ui64)0x3F << eval); // 6 bits are sufficient
  208|   185k|        melp->runs |= ((ui64)run) << eval;   // store the value in runs
  209|   185k|        melp->num_runs++;                    // increment count
  210|   185k|      }
  211|  26.3k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL8mel_readEPNS0_10dec_mel_stE:
   97|  3.71k|    {
   98|  3.71k|      if (melp->bits > 32)  //there are enough bits in the tmp variable
  ------------------
  |  Branch (98:11): [True: 0, False: 3.71k]
  ------------------
   99|      0|        return;             // return without reading new data
  100|       |
  101|  3.71k|      ui32 val = 0xFFFFFFFF;       // feed in 0xFF if buffer is exhausted
  102|  3.71k|      if (melp->size > 4) {        // if there is data in the MEL segment
  ------------------
  |  Branch (102:11): [True: 2.29k, False: 1.42k]
  ------------------
  103|  2.29k|        val = *(ui32*)melp->data;  // read 32 bits from MEL data
  104|  2.29k|        melp->data += 4;           // advance pointer
  105|  2.29k|        melp->size -= 4;           // reduce counter
  106|  2.29k|      }
  107|  1.42k|      else if (melp->size > 0)
  ------------------
  |  Branch (107:16): [True: 1.02k, False: 396]
  ------------------
  108|  1.02k|      { // 4 or less
  109|  1.02k|        int i = 0;
  110|  2.29k|        while (melp->size > 1) {
  ------------------
  |  Branch (110:16): [True: 1.27k, False: 1.02k]
  ------------------
  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.02k|        ui32 v = *melp->data++;    // the one before the last is different
  119|  1.02k|        v |= 0xF;                  // MEL and VLC segments can overlap
  120|  1.02k|        ui32 m = ~(0xFFu << i);
  121|  1.02k|        val = (val & m) | (v << i);
  122|  1.02k|        --melp->size;
  123|  1.02k|      }
  124|       |
  125|       |      // next we unstuff them before adding them to the buffer
  126|  3.71k|      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.71k|      ui32 t = val & 0xFF;
  133|  3.71k|      bool unstuff = ((val & 0xFF) == 0xFF); // true if we need unstuffing
  134|  3.71k|      bits -= unstuff; // there is one less bit in t if unstuffing is needed
  135|  3.71k|      t = t << (8 - unstuff); // move up to make room for the next byte
  136|       |
  137|       |      //this is a repeat of the above
  138|  3.71k|      t |= (val>>8) & 0xFF;
  139|  3.71k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  140|  3.71k|      bits -= unstuff;
  141|  3.71k|      t = t << (8 - unstuff);
  142|       |
  143|  3.71k|      t |= (val>>16) & 0xFF;
  144|  3.71k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  145|  3.71k|      bits -= unstuff;
  146|  3.71k|      t = t << (8 - unstuff);
  147|       |
  148|  3.71k|      t |= (val>>24) & 0xFF;
  149|  3.71k|      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.71k|      melp->tmp |= ((ui64)t) << (64 - bits - melp->bits);
  154|  3.71k|      melp->bits += bits; //increment the number of bits in tmp
  155|  3.71k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL9rev_fetchEPNS0_10rev_structE:
  423|   154k|    {
  424|   154k|      if (vlcp->bits < 32)  // if there are less then 32 bits, read more
  ------------------
  |  Branch (424:11): [True: 23.1k, False: 131k]
  ------------------
  425|  23.1k|      {
  426|  23.1k|        rev_read(vlcp);     // read 32 bits, but unstuffing might reduce this
  427|  23.1k|        if (vlcp->bits < 32)// if there is still space in vlcp->tmp for 32 bits
  ------------------
  |  Branch (427:13): [True: 72, False: 23.0k]
  ------------------
  428|     72|          rev_read(vlcp);   // read another 32
  429|  23.1k|      }
  430|   154k|      return (ui32)vlcp->tmp; // return the head (bottom-most) of vlcp->tmp
  431|   154k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL11rev_advanceEPNS0_10rev_structEj:
  441|   617k|    {
  442|       |      assert(num_bits <= vlcp->bits); // vlcp->tmp must have more than num_bits
  443|   617k|      vlcp->tmp >>= num_bits;         // remove bits
  444|   617k|      vlcp->bits -= num_bits;         // decrement the number of bits
  445|   617k|      return (ui32)vlcp->tmp;
  446|   617k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL22decode_two_quad32_avx2EDv4_xS1_PNS0_16frwd_struct_avx2EjRDv2_x:
  787|  24.2k|    static inline __m256i decode_two_quad32_avx2(__m256i inf_u_q, __m256i U_q, frwd_struct_avx2* magsgn, ui32 p, __m128i& vn) {
  788|  24.2k|        __m256i row = _mm256_setzero_si256();
  789|       |
  790|       |        // we keeps e_k, e_1, and rho in w2
  791|  24.2k|        __m256i flags = _mm256_and_si256(inf_u_q, _mm256_set_epi32(0x8880, 0x4440, 0x2220, 0x1110, 0x8880, 0x4440, 0x2220, 0x1110));
  792|  24.2k|        __m256i insig = _mm256_cmpeq_epi32(flags, _mm256_setzero_si256());
  793|       |
  794|  24.2k|        if ((uint32_t)_mm256_movemask_epi8(insig) != (uint32_t)0xFFFFFFFF) //are all insignificant?
  ------------------
  |  Branch (794:13): [True: 15.1k, False: 9.10k]
  ------------------
  795|  15.1k|        {
  796|  15.1k|            flags = _mm256_mullo_epi16(flags, _mm256_set_epi16(1, 1, 2, 2, 4, 4, 8, 8, 1, 1, 2, 2, 4, 4, 8, 8));
  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|  15.1k|            __m256i m_n;
  804|  15.1k|            __m256i w0 = _mm256_srli_epi32(flags, 15); // e_k
  805|  15.1k|            m_n = _mm256_sub_epi32(U_q, w0);
  806|  15.1k|            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|  15.1k|            __m256i inc_sum = m_n; // inclusive scan
  811|  15.1k|            inc_sum = _mm256_add_epi32(inc_sum, _mm256_bslli_epi128(inc_sum, 4));
  812|  15.1k|            inc_sum = _mm256_add_epi32(inc_sum, _mm256_bslli_epi128(inc_sum, 8));
  813|  15.1k|            int total_mn1 = _mm256_extract_epi16(inc_sum, 6);
  814|  15.1k|            int total_mn2 = _mm256_extract_epi16(inc_sum, 14);
  815|       |
  816|  15.1k|            __m128i ms_vec0 = _mm_setzero_si128();
  817|  15.1k|            __m128i ms_vec1 = _mm_setzero_si128();
  818|  15.1k|            if (total_mn1) {
  ------------------
  |  Branch (818:17): [True: 12.6k, False: 2.43k]
  ------------------
  819|  12.6k|                ms_vec0 = frwd_fetch<0xFF>(magsgn);
  820|  12.6k|                frwd_advance(magsgn, (ui32)total_mn1);
  821|  12.6k|            }
  822|  15.1k|            if (total_mn2) {
  ------------------
  |  Branch (822:17): [True: 9.84k, False: 5.27k]
  ------------------
  823|  9.84k|                ms_vec1 = frwd_fetch<0xFF>(magsgn);
  824|  9.84k|                frwd_advance(magsgn, (ui32)total_mn2);
  825|  9.84k|            }
  826|       |
  827|  15.1k|            __m256i ms_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ms_vec0), ms_vec1, 0x1);
  828|       |
  829|  15.1k|            __m256i ex_sum = _mm256_bslli_epi128(inc_sum, 4); // exclusive scan
  830|       |
  831|       |            // find the starting byte and starting bit
  832|  15.1k|            __m256i byte_idx = _mm256_srli_epi32(ex_sum, 3);
  833|  15.1k|            __m256i bit_idx = _mm256_and_si256(ex_sum, _mm256_set1_epi32(7));
  834|  15.1k|            byte_idx = _mm256_shuffle_epi8(byte_idx,
  835|  15.1k|                _mm256_set_epi32(0x0C0C0C0C, 0x08080808, 0x04040404, 0x00000000, 0x0C0C0C0C, 0x08080808, 0x04040404, 0x00000000));
  836|  15.1k|            byte_idx = _mm256_add_epi32(byte_idx, _mm256_set1_epi32(0x03020100));
  837|  15.1k|            __m256i d0 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  838|  15.1k|            byte_idx = _mm256_add_epi32(byte_idx, _mm256_set1_epi32(0x01010101));
  839|  15.1k|            __m256i d1 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  840|       |
  841|       |            // shift samples values to correct location
  842|  15.1k|            bit_idx = _mm256_or_si256(bit_idx, _mm256_slli_epi32(bit_idx, 16));
  843|       |
  844|  15.1k|            __m128i a = _mm_set_epi8(1, 3, 7, 15, 31, 63, 127, -1, 1, 3, 7, 15, 31, 63, 127, -1);
  845|  15.1k|            __m256i aa = _mm256_inserti128_si256(_mm256_castsi128_si256(a), a, 0x1);
  846|       |
  847|  15.1k|            __m256i bit_shift = _mm256_shuffle_epi8(aa, bit_idx);
  848|  15.1k|            bit_shift = _mm256_add_epi16(bit_shift, _mm256_set1_epi16(0x0101));
  849|  15.1k|            d0 = _mm256_mullo_epi16(d0, bit_shift);
  850|  15.1k|            d0 = _mm256_srli_epi16(d0, 8); // we should have 8 bits in the LSB
  851|  15.1k|            d1 = _mm256_mullo_epi16(d1, bit_shift);
  852|  15.1k|            d1 = _mm256_and_si256(d1, _mm256_set1_epi32((si32)0xFF00FF00)); // 8 in MSB
  853|  15.1k|            d0 = _mm256_or_si256(d0, d1);
  854|       |
  855|       |            // find location of e_k and mask
  856|  15.1k|            __m256i shift;
  857|  15.1k|            __m256i ones = _mm256_set1_epi32(1);
  858|  15.1k|            __m256i twos = _mm256_set1_epi32(2);
  859|  15.1k|            __m256i U_q_m1 = _mm256_sub_epi32(U_q, ones);
  860|  15.1k|            U_q_m1 = _mm256_and_si256(U_q_m1, _mm256_set_epi32(0, 0, 0, 0x1F, 0, 0, 0, 0x1F));
  861|  15.1k|            U_q_m1 = _mm256_shuffle_epi32(U_q_m1, 0);
  862|  15.1k|            w0 = _mm256_sub_epi32(twos, w0);
  863|  15.1k|            shift = _mm256_sllv_epi32(w0, U_q_m1); // U_q_m1 must be no more than 31
  864|  15.1k|            ms_vec = _mm256_and_si256(d0, _mm256_sub_epi32(shift, ones));
  865|       |
  866|       |            // next e_1
  867|  15.1k|            w0 = _mm256_and_si256(flags, _mm256_set1_epi32(0x800));
  868|  15.1k|            w0 = _mm256_cmpeq_epi32(w0, _mm256_setzero_si256());
  869|  15.1k|            w0 = _mm256_andnot_si256(w0, shift);  // e_1 in correct position
  870|  15.1k|            ms_vec = _mm256_or_si256(ms_vec, w0); // e_1
  871|  15.1k|            w0 = _mm256_slli_epi32(ms_vec, 31);   // sign
  872|  15.1k|            ms_vec = _mm256_or_si256(ms_vec, ones); // bin center
  873|  15.1k|            __m256i tvn = ms_vec;
  874|  15.1k|            ms_vec = _mm256_add_epi32(ms_vec, twos);// + 2
  875|  15.1k|            ms_vec = _mm256_slli_epi32(ms_vec, (si32)p - 1);
  876|  15.1k|            ms_vec = _mm256_or_si256(ms_vec, w0); // sign
  877|  15.1k|            row = _mm256_andnot_si256(insig, ms_vec); // significant only
  878|       |
  879|  15.1k|            ms_vec = _mm256_andnot_si256(insig, tvn); // significant only
  880|       |
  881|  15.1k|            tvn = _mm256_shuffle_epi8(ms_vec, _mm256_set_epi32(-1, 0x0F0E0D0C, 0x07060504, -1, -1, -1, 0x0F0E0D0C, 0x07060504));
  882|       |
  883|  15.1k|            vn = _mm_or_si128(vn, _mm256_castsi256_si128(tvn));
  884|       |            vn = _mm_or_si128(vn, _mm256_extracti128_si256(tvn, 0x1));
  885|  15.1k|        }
  886|  24.2k|        return row;
  887|  24.2k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL10frwd_fetchILi255EEEDv2_xPNS0_16frwd_struct_avx2E:
  766|  71.1k|    {
  767|  71.1k|      if (msp->bits <= 128)
  ------------------
  |  Branch (767:11): [True: 14.4k, False: 56.7k]
  ------------------
  768|  14.4k|      {
  769|  14.4k|        frwd_read<X>(msp);
  770|  14.4k|        if (msp->bits <= 128) //need to test
  ------------------
  |  Branch (770:13): [True: 0, False: 14.4k]
  ------------------
  771|      0|          frwd_read<X>(msp);
  772|  14.4k|      }
  773|  71.1k|      __m128i t = _mm_loadu_si128((__m128i*)msp->tmp);
  774|  71.1k|      return t;
  775|  71.1k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL9frwd_readILi255EEEvPNS0_16frwd_struct_avx2E:
  616|  29.8k|    {
  617|  29.8k|      assert(msp->bits <= 128);
  618|       |
  619|  29.8k|      __m128i offset, val, validity, all_xff;
  620|  29.8k|      val = _mm_loadu_si128((__m128i*)msp->data);
  621|  29.8k|      int bytes = msp->size >= 16 ? 16 : msp->size;
  ------------------
  |  Branch (621:19): [True: 18.8k, False: 11.0k]
  ------------------
  622|  29.8k|      validity = _mm_set1_epi8((char)bytes);
  623|  29.8k|      msp->data += bytes;
  624|  29.8k|      msp->size -= bytes;
  625|  29.8k|      int bits = 128;
  626|  29.8k|      offset = _mm_set_epi64x(0x0F0E0D0C0B0A0908,0x0706050403020100);
  627|  29.8k|      validity = _mm_cmpgt_epi8(validity, offset);
  628|  29.8k|      all_xff = _mm_set1_epi8(-1);
  629|  29.8k|      if (X == 0xFF) // the compiler should remove this if statement
  ------------------
  |  Branch (629:11): [True: 29.8k, Folded]
  ------------------
  630|  29.8k|      {
  631|  29.8k|        __m128i t = _mm_xor_si128(validity, all_xff); // complement
  632|  29.8k|        val = _mm_or_si128(t, val); // fill with 0xFF
  633|  29.8k|      }
  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|  29.8k|      __m128i ff_bytes;
  640|  29.8k|      ff_bytes = _mm_cmpeq_epi8(val, all_xff);
  641|  29.8k|      ff_bytes = _mm_and_si128(ff_bytes, validity);
  642|  29.8k|      ui32 flags = (ui32)_mm_movemask_epi8(ff_bytes);
  643|  29.8k|      flags <<= 1; // unstuff following byte
  644|  29.8k|      ui32 next_unstuff = flags >> 16;
  645|  29.8k|      flags |= msp->unstuff;
  646|  29.8k|      flags &= 0xFFFF;
  647|  86.1k|      while (flags)
  ------------------
  |  Branch (647:14): [True: 56.2k, False: 29.8k]
  ------------------
  648|  56.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|  56.2k|        --bits; // consuming one stuffing bit
  652|       |
  653|  56.2k|        ui32 loc = 31 - count_leading_zeros(flags);
  654|  56.2k|        flags ^= 1 << loc;
  655|       |
  656|  56.2k|        __m128i m, t, c;
  657|  56.2k|        t = _mm_set1_epi8((char)loc);
  658|  56.2k|        m = _mm_cmpgt_epi8(offset, t);
  659|       |
  660|  56.2k|        t = _mm_and_si128(m, val);  // keep bits at locations larger than loc
  661|  56.2k|        c = _mm_srli_epi64(t, 1);   // 1 bits left
  662|  56.2k|        t = _mm_srli_si128(t, 8);   // 8 bytes left
  663|  56.2k|        t = _mm_slli_epi64(t, 63);  // keep the MSB only
  664|  56.2k|        t = _mm_or_si128(t, c);     // combine the above 3 steps
  665|       |
  666|  56.2k|        val = _mm_or_si128(t, _mm_andnot_si128(m, val));
  667|  56.2k|      }
  668|       |
  669|       |      // combine with earlier data
  670|  29.8k|      assert(msp->bits >= 0 && msp->bits <= 128);
  671|  29.8k|      int cur_bytes = msp->bits >> 3;
  672|  29.8k|      int cur_bits = msp->bits & 7;
  673|  29.8k|      __m128i b1, b2;
  674|  29.8k|      b1 = _mm_sll_epi64(val, _mm_set1_epi64x(cur_bits));
  675|  29.8k|      b2 = _mm_slli_si128(val, 8);  // 8 bytes right
  676|  29.8k|      b2 = _mm_srl_epi64(b2, _mm_set1_epi64x(64-cur_bits));
  677|  29.8k|      b1 = _mm_or_si128(b1, b2);
  678|  29.8k|      b2 = _mm_loadu_si128((__m128i*)(msp->tmp + cur_bytes));
  679|  29.8k|      b2 = _mm_or_si128(b1, b2);
  680|  29.8k|      _mm_storeu_si128((__m128i*)(msp->tmp + cur_bytes), b2);
  681|       |
  682|  29.8k|      int consumed_bits = bits < 128 - cur_bits ? bits : 128 - cur_bits;
  ------------------
  |  Branch (682:27): [True: 12.7k, False: 17.1k]
  ------------------
  683|  29.8k|      cur_bytes = (msp->bits + (ui32)consumed_bits + 7) >> 3; // round up
  684|  29.8k|      int upper = _mm_extract_epi16(val, 7);
  685|  29.8k|      upper >>= consumed_bits - 128 + 16;
  686|  29.8k|      msp->tmp[cur_bytes] = (ui8)upper; // copy byte
  687|       |
  688|  29.8k|      msp->bits += (ui32)bits;
  689|  29.8k|      msp->unstuff = next_unstuff;   // next unstuff
  690|       |      assert(msp->unstuff == 0 || msp->unstuff == 1);
  691|  29.8k|    }
_ZN4ojph5local16avx2_lzcnt_epi32EDv4_x:
 1039|  33.4k|    inline __m256i avx2_lzcnt_epi32(__m256i v) {
 1040|       |        // prevent value from being rounded up to the next power of two
 1041|  33.4k|        v = _mm256_andnot_si256(_mm256_srli_epi32(v, 8), v);  // keep 8 MSB
 1042|       |
 1043|  33.4k|        v = _mm256_castps_si256(_mm256_cvtepi32_ps(v));    // convert an integer to float
 1044|  33.4k|        v = _mm256_srli_epi32(v, 23);                   // shift down the exponent
 1045|  33.4k|        v = _mm256_subs_epu16(_mm256_set1_epi32(158), v);  // undo bias
 1046|  33.4k|        v = _mm256_min_epi16(v, _mm256_set1_epi32(32));    // clamp at 32
 1047|       |
 1048|  33.4k|        return v;
 1049|  33.4k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL18decode_four_quad16EDv2_xS1_PNS0_16frwd_struct_avx2EjRS1_:
  901|  58.8k|    static inline __m256i decode_four_quad16(const __m128i inf_u_q, __m128i U_q, frwd_struct_avx2* magsgn, ui32 p, __m128i& vn) {
  902|       |
  903|  58.8k|        __m256i w0;     // workers
  904|  58.8k|        __m256i insig;  // lanes hold FF's if samples are insignificant
  905|  58.8k|        __m256i flags;  // lanes hold e_k, e_1, and rho
  906|       |
  907|  58.8k|        __m256i row = _mm256_setzero_si256();
  908|  58.8k|        __m128i ddd = _mm_shuffle_epi8(inf_u_q,
  909|  58.8k|            _mm_set_epi16(0x0d0c, 0x0d0c, 0x0908, 0x908, 0x0504, 0x0504, 0x0100, 0x0100));
  910|  58.8k|        w0 = _mm256_permutevar8x32_epi32(_mm256_castsi128_si256(ddd),
  911|  58.8k|            _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3));
  912|       |        // we keeps e_k, e_1, and rho in w2
  913|  58.8k|        flags = _mm256_and_si256(w0,
  914|  58.8k|            _mm256_set_epi16((si16)0x8880, 0x4440, 0x2220, 0x1110,
  915|  58.8k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110,
  916|  58.8k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110,
  917|  58.8k|                             (si16)0x8880, 0x4440, 0x2220, 0x1110));
  918|  58.8k|        insig = _mm256_cmpeq_epi16(flags, _mm256_setzero_si256());
  919|  58.8k|        if ((uint32_t)_mm256_movemask_epi8(insig) != (uint32_t)0xFFFFFFFF) //are all insignificant?
  ------------------
  |  Branch (919:13): [True: 31.4k, False: 27.4k]
  ------------------
  920|  31.4k|        {
  921|  31.4k|            ddd = _mm_or_si128(_mm_bslli_si128(U_q, 2), U_q);
  922|  31.4k|            __m256i U_q_avx = _mm256_permutevar8x32_epi32(_mm256_castsi128_si256(ddd),
  923|  31.4k|                _mm256_setr_epi32(0, 0, 1, 1, 2, 2, 3, 3));
  924|  31.4k|            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|  31.4k|            __m256i m_n;
  932|  31.4k|            w0 = _mm256_srli_epi16(flags, 15); // e_k
  933|  31.4k|            m_n = _mm256_sub_epi16(U_q_avx, w0);
  934|  31.4k|            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|  31.4k|            __m256i inc_sum = m_n; // inclusive scan
  939|  31.4k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 2));
  940|  31.4k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 4));
  941|  31.4k|            inc_sum = _mm256_add_epi16(inc_sum, _mm256_bslli_epi128(inc_sum, 8));
  942|  31.4k|            int total_mn1 = _mm256_extract_epi16(inc_sum, 7);
  943|  31.4k|            int total_mn2 = _mm256_extract_epi16(inc_sum, 15);
  944|  31.4k|            __m256i ex_sum = _mm256_bslli_epi128(inc_sum, 2); // exclusive scan
  945|       |
  946|  31.4k|            __m128i ms_vec0 = _mm_setzero_si128();
  947|  31.4k|            __m128i ms_vec1 = _mm_setzero_si128();
  948|  31.4k|            if (total_mn1) {
  ------------------
  |  Branch (948:17): [True: 28.4k, False: 3.01k]
  ------------------
  949|  28.4k|                ms_vec0 = frwd_fetch<0xFF>(magsgn);
  950|  28.4k|                frwd_advance(magsgn, (ui32)total_mn1);
  951|  28.4k|            }
  952|  31.4k|            if (total_mn2) {
  ------------------
  |  Branch (952:17): [True: 20.1k, False: 11.3k]
  ------------------
  953|  20.1k|                ms_vec1 = frwd_fetch<0xFF>(magsgn);
  954|  20.1k|                frwd_advance(magsgn, (ui32)total_mn2);
  955|  20.1k|            }
  956|       |
  957|  31.4k|            __m256i ms_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ms_vec0), ms_vec1, 0x1);
  958|       |
  959|       |            // find the starting byte and starting bit
  960|  31.4k|            __m256i byte_idx = _mm256_srli_epi16(ex_sum, 3);
  961|  31.4k|            __m256i bit_idx = _mm256_and_si256(ex_sum, _mm256_set1_epi16(7));
  962|  31.4k|            byte_idx = _mm256_shuffle_epi8(byte_idx,
  963|  31.4k|                _mm256_set_epi16(0x0E0E, 0x0C0C, 0x0A0A, 0x0808,
  964|  31.4k|                    0x0606, 0x0404, 0x0202, 0x0000, 0x0E0E, 0x0C0C, 0x0A0A, 0x0808,
  965|  31.4k|                    0x0606, 0x0404, 0x0202, 0x0000));
  966|  31.4k|            byte_idx = _mm256_add_epi16(byte_idx, _mm256_set1_epi16(0x0100));
  967|  31.4k|            __m256i d0 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  968|  31.4k|            byte_idx = _mm256_add_epi16(byte_idx, _mm256_set1_epi16(0x0101));
  969|  31.4k|            __m256i d1 = _mm256_shuffle_epi8(ms_vec, byte_idx);
  970|       |
  971|       |            // shift samples values to correct location
  972|  31.4k|            __m256i bit_shift = _mm256_shuffle_epi8(
  973|  31.4k|                _mm256_set_epi8(1, 3, 7, 15, 31, 63, 127, -1,
  974|  31.4k|                    1, 3, 7, 15, 31, 63, 127, -1, 1, 3, 7, 15, 31, 63, 127, -1,
  975|  31.4k|                    1, 3, 7, 15, 31, 63, 127, -1), bit_idx);
  976|  31.4k|            bit_shift = _mm256_add_epi16(bit_shift, _mm256_set1_epi16(0x0101));
  977|  31.4k|            d0 = _mm256_mullo_epi16(d0, bit_shift);
  978|  31.4k|            d0 = _mm256_srli_epi16(d0, 8); // we should have 8 bits in the LSB
  979|  31.4k|            d1 = _mm256_mullo_epi16(d1, bit_shift);
  980|  31.4k|            d1 = _mm256_and_si256(d1, _mm256_set1_epi16((si16)0xFF00)); // 8 in MSB
  981|  31.4k|            d0 = _mm256_or_si256(d0, d1);
  982|       |
  983|       |            // find location of e_k and mask
  984|  31.4k|            __m256i shift, t0, t1, Uq0, Uq1;
  985|  31.4k|            __m256i ones = _mm256_set1_epi16(1);
  986|  31.4k|            __m256i twos = _mm256_set1_epi16(2);
  987|  31.4k|            __m256i U_q_m1 = _mm256_sub_epi32(U_q_avx, ones);
  988|  31.4k|            Uq0 = _mm256_and_si256(U_q_m1, _mm256_set_epi32(0, 0, 0, 0x1F, 0, 0, 0, 0x1F));
  989|  31.4k|            Uq1 = _mm256_bsrli_epi128(U_q_m1, 14);
  990|  31.4k|            w0 = _mm256_sub_epi16(twos, w0);
  991|  31.4k|            t0 = _mm256_and_si256(w0, _mm256_set_epi64x(0, -1, 0, -1));
  992|  31.4k|            t1 = _mm256_and_si256(w0, _mm256_set_epi64x(-1, 0, -1, 0));
  993|  31.4k|            {//no _mm256_sllv_epi16 in avx2
  994|  31.4k|                __m128i t_0_sse = _mm256_castsi256_si128(t0);
  995|  31.4k|                t_0_sse = _mm_sll_epi16(t_0_sse, _mm256_castsi256_si128(Uq0));
  996|  31.4k|                __m128i t_1_sse = _mm256_extracti128_si256(t0 , 0x1);
  997|  31.4k|                t_1_sse = _mm_sll_epi16(t_1_sse, _mm256_extracti128_si256(Uq0, 0x1));
  998|  31.4k|                t0 = _mm256_inserti128_si256(_mm256_castsi128_si256(t_0_sse), t_1_sse, 0x1);
  999|       |
 1000|  31.4k|                t_0_sse = _mm256_castsi256_si128(t1);
 1001|  31.4k|                t_0_sse = _mm_sll_epi16(t_0_sse, _mm256_castsi256_si128(Uq1));
 1002|  31.4k|                t_1_sse = _mm256_extracti128_si256(t1, 0x1);
 1003|  31.4k|                t_1_sse = _mm_sll_epi16(t_1_sse, _mm256_extracti128_si256(Uq1, 0x1));
 1004|  31.4k|                t1 = _mm256_inserti128_si256(_mm256_castsi128_si256(t_0_sse), t_1_sse, 0x1);
 1005|  31.4k|            }
 1006|  31.4k|            shift = _mm256_or_si256(t0, t1);
 1007|  31.4k|            ms_vec = _mm256_and_si256(d0, _mm256_sub_epi16(shift, ones));
 1008|       |
 1009|       |            // next e_1
 1010|  31.4k|            w0 = _mm256_and_si256(flags, _mm256_set1_epi16(0x800));
 1011|  31.4k|            w0 = _mm256_cmpeq_epi16(w0, _mm256_setzero_si256());
 1012|  31.4k|            w0 = _mm256_andnot_si256(w0, shift);  // e_1 in correct position
 1013|  31.4k|            ms_vec = _mm256_or_si256(ms_vec, w0); // e_1
 1014|  31.4k|            w0 = _mm256_slli_epi16(ms_vec, 15);   // sign
 1015|  31.4k|            ms_vec = _mm256_or_si256(ms_vec, ones); // bin center
 1016|  31.4k|            __m256i tvn = ms_vec;
 1017|  31.4k|            ms_vec = _mm256_add_epi16(ms_vec, twos);// + 2
 1018|  31.4k|            ms_vec = _mm256_slli_epi16(ms_vec, (si32)p - 1);
 1019|  31.4k|            ms_vec = _mm256_or_si256(ms_vec, w0); // sign
 1020|  31.4k|            row = _mm256_andnot_si256(insig, ms_vec); // significant only
 1021|       |
 1022|  31.4k|            ms_vec = _mm256_andnot_si256(insig, tvn); // significant only
 1023|       |
 1024|  31.4k|            __m256i ms_vec_shuffle1 = _mm256_shuffle_epi8(ms_vec,
 1025|  31.4k|                _mm256_set_epi16(-1, -1, -1, -1, 0x0706, 0x0302, -1, -1,
 1026|  31.4k|                                 -1, -1, -1, -1, -1, -1, 0x0706, 0x0302));
 1027|  31.4k|            __m256i ms_vec_shuffle2 = _mm256_shuffle_epi8(ms_vec,
 1028|  31.4k|                _mm256_set_epi16(-1, -1, -1, 0x0F0E, 0x0B0A, -1, -1, -1,
 1029|  31.4k|                                 -1, -1, -1, -1, -1, 0x0F0E, 0x0B0A, -1));
 1030|  31.4k|            ms_vec = _mm256_or_si256(ms_vec_shuffle1, ms_vec_shuffle2);
 1031|       |
 1032|  31.4k|            vn = _mm_or_si128(vn, _mm256_castsi256_si128(ms_vec));
 1033|       |            vn = _mm_or_si128(vn, _mm256_extracti128_si256(ms_vec, 0x1));
 1034|  31.4k|        }
 1035|  58.8k|        return row;
 1036|  58.8k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL12frwd_advanceEPNS0_16frwd_struct_avx2Ej:
  726|   110k|    {
  727|   110k|      assert(num_bits > 0 && num_bits <= msp->bits && num_bits < 128);
  728|   110k|      msp->bits -= num_bits;
  729|       |
  730|   110k|      __m128i *p = (__m128i*)(msp->tmp + ((num_bits >> 3) & 0x18));
  731|   110k|      num_bits &= 63;
  732|       |
  733|   110k|      __m128i v0, v1, c0, c1, t;
  734|   110k|      v0 = _mm_loadu_si128(p);
  735|   110k|      v1 = _mm_loadu_si128(p + 1);
  736|       |
  737|       |      // shift right by num_bits
  738|   110k|      c0 = _mm_srl_epi64(v0, _mm_set1_epi64x(num_bits));
  739|   110k|      t = _mm_srli_si128(v0, 8);
  740|   110k|      t = _mm_sll_epi64(t, _mm_set1_epi64x(64 - num_bits));
  741|   110k|      c0 = _mm_or_si128(c0, t);
  742|   110k|      t = _mm_slli_si128(v1, 8);
  743|   110k|      t = _mm_sll_epi64(t, _mm_set1_epi64x(64 - num_bits));
  744|   110k|      c0 = _mm_or_si128(c0, t);
  745|       |
  746|   110k|      _mm_storeu_si128((__m128i*)msp->tmp, c0);
  747|       |
  748|   110k|      c1 = _mm_srl_epi64(v1, _mm_set1_epi64x(num_bits));
  749|   110k|      t = _mm_srli_si128(v1, 8);
  750|   110k|      t = _mm_sll_epi64(t, _mm_set1_epi64x(64 - num_bits));
  751|   110k|      c1 = _mm_or_si128(c1, t);
  752|       |
  753|   110k|      _mm_storeu_si128((__m128i*)msp->tmp + 1, c1);
  754|   110k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL12rev_init_mrpEPNS0_10rev_structEPhii:
  525|  8.26k|    {
  526|  8.26k|      mrp->data = data + lcup + len2 - 1;
  527|  8.26k|      mrp->size = len2;
  528|  8.26k|      mrp->unstuff = true;
  529|  8.26k|      mrp->bits = 0;
  530|  8.26k|      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|  8.26k|      int num = 1 + (int)(intptr_t(mrp->data) & 0x3);
  537|  29.3k|      for (int i = 0; i < num; ++i) {
  ------------------
  |  Branch (537:23): [True: 21.0k, False: 8.26k]
  ------------------
  538|  21.0k|        ui64 d;
  539|       |        //read a byte, 0 if no more data
  540|  21.0k|        d = (mrp->size-- > 0) ? *mrp->data-- : 0;
  ------------------
  |  Branch (540:13): [True: 20.1k, False: 952]
  ------------------
  541|       |        //check if unstuffing is needed
  542|  21.0k|        ui32 d_bits = 8 - ((mrp->unstuff && ((d & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (542:29): [True: 11.7k, False: 9.34k]
  |  Branch (542:45): [True: 1.67k, False: 10.0k]
  ------------------
  543|  21.0k|        mrp->tmp |= d << mrp->bits; // move data to vlcp->tmp
  544|  21.0k|        mrp->bits += d_bits;
  545|  21.0k|        mrp->unstuff = d > 0x8F; // for next byte
  546|  21.0k|      }
  547|  8.26k|      rev_read_mrp(mrp);
  548|  8.26k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL12rev_read_mrpEPNS0_10rev_structE:
  461|  11.8k|    {
  462|       |      //process 4 bytes at a time
  463|  11.8k|      if (mrp->bits > 32)
  ------------------
  |  Branch (463:11): [True: 0, False: 11.8k]
  ------------------
  464|      0|        return;
  465|  11.8k|      ui32 val = 0;
  466|  11.8k|      if (mrp->size > 3) // If there are 3 byte or more
  ------------------
  |  Branch (466:11): [True: 8.50k, False: 3.35k]
  ------------------
  467|  8.50k|      { // (mrp->data - 3) move pointer back to read 32 bits at once
  468|  8.50k|        val = *(ui32*)(mrp->data - 3); // read 32 bits
  469|  8.50k|        mrp->data -= 4;                // move back pointer
  470|  8.50k|        mrp->size -= 4;                // reduce count
  471|  8.50k|      }
  472|  3.35k|      else if (mrp->size > 0)
  ------------------
  |  Branch (472:16): [True: 1.24k, False: 2.11k]
  ------------------
  473|  1.24k|      {
  474|  1.24k|        int i = 24;
  475|  4.21k|        while (mrp->size > 0) {
  ------------------
  |  Branch (475:16): [True: 2.96k, False: 1.24k]
  ------------------
  476|  2.96k|          ui32 v = *mrp->data--; // read one byte at a time
  477|  2.96k|          val |= (v << i);       // put byte in its correct location
  478|  2.96k|          --mrp->size;
  479|  2.96k|          i -= 8;
  480|  2.96k|        }
  481|  1.24k|      }
  482|       |
  483|       |      //accumulate in tmp, and keep count in bits
  484|  11.8k|      ui32 bits, tmp = val >> 24;
  485|       |
  486|       |      //test if the last byte > 0x8F (unstuff must be true) and this is 0x7F
  487|  11.8k|      bits = 8 - ((mrp->unstuff && (((val >> 24) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (487:20): [True: 3.97k, False: 7.89k]
  |  Branch (487:36): [True: 2.19k, False: 1.77k]
  ------------------
  488|  11.8k|      bool unstuff = (val >> 24) > 0x8F;
  489|       |
  490|       |      //process the next byte
  491|  11.8k|      tmp |= ((val >> 16) & 0xFF) << bits;
  492|  11.8k|      bits += 8 - ((unstuff && (((val >> 16) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (492:21): [True: 4.45k, False: 7.41k]
  |  Branch (492:32): [True: 1.71k, False: 2.73k]
  ------------------
  493|  11.8k|      unstuff = ((val >> 16) & 0xFF) > 0x8F;
  494|       |
  495|  11.8k|      tmp |= ((val >> 8) & 0xFF) << bits;
  496|  11.8k|      bits += 8 - ((unstuff && (((val >> 8) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (496:21): [True: 4.04k, False: 7.81k]
  |  Branch (496:32): [True: 1.45k, False: 2.59k]
  ------------------
  497|  11.8k|      unstuff = ((val >> 8) & 0xFF) > 0x8F;
  498|       |
  499|  11.8k|      tmp |= (val & 0xFF) << bits;
  500|  11.8k|      bits += 8 - ((unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (500:21): [True: 3.65k, False: 8.20k]
  |  Branch (500:32): [True: 1.71k, False: 1.94k]
  ------------------
  501|  11.8k|      unstuff = (val & 0xFF) > 0x8F;
  502|       |
  503|  11.8k|      mrp->tmp |= (ui64)tmp << mrp->bits; // move data to mrp pointer
  504|  11.8k|      mrp->bits += bits;
  505|  11.8k|      mrp->unstuff = unstuff;             // next byte
  506|  11.8k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL13rev_fetch_mrpEPNS0_10rev_structE:
  559|  48.5k|    {
  560|  48.5k|      if (mrp->bits < 32) // if there are less than 32 bits in mrp->tmp
  ------------------
  |  Branch (560:11): [True: 3.59k, False: 44.9k]
  ------------------
  561|  3.59k|      {
  562|  3.59k|        rev_read_mrp(mrp);    // read 30-32 bits from mrp
  563|  3.59k|        if (mrp->bits < 32)   // if there is a space of 32 bits
  ------------------
  |  Branch (563:13): [True: 0, False: 3.59k]
  ------------------
  564|      0|          rev_read_mrp(mrp);  // read more
  565|  3.59k|      }
  566|  48.5k|      return (ui32)mrp->tmp;  // return the head of mrp->tmp
  567|  48.5k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL9frwd_initILi255EEEvPNS0_16frwd_struct_avx2EPKhi:
  705|  15.4k|    {
  706|  15.4k|      msp->data = data;
  707|  15.4k|      _mm_storeu_si128((__m128i *)msp->tmp, _mm_setzero_si128());
  708|  15.4k|      _mm_storeu_si128((__m128i *)msp->tmp + 1, _mm_setzero_si128());
  709|  15.4k|      _mm_storeu_si128((__m128i *)msp->tmp + 2, _mm_setzero_si128());
  710|       |
  711|  15.4k|      msp->bits = 0;
  712|  15.4k|      msp->unstuff = 0;
  713|  15.4k|      msp->size = size;
  714|       |
  715|  15.4k|      frwd_read<X>(msp); // read 128 bits more
  716|  15.4k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL9frwd_initILi0EEEvPNS0_16frwd_struct_avx2EPKhi:
  705|  10.0k|    {
  706|  10.0k|      msp->data = data;
  707|  10.0k|      _mm_storeu_si128((__m128i *)msp->tmp, _mm_setzero_si128());
  708|  10.0k|      _mm_storeu_si128((__m128i *)msp->tmp + 1, _mm_setzero_si128());
  709|  10.0k|      _mm_storeu_si128((__m128i *)msp->tmp + 2, _mm_setzero_si128());
  710|       |
  711|  10.0k|      msp->bits = 0;
  712|  10.0k|      msp->unstuff = 0;
  713|  10.0k|      msp->size = size;
  714|       |
  715|  10.0k|      frwd_read<X>(msp); // read 128 bits more
  716|  10.0k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL9frwd_readILi0EEEvPNS0_16frwd_struct_avx2E:
  616|  18.9k|    {
  617|  18.9k|      assert(msp->bits <= 128);
  618|       |
  619|  18.9k|      __m128i offset, val, validity, all_xff;
  620|  18.9k|      val = _mm_loadu_si128((__m128i*)msp->data);
  621|  18.9k|      int bytes = msp->size >= 16 ? 16 : msp->size;
  ------------------
  |  Branch (621:19): [True: 2.78k, False: 16.1k]
  ------------------
  622|  18.9k|      validity = _mm_set1_epi8((char)bytes);
  623|  18.9k|      msp->data += bytes;
  624|  18.9k|      msp->size -= bytes;
  625|  18.9k|      int bits = 128;
  626|  18.9k|      offset = _mm_set_epi64x(0x0F0E0D0C0B0A0908,0x0706050403020100);
  627|  18.9k|      validity = _mm_cmpgt_epi8(validity, offset);
  628|  18.9k|      all_xff = _mm_set1_epi8(-1);
  629|  18.9k|      if (X == 0xFF) // the compiler should remove this if statement
  ------------------
  |  Branch (629:11): [Folded, False: 18.9k]
  ------------------
  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|  18.9k|      else if (X == 0)
  ------------------
  |  Branch (634:16): [True: 18.9k, Folded]
  ------------------
  635|  18.9k|        val = _mm_and_si128(validity, val); // fill with zeros
  636|      0|      else
  637|  18.9k|        assert(0);
  638|       |
  639|  18.9k|      __m128i ff_bytes;
  640|  18.9k|      ff_bytes = _mm_cmpeq_epi8(val, all_xff);
  641|  18.9k|      ff_bytes = _mm_and_si128(ff_bytes, validity);
  642|  18.9k|      ui32 flags = (ui32)_mm_movemask_epi8(ff_bytes);
  643|  18.9k|      flags <<= 1; // unstuff following byte
  644|  18.9k|      ui32 next_unstuff = flags >> 16;
  645|  18.9k|      flags |= msp->unstuff;
  646|  18.9k|      flags &= 0xFFFF;
  647|  39.0k|      while (flags)
  ------------------
  |  Branch (647:14): [True: 20.1k, False: 18.9k]
  ------------------
  648|  20.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|  20.1k|        --bits; // consuming one stuffing bit
  652|       |
  653|  20.1k|        ui32 loc = 31 - count_leading_zeros(flags);
  654|  20.1k|        flags ^= 1 << loc;
  655|       |
  656|  20.1k|        __m128i m, t, c;
  657|  20.1k|        t = _mm_set1_epi8((char)loc);
  658|  20.1k|        m = _mm_cmpgt_epi8(offset, t);
  659|       |
  660|  20.1k|        t = _mm_and_si128(m, val);  // keep bits at locations larger than loc
  661|  20.1k|        c = _mm_srli_epi64(t, 1);   // 1 bits left
  662|  20.1k|        t = _mm_srli_si128(t, 8);   // 8 bytes left
  663|  20.1k|        t = _mm_slli_epi64(t, 63);  // keep the MSB only
  664|  20.1k|        t = _mm_or_si128(t, c);     // combine the above 3 steps
  665|       |
  666|  20.1k|        val = _mm_or_si128(t, _mm_andnot_si128(m, val));
  667|  20.1k|      }
  668|       |
  669|       |      // combine with earlier data
  670|  18.9k|      assert(msp->bits >= 0 && msp->bits <= 128);
  671|  18.9k|      int cur_bytes = msp->bits >> 3;
  672|  18.9k|      int cur_bits = msp->bits & 7;
  673|  18.9k|      __m128i b1, b2;
  674|  18.9k|      b1 = _mm_sll_epi64(val, _mm_set1_epi64x(cur_bits));
  675|  18.9k|      b2 = _mm_slli_si128(val, 8);  // 8 bytes right
  676|  18.9k|      b2 = _mm_srl_epi64(b2, _mm_set1_epi64x(64-cur_bits));
  677|  18.9k|      b1 = _mm_or_si128(b1, b2);
  678|  18.9k|      b2 = _mm_loadu_si128((__m128i*)(msp->tmp + cur_bytes));
  679|  18.9k|      b2 = _mm_or_si128(b1, b2);
  680|  18.9k|      _mm_storeu_si128((__m128i*)(msp->tmp + cur_bytes), b2);
  681|       |
  682|  18.9k|      int consumed_bits = bits < 128 - cur_bits ? bits : 128 - cur_bits;
  ------------------
  |  Branch (682:27): [True: 7.32k, False: 11.6k]
  ------------------
  683|  18.9k|      cur_bytes = (msp->bits + (ui32)consumed_bits + 7) >> 3; // round up
  684|  18.9k|      int upper = _mm_extract_epi16(val, 7);
  685|  18.9k|      upper >>= consumed_bits - 128 + 16;
  686|  18.9k|      msp->tmp[cur_bytes] = (ui8)upper; // copy byte
  687|       |
  688|  18.9k|      msp->bits += (ui32)bits;
  689|  18.9k|      msp->unstuff = next_unstuff;   // next unstuff
  690|       |      assert(msp->unstuff == 0 || msp->unstuff == 1);
  691|  18.9k|    }
ojph_block_decoder_avx2.cpp:_ZN4ojph5localL10frwd_fetchILi0EEEDv2_xPNS0_16frwd_struct_avx2E:
  766|  39.7k|    {
  767|  39.7k|      if (msp->bits <= 128)
  ------------------
  |  Branch (767:11): [True: 8.85k, False: 30.9k]
  ------------------
  768|  8.85k|      {
  769|  8.85k|        frwd_read<X>(msp);
  770|  8.85k|        if (msp->bits <= 128) //need to test
  ------------------
  |  Branch (770:13): [True: 0, False: 8.85k]
  ------------------
  771|      0|          frwd_read<X>(msp);
  772|  8.85k|      }
  773|  39.7k|      __m128i t = _mm_loadu_si128((__m128i*)msp->tmp);
  774|  39.7k|      return t;
  775|  39.7k|    }

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

_ZN4ojph5local31initialize_block_encoder_tablesEv:
  258|  1.54M|    bool initialize_block_encoder_tables() {
  259|  1.54M|      static bool tables_initialized = false;
  260|  1.54M|      static std::once_flag tables_initialized_flag;
  261|  1.54M|      std::call_once(tables_initialized_flag, []() {
  262|  1.54M|        memset(vlc_tbl0, 0, 2048 * sizeof(ui16));
  263|  1.54M|        memset(vlc_tbl1, 0, 2048 * sizeof(ui16));
  264|  1.54M|        tables_initialized = vlc_init_tables();
  265|  1.54M|        tables_initialized = tables_initialized && uvlc_init_tables();
  266|  1.54M|      });
  267|  1.54M|      return tables_initialized;
  268|  1.54M|    }
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|  1.54M|    bool initialize_block_encoder_tables_avx2() {
  226|  1.54M|      static bool tables_initialized = false;
  227|  1.54M|      static std::once_flag tables_initialized_flag;
  228|  1.54M|      std::call_once(tables_initialized_flag, []() {
  229|  1.54M|        memset(vlc_tbl0, 0, 2048 * sizeof(ui32));
  230|  1.54M|        memset(vlc_tbl1, 0, 2048 * sizeof(ui32));
  231|  1.54M|        tables_initialized = vlc_init_tables();
  232|  1.54M|        tables_initialized = tables_initialized && uvlc_init_tables();
  233|  1.54M|      });
  234|  1.54M|      return tables_initialized;
  235|  1.54M|    }
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|  53.8k|  {
  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|  53.8k|  }
_ZN4ojph17calc_aligned_sizeINS_5local4tileELj8EEEmm:
  302|  5.97k|  size_t calc_aligned_size(size_t size) {
  303|  5.97k|    size = size * sizeof(T) + N - 1;
  304|  5.97k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  5.97k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  5.97k|    return size;
  307|  5.97k|  }
ojph_codestream_local.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  36.0k|  {
  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|  36.0k|  }
_ZN4ojph17calc_aligned_sizeINS_8line_bufELj8EEEmm:
  302|  1.43M|  size_t calc_aligned_size(size_t size) {
  303|  1.43M|    size = size * sizeof(T) + N - 1;
  304|  1.43M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  1.43M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  1.43M|    return size;
  307|  1.43M|  }
_ZN4ojph17calc_aligned_sizeINS_4sizeELj8EEEmm:
  302|  11.6k|  size_t calc_aligned_size(size_t size) {
  303|  11.6k|    size = size * sizeof(T) + N - 1;
  304|  11.6k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  11.6k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  11.6k|    return size;
  307|  11.6k|  }
_ZN4ojph17calc_aligned_sizeIiLj64EEEmm:
  302|  1.37M|  size_t calc_aligned_size(size_t size) {
  303|  1.37M|    size = size * sizeof(T) + N - 1;
  304|  1.37M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  1.37M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  1.37M|    return size;
  307|  1.37M|  }
_ZN4ojph17calc_aligned_sizeIhLj8EEEmm:
  302|   290k|  size_t calc_aligned_size(size_t size) {
  303|   290k|    size = size * sizeof(T) + N - 1;
  304|   290k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   290k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   290k|    return size;
  307|   290k|  }
_ZN4ojph9align_ptrIhLj8EEEPT_S2_:
  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_5local4tileELj8EEEPT_S4_:
  312|  2.97k|  inline T *align_ptr(T *ptr) {
  313|  2.97k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  2.97k|    p += N - 1;
  315|  2.97k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  2.97k|    return reinterpret_cast<T *>(p);
  317|  2.97k|  }
_ZN4ojph9align_ptrINS_8line_bufELj8EEEPT_S3_:
  312|   704k|  inline T *align_ptr(T *ptr) {
  313|   704k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   704k|    p += N - 1;
  315|   704k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   704k|    return reinterpret_cast<T *>(p);
  317|   704k|  }
_ZN4ojph9align_ptrINS_4sizeELj8EEEPT_S3_:
  312|  5.71k|  inline T *align_ptr(T *ptr) {
  313|  5.71k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  5.71k|    p += N - 1;
  315|  5.71k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  5.71k|    return reinterpret_cast<T *>(p);
  317|  5.71k|  }
_ZN4ojph9align_ptrIiLj64EEEPT_S2_:
  312|   678k|  inline T *align_ptr(T *ptr) {
  313|   678k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   678k|    p += N - 1;
  315|   678k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   678k|    return reinterpret_cast<T *>(p);
  317|   678k|  }
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|    525|  {
  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|    525|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  3.85M|  {
  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|  3.85M|  }
_ZN4ojph17calc_aligned_sizeINS_5local9tile_compELj8EEEmm:
  302|   284k|  size_t calc_aligned_size(size_t size) {
  303|   284k|    size = size * sizeof(T) + N - 1;
  304|   284k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   284k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   284k|    return size;
  307|   284k|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  2.58M|  {
  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|  2.58M|  }
_ZN4ojph17calc_aligned_sizeINS_4rectELj8EEEmm:
  302|   569k|  size_t calc_aligned_size(size_t size) {
  303|   569k|    size = size * sizeof(T) + N - 1;
  304|   569k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   569k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   569k|    return size;
  307|   569k|  }
_ZN4ojph17calc_aligned_sizeIjLj8EEEmm:
  302|   854k|  size_t calc_aligned_size(size_t size) {
  303|   854k|    size = size * sizeof(T) + N - 1;
  304|   854k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   854k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   854k|    return size;
  307|   854k|  }
_ZN4ojph17calc_aligned_sizeIbLj8EEEmm:
  302|   569k|  size_t calc_aligned_size(size_t size) {
  303|   569k|    size = size * sizeof(T) + N - 1;
  304|   569k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   569k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   569k|    return size;
  307|   569k|  }
_ZN4ojph17calc_aligned_sizeIfLj64EEEmm:
  302|   300k|  size_t calc_aligned_size(size_t size) {
  303|   300k|    size = size * sizeof(T) + N - 1;
  304|   300k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   300k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   300k|    return size;
  307|   300k|  }
_ZN4ojph9align_ptrINS_5local9tile_compELj8EEEPT_S4_:
  312|   141k|  inline T *align_ptr(T *ptr) {
  313|   141k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   141k|    p += N - 1;
  315|   141k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   141k|    return reinterpret_cast<T *>(p);
  317|   141k|  }
_ZN4ojph9align_ptrINS_4rectELj8EEEPT_S3_:
  312|   282k|  inline T *align_ptr(T *ptr) {
  313|   282k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   282k|    p += N - 1;
  315|   282k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   282k|    return reinterpret_cast<T *>(p);
  317|   282k|  }
_ZN4ojph9align_ptrIjLj8EEEPT_S2_:
  312|   424k|  inline T *align_ptr(T *ptr) {
  313|   424k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   424k|    p += N - 1;
  315|   424k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   424k|    return reinterpret_cast<T *>(p);
  317|   424k|  }
_ZN4ojph9align_ptrIbLj8EEEPT_S2_:
  312|   282k|  inline T *align_ptr(T *ptr) {
  313|   282k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   282k|    p += N - 1;
  315|   282k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   282k|    return reinterpret_cast<T *>(p);
  317|   282k|  }
_ZN4ojph9align_ptrIfLj64EEEPT_S2_:
  312|  96.3k|  inline T *align_ptr(T *ptr) {
  313|  96.3k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  96.3k|    p += N - 1;
  315|  96.3k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  96.3k|    return reinterpret_cast<T *>(p);
  317|  96.3k|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|   247k|  {
  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|   247k|  }
_ZN4ojph17calc_aligned_sizeINS_5local10resolutionELj8EEEmm:
  302|   989k|  size_t calc_aligned_size(size_t size) {
  303|   989k|    size = size * sizeof(T) + N - 1;
  304|   989k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   989k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   989k|    return size;
  307|   989k|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|   166k|  {
  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|   166k|  }
_ZN4ojph9align_ptrINS_5local10resolutionELj8EEEPT_S4_:
  312|   483k|  inline T *align_ptr(T *ptr) {
  313|   483k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   483k|    p += N - 1;
  315|   483k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   483k|    return reinterpret_cast<T *>(p);
  317|   483k|  }
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|  12.0M|  {
  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|  12.0M|  }
_ZN4ojph17calc_aligned_sizeINS_5local7subbandELj8EEEmm:
  302|   989k|  size_t calc_aligned_size(size_t size) {
  303|   989k|    size = size * sizeof(T) + N - 1;
  304|   989k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   989k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   989k|    return size;
  307|   989k|  }
ojph_resolution.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  8.07M|  {
  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|  8.07M|  }
_ZN4ojph17calc_aligned_sizeINS_5local8precinctELj8EEEmm:
  302|   517k|  size_t calc_aligned_size(size_t size) {
  303|   517k|    size = size * sizeof(T) + N - 1;
  304|   517k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   517k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   517k|    return size;
  307|   517k|  }
_ZN4ojph17calc_aligned_sizeINS_11lifting_bufELj8EEEmm:
  302|   942k|  size_t calc_aligned_size(size_t size) {
  303|   942k|    size = size * sizeof(T) + N - 1;
  304|   942k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   942k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   942k|    return size;
  307|   942k|  }
_ZN4ojph17calc_aligned_sizeIlLj64EEEmm:
  302|  2.69M|  size_t calc_aligned_size(size_t size) {
  303|  2.69M|    size = size * sizeof(T) + N - 1;
  304|  2.69M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  2.69M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  2.69M|    return size;
  307|  2.69M|  }
_ZN4ojph9align_ptrINS_5local7subbandELj8EEEPT_S4_:
  312|   483k|  inline T *align_ptr(T *ptr) {
  313|   483k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   483k|    p += N - 1;
  315|   483k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   483k|    return reinterpret_cast<T *>(p);
  317|   483k|  }
_ZN4ojph9align_ptrINS_5local8precinctELj8EEEPT_S4_:
  312|   256k|  inline T *align_ptr(T *ptr) {
  313|   256k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   256k|    p += N - 1;
  315|   256k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   256k|    return reinterpret_cast<T *>(p);
  317|   256k|  }
_ZN4ojph9align_ptrINS_11lifting_bufELj8EEEPT_S3_:
  312|   461k|  inline T *align_ptr(T *ptr) {
  313|   461k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   461k|    p += N - 1;
  315|   461k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   461k|    return reinterpret_cast<T *>(p);
  317|   461k|  }
_ZN4ojph9align_ptrIlLj64EEEPT_S2_:
  312|  1.34M|  inline T *align_ptr(T *ptr) {
  313|  1.34M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  1.34M|    p += N - 1;
  315|  1.34M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  1.34M|    return reinterpret_cast<T *>(p);
  317|  1.34M|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  2.89M|  {
  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.89M|  }
_ZN4ojph17calc_aligned_sizeINS_5local9codeblockELj8EEEmm:
  302|   483k|  size_t calc_aligned_size(size_t size) {
  303|   483k|    size = size * sizeof(T) + N - 1;
  304|   483k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   483k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   483k|    return size;
  307|   483k|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  1.93M|  {
  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.93M|  }
_ZN4ojph17calc_aligned_sizeINS_5local15coded_cb_headerELj8EEEmm:
  302|   483k|  size_t calc_aligned_size(size_t size) {
  303|   483k|    size = size * sizeof(T) + N - 1;
  304|   483k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   483k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   483k|    return size;
  307|   483k|  }
_ZN4ojph9align_ptrINS_5local9codeblockELj8EEEPT_S4_:
  312|   238k|  inline T *align_ptr(T *ptr) {
  313|   238k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   238k|    p += N - 1;
  315|   238k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   238k|    return reinterpret_cast<T *>(p);
  317|   238k|  }
_ZN4ojph9align_ptrINS_5local15coded_cb_headerELj8EEEPT_S4_:
  312|   238k|  inline T *align_ptr(T *ptr) {
  313|   238k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   238k|    p += N - 1;
  315|   238k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   238k|    return reinterpret_cast<T *>(p);
  317|   238k|  }
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|  4.66M|  {
  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|  4.66M|  }
_ZN4ojph17calc_aligned_sizeIjLj64EEEmm:
  302|  1.35M|  size_t calc_aligned_size(size_t size) {
  303|  1.35M|    size = size * sizeof(T) + N - 1;
  304|  1.35M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  1.35M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  1.35M|    return size;
  307|  1.35M|  }
ojph_codeblock.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  3.12M|  {
  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|  3.12M|  }
_ZN4ojph17calc_aligned_sizeImLj64EEEmm:
  302|  1.76M|  size_t calc_aligned_size(size_t size) {
  303|  1.76M|    size = size * sizeof(T) + N - 1;
  304|  1.76M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  1.76M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  1.76M|    return size;
  307|  1.76M|  }
_ZN4ojph9align_ptrIjLj64EEEPT_S2_:
  312|   657k|  inline T *align_ptr(T *ptr) {
  313|   657k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   657k|    p += N - 1;
  315|   657k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   657k|    return reinterpret_cast<T *>(p);
  317|   657k|  }
_ZN4ojph9align_ptrImLj64EEEPT_S2_:
  312|   883k|  inline T *align_ptr(T *ptr) {
  313|   883k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   883k|    p += N - 1;
  315|   883k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   883k|    return reinterpret_cast<T *>(p);
  317|   883k|  }
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|   756k|  {
  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|   756k|  }
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|   127k|  {
  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|   127k|  }
ojph_block_decoder64.cpp:_ZN4ojphL16population_countEj:
  157|  32.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|  32.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|  76.3k|  {
  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|  76.3k|  }
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|  38.9M|    explicit size(ui32 w = 0, ui32 h = 0) : w(w), h(h) {}
_ZNK4ojph4size4areaEv:
   53|  3.40M|    ui64 area() const { return (ui64)w * (ui64)h; }
_ZN4ojph5pointC2Ejj:
   59|  37.9M|    explicit point(ui32 x = 0, ui32 y = 0) : x(x), y(y) {}

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

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

_ZN4ojph9param_sizC2EPNS_5local9param_sizE:
   73|  11.8k|    param_siz(local::param_siz *p) : state(p) {}
_ZN4ojph9param_codC2EPNS_5local9param_codE:
  106|   148k|    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|  9.24M|  {
  262|       |    assert(cpu_level_initialized);
  263|  9.24M|    return cpu_level;
  264|  9.24M|  }

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

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

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

_ZN4ojph5local31init_colour_transform_functionsEv:
  110|  4.18k|    {
  111|  4.18k|      static std::once_flag colour_transform_functions_init_flag;
  112|  4.18k|      std::call_once(colour_transform_functions_init_flag, []() {
  113|  4.18k|#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
  114|       |
  115|  4.18k|        rev_convert = gen_rev_convert;
  116|  4.18k|        rev_convert_nlt_type3 = gen_rev_convert_nlt_type3;
  117|  4.18k|        irv_convert_to_integer = gen_irv_convert_to_integer;
  118|  4.18k|        irv_convert_to_float = gen_irv_convert_to_float;
  119|  4.18k|        irv_convert_to_integer_nlt_type3 = gen_irv_convert_to_integer_nlt_type3;
  120|  4.18k|        irv_convert_to_float_nlt_type3 = gen_irv_convert_to_float_nlt_type3;
  121|  4.18k|        rct_forward = gen_rct_forward;
  122|  4.18k|        rct_backward = gen_rct_backward;
  123|  4.18k|        ict_forward = gen_ict_forward;
  124|  4.18k|        ict_backward = gen_ict_backward;
  125|       |
  126|  4.18k|  #ifndef OJPH_DISABLE_SIMD
  127|       |
  128|  4.18k|    #if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
  129|       |
  130|  4.18k|      #ifndef OJPH_DISABLE_SSE
  131|  4.18k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
  132|  4.18k|        {
  133|  4.18k|          ict_forward = sse_ict_forward;
  134|  4.18k|          ict_backward = sse_ict_backward;
  135|  4.18k|        }
  136|  4.18k|      #endif // !OJPH_DISABLE_SSE
  137|       |
  138|  4.18k|      #ifndef OJPH_DISABLE_SSE2
  139|  4.18k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2)
  140|  4.18k|        {
  141|  4.18k|          rev_convert = sse2_rev_convert;
  142|  4.18k|          rev_convert_nlt_type3 = sse2_rev_convert_nlt_type3;
  143|  4.18k|          irv_convert_to_integer = sse2_irv_convert_to_integer;
  144|  4.18k|          irv_convert_to_float = sse2_irv_convert_to_float;
  145|  4.18k|          irv_convert_to_integer_nlt_type3 =
  146|  4.18k|            sse2_irv_convert_to_integer_nlt_type3;
  147|  4.18k|          irv_convert_to_float_nlt_type3 =
  148|  4.18k|            sse2_irv_convert_to_float_nlt_type3;
  149|  4.18k|          rct_forward = sse2_rct_forward;
  150|  4.18k|          rct_backward = sse2_rct_backward;
  151|  4.18k|        }
  152|  4.18k|      #endif // !OJPH_DISABLE_SSE2
  153|       |
  154|  4.18k|      #ifndef OJPH_DISABLE_AVX
  155|  4.18k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
  156|  4.18k|        {
  157|  4.18k|          ict_forward = avx_ict_forward;
  158|  4.18k|          ict_backward = avx_ict_backward;
  159|  4.18k|        }
  160|  4.18k|      #endif // !OJPH_DISABLE_AVX
  161|       |
  162|  4.18k|      #ifndef OJPH_DISABLE_AVX2
  163|  4.18k|        if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2)
  164|  4.18k|        {
  165|  4.18k|          rev_convert = avx2_rev_convert;
  166|  4.18k|          rev_convert_nlt_type3 = avx2_rev_convert_nlt_type3;
  167|  4.18k|          irv_convert_to_integer = avx2_irv_convert_to_integer;
  168|  4.18k|          irv_convert_to_float = avx2_irv_convert_to_float;
  169|  4.18k|          irv_convert_to_integer_nlt_type3 =
  170|  4.18k|            avx2_irv_convert_to_integer_nlt_type3;
  171|  4.18k|          irv_convert_to_float_nlt_type3 =
  172|  4.18k|            avx2_irv_convert_to_float_nlt_type3;
  173|  4.18k|          rct_forward = avx2_rct_forward;
  174|  4.18k|          rct_backward = avx2_rct_backward;
  175|  4.18k|        }
  176|  4.18k|      #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|  4.18k|  #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|  4.18k|      });
  199|  4.18k|    }
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.10k|    {
   81|  1.10k|      __m256 gamma_cr2g = _mm256_set1_ps(CT_CNST::GAMMA_CR2G);
   82|  1.10k|      __m256 gamma_cb2g = _mm256_set1_ps(CT_CNST::GAMMA_CB2G);
   83|  1.10k|      __m256 gamma_cr2r = _mm256_set1_ps(CT_CNST::GAMMA_CR2R);
   84|  1.10k|      __m256 gamma_cb2b = _mm256_set1_ps(CT_CNST::GAMMA_CB2B);
   85|  2.22k|      for (int i = (repeat + 7) >> 3; i > 0; --i)
  ------------------
  |  Branch (85:39): [True: 1.12k, False: 1.10k]
  ------------------
   86|  1.12k|      {
   87|  1.12k|        __m256 my = _mm256_load_ps(y);
   88|  1.12k|        __m256 mcr = _mm256_load_ps(cr);
   89|  1.12k|        __m256 mcb = _mm256_load_ps(cb);
   90|  1.12k|        __m256 mg = _mm256_sub_ps(my, _mm256_mul_ps(gamma_cr2g, mcr));
   91|  1.12k|        _mm256_store_ps(g, _mm256_sub_ps(mg, _mm256_mul_ps(gamma_cb2g, mcb)));
   92|  1.12k|        _mm256_store_ps(r, _mm256_add_ps(my, _mm256_mul_ps(gamma_cr2r, mcr)));
   93|  1.12k|        _mm256_store_ps(b, _mm256_add_ps(my, _mm256_mul_ps(gamma_cb2b, mcb)));
   94|       |
   95|  1.12k|        y += 8; cb += 8; cr += 8;
   96|  1.12k|        r += 8; g += 8; b += 8;
   97|  1.12k|      }
   98|  1.10k|    }

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

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

_ZN4ojph5local18avx2_rev_vert_stepEPKNS0_12lifting_stepEPKNS_8line_bufES6_S6_jb:
  383|  2.45M|    {
  384|  2.45M|      if (((sig != NULL) && (sig->flags & line_buf::LFT_32BIT)) || 
  ------------------
  |  Branch (384:12): [True: 2.45M, False: 0]
  |  Branch (384:29): [True: 1.10M, False: 1.35M]
  ------------------
  385|  1.35M|          ((aug != NULL) && (aug->flags & line_buf::LFT_32BIT)) ||
  ------------------
  |  Branch (385:12): [True: 1.35M, False: 0]
  |  Branch (385:29): [True: 0, False: 1.35M]
  ------------------
  386|  1.35M|          ((other != NULL) && (other->flags & line_buf::LFT_32BIT))) 
  ------------------
  |  Branch (386:12): [True: 1.35M, False: 0]
  |  Branch (386:31): [True: 0, False: 1.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|  1.35M|      else 
  394|  1.35M|      {
  395|       |        assert((sig == NULL || sig->flags & line_buf::LFT_64BIT) &&
  396|  1.35M|               (other == NULL || other->flags & line_buf::LFT_64BIT) && 
  397|  1.35M|               (aug == NULL || aug->flags & line_buf::LFT_64BIT));
  398|  1.35M|        avx2_rev_vert_step64(s, sig, other, aug, repeat, synthesis);
  399|  1.35M|      }
  400|  2.45M|    }
_ZN4ojph5local17avx2_rev_horz_synEPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
 1060|  2.57M|    {
 1061|  2.57M|      if (dst->flags & line_buf::LFT_32BIT) 
  ------------------
  |  Branch (1061:11): [True: 1.14M, False: 1.43M]
  ------------------
 1062|  1.14M|      {
 1063|  1.14M|        assert((lsrc == NULL || lsrc->flags & line_buf::LFT_32BIT) && 
 1064|  1.14M|               (hsrc == NULL || hsrc->flags & line_buf::LFT_32BIT));
 1065|  1.14M|        avx2_rev_horz_syn32(atk, dst, lsrc, hsrc, width, even);
 1066|  1.14M|      }
 1067|  1.43M|      else 
 1068|  1.43M|      {
 1069|       |        assert((dst == NULL || dst->flags & line_buf::LFT_64BIT) &&
 1070|  1.43M|               (lsrc == NULL || lsrc->flags & line_buf::LFT_64BIT) && 
 1071|  1.43M|               (hsrc == NULL || hsrc->flags & line_buf::LFT_64BIT));
 1072|  1.43M|        avx2_rev_horz_syn64(atk, dst, lsrc, hsrc, width, even);
 1073|  1.43M|      }
 1074|  2.57M|    }
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: 550k]
  ------------------
  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|  3.88M|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (159:18): [True: 3.33M, False: 552k]
  ------------------
  160|  3.33M|          {
  161|  3.33M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  162|  3.33M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  163|  3.33M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  164|  3.33M|            __m256i t = _mm256_add_epi32(s1, s2);
  165|  3.33M|            __m256i v = _mm256_add_epi32(vb, t);
  166|  3.33M|            __m256i w = _mm256_srai_epi32(v, e);
  167|  3.33M|            d = _mm256_sub_epi32(d, w);
  168|  3.33M|            _mm256_store_si256((__m256i*)dst, d);
  169|  3.33M|          }
  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|   550k|      else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (183:16): [True: 550k, False: 0]
  |  Branch (183:27): [True: 550k, False: 0]
  |  Branch (183:37): [True: 550k, False: 0]
  ------------------
  184|   550k|      { // 5/3 predict
  185|   550k|        int i = (int)repeat;
  186|   550k|        if (synthesis)
  ------------------
  |  Branch (186:13): [True: 550k, False: 0]
  ------------------
  187|  3.87M|          for (; i > 0; i -= 8, dst += 8, src1 += 8, src2 += 8)
  ------------------
  |  Branch (187:18): [True: 3.32M, False: 550k]
  ------------------
  188|  3.32M|          {
  189|  3.32M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  190|  3.32M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  191|  3.32M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  192|  3.32M|            __m256i t = _mm256_add_epi32(s1, s2);
  193|  3.32M|            __m256i w = _mm256_srai_epi32(t, e);
  194|  3.32M|            d = _mm256_add_epi32(d, w);
  195|  3.32M|            _mm256_store_si256((__m256i*)dst, d);
  196|  3.32M|          }
  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|   550k|      }
  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|  1.35M|    {
  274|  1.35M|      const si32 a = s->rev.Aatk;
  275|  1.35M|      const si32 b = s->rev.Batk;
  276|  1.35M|      const ui8 e = s->rev.Eatk;
  277|  1.35M|      __m256i vb = _mm256_set1_epi64x(b);
  278|  1.35M|      __m256i ve = _mm256_set1_epi64x(1LL << (63 - e));      
  279|       |
  280|  1.35M|      si64* dst = aug->i64;
  281|  1.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|  1.35M|      if (a == 1)
  ------------------
  |  Branch (285:11): [True: 676k, False: 674k]
  ------------------
  286|   676k|      { // 5/3 update and any case with a == 1
  287|   676k|        int i = (int)repeat;
  288|   676k|        if (synthesis)
  ------------------
  |  Branch (288:13): [True: 676k, False: 0]
  ------------------
  289|  7.48M|          for (; i > 0; i -= 4, dst += 4, src1 += 4, src2 += 4)
  ------------------
  |  Branch (289:18): [True: 6.80M, False: 676k]
  ------------------
  290|  6.80M|          {
  291|  6.80M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  292|  6.80M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  293|  6.80M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  294|  6.80M|            __m256i t = _mm256_add_epi64(s1, s2);
  295|  6.80M|            __m256i v = _mm256_add_epi64(vb, t);
  296|  6.80M|            __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  297|  6.80M|            d = _mm256_sub_epi64(d, w);
  298|  6.80M|            _mm256_store_si256((__m256i*)dst, d);
  299|  6.80M|          }
  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|   676k|      }
  313|   674k|      else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (313:16): [True: 674k, False: 0]
  |  Branch (313:27): [True: 674k, False: 0]
  |  Branch (313:37): [True: 674k, False: 0]
  ------------------
  314|   674k|      { // 5/3 predict
  315|   674k|        int i = (int)repeat;
  316|   674k|        if (synthesis)
  ------------------
  |  Branch (316:13): [True: 674k, False: 0]
  ------------------
  317|  7.44M|          for (; i > 0; i -= 4, dst += 4, src1 += 4, src2 += 4)
  ------------------
  |  Branch (317:18): [True: 6.77M, False: 674k]
  ------------------
  318|  6.77M|          {
  319|  6.77M|            __m256i s1 = _mm256_load_si256((__m256i*)src1);
  320|  6.77M|            __m256i s2 = _mm256_load_si256((__m256i*)src2);
  321|  6.77M|            __m256i d = _mm256_load_si256((__m256i*)dst);
  322|  6.77M|            __m256i t = _mm256_add_epi64(s1, s2);
  323|  6.77M|            __m256i w = avx2_mm256_srai_epi64(t, e, ve);
  324|  6.77M|            d = _mm256_add_epi64(d, w);
  325|  6.77M|            _mm256_store_si256((__m256i*)dst, d);
  326|  6.77M|          }
  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|   674k|      }
  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|  1.35M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL21avx2_mm256_srai_epi64EDv4_xiS1_:
   61|  26.4M|    {
   62|       |      // note than m must be obtained using
   63|       |      // __m256i m = _mm256_set1_epi64x(1ULL << (63 - amt));
   64|  26.4M|      __m256i x = _mm256_srli_epi64(a, amt);
   65|  26.4M|      x = _mm256_xor_si256(x, m);
   66|  26.4M|      __m256i result = _mm256_sub_epi64(x, m);
   67|  26.4M|      return result;
   68|  26.4M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL19avx2_rev_horz_syn32EPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
  744|  1.14M|    {
  745|  1.14M|      if (width > 1)
  ------------------
  |  Branch (745:11): [True: 403k, False: 738k]
  ------------------
  746|   403k|      {
  747|   403k|        bool ev = even;
  748|   403k|        si32* oth = hsrc->i32, * aug = lsrc->i32;
  749|   403k|        ui32 aug_width = (width + (even ? 1 : 0)) >> 1;  // low pass
  ------------------
  |  Branch (749:36): [True: 356k, False: 46.8k]
  ------------------
  750|   403k|        ui32 oth_width = (width + (even ? 0 : 1)) >> 1;  // high pass
  ------------------
  |  Branch (750:36): [True: 356k, False: 46.8k]
  ------------------
  751|   403k|        ui32 num_steps = atk->get_num_steps();
  752|  1.20M|        for (ui32 j = 0; j < num_steps; ++j)
  ------------------
  |  Branch (752:26): [True: 806k, False: 403k]
  ------------------
  753|   806k|        {
  754|   806k|          const lifting_step* s = atk->get_step(j);
  755|   806k|          const si32 a = s->rev.Aatk;
  756|   806k|          const si32 b = s->rev.Batk;
  757|   806k|          const ui8 e  = s->rev.Eatk;
  758|   806k|          __m256i va = _mm256_set1_epi32(a);
  759|   806k|          __m256i vb = _mm256_set1_epi32(b);
  760|       |
  761|       |          // extension
  762|   806k|          oth[-1] = oth[0];
  763|   806k|          oth[oth_width] = oth[oth_width - 1];
  764|       |          // lifting step
  765|   806k|          const si32* sp = oth;
  766|   806k|          si32* dp = aug;
  767|   806k|          if (a == 1)
  ------------------
  |  Branch (767:15): [True: 403k, False: 403k]
  ------------------
  768|   403k|          { // 5/3 update and any case with a == 1
  769|   403k|            int i = (int)aug_width;
  770|   403k|            if (ev)
  ------------------
  |  Branch (770:17): [True: 356k, False: 46.8k]
  ------------------
  771|   356k|            {
  772|  3.34M|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (772:22): [True: 2.99M, False: 356k]
  ------------------
  773|  2.99M|              {
  774|  2.99M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  775|  2.99M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  776|  2.99M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  777|  2.99M|                __m256i t = _mm256_add_epi32(s1, s2);
  778|  2.99M|                __m256i v = _mm256_add_epi32(vb, t);
  779|  2.99M|                __m256i w = _mm256_srai_epi32(v, e);
  780|  2.99M|                d = _mm256_sub_epi32(d, w);
  781|  2.99M|                _mm256_store_si256((__m256i*)dp, d);
  782|  2.99M|              }
  783|   356k|            }
  784|  46.8k|            else
  785|  46.8k|            {
  786|   150k|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (786:22): [True: 103k, False: 46.8k]
  ------------------
  787|   103k|              {
  788|   103k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  789|   103k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  790|   103k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  791|   103k|                __m256i t = _mm256_add_epi32(s1, s2);
  792|   103k|                __m256i v = _mm256_add_epi32(vb, t);
  793|   103k|                __m256i w = _mm256_srai_epi32(v, e);
  794|   103k|                d = _mm256_sub_epi32(d, w);
  795|   103k|                _mm256_store_si256((__m256i*)dp, d);
  796|   103k|              }
  797|  46.8k|            }
  798|   403k|          }
  799|   403k|          else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (799:20): [True: 403k, False: 0]
  |  Branch (799:31): [True: 403k, False: 0]
  |  Branch (799:41): [True: 403k, False: 0]
  ------------------
  800|   403k|          {  // 5/3 predict
  801|   403k|            int i = (int)aug_width;
  802|   403k|            if (ev)
  ------------------
  |  Branch (802:17): [True: 46.8k, False: 356k]
  ------------------
  803|   150k|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (803:22): [True: 103k, False: 46.8k]
  ------------------
  804|   103k|              {
  805|   103k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  806|   103k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  807|   103k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  808|   103k|                __m256i t = _mm256_add_epi32(s1, s2);
  809|   103k|                __m256i w = _mm256_srai_epi32(t, e);
  810|   103k|                d = _mm256_add_epi32(d, w);
  811|   103k|                _mm256_store_si256((__m256i*)dp, d);
  812|   103k|              }
  813|   356k|            else
  814|  3.28M|              for (; i > 0; i -= 8, sp += 8, dp += 8)
  ------------------
  |  Branch (814:22): [True: 2.92M, False: 356k]
  ------------------
  815|  2.92M|              {
  816|  2.92M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  817|  2.92M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  818|  2.92M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  819|  2.92M|                __m256i t = _mm256_add_epi32(s1, s2);
  820|  2.92M|                __m256i w = _mm256_srai_epi32(t, e);
  821|  2.92M|                d = _mm256_add_epi32(d, w);
  822|  2.92M|                _mm256_store_si256((__m256i*)dp, d);
  823|  2.92M|              }
  824|   403k|          }
  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|   806k|          si32* t = aug; aug = oth; oth = t;
  886|   806k|          ev = !ev;
  887|   806k|          ui32 w = aug_width; aug_width = oth_width; oth_width = w;
  888|   806k|        }
  889|       |
  890|       |        // combine both lsrc and hsrc into dst
  891|   403k|        {
  892|   403k|          float* dp  = dst->f32;
  893|   403k|          float* spl = even ? lsrc->f32 : hsrc->f32;
  ------------------
  |  Branch (893:24): [True: 356k, False: 46.8k]
  ------------------
  894|   403k|          float* sph = even ? hsrc->f32 : lsrc->f32;
  ------------------
  |  Branch (894:24): [True: 356k, False: 46.8k]
  ------------------
  895|   403k|          int w = (int)width;
  896|   403k|          avx2_interleave32(dp, spl, sph, w);
  897|   403k|        }
  898|   403k|      }
  899|   738k|      else {
  900|   738k|        if (even)
  ------------------
  |  Branch (900:13): [True: 733k, False: 5.60k]
  ------------------
  901|   733k|          dst->i32[0] = lsrc->i32[0];
  902|  5.60k|        else
  903|  5.60k|          dst->i32[0] = hsrc->i32[0] >> 1;
  904|   738k|      }
  905|  1.14M|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL17avx2_interleave32EPfS1_S1_i:
   90|   403k|    {
   91|  3.49M|      for (; width > 0; width -= 16, dp += 16, spl += 8, sph += 8)
  ------------------
  |  Branch (91:14): [True: 3.09M, False: 403k]
  ------------------
   92|  3.09M|      {
   93|  3.09M|        __m256 a = _mm256_load_ps(spl);
   94|  3.09M|        __m256 b = _mm256_load_ps(sph);
   95|  3.09M|        __m256 c = _mm256_unpacklo_ps(a, b);
   96|  3.09M|        __m256 d = _mm256_unpackhi_ps(a, b);
   97|  3.09M|        __m256 e = _mm256_permute2f128_ps(c, d, (2 << 4) | (0));
   98|       |        __m256 f = _mm256_permute2f128_ps(c, d, (3 << 4) | (1));
   99|  3.09M|        _mm256_store_ps(dp, e);
  100|  3.09M|        _mm256_store_ps(dp + 8, f);
  101|  3.09M|      }
  102|   403k|    }
ojph_transform_avx2.cpp:_ZN4ojph5localL19avx2_rev_horz_syn64EPKNS0_9param_atkEPKNS_8line_bufES6_S6_jb:
  912|  1.43M|    {
  913|  1.43M|      if (width > 1)
  ------------------
  |  Branch (913:11): [True: 396k, False: 1.04M]
  ------------------
  914|   396k|      {
  915|   396k|        bool ev = even;
  916|   396k|        si64* oth = hsrc->i64, * aug = lsrc->i64;
  917|   396k|        ui32 aug_width = (width + (even ? 1 : 0)) >> 1;  // low pass
  ------------------
  |  Branch (917:36): [True: 371k, False: 25.1k]
  ------------------
  918|   396k|        ui32 oth_width = (width + (even ? 0 : 1)) >> 1;  // high pass
  ------------------
  |  Branch (918:36): [True: 371k, False: 25.1k]
  ------------------
  919|   396k|        ui32 num_steps = atk->get_num_steps();
  920|  1.18M|        for (ui32 j = 0; j < num_steps; ++j)
  ------------------
  |  Branch (920:26): [True: 793k, False: 396k]
  ------------------
  921|   793k|        {
  922|   793k|          const lifting_step* s = atk->get_step(j);
  923|   793k|          const si32 a = s->rev.Aatk;
  924|   793k|          const si32 b = s->rev.Batk;
  925|   793k|          const ui8 e  = s->rev.Eatk;
  926|   793k|          __m256i vb = _mm256_set1_epi64x(b);
  927|   793k|          __m256i ve = _mm256_set1_epi64x(1LL << (63 - e));      
  928|       |
  929|       |          // extension
  930|   793k|          oth[-1] = oth[0];
  931|   793k|          oth[oth_width] = oth[oth_width - 1];
  932|       |          // lifting step
  933|   793k|          const si64* sp = oth;
  934|   793k|          si64* dp = aug;
  935|   793k|          if (a == 1)
  ------------------
  |  Branch (935:15): [True: 396k, False: 396k]
  ------------------
  936|   396k|          { // 5/3 update and any case with a == 1
  937|   396k|            int i = (int)aug_width;
  938|   396k|            if (ev)
  ------------------
  |  Branch (938:17): [True: 371k, False: 25.1k]
  ------------------
  939|   371k|            {
  940|  6.69M|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (940:22): [True: 6.32M, False: 371k]
  ------------------
  941|  6.32M|              {
  942|  6.32M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  943|  6.32M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  944|  6.32M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  945|  6.32M|                __m256i t = _mm256_add_epi64(s1, s2);
  946|  6.32M|                __m256i v = _mm256_add_epi64(vb, t);
  947|  6.32M|                __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  948|  6.32M|                d = _mm256_sub_epi64(d, w);
  949|  6.32M|                _mm256_store_si256((__m256i*)dp, d);
  950|  6.32M|              }
  951|   371k|            }
  952|  25.1k|            else
  953|  25.1k|            {
  954|   192k|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (954:22): [True: 167k, False: 25.1k]
  ------------------
  955|   167k|              {
  956|   167k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  957|   167k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  958|   167k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  959|   167k|                __m256i t = _mm256_add_epi64(s1, s2);
  960|   167k|                __m256i v = _mm256_add_epi64(vb, t);
  961|   167k|                __m256i w = avx2_mm256_srai_epi64(v, e, ve);
  962|   167k|                d = _mm256_sub_epi64(d, w);
  963|   167k|                _mm256_store_si256((__m256i*)dp, d);
  964|   167k|              }
  965|  25.1k|            }
  966|   396k|          }
  967|   396k|          else if (a == -1 && b == 1 && e == 1)
  ------------------
  |  Branch (967:20): [True: 396k, False: 0]
  |  Branch (967:31): [True: 396k, False: 0]
  |  Branch (967:41): [True: 396k, False: 0]
  ------------------
  968|   396k|          {  // 5/3 predict
  969|   396k|            int i = (int)aug_width;
  970|   396k|            if (ev)
  ------------------
  |  Branch (970:17): [True: 25.1k, False: 371k]
  ------------------
  971|   194k|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (971:22): [True: 169k, False: 25.1k]
  ------------------
  972|   169k|              {
  973|   169k|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  974|   169k|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp - 1));
  975|   169k|                __m256i d = _mm256_load_si256((__m256i*)dp);
  976|   169k|                __m256i t = _mm256_add_epi64(s1, s2);
  977|   169k|                __m256i w = avx2_mm256_srai_epi64(t, e, ve);
  978|   169k|                d = _mm256_add_epi64(d, w);
  979|   169k|                _mm256_store_si256((__m256i*)dp, d);
  980|   169k|              }
  981|   371k|            else
  982|  6.56M|              for (; i > 0; i -= 4, sp += 4, dp += 4)
  ------------------
  |  Branch (982:22): [True: 6.19M, False: 371k]
  ------------------
  983|  6.19M|              {
  984|  6.19M|                __m256i s1 = _mm256_load_si256((__m256i*)sp);
  985|  6.19M|                __m256i s2 = _mm256_loadu_si256((__m256i*)(sp + 1));
  986|  6.19M|                __m256i d = _mm256_load_si256((__m256i*)dp);
  987|  6.19M|                __m256i t = _mm256_add_epi64(s1, s2);
  988|  6.19M|                __m256i w = avx2_mm256_srai_epi64(t, e, ve);
  989|  6.19M|                d = _mm256_add_epi64(d, w);
  990|  6.19M|                _mm256_store_si256((__m256i*)dp, d);
  991|  6.19M|              }
  992|   396k|          }
  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|   793k|          si64* t = aug; aug = oth; oth = t;
 1035|   793k|          ev = !ev;
 1036|   793k|          ui32 w = aug_width; aug_width = oth_width; oth_width = w;
 1037|   793k|        }
 1038|       |
 1039|       |        // combine both lsrc and hsrc into dst
 1040|   396k|        {
 1041|   396k|          double* dp  = (double*)dst->p;
 1042|   396k|          double* spl = (double*)(even ? lsrc->p : hsrc->p);
  ------------------
  |  Branch (1042:35): [True: 371k, False: 25.1k]
  ------------------
 1043|   396k|          double* sph = (double*)(even ? hsrc->p : lsrc->p);
  ------------------
  |  Branch (1043:35): [True: 371k, False: 25.1k]
  ------------------
 1044|   396k|          int w = (int)width;
 1045|   396k|          avx2_interleave64(dp, spl, sph, w);
 1046|   396k|        }
 1047|   396k|      }
 1048|  1.04M|      else {
 1049|  1.04M|        if (even)
  ------------------
  |  Branch (1049:13): [True: 1.03M, False: 2.71k]
  ------------------
 1050|  1.03M|          dst->i64[0] = lsrc->i64[0];
 1051|  2.71k|        else
 1052|  2.71k|          dst->i64[0] = hsrc->i64[0] >> 1;
 1053|  1.04M|      }
 1054|  1.43M|    }    
ojph_transform_avx2.cpp:_ZN4ojph5localL17avx2_interleave64EPdS1_S1_i:
  124|   396k|    {
  125|  6.88M|      for (; width > 0; width -= 8, dp += 8, spl += 4, sph += 4)
  ------------------
  |  Branch (125:14): [True: 6.49M, False: 396k]
  ------------------
  126|  6.49M|      {
  127|  6.49M|        __m256d a = _mm256_load_pd(spl);
  128|  6.49M|        __m256d b = _mm256_load_pd(sph);
  129|  6.49M|        __m256d c = _mm256_unpacklo_pd(a, b);
  130|  6.49M|        __m256d d = _mm256_unpackhi_pd(a, b);
  131|  6.49M|        __m256d e = _mm256_permute2f128_pd(c, d, (2 << 4) | (0));
  132|       |        __m256d f = _mm256_permute2f128_pd(c, d, (3 << 4) | (1));
  133|  6.49M|        _mm256_store_pd(dp, e);
  134|  6.49M|        _mm256_store_pd(dp + 4, f);
  135|  6.49M|      }
  136|   396k|    }

