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

ojph_precinct.cpp:_ZN4ojph5localL7bb_initEPNS0_12bit_read_bufEjPNS_11infile_baseE:
   68|   536k|    {
   69|   536k|      bbp->avail_bits = 0;
   70|   536k|      bbp->file = file;
   71|   536k|      bbp->bytes_left = bytes_left;
   72|   536k|      bbp->tmp = 0;
   73|   536k|      bbp->unstuff = false;
   74|   536k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_skip_sopEPNS0_12bit_read_bufE:
  184|  30.5k|    {
  185|  30.5k|      if (bbp->bytes_left >= 2)
  ------------------
  |  Branch (185:11): [True: 30.0k, False: 453]
  ------------------
  186|  30.0k|      {
  187|  30.0k|        ui8 marker[2];
  188|  30.0k|        if (bbp->file->read(marker, 2) != 2)
  ------------------
  |  Branch (188:13): [True: 929, False: 29.1k]
  ------------------
  189|    929|          throw "error reading from file";
  190|  29.1k|        if ((int)marker[0] == (SOP >> 8) && (int)marker[1] == (SOP & 0xFF))
  ------------------
  |  Branch (190:13): [True: 4.16k, False: 24.9k]
  |  Branch (190:45): [True: 1.15k, False: 3.01k]
  ------------------
  191|  1.15k|        {
  192|  1.15k|          bbp->bytes_left -= 2;
  193|  1.15k|          if (bbp->bytes_left >= 4)
  ------------------
  |  Branch (193:15): [True: 1.07k, False: 75]
  ------------------
  194|  1.07k|          {
  195|  1.07k|            ui16 com_len;
  196|  1.07k|            if (bbp->file->read(&com_len, 2) != 2)
  ------------------
  |  Branch (196:17): [True: 233, False: 842]
  ------------------
  197|    233|              throw "error reading from file";
  198|    842|            com_len = swap_byte(com_len);
  199|    842|            if (com_len != 4)
  ------------------
  |  Branch (199:17): [True: 481, False: 361]
  ------------------
  200|    481|              throw "something is wrong with SOP length";
  201|    361|            int result = 
  202|    361|              bbp->file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
  203|    361|            if (result != 0)
  ------------------
  |  Branch (203:17): [True: 102, False: 259]
  ------------------
  204|    102|              throw "error seeking file";
  205|    259|            bbp->bytes_left -= com_len;
  206|    259|          }
  207|     75|          else
  208|     75|            throw "precinct truncated early";
  209|    259|          return true;
  210|  1.15k|        }
  211|  27.9k|        else
  212|  27.9k|        {
  213|       |          //put the bytes back
  214|  27.9k|          if (bbp->file->seek(-2, infile_base::OJPH_SEEK_CUR) != 0)
  ------------------
  |  Branch (214:15): [True: 0, False: 27.9k]
  ------------------
  215|      0|            throw "error seeking file";
  216|  27.9k|          return false;
  217|  27.9k|        }
  218|  29.1k|      }
  219|       |
  220|    453|      return false;
  221|  30.5k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_read_bitEPNS0_12bit_read_bufERj:
  103|  2.65M|    {
  104|  2.65M|      bool result = true;
  105|  2.65M|      if (bbp->avail_bits == 0)
  ------------------
  |  Branch (105:11): [True: 750k, False: 1.90M]
  ------------------
  106|   750k|        result = bb_read(bbp);
  107|  2.65M|      bit = (bbp->tmp >> --bbp->avail_bits) & 1;
  108|  2.65M|      return result;
  109|  2.65M|    }
ojph_precinct.cpp:_ZN4ojph5localL7bb_readEPNS0_12bit_read_bufE:
   79|  1.15M|    {
   80|  1.15M|      if (bbp->bytes_left > 0)
  ------------------
  |  Branch (80:11): [True: 1.15M, False: 4.06k]
  ------------------
   81|  1.15M|      {
   82|  1.15M|        ui32 t = 0;
   83|  1.15M|        if (bbp->file->read(&t, 1) != 1)
  ------------------
  |  Branch (83:13): [True: 15.8k, False: 1.13M]
  ------------------
   84|  15.8k|          throw "error reading from file";
   85|  1.13M|        bbp->tmp = t;
   86|  1.13M|        bbp->avail_bits = 8 - bbp->unstuff;
   87|  1.13M|        bbp->unstuff = (t == 0xFF);
   88|  1.13M|        --bbp->bytes_left;
   89|  1.13M|        return true;
   90|  1.15M|      }
   91|  4.06k|      else
   92|  4.06k|      {
   93|  4.06k|        bbp->tmp = 0;
   94|  4.06k|        bbp->avail_bits = 8 - bbp->unstuff;
   95|  4.06k|        bbp->unstuff = false;
   96|  4.06k|        return false;
   97|  4.06k|      }
   98|  1.15M|    }
ojph_precinct.cpp:_ZN4ojph5localL12bb_terminateEPNS0_12bit_read_bufEb:
  169|   494k|    {
  170|   494k|      bool result = true;
  171|   494k|      if (bbp->unstuff)
  ------------------
  |  Branch (171:11): [True: 1.99k, False: 492k]
  ------------------
  172|  1.99k|        result = bb_read(bbp);
  173|   494k|      assert(bbp->unstuff == false);
  174|   494k|      if (uses_eph)
  ------------------
  |  Branch (174:11): [True: 5.07k, False: 489k]
  ------------------
  175|  5.07k|        bb_skip_eph(bbp);
  176|   494k|      bbp->tmp = 0;
  177|   494k|      bbp->avail_bits = 0;
  178|   494k|      return result;
  179|   494k|    }
ojph_precinct.cpp:_ZN4ojph5localL11bb_skip_ephEPNS0_12bit_read_bufE:
  154|  5.07k|    {
  155|  5.07k|      if (bbp->bytes_left >= 2)
  ------------------
  |  Branch (155:11): [True: 4.33k, False: 738]
  ------------------
  156|  4.33k|      {
  157|  4.33k|        ui8 marker[2];
  158|  4.33k|        if (bbp->file->read(marker, 2) != 2)
  ------------------
  |  Branch (158:13): [True: 338, False: 3.99k]
  ------------------
  159|    338|          throw "error reading from file";
  160|  3.99k|        bbp->bytes_left -= 2;
  161|  3.99k|        if ((int)marker[0] != (EPH >> 8) || (int)marker[1] != (EPH & 0xFF))
  ------------------
  |  Branch (161:13): [True: 3.22k, False: 769]
  |  Branch (161:45): [True: 568, False: 201]
  ------------------
  162|  3.79k|          throw "should find EPH, but found something else";
  163|  3.99k|      }
  164|  5.07k|    }
ojph_precinct.cpp:_ZN4ojph5localL12bb_read_bitsEPNS0_12bit_read_bufEiRj:
  114|   430k|    {
  115|   430k|      assert(num_bits <= 32);
  116|       |
  117|   430k|      bits = 0;
  118|   430k|      bool result = true;
  119|  1.23M|      while (num_bits) {
  ------------------
  |  Branch (119:14): [True: 809k, False: 430k]
  ------------------
  120|   809k|        if (bbp->avail_bits == 0)
  ------------------
  |  Branch (120:13): [True: 403k, False: 405k]
  ------------------
  121|   403k|          result = bb_read(bbp);
  122|   809k|        int tx_bits = ojph_min(bbp->avail_bits, num_bits);
  ------------------
  |  |   76|   809k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 379k, False: 430k]
  |  |  ------------------
  ------------------
  123|   809k|        bits <<= tx_bits;
  124|   809k|        bbp->avail_bits -= tx_bits;
  125|   809k|        num_bits -= tx_bits;
  126|   809k|        bits |= (bbp->tmp >> bbp->avail_bits) & ((1 << tx_bits) - 1);
  127|   809k|      }
  128|   430k|      return result;
  129|   430k|    }
ojph_precinct.cpp:_ZN4ojph5localL13bb_read_chunkEPNS0_12bit_read_bufEjRPNS_11coded_listsEPNS_21mem_elastic_allocatorE:
  136|   103k|    {
  137|   103k|      assert(bbp->avail_bits == 0 && bbp->unstuff == false);
  138|   103k|      elastic->get_buffer(num_bytes + coded_cb_header::prefix_buf_size
  139|   103k|        + coded_cb_header::suffix_buf_size, cur_coded_list);
  140|   103k|      ui32 bytes = ojph_min(num_bytes, bbp->bytes_left);
  ------------------
  |  |   76|   103k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 102k, False: 1.41k]
  |  |  ------------------
  ------------------
  141|   103k|      ui32 bytes_read = (ui32)bbp->file->read(
  142|   103k|        cur_coded_list->buf + coded_cb_header::prefix_buf_size, bytes);
  143|   103k|      if (num_bytes > bytes_read)
  ------------------
  |  Branch (143:11): [True: 12.9k, False: 90.9k]
  ------------------
  144|  12.9k|        memset(
  145|  12.9k|          cur_coded_list->buf + coded_cb_header::prefix_buf_size + bytes_read,
  146|  12.9k|          0, num_bytes - bytes_read);
  147|   103k|      bbp->bytes_left -= bytes_read;
  148|   103k|      return bytes_read == bytes;
  149|   103k|    }

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

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

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

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

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

_ZN4ojph5local10codestreamC2Ev:
   57|  6.44k|    : precinct_scratch(NULL), allocator(NULL), elastic_alloc(NULL)
   58|  6.44k|    {
   59|  6.44k|      allocator = new mem_fixed_allocator;
   60|  6.44k|      elastic_alloc = new mem_elastic_allocator(1048576); // 1 megabyte
   61|       |
   62|  6.44k|      init_colour_transform_functions();
   63|  6.44k|      init_wavelet_transform_functions();
   64|       |
   65|  6.44k|      restart();
   66|  6.44k|    }
_ZN4ojph5local10codestreamD2Ev:
   70|  6.44k|    {
   71|  6.44k|      if (allocator)
  ------------------
  |  Branch (71:11): [True: 6.44k, False: 0]
  ------------------
   72|  6.44k|        delete allocator;
   73|  6.44k|      if (elastic_alloc)
  ------------------
  |  Branch (73:11): [True: 6.44k, False: 0]
  ------------------
   74|  6.44k|        delete elastic_alloc;
   75|  6.44k|    }
_ZN4ojph5local10codestream7restartEv:
   79|  6.44k|    {
   80|  6.44k|      tiles = NULL;
   81|  6.44k|      lines = NULL;
   82|  6.44k|      comp_size = NULL;
   83|  6.44k|      recon_comp_size = NULL;
   84|  6.44k|      outfile = NULL;
   85|  6.44k|      infile = NULL;
   86|       |
   87|  6.44k|      num_comps = 0;
   88|  6.44k|      employ_color_transform = false;
   89|  6.44k|      planar = -1;
   90|  6.44k|      profile = OJPH_PN_UNDEFINED;
   91|  6.44k|      tilepart_div = OJPH_TILEPART_NO_DIVISIONS;
   92|  6.44k|      need_tlm = false;
   93|       |
   94|  6.44k|      cur_comp = 0;
   95|  6.44k|      cur_line = 0;
   96|  6.44k|      cur_tile_row = 0;
   97|  6.44k|      resilient = false;
   98|  6.44k|      skipped_res_for_read = skipped_res_for_recon = 0;
   99|       |
  100|  6.44k|      precinct_scratch_needed_bytes = 0;
  101|       |
  102|  6.44k|      cod.restart();
  103|  6.44k|      qcd.restart();
  104|  6.44k|      nlt.restart();
  105|  6.44k|      dfs.restart();
  106|  6.44k|      atk.restart();
  107|       |
  108|  6.44k|      allocator->restart();
  109|  6.44k|      elastic_alloc->restart();
  110|  6.44k|    }
_ZN4ojph5local10codestream9pre_allocEv:
  114|  4.77k|    {
  115|  4.77k|      ojph::param_siz sz = access_siz();
  116|  4.77k|      num_tiles.w = sz.get_image_extent().x - sz.get_tile_offset().x;
  117|  4.77k|      num_tiles.w = ojph_div_ceil(num_tiles.w, sz.get_tile_size().w);
  ------------------
  |  |   70|  4.77k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  118|  4.77k|      num_tiles.h = sz.get_image_extent().y - sz.get_tile_offset().y;
  119|  4.77k|      num_tiles.h = ojph_div_ceil(num_tiles.h, sz.get_tile_size().h);
  ------------------
  |  |   70|  4.77k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  120|  4.77k|      if (num_tiles.area() > 65535)
  ------------------
  |  Branch (120:11): [True: 1, False: 4.77k]
  ------------------
  121|      1|        OJPH_ERROR(0x00030011, "the number of tiles cannot exceed 65535");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  122|  4.77k|      if (num_tiles.area() == 0)
  ------------------
  |  Branch (122:11): [True: 1, False: 4.77k]
  ------------------
  123|      1|        OJPH_ERROR(0x00030012, "the number of tiles cannot be 0");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|       |
  125|       |      //allocate tiles
  126|  4.77k|      allocator->pre_alloc_obj<tile>((size_t)num_tiles.area());
  127|       |
  128|  4.77k|      ui32 num_tileparts = 0;
  129|  4.77k|      point index;
  130|  4.77k|      rect tile_rect, recon_tile_rect;
  131|  4.77k|      ui32 ds = 1 << skipped_res_for_recon;
  132|  39.6k|      for (index.y = 0; index.y < num_tiles.h; ++index.y)
  ------------------
  |  Branch (132:25): [True: 34.8k, False: 4.77k]
  ------------------
  133|  34.8k|      {
  134|  34.8k|        ui32 y0 = sz.get_tile_offset().y
  135|  34.8k|                + index.y * sz.get_tile_size().h;
  136|  34.8k|        ui32 y1 = y0 + sz.get_tile_size().h; //end of tile
  137|       |
  138|  34.8k|        tile_rect.org.y = ojph_max(y0, sz.get_image_offset().y);
  ------------------
  |  |   73|  34.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 30.1k, False: 4.77k]
  |  |  ------------------
  ------------------
  139|  34.8k|        tile_rect.siz.h =
  140|  34.8k|          ojph_min(y1, sz.get_image_extent().y) - tile_rect.org.y;
  ------------------
  |  |   76|  34.8k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 30.1k, False: 4.76k]
  |  |  ------------------
  ------------------
  141|       |
  142|  34.8k|        recon_tile_rect.org.y = ojph_max(ojph_div_ceil(y0, ds),
  ------------------
  |  |   73|  34.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 30.1k, False: 4.79k]
  |  |  ------------------
  ------------------
  143|  34.8k|          ojph_div_ceil(sz.get_image_offset().y, ds));
  144|  34.8k|        recon_tile_rect.siz.h = ojph_min(ojph_div_ceil(y1, ds),
  ------------------
  |  |   76|  34.8k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 30.0k, False: 4.83k]
  |  |  ------------------
  ------------------
  145|  34.8k|          ojph_div_ceil(sz.get_image_extent().y, ds))
  146|  34.8k|          - recon_tile_rect.org.y;
  147|       |
  148|   109k|        for (index.x = 0; index.x < num_tiles.w; ++index.x)
  ------------------
  |  Branch (148:27): [True: 74.6k, False: 34.8k]
  ------------------
  149|  74.6k|        {
  150|  74.6k|          ui32 x0 = sz.get_tile_offset().x
  151|  74.6k|                  + index.x * sz.get_tile_size().w;
  152|  74.6k|          ui32 x1 = x0 + sz.get_tile_size().w;
  153|       |
  154|  74.6k|          tile_rect.org.x = ojph_max(x0, sz.get_image_offset().x);
  ------------------
  |  |   73|  74.6k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 39.7k, False: 34.8k]
  |  |  ------------------
  ------------------
  155|  74.6k|          tile_rect.siz.w =
  156|  74.6k|            ojph_min(x1, sz.get_image_extent().x) - tile_rect.org.x;
  ------------------
  |  |   76|  74.6k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 39.7k, False: 34.8k]
  |  |  ------------------
  ------------------
  157|       |
  158|  74.6k|          recon_tile_rect.org.x = ojph_max(ojph_div_ceil(x0, ds),
  ------------------
  |  |   73|  74.6k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 39.7k, False: 34.9k]
  |  |  ------------------
  ------------------
  159|  74.6k|            ojph_div_ceil(sz.get_image_offset().x, ds));
  160|  74.6k|          recon_tile_rect.siz.w = ojph_min(ojph_div_ceil(x1, ds),
  ------------------
  |  |   76|  74.6k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 39.7k, False: 34.9k]
  |  |  ------------------
  ------------------
  161|  74.6k|            ojph_div_ceil(sz.get_image_extent().x, ds))
  162|  74.6k|            - recon_tile_rect.org.x;
  163|       |
  164|  74.6k|          ui32 tps = 0; // number of tileparts for this tile
  165|  74.6k|          tile::pre_alloc(this, tile_rect, recon_tile_rect, tps);
  166|  74.6k|          num_tileparts += tps;
  167|  74.6k|        }
  168|  34.8k|      }
  169|       |
  170|       |      //allocate lines
  171|       |      //These lines are used by codestream to exchange data with external
  172|       |      // world
  173|  4.77k|      ui32 num_comps = sz.get_num_components();
  174|  4.77k|      allocator->pre_alloc_obj<line_buf>(num_comps);
  175|  4.77k|      allocator->pre_alloc_obj<size>(num_comps); //for *comp_size
  176|  4.77k|      allocator->pre_alloc_obj<size>(num_comps); //for *recon_comp_size
  177|  10.1k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (177:24): [True: 5.40k, False: 4.77k]
  ------------------
  178|  5.40k|        allocator->pre_alloc_data<si32>(siz.get_recon_width(i), 0);
  179|       |
  180|       |      //allocate tlm
  181|  4.77k|      if (outfile != NULL && need_tlm)
  ------------------
  |  Branch (181:11): [True: 0, False: 4.77k]
  |  Branch (181:30): [True: 0, False: 0]
  ------------------
  182|      0|        allocator->pre_alloc_obj<param_tlm::Ttlm_Ptlm_pair>(num_tileparts);
  183|       |
  184|       |      //precinct scratch buffer
  185|  4.77k|      ui32 num_decomps = cod.get_num_decompositions();
  186|  4.77k|      size log_cb = cod.get_log_block_dims();
  187|       |
  188|  4.77k|      size ratio;
  189|  33.2k|      for (ui32 r = 0; r <= num_decomps; ++r)
  ------------------
  |  Branch (189:24): [True: 28.4k, False: 4.77k]
  ------------------
  190|  28.4k|      {
  191|  28.4k|        size log_PP = cod.get_log_precinct_size(r);
  192|  28.4k|        ratio.w = ojph_max(ratio.w, log_PP.w - ojph_min(log_cb.w, log_PP.w));
  ------------------
  |  |   73|  56.9k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 5.96k, False: 22.5k]
  |  |  |  Branch (73:33): [True: 4.72k, False: 23.7k]
  |  |  |  Branch (73:46): [True: 3.52k, False: 18.9k]
  |  |  ------------------
  ------------------
  193|  28.4k|        ratio.h = ojph_max(ratio.h, log_PP.h - ojph_min(log_cb.h, log_PP.h));
  ------------------
  |  |   73|  56.9k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.22k, False: 27.2k]
  |  |  |  Branch (73:33): [True: 1.38k, False: 27.0k]
  |  |  |  Branch (73:46): [True: 1.28k, False: 25.9k]
  |  |  ------------------
  ------------------
  194|  28.4k|      }
  195|  4.77k|      ui32 max_ratio = ojph_max(ratio.w, ratio.h);
  ------------------
  |  |   73|  4.77k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 2.29k, False: 2.47k]
  |  |  ------------------
  ------------------
  196|  4.77k|      max_ratio = 1 << max_ratio;
  197|       |      // assuming that we have a hierarchy of n levels.
  198|       |      // This needs 4/3 times the area, rounded up
  199|       |      // (rounding up leaves one extra entry).
  200|       |      // This exta entry is necessary
  201|       |      // We need 4 such tables. These tables store
  202|       |      // 1. missing msbs and 2. their flags,
  203|       |      // 3. number of layers and 4. their flags
  204|  4.77k|      precinct_scratch_needed_bytes =
  205|  4.77k|        4 * ((max_ratio * max_ratio * 4 + 2) / 3);
  206|       |
  207|  4.77k|      allocator->pre_alloc_obj<ui8>(precinct_scratch_needed_bytes);
  208|  4.77k|    }
_ZN4ojph5local10codestream14finalize_allocEv:
  212|  4.74k|    {
  213|  4.74k|      allocator->alloc();
  214|       |
  215|       |      //precinct scratch buffer
  216|  4.74k|      precinct_scratch =
  217|  4.74k|        allocator->post_alloc_obj<ui8>(precinct_scratch_needed_bytes);
  218|       |
  219|       |      //get tiles
  220|  4.74k|      tiles = this->allocator->post_alloc_obj<tile>((size_t)num_tiles.area());
  221|       |
  222|  4.74k|      ui32 num_tileparts = 0;
  223|  4.74k|      point index;
  224|  4.74k|      rect tile_rect;
  225|  4.74k|      ojph::param_siz sz = access_siz();
  226|  39.0k|      for (index.y = 0; index.y < num_tiles.h; ++index.y)
  ------------------
  |  Branch (226:25): [True: 34.2k, False: 4.74k]
  ------------------
  227|  34.2k|      {
  228|  34.2k|        ui32 y0 = sz.get_tile_offset().y
  229|  34.2k|                + index.y * sz.get_tile_size().h;
  230|  34.2k|        ui32 y1 = y0 + sz.get_tile_size().h; //end of tile
  231|       |
  232|  34.2k|        tile_rect.org.y = ojph_max(y0, sz.get_image_offset().y);
  ------------------
  |  |   73|  34.2k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 29.5k, False: 4.74k]
  |  |  ------------------
  ------------------
  233|  34.2k|        tile_rect.siz.h =
  234|  34.2k|          ojph_min(y1, sz.get_image_extent().y) - tile_rect.org.y;
  ------------------
  |  |   76|  34.2k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 29.5k, False: 4.71k]
  |  |  ------------------
  ------------------
  235|       |
  236|  34.2k|        ui32 offset = 0;
  237|   107k|        for (index.x = 0; index.x < num_tiles.w; ++index.x)
  ------------------
  |  Branch (237:27): [True: 73.5k, False: 34.2k]
  ------------------
  238|  73.5k|        {
  239|  73.5k|          ui32 x0 = sz.get_tile_offset().x
  240|  73.5k|                  + index.x * sz.get_tile_size().w;
  241|  73.5k|          ui32 x1 = x0 + sz.get_tile_size().w;
  242|       |
  243|  73.5k|          tile_rect.org.x = ojph_max(x0, sz.get_image_offset().x);
  ------------------
  |  |   73|  73.5k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 39.2k, False: 34.2k]
  |  |  ------------------
  ------------------
  244|  73.5k|          tile_rect.siz.w =
  245|  73.5k|            ojph_min(x1, sz.get_image_extent().x) - tile_rect.org.x;
  ------------------
  |  |   76|  73.5k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 39.2k, False: 34.2k]
  |  |  ------------------
  ------------------
  246|       |
  247|  73.5k|          ui32 tps = 0; // number of tileparts for this tile
  248|  73.5k|          ui32 idx = index.y * num_tiles.w + index.x;
  249|  73.5k|          tiles[idx].finalize_alloc(this, tile_rect, idx, offset, tps);
  250|  73.5k|          num_tileparts += tps;
  251|  73.5k|        }
  252|  34.2k|      }
  253|       |
  254|       |      //allocate lines
  255|       |      //These lines are used by codestream to exchange data with external
  256|       |      // world
  257|  4.74k|      this->num_comps = sz.get_num_components();
  258|  4.74k|      lines = allocator->post_alloc_obj<line_buf>(this->num_comps);
  259|  4.74k|      comp_size = allocator->post_alloc_obj<size>(this->num_comps);
  260|  4.74k|      recon_comp_size = allocator->post_alloc_obj<size>(this->num_comps);
  261|  4.74k|      employ_color_transform = cod.is_employing_color_transform();
  262|  9.83k|      for (ui32 i = 0; i < this->num_comps; ++i)
  ------------------
  |  Branch (262:24): [True: 5.08k, False: 4.74k]
  ------------------
  263|  5.08k|      {
  264|  5.08k|        comp_size[i].w = siz.get_width(i);
  265|  5.08k|        comp_size[i].h = siz.get_height(i);
  266|  5.08k|        ui32 cw = siz.get_recon_width(i);
  267|  5.08k|        recon_comp_size[i].w = cw;
  268|  5.08k|        recon_comp_size[i].h = siz.get_recon_height(i);
  269|  5.08k|        lines[i].wrap(allocator->post_alloc_data<si32>(cw, 0), cw, 0);
  270|  5.08k|      }
  271|       |
  272|  4.74k|      cur_comp = 0;
  273|  4.74k|      cur_line = 0;
  274|       |
  275|       |      //allocate tlm
  276|  4.74k|      if (outfile != NULL && need_tlm)
  ------------------
  |  Branch (276:11): [True: 0, False: 4.74k]
  |  Branch (276:30): [True: 0, False: 0]
  ------------------
  277|      0|        tlm.init(num_tileparts,
  278|      0|          allocator->post_alloc_obj<param_tlm::Ttlm_Ptlm_pair>(num_tileparts));
  279|  4.74k|    }
_ZN4ojph5local10codestream12read_headersEPNS_11infile_baseE:
  753|  6.44k|    {
  754|  6.44k|      ui16 marker_list[20] = { SOC, SIZ, CAP, PRF, CPF, COD, COC, QCD, QCC,
  755|  6.44k|        RGN, POC, PPM, TLM, PLM, CRG, COM, DFS, ATK, NLT, SOT };
  756|  6.44k|      find_marker(file, marker_list, 1); //find SOC
  757|  6.44k|      find_marker(file, marker_list + 1, 1); //find SIZ
  758|  6.44k|      siz.read(file);
  759|  6.44k|      int marker_idx = 0;
  760|  6.44k|      int received_markers = 0; //check that COD, & QCD received
  761|   849k|      while (true)
  ------------------
  |  Branch (761:14): [True: 847k, Folded]
  ------------------
  762|   847k|      {
  763|   847k|        marker_idx = find_marker(file, marker_list + 2, 18);
  764|   847k|        if (marker_idx == 0)
  ------------------
  |  Branch (764:13): [True: 492, False: 847k]
  ------------------
  765|    492|          cap.read(file);
  766|   847k|        else if (marker_idx == 1)
  ------------------
  |  Branch (766:18): [True: 253, False: 846k]
  ------------------
  767|       |          //Skipping PRF marker segment; this should not cause any issues
  768|    253|          skip_marker(file, "PRF", NULL, OJPH_MSG_NO_MSG, false);
  769|   846k|        else if (marker_idx == 2)
  ------------------
  |  Branch (769:18): [True: 283, False: 846k]
  ------------------
  770|       |          //Skipping CPF marker segment; this should not cause any issues
  771|    283|          skip_marker(file, "CPF", NULL, OJPH_MSG_NO_MSG, false);
  772|   846k|        else if (marker_idx == 3)
  ------------------
  |  Branch (772:18): [True: 6.18k, False: 840k]
  ------------------
  773|  6.18k|        {
  774|  6.18k|          cod.read(file);
  775|  6.18k|          received_markers |= 1;
  776|  6.18k|          ojph::param_cod c(&cod);
  777|  6.18k|          int num_qlayers = c.get_num_layers();
  778|  6.18k|          if (num_qlayers != 1)
  ------------------
  |  Branch (778:15): [True: 12, False: 6.17k]
  ------------------
  779|     12|            OJPH_ERROR(0x00030053, "The current implementation supports "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  780|  6.18k|              "1 quality layer only.  This codestream has %d quality layers",
  781|  6.18k|              num_qlayers);
  782|  6.18k|        }
  783|   840k|        else if (marker_idx == 4)
  ------------------
  |  Branch (783:18): [True: 573, False: 839k]
  ------------------
  784|    573|        {
  785|    573|          param_cod* p = cod.add_coc_object(param_cod::OJPH_COD_UNKNOWN);
  786|    573|          p->read_coc(file, siz.get_num_components(), &cod);
  787|    573|          if (p->get_comp_idx() >= siz.get_num_components())
  ------------------
  |  Branch (787:15): [True: 119, False: 454]
  ------------------
  788|    119|            OJPH_INFO(0x00030056, "The codestream carries a COC marker "
  ------------------
  |  |  285|    119|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    119|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 119, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  789|    573|              "segment for a component indexed by %d, which is more than the "
  790|    573|              "allowed index number, since the codestream has %d components",
  791|    573|              p->get_comp_idx(), num_comps);
  792|    573|          param_cod *q = cod.get_coc(p->get_comp_idx());
  793|    573|          if (p != q && p->get_comp_idx() == q->get_comp_idx())
  ------------------
  |  Branch (793:15): [True: 7, False: 566]
  |  Branch (793:25): [True: 7, False: 0]
  ------------------
  794|      7|            OJPH_ERROR(0x00030057, "The codestream has two COC 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  795|    573|              "segments for one component of index %d",  p->get_comp_idx());
  796|    573|        }
  797|   839k|        else if (marker_idx == 5)
  ------------------
  |  Branch (797:18): [True: 6.28k, False: 833k]
  ------------------
  798|  6.28k|        {
  799|  6.28k|          qcd.read(file);
  800|  6.28k|          received_markers |= 2;
  801|  6.28k|        }
  802|   833k|        else if (marker_idx == 6)
  ------------------
  |  Branch (802:18): [True: 247, False: 833k]
  ------------------
  803|    247|        {
  804|    247|          param_qcd* p = qcd.add_qcc_object(param_qcd::OJPH_QCD_UNKNOWN);
  805|    247|          p->read_qcc(file, siz.get_num_components());
  806|    247|          if (p->get_comp_idx() >= siz.get_num_components())
  ------------------
  |  Branch (806:15): [True: 12, False: 235]
  ------------------
  807|     12|            OJPH_ERROR(0x00030054, "The codestream carries a 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  808|    247|              "segment for a component indexed by %d, which is more than the "
  809|    247|              "allowed index number, since the codestream has %d components",
  810|    247|              p->get_comp_idx(), num_comps);
  811|    247|          param_qcd *q = qcd.get_qcc(p->get_comp_idx());
  812|    247|          if (p != q && p->get_comp_idx() == q->get_comp_idx())
  ------------------
  |  Branch (812:15): [True: 8, False: 239]
  |  Branch (812:25): [True: 8, False: 0]
  ------------------
  813|      8|            OJPH_ERROR(0x00030055, "The codestream has two QCC marker "
  ------------------
  |  |  289|      8|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      8|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  814|    247|              "segments for one component of index %d", p->get_comp_idx());
  815|    247|        }
  816|   833k|        else if (marker_idx == 7)
  ------------------
  |  Branch (816:18): [True: 2.67k, False: 830k]
  ------------------
  817|  2.67k|          skip_marker(file, "RGN", "RGN is not supported yet",
  818|  2.67k|            OJPH_MSG_WARN, false);
  819|   830k|        else if (marker_idx == 8)
  ------------------
  |  Branch (819:18): [True: 259, False: 830k]
  ------------------
  820|    259|          skip_marker(file, "POC", "POC is not supported yet",
  821|    259|            OJPH_MSG_WARN, false);
  822|   830k|        else if (marker_idx == 9)
  ------------------
  |  Branch (822:18): [True: 473, False: 829k]
  ------------------
  823|    473|          skip_marker(file, "PPM", "PPM is not supported yet",
  824|    473|            OJPH_MSG_WARN, false);
  825|   829k|        else if (marker_idx == 10)
  ------------------
  |  Branch (825:18): [True: 223, False: 829k]
  ------------------
  826|       |          //Skipping TLM marker segment; this should not cause any issues
  827|    223|          skip_marker(file, "TLM", NULL, OJPH_MSG_NO_MSG, false);
  828|   829k|        else if (marker_idx == 11)
  ------------------
  |  Branch (828:18): [True: 261, False: 829k]
  ------------------
  829|       |          //Skipping PLM marker segment; this should not cause any issues
  830|    261|          skip_marker(file, "PLM", NULL, OJPH_MSG_NO_MSG, false);
  831|   829k|        else if (marker_idx == 12)
  ------------------
  |  Branch (831:18): [True: 350, False: 829k]
  ------------------
  832|       |          //Skipping CRG marker segment;
  833|    350|          skip_marker(file, "CRG", "CRG has been ignored; CRG is related to"
  834|    350|            " where the Cb and Cr colour components are co-sited or located"
  835|    350|            " with respect to the Y' luma component. Perhaps, it is better"
  836|    350|            " to get the individual components and assemble the samples"
  837|    350|            " according to your needs",
  838|    350|            OJPH_MSG_INFO, false);
  839|   829k|        else if (marker_idx == 13)
  ------------------
  |  Branch (839:18): [True: 356, False: 828k]
  ------------------
  840|    356|          skip_marker(file, "COM", NULL, OJPH_MSG_NO_MSG, false);
  841|   828k|        else if (marker_idx == 14)
  ------------------
  |  Branch (841:18): [True: 822k, False: 6.40k]
  ------------------
  842|   822k|          dfs.read(file);
  843|  6.40k|        else if (marker_idx == 15)
  ------------------
  |  Branch (843:18): [True: 249, False: 6.15k]
  ------------------
  844|    249|          atk.read(file);
  845|  6.15k|        else if (marker_idx == 16)
  ------------------
  |  Branch (845:18): [True: 1.02k, False: 5.13k]
  ------------------
  846|  1.02k|          nlt.read(file);
  847|  5.13k|        else if (marker_idx == 17)
  ------------------
  |  Branch (847:18): [True: 4.88k, False: 250]
  ------------------
  848|  4.88k|          break;
  849|    250|        else
  850|   842k|          OJPH_ERROR(0x00030051, "File ended before finding a tile segment");
  ------------------
  |  |  289|    250|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    250|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 250, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  851|   842k|      }
  852|       |
  853|  6.44k|      cod.update_atk(&atk);
  854|  6.44k|      siz.link(&cod);
  855|  6.44k|      if (dfs.exists())
  ------------------
  |  Branch (855:11): [True: 257, False: 6.18k]
  ------------------
  856|    257|        siz.link(&dfs);
  857|       |
  858|  6.44k|      if (received_markers != 3)
  ------------------
  |  Branch (858:11): [True: 33, False: 6.41k]
  ------------------
  859|     33|        OJPH_ERROR(0x00030052, "markers error, COD and QCD are required");
  ------------------
  |  |  289|     33|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     33|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 33, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  860|       |
  861|  6.44k|      this->infile = file;
  862|  6.44k|      planar = cod.is_employing_color_transform() ? 0 : 1;
  ------------------
  |  Branch (862:16): [True: 335, False: 6.11k]
  ------------------
  863|  6.44k|    }
_ZN4ojph5local10codestream25restrict_input_resolutionEjj:
  868|  1.72k|    {
  869|  1.72k|      if (skipped_res_for_read < skipped_res_for_recon)
  ------------------
  |  Branch (869:11): [True: 0, False: 1.72k]
  ------------------
  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.72k|          "skipped_resolution for data %d must be equal or smaller than "
  872|  1.72k|          " skipped_resolution for reconstruction %d\n",
  873|  1.72k|          skipped_res_for_read, skipped_res_for_recon);
  874|  1.72k|      if (skipped_res_for_read > cod.get_num_decompositions())
  ------------------
  |  Branch (874:11): [True: 1, False: 1.72k]
  ------------------
  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.72k|          "skipped_resolution for data %d must be smaller than "
  877|  1.72k|          " the number of decomposition levels %d\n",
  878|  1.72k|          skipped_res_for_read, cod.get_num_decompositions());
  879|       |
  880|  1.72k|      this->skipped_res_for_read = skipped_res_for_read;
  881|  1.72k|      this->skipped_res_for_recon = skipped_res_for_recon;
  882|  1.72k|      siz.set_skipped_resolutions(skipped_res_for_recon);
  883|  1.72k|    }
_ZN4ojph5local10codestream17enable_resilienceEv:
  887|  6.44k|    {
  888|  6.44k|      if (infile != NULL)
  ------------------
  |  Branch (888:11): [True: 0, False: 6.44k]
  ------------------
  889|      0|        OJPH_ERROR(0x000300A3, "Codestream resilience must be enabled before"
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  890|  6.44k|          " reading file headers.\n");
  891|  6.44k|      this->resilient = true;
  892|  6.44k|    }
_ZN4ojph5local10codestream4readEv:
  896|  4.77k|    {
  897|  4.77k|      this->pre_alloc();
  898|  4.77k|      this->finalize_alloc();
  899|       |
  900|  93.0k|      while (true)
  ------------------
  |  Branch (900:14): [True: 92.7k, Folded]
  ------------------
  901|  92.7k|      {
  902|  92.7k|        param_sot sot;
  903|  92.7k|        if (sot.read(infile, resilient))
  ------------------
  |  Branch (903:13): [True: 80.2k, False: 12.5k]
  ------------------
  904|  80.2k|        {
  905|  80.2k|          ui64 tile_start_location = (ui64)infile->tell();
  906|  80.2k|          bool skip_tile = false;
  907|       |
  908|  80.2k|          if (sot.get_tile_index() >= (int)num_tiles.area())
  ------------------
  |  Branch (908:15): [True: 3.59k, False: 76.6k]
  ------------------
  909|  3.59k|          {
  910|  3.59k|            if (resilient) {
  ------------------
  |  Branch (910:17): [True: 3.59k, False: 0]
  ------------------
  911|  3.59k|              OJPH_INFO(0x00030061, "wrong tile index")
  ------------------
  |  |  285|  3.59k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  3.59k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3.59k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  912|  3.59k|              skip_tile = true; // skip the faulty tile
  913|  3.59k|            }
  914|      0|            else
  915|      0|              OJPH_ERROR(0x00030061, "wrong tile index")
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  916|  3.59k|          }
  917|       |
  918|  80.2k|          if (!skip_tile)
  ------------------
  |  Branch (918:15): [True: 76.6k, False: 3.59k]
  ------------------
  919|  76.6k|          {
  920|  76.6k|            if (sot.get_tile_part_index())
  ------------------
  |  Branch (920:17): [True: 37.7k, False: 38.9k]
  ------------------
  921|  37.7k|            { //tile part
  922|  37.7k|              if (sot.get_num_tile_parts() &&
  ------------------
  |  Branch (922:19): [True: 32.5k, False: 5.21k]
  ------------------
  923|  32.5k|                sot.get_tile_part_index() >= sot.get_num_tile_parts())
  ------------------
  |  Branch (923:17): [True: 4.22k, False: 28.2k]
  ------------------
  924|  4.22k|              {
  925|  4.22k|                if (resilient)
  ------------------
  |  Branch (925:21): [True: 4.22k, False: 0]
  ------------------
  926|  4.22k|                  OJPH_INFO(0x00030062,
  ------------------
  |  |  285|  4.22k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  4.22k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4.22k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  4.22k|                    "error in tile part number, should be smaller than total"
  928|  4.22k|                    " 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|  4.22k|                    "error in tile part number, should be smaller than total"
  932|  4.22k|                    " number of tile parts")
  933|  4.22k|              }
  934|       |
  935|  37.7k|              bool sod_found = false;
  936|  37.7k|              ui16 other_tile_part_markers[7] = { SOT, POC, PPT, PLT, COM,
  937|  37.7k|                NLT, SOD };
  938|  60.4k|              while (true)
  ------------------
  |  Branch (938:22): [True: 60.4k, Folded]
  ------------------
  939|  60.4k|              {
  940|  60.4k|                int marker_idx = 0;
  941|  60.4k|                int result = 0;
  942|  60.4k|                marker_idx = find_marker(infile, other_tile_part_markers+1, 6);
  943|  60.4k|                if (marker_idx == 0)
  ------------------
  |  Branch (943:21): [True: 3.76k, False: 56.6k]
  ------------------
  944|  3.76k|                  result = skip_marker(infile, "POC",
  945|  3.76k|                    "POC marker segment in a tile is not supported yet",
  946|  3.76k|                    OJPH_MSG_WARN, resilient);
  947|  56.6k|                else if (marker_idx == 1)
  ------------------
  |  Branch (947:26): [True: 5.63k, False: 51.0k]
  ------------------
  948|  5.63k|                  result = skip_marker(infile, "PPT",
  949|  5.63k|                    "PPT marker segment in a tile is not supported yet",
  950|  5.63k|                    OJPH_MSG_WARN, resilient);
  951|  51.0k|                else if (marker_idx == 2)
  ------------------
  |  Branch (951:26): [True: 3.28k, False: 47.7k]
  ------------------
  952|       |                  //Skipping PLT marker segment;this should not cause any issues
  953|  3.28k|                  result = skip_marker(infile, "PLT", NULL,
  954|  3.28k|                    OJPH_MSG_NO_MSG, resilient);
  955|  47.7k|                else if (marker_idx == 3)
  ------------------
  |  Branch (955:26): [True: 8.88k, False: 38.8k]
  ------------------
  956|  8.88k|                  result = skip_marker(infile, "COM", NULL,
  957|  8.88k|                    OJPH_MSG_NO_MSG, resilient);
  958|  38.8k|                else if (marker_idx == 4)
  ------------------
  |  Branch (958:26): [True: 1.12k, False: 37.7k]
  ------------------
  959|  1.12k|                  result = skip_marker(infile, "NLT",
  960|  1.12k|                    "NLT marker in tile is not supported yet",
  961|  1.12k|                    OJPH_MSG_WARN, resilient);
  962|  37.7k|                else if (marker_idx == 5)
  ------------------
  |  Branch (962:26): [True: 37.4k, False: 265]
  ------------------
  963|  37.4k|                {
  964|  37.4k|                  sod_found = true;
  965|  37.4k|                  break;
  966|  37.4k|                }
  967|       |
  968|  22.9k|                if (marker_idx == -1) //marker not found
  ------------------
  |  Branch (968:21): [True: 265, False: 22.6k]
  ------------------
  969|    265|                {
  970|    265|                  if (resilient)
  ------------------
  |  Branch (970:23): [True: 265, False: 0]
  ------------------
  971|    265|                    OJPH_INFO(0x00030063,
  ------------------
  |  |  285|    265|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    265|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 265, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|    265|                      "File terminated early before start of data is found"
  973|    265|                      " for tile indexed %d and tile part %d",
  974|    265|                      sot.get_tile_index(), sot.get_tile_part_index())
  975|      0|                  else
  976|      0|                    OJPH_ERROR(0x00030063,
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  977|    265|                      "File terminated early before start of data is found"
  978|    265|                      " for tile indexed %d and tile part %d",
  979|    265|                      sot.get_tile_index(), sot.get_tile_part_index())
  980|    265|                  break;
  981|    265|                }
  982|  22.6k|                if (result == -1) //file terminated during marker seg. skipping
  ------------------
  |  Branch (982:21): [True: 9, False: 22.6k]
  ------------------
  983|      9|                {
  984|      9|                  if (resilient)
  ------------------
  |  Branch (984:23): [True: 9, False: 0]
  ------------------
  985|      9|                    OJPH_INFO(0x00030064,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  986|      9|                      "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|      9|                      "File terminated during marker segment skipping")
  990|      9|                  break;
  991|      9|                }
  992|  22.6k|              }
  993|  37.7k|              if (sod_found)
  ------------------
  |  Branch (993:19): [True: 37.4k, False: 274]
  ------------------
  994|  37.4k|                tiles[sot.get_tile_index()].parse_tile_header(sot, infile,
  995|  37.4k|                  tile_start_location);
  996|  37.7k|            }
  997|  38.9k|            else
  998|  38.9k|            { //first tile part
  999|  38.9k|              bool sod_found = false;
 1000|  38.9k|              ui16 first_tile_part_markers[12] = { SOT, COD, COC, QCD, QCC, RGN,
 1001|  38.9k|                POC, PPT, PLT, COM, NLT, SOD };
 1002|   192k|              while (true)
  ------------------
  |  Branch (1002:22): [True: 192k, Folded]
  ------------------
 1003|   192k|              {
 1004|   192k|                int marker_idx = 0;
 1005|   192k|                int result = 0;
 1006|   192k|                marker_idx = find_marker(infile, first_tile_part_markers+1, 11);
 1007|   192k|                if (marker_idx == 0)
  ------------------
  |  Branch (1007:21): [True: 71.7k, False: 121k]
  ------------------
 1008|  71.7k|                  result = skip_marker(infile, "COD",
 1009|  71.7k|                    "COD marker segment in a tile is not supported yet",
 1010|  71.7k|                    OJPH_MSG_WARN, resilient);
 1011|   121k|                else if (marker_idx == 1)
  ------------------
  |  Branch (1011:26): [True: 1.93k, False: 119k]
  ------------------
 1012|  1.93k|                  result = skip_marker(infile, "COC",
 1013|  1.93k|                    "COC marker segment in a tile is not supported yet",
 1014|  1.93k|                    OJPH_MSG_WARN, resilient);
 1015|   119k|                else if (marker_idx == 2)
  ------------------
  |  Branch (1015:26): [True: 58.8k, False: 60.3k]
  ------------------
 1016|  58.8k|                  result = skip_marker(infile, "QCD",
 1017|  58.8k|                    "QCD marker segment in a tile is not supported yet",
 1018|  58.8k|                    OJPH_MSG_WARN, resilient);
 1019|  60.3k|                else if (marker_idx == 3)
  ------------------
  |  Branch (1019:26): [True: 1.00k, False: 59.3k]
  ------------------
 1020|  1.00k|                  result = skip_marker(infile, "QCC",
 1021|  1.00k|                    "QCC marker segment in a tile is not supported yet",
 1022|  1.00k|                    OJPH_MSG_WARN, resilient);
 1023|  59.3k|                else if (marker_idx == 4)
  ------------------
  |  Branch (1023:26): [True: 537, False: 58.8k]
  ------------------
 1024|    537|                  result = skip_marker(infile, "RGN",
 1025|    537|                    "RGN marker segment in a tile is not supported yet",
 1026|    537|                    OJPH_MSG_WARN, resilient);
 1027|  58.8k|                else if (marker_idx == 5)
  ------------------
  |  Branch (1027:26): [True: 2.55k, False: 56.2k]
  ------------------
 1028|  2.55k|                  result = skip_marker(infile, "POC",
 1029|  2.55k|                    "POC marker segment in a tile is not supported yet",
 1030|  2.55k|                    OJPH_MSG_WARN, resilient);
 1031|  56.2k|                else if (marker_idx == 6)
  ------------------
  |  Branch (1031:26): [True: 888, False: 55.3k]
  ------------------
 1032|    888|                  result = skip_marker(infile, "PPT",
 1033|    888|                    "PPT marker segment in a tile is not supported yet",
 1034|    888|                    OJPH_MSG_WARN, resilient);
 1035|  55.3k|                else if (marker_idx == 7)
  ------------------
  |  Branch (1035:26): [True: 2.28k, False: 53.0k]
  ------------------
 1036|       |                  //Skipping PLT marker segment;this should not cause any issues
 1037|  2.28k|                  result = skip_marker(infile, "PLT", NULL,
 1038|  2.28k|                    OJPH_MSG_NO_MSG, resilient);
 1039|  53.0k|                else if (marker_idx == 8)
  ------------------
  |  Branch (1039:26): [True: 12.4k, False: 40.6k]
  ------------------
 1040|  12.4k|                  result = skip_marker(infile, "COM", NULL,
 1041|  12.4k|                    OJPH_MSG_NO_MSG, resilient);
 1042|  40.6k|                else if (marker_idx == 9)
  ------------------
  |  Branch (1042:26): [True: 1.74k, False: 38.9k]
  ------------------
 1043|  1.74k|                  result = skip_marker(infile, "NLT",
 1044|  1.74k|                    "PPT marker segment in a tile is not supported yet",
 1045|  1.74k|                    OJPH_MSG_WARN, resilient);
 1046|  38.9k|                else if (marker_idx == 10)
  ------------------
  |  Branch (1046:26): [True: 38.5k, False: 373]
  ------------------
 1047|  38.5k|                {
 1048|  38.5k|                  sod_found = true;
 1049|  38.5k|                  break;
 1050|  38.5k|                }
 1051|       |
 1052|   154k|                if (marker_idx == -1) //marker not found
  ------------------
  |  Branch (1052:21): [True: 373, False: 154k]
  ------------------
 1053|    373|                {
 1054|    373|                  if (resilient)
  ------------------
  |  Branch (1054:23): [True: 373, False: 0]
  ------------------
 1055|    373|                    OJPH_INFO(0x00030065,
  ------------------
  |  |  285|    373|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    373|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 373, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1056|    373|                      "File terminated early before start of data is found"
 1057|    373|                      " for tile indexed %d and tile part %d",
 1058|    373|                      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|    373|                      "File terminated early before start of data is found"
 1062|    373|                      " for tile indexed %d and tile part %d",
 1063|    373|                      sot.get_tile_index(), sot.get_tile_part_index())
 1064|    373|                  break;
 1065|    373|                }
 1066|   154k|                if (result == -1) //file terminated during marker seg. skipping
  ------------------
  |  Branch (1066:21): [True: 26, False: 154k]
  ------------------
 1067|     26|                {
 1068|     26|                  if (resilient)
  ------------------
  |  Branch (1068:23): [True: 26, False: 0]
  ------------------
 1069|     26|                    OJPH_INFO(0x00030066,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1070|     26|                      "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|     26|                      "File terminated during marker segment skipping")
 1074|     26|                  break;
 1075|     26|                }
 1076|   154k|              }
 1077|  38.9k|              if (sod_found)
  ------------------
  |  Branch (1077:19): [True: 38.5k, False: 399]
  ------------------
 1078|  38.5k|                tiles[sot.get_tile_index()].parse_tile_header(sot, infile,
 1079|  38.5k|                  tile_start_location);
 1080|  38.9k|            }
 1081|  76.6k|          }
 1082|  80.2k|        }
 1083|       |
 1084|       |        // check the next marker; either SOT or EOC,
 1085|       |        // if something is broken, just an end of file
 1086|  92.7k|        ui16 next_markers[2] = { SOT, EOC };
 1087|  92.7k|        int marker_idx = find_marker(infile, next_markers, 2);
 1088|  92.7k|        if (marker_idx == -1)
  ------------------
  |  Branch (1088:13): [True: 4.55k, False: 88.2k]
  ------------------
 1089|  4.55k|        {
 1090|  4.55k|          OJPH_INFO(0x00030067, "File terminated early");
  ------------------
  |  |  285|  4.55k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  4.55k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4.55k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1091|  4.55k|          break;
 1092|  4.55k|        }
 1093|  88.2k|        else if (marker_idx == 0)
  ------------------
  |  Branch (1093:18): [True: 88.2k, False: 7]
  ------------------
 1094|  88.2k|          ;
 1095|      7|        else if (marker_idx == 1)
  ------------------
  |  Branch (1095:18): [True: 2, False: 5]
  ------------------
 1096|      2|          break;
 1097|  92.7k|      }
 1098|  4.77k|    }
_ZN4ojph5local10codestream10set_planarEi:
 1102|  2.96k|    {
 1103|  2.96k|      this->planar = planar;
 1104|  2.96k|    }
_ZN4ojph5local10codestream5closeEv:
 1151|  4.62k|    {
 1152|  4.62k|      if (infile)
  ------------------
  |  Branch (1152:11): [True: 4.62k, False: 0]
  ------------------
 1153|  4.62k|        infile->close();
 1154|  4.62k|      if (outfile)
  ------------------
  |  Branch (1154:11): [True: 0, False: 4.62k]
  ------------------
 1155|      0|        outfile->close();
 1156|  4.62k|    }
_ZN4ojph5local10codestream4pullERj:
 1211|  2.16M|    {
 1212|  2.16M|      bool success = false;
 1213|  4.36M|      while (!success)
  ------------------
  |  Branch (1213:14): [True: 2.20M, False: 2.16M]
  ------------------
 1214|  2.20M|      {
 1215|  2.20M|        success = true;
 1216|  4.48M|        for (ui32 i = 0; i < num_tiles.w; ++i)
  ------------------
  |  Branch (1216:26): [True: 2.32M, False: 2.16M]
  ------------------
 1217|  2.32M|        {
 1218|  2.32M|          ui32 idx = i + cur_tile_row * num_tiles.w;
 1219|  2.32M|          if ((success &= tiles[idx].pull(lines + cur_comp, cur_comp)) == false)
  ------------------
  |  Branch (1219:15): [True: 32.7k, False: 2.28M]
  ------------------
 1220|  32.7k|            break;
 1221|  2.32M|        }
 1222|  2.20M|        cur_tile_row += success == false ? 1 : 0;
  ------------------
  |  Branch (1222:25): [True: 32.7k, False: 2.16M]
  ------------------
 1223|  2.20M|        if (cur_tile_row >= num_tiles.h)
  ------------------
  |  Branch (1223:13): [True: 0, False: 2.20M]
  ------------------
 1224|      0|          cur_tile_row = 0;
 1225|  2.20M|      }
 1226|  2.16M|      comp_num = cur_comp;
 1227|       |
 1228|  2.16M|      if (planar) //process one component at a time
  ------------------
  |  Branch (1228:11): [True: 1.86M, False: 303k]
  ------------------
 1229|  1.86M|      {
 1230|  1.86M|        if (++cur_line >= recon_comp_size[cur_comp].h)
  ------------------
  |  Branch (1230:13): [True: 4.32k, False: 1.85M]
  ------------------
 1231|  4.32k|        {
 1232|  4.32k|          cur_line = 0;
 1233|  4.32k|          cur_tile_row = 0;
 1234|  4.32k|          if (cur_comp++ >= num_comps)
  ------------------
  |  Branch (1234:15): [True: 0, False: 4.32k]
  ------------------
 1235|      0|          {
 1236|      0|            comp_num = 0;
 1237|      0|            return NULL;
 1238|      0|          }
 1239|  4.32k|        }
 1240|  1.86M|      }
 1241|   303k|      else //process all component for a line
 1242|   303k|      {
 1243|   303k|        if (++cur_comp >= num_comps)
  ------------------
  |  Branch (1243:13): [True: 299k, False: 4.09k]
  ------------------
 1244|   299k|        {
 1245|   299k|          cur_comp = 0;
 1246|   299k|          if (cur_line++ >= recon_comp_size[cur_comp].h)
  ------------------
  |  Branch (1246:15): [True: 0, False: 299k]
  ------------------
 1247|      0|          {
 1248|      0|            comp_num = 0;
 1249|      0|            return NULL;
 1250|      0|          }
 1251|   299k|        }
 1252|   303k|      }
 1253|       |
 1254|  2.16M|      return lines + comp_num;
 1255|  2.16M|    }
ojph_codestream_local.cpp:_ZN4ojph5localL11find_markerEPNS_11infile_baseEPKti:
  692|  1.20M|    {
  693|       |      //returns the marker index in char_list, or -1
  694|   135M|      while (!f->eof())
  ------------------
  |  Branch (694:14): [True: 135M, False: 5.24k]
  ------------------
  695|   135M|      {
  696|   135M|        ui8 new_char;
  697|   135M|        size_t num_bytes = f->read(&new_char, 1);
  698|   135M|        if (num_bytes != 1)
  ------------------
  |  Branch (698:13): [True: 0, False: 135M]
  ------------------
  699|      0|            return -1;
  700|   135M|        if (new_char == 0xFF)
  ------------------
  |  Branch (700:13): [True: 9.04M, False: 126M]
  ------------------
  701|  9.04M|        {
  702|  9.04M|          size_t num_bytes = f->read(&new_char, 1);
  703|       |
  704|  9.04M|          if (num_bytes != 1)
  ------------------
  |  Branch (704:15): [True: 386, False: 9.04M]
  ------------------
  705|    386|              return -1;
  706|       |
  707|  92.9M|          for (int i = 0; i < list_len; ++i)
  ------------------
  |  Branch (707:27): [True: 85.0M, False: 7.83M]
  ------------------
  708|  85.0M|            if (new_char == (char_list[i] & 0xFF))
  ------------------
  |  Branch (708:17): [True: 1.20M, False: 83.8M]
  ------------------
  709|  1.20M|              return i;
  710|  9.04M|        }
  711|   135M|      }
  712|  5.24k|      return -1;
  713|  1.20M|    }
ojph_codestream_local.cpp:_ZN4ojph5localL11skip_markerEPNS_11infile_baseEPKcS4_ib:
  719|   181k|    {
  720|   181k|      ojph_unused(marker);
  ------------------
  |  |   78|   181k|#define ojph_unused(x) (void)(x)
  ------------------
  721|   181k|      ui16 com_len;
  722|   181k|      if (file->read(&com_len, 2) != 2)
  ------------------
  |  Branch (722:11): [True: 65, False: 181k]
  ------------------
  723|     65|      {
  724|     65|        if (resilient)
  ------------------
  |  Branch (724:13): [True: 35, False: 30]
  ------------------
  725|     35|          return -1;
  726|     30|        else
  727|     30|          OJPH_ERROR(0x00030041, "error reading marker");
  ------------------
  |  |  289|     30|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     30|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 30, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|     30|      }
  729|   181k|      com_len = swap_byte(com_len);
  730|   181k|      file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
  731|   181k|      if (msg != NULL && msg_level != OJPH_MSG_NO_MSG)
  ------------------
  |  Branch (731:11): [True: 153k, False: 28.2k]
  |  Branch (731:26): [True: 153k, False: 0]
  ------------------
  732|   153k|      {
  733|   153k|        if (msg_level == OJPH_MSG_INFO)
  ------------------
  |  Branch (733:13): [True: 346, False: 153k]
  ------------------
  734|    346|        {
  735|    346|          OJPH_INFO(0x00030001, "%s", msg);
  ------------------
  |  |  285|    346|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    346|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 346, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|    346|        }
  737|   153k|        else if (msg_level == OJPH_MSG_WARN)
  ------------------
  |  Branch (737:18): [True: 153k, False: 0]
  ------------------
  738|   153k|        {
  739|   153k|          OJPH_WARN(0x00030001, "%s", msg);
  ------------------
  |  |  287|   153k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|   153k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 153k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  740|   153k|        }
  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|   153k|      }
  748|   181k|      return 0;
  749|   181k|    }

_ZNK4ojph5local10codestream16get_tilepart_divEv:
  120|   221k|      ui32 get_tilepart_div() const { return tilepart_div; };
_ZNK4ojph5local10codestream13is_tlm_neededEv:
  121|  73.5k|      bool is_tlm_needed() const { return need_tlm; };
_ZNK4ojph5local10codestream9is_planarEv:
  118|  4.55k|      bool is_planar() const { return planar != 0; }
_ZN4ojph5local10codestream10access_sizEv:
   82|  9.51k|      { return ojph::param_siz(&siz); }
_ZN4ojph5local10codestream7get_sizEv:
   84|   203k|      { return &siz; }
_ZN4ojph5local10codestream10access_codEv:
   86|  73.5k|      { return ojph::param_cod(&cod); }
_ZN4ojph5local10codestream7get_codEv:
   88|   147k|      { return &cod; }
_ZN4ojph5local10codestream7get_cocEj:
   90|  4.21M|      { return cod.get_coc(comp_num); }
_ZN4ojph5local10codestream10access_qcdEv:
   92|  1.58M|      { return &qcd; }
_ZN4ojph5local10codestream10access_dfsEv:
   94|  29.2k|      { if (dfs.exists()) return &dfs; else return NULL; }
  ------------------
  |  Branch (94:13): [True: 29.2k, False: 1]
  ------------------
_ZN4ojph5local10codestream7get_nltEv:
   96|  73.5k|      { return &nlt; }
_ZN4ojph5local10codestream13get_allocatorEv:
   97|  7.39M|      mem_fixed_allocator* get_allocator() { return allocator; }
_ZN4ojph5local10codestream17get_elastic_allocEv:
   98|  1.18M|      mem_elastic_allocator* get_elastic_alloc() { return elastic_alloc; }
_ZN4ojph5local10codestream12is_resilientEv:
  105|  2.40M|      bool is_resilient() { return resilient; }
_ZNK4ojph5local10codestream11get_profileEv:
  119|  73.5k|      si32 get_profile() const { return profile; };
_ZN4ojph5local10codestream20get_precinct_scratchEv:
  126|  7.36M|      ui8* get_precinct_scratch() { return precinct_scratch; }
_ZN4ojph5local10codestream25get_skipped_res_for_reconEv:
  128|   670k|      { return skipped_res_for_recon; }
_ZN4ojph5local10codestream24get_skipped_res_for_readEv:
  130|   402k|      { return skipped_res_for_read; }
ojph_codestream_local.cpp:_ZN4ojph5localL9swap_byteEt:
   59|   181k|    {
   60|   181k|      return (ui16)((t << 8) | (t >> 8));
   61|   181k|    }
ojph_precinct.cpp:_ZN4ojph5localL9swap_byteEt:
   59|    842|    {
   60|    842|      return (ui16)((t << 8) | (t >> 8));
   61|    842|    }

_ZNK4ojph9param_siz16get_image_extentEv:
   97|   459k|  {
   98|   459k|    return point(state->Xsiz, state->Ysiz);
   99|   459k|  }
_ZNK4ojph9param_siz16get_image_offsetEv:
  103|   450k|  {
  104|   450k|    return point(state->XOsiz, state->YOsiz);
  105|   450k|  }
_ZNK4ojph9param_siz13get_tile_sizeEv:
  109|   453k|  {
  110|   453k|    return size(state->XTsiz, state->YTsiz);
  111|   453k|  }
_ZNK4ojph9param_siz15get_tile_offsetEv:
  115|   226k|  {
  116|   226k|    return point(state->XTOsiz, state->YTOsiz);
  117|   226k|  }
_ZNK4ojph9param_siz18get_num_componentsEv:
  121|   634k|  {
  122|   634k|    return state->Csiz;
  123|   634k|  }
_ZNK4ojph9param_siz15get_recon_widthEj:
  145|  5.07k|  {
  146|  5.07k|    return state->get_recon_width(comp_num);
  147|  5.07k|  }
_ZNK4ojph9param_siz16get_recon_heightEj:
  151|  10.1k|  {
  152|  10.1k|    return state->get_recon_height(comp_num);
  153|  10.1k|  }
_ZNK4ojph9param_cod22get_num_decompositionsEv:
  264|  38.1k|  {
  265|  38.1k|    return state->get_num_decompositions();
  266|  38.1k|  }
_ZNK4ojph9param_cod17get_precinct_sizeEj:
  288|  28.6k|  {
  289|  28.6k|    return state->get_precinct_size(level_num);
  290|  28.6k|  }
_ZNK4ojph9param_cod21get_progression_orderEv:
  300|  73.5k|  {
  301|  73.5k|    return state->SGCod.prog_order;
  302|  73.5k|  }
_ZNK4ojph9param_cod14get_num_layersEv:
  324|  6.09k|  {
  325|  6.09k|    return state->SGCod.num_layers;
  326|  6.09k|  }
_ZN4ojph5local9param_siz4readEPNS_11infile_baseE:
  681|  6.44k|    {
  682|  6.44k|      if (file->read(&Lsiz, 2) != 2)
  ------------------
  |  Branch (682:11): [True: 114, False: 6.33k]
  ------------------
  683|    114|        OJPH_ERROR(0x00050041, "error reading SIZ marker");
  ------------------
  |  |  289|    114|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    114|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 114, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  684|  6.44k|      Lsiz = swap_byte(Lsiz);
  685|  6.44k|      int num_comps = (Lsiz - 38) / 3;
  686|  6.44k|      if (Lsiz != 38 + 3 * num_comps)
  ------------------
  |  Branch (686:11): [True: 24, False: 6.42k]
  ------------------
  687|     24|        OJPH_ERROR(0x00050042, "error in SIZ marker length");
  ------------------
  |  |  289|     24|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     24|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 24, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  688|  6.44k|      if (file->read(&Rsiz, 2) != 2)
  ------------------
  |  Branch (688:11): [True: 2, False: 6.44k]
  ------------------
  689|      2|        OJPH_ERROR(0x00050043, "error reading SIZ marker");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  690|  6.44k|      Rsiz = swap_byte(Rsiz);
  691|  6.44k|      if ((Rsiz & 0x4000) == 0)
  ------------------
  |  Branch (691:11): [True: 2, False: 6.44k]
  ------------------
  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|  6.44k|          "Rsiz bit 14 is not set (this is not a JPH file)");
  694|  6.44k|      if ((Rsiz & 0x8000) != 0 && (Rsiz & 0xD5F) != 0)
  ------------------
  |  Branch (694:11): [True: 381, False: 6.06k]
  |  Branch (694:35): [True: 365, False: 16]
  ------------------
  695|    365|        OJPH_WARN(0x00050001, "Rsiz in SIZ has unimplemented fields");
  ------------------
  |  |  287|    365|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    365|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 365, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|  6.44k|      if (file->read(&Xsiz, 4) != 4)
  ------------------
  |  Branch (696:11): [True: 19, False: 6.42k]
  ------------------
  697|     19|        OJPH_ERROR(0x00050045, "error reading SIZ marker");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|  6.44k|      Xsiz = swap_byte(Xsiz);
  699|  6.44k|      if (file->read(&Ysiz, 4) != 4)
  ------------------
  |  Branch (699:11): [True: 8, False: 6.43k]
  ------------------
  700|      8|        OJPH_ERROR(0x00050046, "error reading SIZ marker");
  ------------------
  |  |  289|      8|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      8|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  701|  6.44k|      Ysiz = swap_byte(Ysiz);
  702|  6.44k|      ui32 t_XOsiz, t_YOsiz;
  703|  6.44k|      if (file->read(&t_XOsiz, 4) != 4)
  ------------------
  |  Branch (703:11): [True: 3, False: 6.44k]
  ------------------
  704|      3|        OJPH_ERROR(0x00050047, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  705|  6.44k|      if (file->read(&t_YOsiz, 4) != 4)
  ------------------
  |  Branch (705:11): [True: 3, False: 6.44k]
  ------------------
  706|      3|        OJPH_ERROR(0x00050048, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|  6.44k|      set_image_offset(point(swap_byte(t_XOsiz), swap_byte(t_YOsiz)));
  708|  6.44k|      ui32 t_XTsiz, t_YTsiz;
  709|  6.44k|      if (file->read(&t_XTsiz, 4) != 4)
  ------------------
  |  Branch (709:11): [True: 3, False: 6.44k]
  ------------------
  710|      3|        OJPH_ERROR(0x00050049, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  711|  6.44k|      if (file->read(&t_YTsiz, 4) != 4)
  ------------------
  |  Branch (711:11): [True: 4, False: 6.44k]
  ------------------
  712|      4|        OJPH_ERROR(0x0005004A, "error reading SIZ marker");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  713|  6.44k|      set_tile_size(size(swap_byte(t_XTsiz), swap_byte(t_YTsiz)));
  714|  6.44k|      ui32 t_XTOsiz, t_YTOsiz;
  715|  6.44k|      if (file->read(&t_XTOsiz, 4) != 4)
  ------------------
  |  Branch (715:11): [True: 3, False: 6.44k]
  ------------------
  716|      3|        OJPH_ERROR(0x0005004B, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  717|  6.44k|      if (file->read(&t_YTOsiz, 4) != 4)
  ------------------
  |  Branch (717:11): [True: 3, False: 6.44k]
  ------------------
  718|      3|        OJPH_ERROR(0x0005004C, "error reading SIZ marker");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  719|  6.44k|      set_tile_offset(point(swap_byte(t_XTOsiz), swap_byte(t_YTOsiz)));
  720|  6.44k|      if (file->read(&Csiz, 2) != 2)
  ------------------
  |  Branch (720:11): [True: 1, False: 6.44k]
  ------------------
  721|      1|        OJPH_ERROR(0x0005004D, "error reading SIZ marker");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  722|  6.44k|      Csiz = swap_byte(Csiz);
  723|  6.44k|      if (Csiz != num_comps)
  ------------------
  |  Branch (723:11): [True: 44, False: 6.40k]
  ------------------
  724|     44|        OJPH_ERROR(0x0005004E, "Csiz does not match the SIZ marker size");
  ------------------
  |  |  289|     44|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     44|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 44, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  725|  6.44k|      set_num_components(Csiz);
  726|  23.2k|      for (int c = 0; c < Csiz; ++c)
  ------------------
  |  Branch (726:23): [True: 16.8k, False: 6.44k]
  ------------------
  727|  16.8k|      {
  728|  16.8k|        if (file->read(&cptr[c].SSiz, 1) != 1)
  ------------------
  |  Branch (728:13): [True: 5, False: 16.8k]
  ------------------
  729|      5|          OJPH_ERROR(0x00050051, "error reading SIZ marker");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|  16.8k|        if (file->read(&cptr[c].XRsiz, 1) != 1)
  ------------------
  |  Branch (730:13): [True: 4, False: 16.8k]
  ------------------
  731|      4|          OJPH_ERROR(0x00050052, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  732|  16.8k|        if (file->read(&cptr[c].YRsiz, 1) != 1)
  ------------------
  |  Branch (732:13): [True: 5, False: 16.8k]
  ------------------
  733|      5|          OJPH_ERROR(0x00050053, "error reading SIZ marker");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  734|  16.8k|        if ((cptr[c].SSiz & 0x7F) > 37)
  ------------------
  |  Branch (734:13): [True: 5, False: 16.8k]
  ------------------
  735|      5|          OJPH_ERROR(0x00050054, "Wrong SIZ-SSiz value of %d", cptr[c].SSiz);
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|  16.8k|        if (cptr[c].XRsiz == 0)
  ------------------
  |  Branch (736:13): [True: 3, False: 16.8k]
  ------------------
  737|      3|          OJPH_ERROR(0x00050055, "Wrong SIZ-XRsiz value of %d", cptr[c].XRsiz);
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|  16.8k|        if (cptr[c].YRsiz == 0)
  ------------------
  |  Branch (738:13): [True: 2, False: 16.8k]
  ------------------
  739|      2|          OJPH_ERROR(0x00050056, "Wrong SIZ-YRsiz value of %d", cptr[c].YRsiz);
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  740|  16.8k|      }
  741|       |
  742|  6.44k|      ws_kern_support_needed = (Rsiz & 0x20) != 0;
  743|  6.44k|      dfs_support_needed = (Rsiz & 0x80) != 0;
  744|       |
  745|  6.44k|      check_validity();
  746|  6.44k|    }
_ZNK4ojph5local9param_siz22get_recon_downsamplingEj:
  750|  86.3k|    {
  751|  86.3k|      assert(comp_num < get_num_components());
  752|       |
  753|  86.3k|      point factor(1u << skipped_resolutions, 1u << skipped_resolutions);
  754|  86.3k|      const param_cod* cdp = cod->get_coc(comp_num);
  755|  86.3k|      if (dfs && cdp && cdp->is_dfs_defined()) {
  ------------------
  |  Branch (755:11): [True: 5.25k, False: 81.1k]
  |  Branch (755:18): [True: 5.25k, False: 0]
  |  Branch (755:25): [True: 2.37k, False: 2.88k]
  ------------------
  756|  2.37k|        const param_dfs* d = dfs->get_dfs(cdp->get_dfs_index());
  757|  2.37k|        factor = d->get_res_downsamp(skipped_resolutions);
  758|  2.37k|      }
  759|  86.3k|      factor.x *= (ui32)cptr[comp_num].XRsiz;
  760|  86.3k|      factor.y *= (ui32)cptr[comp_num].YRsiz;
  761|  86.3k|      return factor;
  762|  86.3k|    }
_ZNK4ojph5local9param_siz14get_recon_sizeEj:
  766|  30.7k|    {
  767|  30.7k|      assert(comp_num < get_num_components());
  768|       |
  769|  30.7k|      point factor = get_recon_downsampling(comp_num);
  770|  30.7k|      point r;
  771|  30.7k|      r.x = ojph_div_ceil(Xsiz, factor.x) - ojph_div_ceil(XOsiz, factor.x);
  ------------------
  |  |   70|  30.7k|#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|  30.7k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  772|  30.7k|      r.y = ojph_div_ceil(Ysiz, factor.y) - ojph_div_ceil(YOsiz, factor.y);
  ------------------
  |  |   70|  30.7k|#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|  30.7k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  773|  30.7k|      return r;
  774|  30.7k|    }
_ZN4ojph5local9param_cap4readEPNS_11infile_baseE:
  810|    492|    {
  811|    492|      if (file->read(&Lcap, 2) != 2)
  ------------------
  |  Branch (811:11): [True: 2, False: 490]
  ------------------
  812|      2|        OJPH_ERROR(0x00050061, "error reading CAP marker");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  813|    492|      Lcap = swap_byte(Lcap);
  814|    492|      if (file->read(&Pcap, 4) != 4)
  ------------------
  |  Branch (814:11): [True: 4, False: 488]
  ------------------
  815|      4|        OJPH_ERROR(0x00050062, "error reading CAP marker");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|    492|      Pcap = swap_byte(Pcap);
  817|    492|      ui32 count = population_count(Pcap);
  818|    492|      if (Pcap & 0xFFFDFFFF)
  ------------------
  |  Branch (818:11): [True: 37, False: 455]
  ------------------
  819|     37|        OJPH_ERROR(0x00050063,
  ------------------
  |  |  289|     37|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     37|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 37, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  820|    492|          "error Pcap in CAP has options that are not supported");
  821|    492|      if ((Pcap & 0x00020000) == 0)
  ------------------
  |  Branch (821:11): [True: 2, False: 490]
  ------------------
  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|    492|          "error Pcap should have its 15th MSB set, Pcap^15. "
  824|    492|          " This is not a JPH file");
  825|    939|      for (ui32 i = 0; i < count; ++i)
  ------------------
  |  Branch (825:24): [True: 447, False: 492]
  ------------------
  826|    447|        if (file->read(Ccap+i, 2) != 2)
  ------------------
  |  Branch (826:13): [True: 2, False: 445]
  ------------------
  827|      2|          OJPH_ERROR(0x00050065, "error reading CAP marker");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  828|    492|      if (Lcap != 6 + 2 * count)
  ------------------
  |  Branch (828:11): [True: 11, False: 481]
  ------------------
  829|     11|        OJPH_ERROR(0x00050066, "error in CAP marker length");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  830|    492|    }
_ZNK4ojph5local9param_cod13is_reversibleEv:
  842|  2.40M|    {
  843|  2.40M|      if (SPcod.wavelet_trans <= 1)
  ------------------
  |  Branch (843:11): [True: 2.40M, False: 0]
  ------------------
  844|  2.40M|        return get_wavelet_kern() == local::param_cod::DWT_REV53;
  845|      0|      else {
  846|       |        assert(atk != NULL);
  847|      0|        return atk->is_reversible();
  848|      0|      }
  849|  2.40M|    }
_ZN4ojph5local9param_cod4readEPNS_11infile_baseE:
  956|  6.18k|    {
  957|  6.18k|      assert(type == COD_MAIN);
  958|       |
  959|  6.18k|      if (file->read(&Lcod, 2) != 2)
  ------------------
  |  Branch (959:11): [True: 3, False: 6.18k]
  ------------------
  960|      3|        OJPH_ERROR(0x00050071, "error reading COD segment");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  961|  6.18k|      Lcod = swap_byte(Lcod);
  962|  6.18k|      if (file->read(&Scod, 1) != 1)
  ------------------
  |  Branch (962:11): [True: 2, False: 6.18k]
  ------------------
  963|      2|        OJPH_ERROR(0x00050072, "error reading COD segment");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  964|  6.18k|      if (file->read(&SGCod.prog_order, 1) != 1)
  ------------------
  |  Branch (964:11): [True: 2, False: 6.18k]
  ------------------
  965|      2|        OJPH_ERROR(0x00050073, "error reading COD segment");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  966|  6.18k|      if (file->read(&SGCod.num_layers, 2) != 2)
  ------------------
  |  Branch (966:11): [True: 4, False: 6.18k]
  ------------------
  967|      4|      { OJPH_ERROR(0x00050074, "error reading COD segment"); }
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  968|  6.18k|      else
  969|  6.18k|        SGCod.num_layers = swap_byte(SGCod.num_layers);
  970|  6.18k|      if (file->read(&SGCod.mc_trans, 1) != 1)
  ------------------
  |  Branch (970:11): [True: 1, False: 6.18k]
  ------------------
  971|      1|        OJPH_ERROR(0x00050075, "error reading COD segment");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|  6.18k|      if (file->read(&SPcod.num_decomp, 1) != 1)
  ------------------
  |  Branch (972:11): [True: 2, False: 6.18k]
  ------------------
  973|      2|        OJPH_ERROR(0x00050076, "error reading COD segment");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  974|  6.18k|      if (file->read(&SPcod.block_width, 1) != 1)
  ------------------
  |  Branch (974:11): [True: 1, False: 6.18k]
  ------------------
  975|      1|        OJPH_ERROR(0x00050077, "error reading COD segment");
  ------------------
  |  |  289|      1|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      1|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  976|  6.18k|      if (file->read(&SPcod.block_height, 1) != 1)
  ------------------
  |  Branch (976:11): [True: 3, False: 6.18k]
  ------------------
  977|      3|        OJPH_ERROR(0x00050078, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  6.18k|      if (file->read(&SPcod.block_style, 1) != 1)
  ------------------
  |  Branch (978:11): [True: 3, False: 6.18k]
  ------------------
  979|      3|        OJPH_ERROR(0x00050079, "error reading COD segment");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  980|  6.18k|      if (file->read(&SPcod.wavelet_trans, 1) != 1)
  ------------------
  |  Branch (980:11): [True: 1, False: 6.18k]
  ------------------
  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|  6.18k|      if (get_num_decompositions() > 32
  ------------------
  |  Branch (983:11): [True: 28, False: 6.16k]
  ------------------
  984|  6.16k|        || SPcod.block_width > 8
  ------------------
  |  Branch (984:12): [True: 8, False: 6.15k]
  ------------------
  985|  6.15k|        || SPcod.block_height > 8
  ------------------
  |  Branch (985:12): [True: 7, False: 6.14k]
  ------------------
  986|  6.14k|        || SPcod.block_width + SPcod.block_height > 8
  ------------------
  |  Branch (986:12): [True: 1, False: 6.14k]
  ------------------
  987|  6.14k|        || (SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (987:12): [True: 2, False: 6.14k]
  ------------------
  988|  6.14k|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (988:12): [True: 7, False: 6.13k]
  ------------------
  989|     31|        OJPH_ERROR(0x0005007D, "wrong settings in a COD-SPcod parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  990|  6.18k|      if ((SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (990:11): [True: 53, False: 6.13k]
  ------------------
  991|  6.13k|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (991:12): [True: 0, False: 6.13k]
  ------------------
  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|  6.18k|      ui8 num_decompositions =  get_num_decompositions();
  995|  6.18k|      if (Scod & 1) {
  ------------------
  |  Branch (995:11): [True: 5.53k, False: 655]
  ------------------
  996|  38.5k|        for (int i = 0; i <= num_decompositions; ++i) {
  ------------------
  |  Branch (996:25): [True: 33.0k, False: 5.53k]
  ------------------
  997|  33.0k|          if (file->read(&SPcod.precinct_size[i], 1) != 1)
  ------------------
  |  Branch (997:15): [True: 7, False: 33.0k]
  ------------------
  998|      7|            OJPH_ERROR(0x0005007B, "error reading COD segment");
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  999|  33.0k|          if (i)
  ------------------
  |  Branch (999:15): [True: 27.4k, False: 5.53k]
  ------------------
 1000|  27.4k|            if ((SPcod.precinct_size[i] & 0x0F) == 0 ||
  ------------------
  |  Branch (1000:17): [True: 10, False: 27.4k]
  ------------------
 1001|  27.4k|              (SPcod.precinct_size[i] >> 4) == 0)
  ------------------
  |  Branch (1001:15): [True: 5, False: 27.4k]
  ------------------
 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|  33.0k|                "Precinct width or height for resolutions other than the"
 1004|  33.0k|                " coarsest must be larger than 1; here, they are %d and %d,"
 1005|  33.0k|                " respectively.",
 1006|  33.0k|                1 << (SPcod.precinct_size[i] & 0x0F),
 1007|  33.0k|                1 << (SPcod.precinct_size[i] >> 4));
 1008|  33.0k|        }
 1009|  5.53k|      }
 1010|  6.18k|      if (Lcod != 12 + ((Scod & 1) ? 1 + SPcod.num_decomp : 0))
  ------------------
  |  Branch (1010:11): [True: 21, False: 6.16k]
  |  Branch (1010:25): [True: 5.51k, False: 677]
  ------------------
 1011|     21|        OJPH_ERROR(0x0005007C, "error in COD segment length");
  ------------------
  |  |  289|     21|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     21|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1012|  6.18k|    }
_ZN4ojph5local9param_cod8read_cocEPNS_11infile_baseEjPS1_:
 1017|    573|    {
 1018|    573|      assert(type == COC_MAIN);
 1019|    573|      assert(top_cod != NULL);
 1020|       |
 1021|    573|      this->SGCod = top_cod->SGCod;
 1022|    573|      this->top_cod = top_cod;
 1023|    573|      if (file->read(&Lcod, 2) != 2)
  ------------------
  |  Branch (1023:11): [True: 4, False: 569]
  ------------------
 1024|      4|        OJPH_ERROR(0x00050121, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1025|    573|      Lcod = swap_byte(Lcod);
 1026|    573|      if (num_comps < 257) {
  ------------------
  |  Branch (1026:11): [True: 568, False: 5]
  ------------------
 1027|    568|        ui8 t;
 1028|    568|        if (file->read(&t, 1) != 1)
  ------------------
  |  Branch (1028:13): [True: 4, False: 564]
  ------------------
 1029|      4|          OJPH_ERROR(0x00050122, "error reading COC segment");
  ------------------
  |  |  289|      4|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      4|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1030|    568|        comp_idx = t;
 1031|    568|      }
 1032|      5|      else {
 1033|      5|        if (file->read(&comp_idx, 2) != 2)
  ------------------
  |  Branch (1033:13): [True: 0, False: 5]
  ------------------
 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|      5|        comp_idx = swap_byte(comp_idx);
 1036|      5|      }
 1037|    573|      if (file->read(&Scod, 1) != 1)
  ------------------
  |  Branch (1037:11): [True: 2, False: 571]
  ------------------
 1038|      2|        OJPH_ERROR(0x00050124, "error reading COC segment");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1039|    573|      if (Scod & 0xF8)
  ------------------
  |  Branch (1039:11): [True: 465, False: 108]
  ------------------
 1040|    465|        OJPH_WARN(0x00050011,
  ------------------
  |  |  287|    465|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    465|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 465, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1041|    573|          "Unsupported options in Scoc field of the COC segment");
 1042|    573|      if (file->read(&SPcod.num_decomp, 1) != 1)
  ------------------
  |  Branch (1042:11): [True: 8, False: 565]
  ------------------
 1043|      8|        OJPH_ERROR(0x00050125, "error reading COC segment");
  ------------------
  |  |  289|      8|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      8|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1044|    573|      if (file->read(&SPcod.block_width, 1) != 1)
  ------------------
  |  Branch (1044:11): [True: 3, False: 570]
  ------------------
 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|    573|      if (file->read(&SPcod.block_height, 1) != 1)
  ------------------
  |  Branch (1046:11): [True: 3, False: 570]
  ------------------
 1047|      3|        OJPH_ERROR(0x00050127, "error reading COC segment");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|    573|      if (file->read(&SPcod.block_style, 1) != 1)
  ------------------
  |  Branch (1048:11): [True: 2, False: 571]
  ------------------
 1049|      2|        OJPH_ERROR(0x00050128, "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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1050|    573|      if (file->read(&SPcod.wavelet_trans, 1) != 1)
  ------------------
  |  Branch (1050:11): [True: 2, False: 571]
  ------------------
 1051|      2|        OJPH_ERROR(0x00050129, "error reading COC segment");
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1052|       |
 1053|    573|      if (get_num_decompositions() > 32
  ------------------
  |  Branch (1053:11): [True: 33, False: 540]
  ------------------
 1054|    540|        || SPcod.block_width > 8
  ------------------
  |  Branch (1054:12): [True: 11, False: 529]
  ------------------
 1055|    529|        || SPcod.block_height > 8
  ------------------
  |  Branch (1055:12): [True: 5, False: 524]
  ------------------
 1056|    524|        || SPcod.block_width + SPcod.block_height > 8
  ------------------
  |  Branch (1056:12): [True: 2, False: 522]
  ------------------
 1057|    522|        || (SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1057:12): [True: 3, False: 519]
  ------------------
 1058|    519|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1058:12): [True: 5, False: 514]
  ------------------
 1059|     31|        OJPH_ERROR(0x0005012C, "wrong settings in a COC-SPcoc parameter");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1060|    573|      if ((SPcod.block_style & 0x40) != 0x40
  ------------------
  |  Branch (1060:11): [True: 59, False: 514]
  ------------------
 1061|    514|        || (SPcod.block_style & 0xB7) != 0x00)
  ------------------
  |  Branch (1061:12): [True: 0, False: 514]
  ------------------
 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|    573|      ui8 num_decompositions =  get_num_decompositions();
 1065|    573|      if (Scod & 1) {
  ------------------
  |  Branch (1065:11): [True: 223, False: 350]
  ------------------
 1066|    554|        for (int i = 0; i <= num_decompositions; ++i) {
  ------------------
  |  Branch (1066:25): [True: 331, False: 223]
  ------------------
 1067|    331|          if (file->read(&SPcod.precinct_size[i], 1) != 1)
  ------------------
  |  Branch (1067:15): [True: 5, False: 326]
  ------------------
 1068|      5|            OJPH_ERROR(0x0005012A, "error reading COC segment");
  ------------------
  |  |  289|      5|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      5|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1069|    331|          if (i)
  ------------------
  |  Branch (1069:15): [True: 104, False: 227]
  ------------------
 1070|    104|            if ((SPcod.precinct_size[i] & 0x0F) == 0 ||
  ------------------
  |  Branch (1070:17): [True: 3, False: 101]
  ------------------
 1071|    101|              (SPcod.precinct_size[i] >> 4) == 0)
  ------------------
  |  Branch (1071:15): [True: 6, False: 95]
  ------------------
 1072|      9|              OJPH_ERROR(0x0005012E,
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1073|    331|                "Precinct width or height for resolutions other than the"
 1074|    331|                " coarsest must be larger than 1; here, they are %d and %d,"
 1075|    331|                " respectively.",
 1076|    331|                1 << (SPcod.precinct_size[i] & 0x0F),
 1077|    331|                1 << (SPcod.precinct_size[i] >> 4));
 1078|    331|        }
 1079|    223|      }
 1080|    573|      ui32 t = 9;
 1081|    573|      t += num_comps < 257 ? 0 : 1;
  ------------------
  |  Branch (1081:12): [True: 500, False: 73]
  ------------------
 1082|    573|      t += (Scod & 1) ? 1 + num_decompositions : 0;
  ------------------
  |  Branch (1082:12): [True: 209, False: 364]
  ------------------
 1083|    573|      if (Lcod != t)
  ------------------
  |  Branch (1083:11): [True: 12, False: 561]
  ------------------
 1084|     12|        OJPH_ERROR(0x0005012B, "error in COC segment length");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1085|    573|    }
_ZN4ojph5local9param_cod10update_atkEPNS0_9param_atkE:
 1089|  4.88k|    {
 1090|  4.88k|      assert(type == COD_MAIN);
 1091|  4.88k|      this->atk = atk->get_atk(SPcod.wavelet_trans);
 1092|  4.88k|      if (this->atk == NULL)
  ------------------
  |  Branch (1092:11): [True: 9, False: 4.87k]
  ------------------
 1093|      9|        OJPH_ERROR(0x00050131, "A COD segment employs the DWT kernel "
  ------------------
  |  |  289|      9|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      9|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1094|  4.88k|          "atk = %d, but a corresponding ATK segment cannot be found.",
 1095|  4.88k|          SPcod.wavelet_trans);
 1096|  4.88k|      param_cod *p = next;
 1097|  5.27k|      while (p)
  ------------------
  |  Branch (1097:14): [True: 390, False: 4.88k]
  ------------------
 1098|    390|      {
 1099|    390|        p->atk = atk->get_atk(p->SPcod.wavelet_trans);
 1100|    390|        if (p->atk == NULL)
  ------------------
  |  Branch (1100:13): [True: 2, False: 388]
  ------------------
 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|    390|            "atk = %d, but a corresponding ATK segment cannot be found",
 1103|    390|            SPcod.wavelet_trans);
 1104|    390|        p = p->next;
 1105|    390|      }
 1106|  4.88k|    }
_ZNK4ojph5local9param_cod7get_cocEj:
 1110|  5.89M|    {
 1111|  5.89M|      assert(this->type == COD_MAIN || this->top_cod->type == COD_MAIN);
 1112|  5.89M|      const param_cod *p, *q;
 1113|  5.89M|      if (this->type == COD_MAIN)
  ------------------
  |  Branch (1113:11): [True: 5.85M, False: 31.8k]
  ------------------
 1114|  5.85M|        q = p = this;
 1115|  31.8k|      else
 1116|  31.8k|        q = p = this->top_cod;
 1117|  10.2M|      while (p && p->comp_idx != comp_idx)
  ------------------
  |  Branch (1117:14): [True: 6.02M, False: 4.20M]
  |  Branch (1117:19): [True: 4.33M, False: 1.68M]
  ------------------
 1118|  4.33M|        p = p->next;
 1119|  5.89M|      return p ? p : q;
  ------------------
  |  Branch (1119:14): [True: 1.68M, False: 4.20M]
  ------------------
 1120|  5.89M|    }
_ZN4ojph5local9param_cod7get_cocEj:
 1124|  4.21M|    {
 1125|       |      // cast object to constant
 1126|  4.21M|      const param_cod* const_p = const_cast<const param_cod*>(this);
 1127|       |      // call using the constant object, then cast to non-const
 1128|  4.21M|      return const_cast<param_cod*>(const_p->get_coc(comp_idx));
 1129|  4.21M|    }
_ZN4ojph5local9param_cod14add_coc_objectEj:
 1133|    573|    {
 1134|    573|      assert(type == COD_MAIN);
 1135|    573|      param_cod *p = this;
 1136|    870|      while (p->next != NULL)
  ------------------
  |  Branch (1136:14): [True: 297, False: 573]
  ------------------
 1137|    297|        p = p->next;
 1138|    573|      if (avail)
  ------------------
  |  Branch (1138:11): [True: 0, False: 573]
  ------------------
 1139|      0|      {
 1140|      0|        p->next = avail;
 1141|      0|        avail = avail->next;
 1142|      0|        p->next->init(this, (ui16)comp_idx);
 1143|      0|      }
 1144|    573|      else
 1145|    573|        p->next = new param_cod(this, (ui16)comp_idx);
 1146|    573|      return p->next;
 1147|    573|    }
_ZNK4ojph5local9param_qcd15get_irrev_deltaEPKNS0_9param_dfsEjjjj:
 1444|   146k|    {
 1445|   146k|      float arr[] = { 1.0f, 2.0f, 2.0f, 4.0f };
 1446|   146k|      if ((Sqcd & 0x1F) != 2)
  ------------------
  |  Branch (1446:11): [True: 184, False: 146k]
  ------------------
 1447|    184|        OJPH_ERROR(0x00050101, "There is something wrong in the configuration "
  ------------------
  |  |  289|    184|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    184|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 184, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1448|   146k|          "of the codestream; for component %d, the codestream defines an "
 1449|   146k|          "irreversible transform, for which the codestream provides a "
 1450|   146k|          "reversible (no quantization) step sizes in Sqcd/Sqcc.", comp_num);
 1451|       |
 1452|   146k|      ui32 idx;
 1453|   146k|      if (dfs != NULL && dfs->exists())
  ------------------
  |  Branch (1453:11): [True: 5.28k, False: 141k]
  |  Branch (1453:26): [True: 5.24k, False: 36]
  ------------------
 1454|  5.24k|        idx = dfs->get_subband_idx(num_decompositions, resolution, subband);
 1455|   141k|      else
 1456|   141k|        idx = resolution ? (resolution - 1) * 3 + subband : 0;
  ------------------
  |  Branch (1456:15): [True: 132k, False: 9.12k]
  ------------------
 1457|   146k|      if (idx >= num_subbands) {
  ------------------
  |  Branch (1457:11): [True: 38.1k, False: 108k]
  ------------------
 1458|  38.1k|        OJPH_INFO(0x00050101, "Trying to access quantization step size for "
  ------------------
  |  |  285|  38.1k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  38.1k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 38.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1459|  38.1k|          "subband %d when the QCD/QCC marker segment specifies "
 1460|  38.1k|          "quantization step sizes for %d subbands only.  To continue "
 1461|  38.1k|          "decoding, we are using the step size for subband %d, which can "
 1462|  38.1k|          "produce incorrect results",
 1463|  38.1k|          idx + 1, num_subbands, num_subbands - 1);
 1464|  38.1k|        idx = num_subbands - 1;
 1465|  38.1k|      }
 1466|   146k|      int eps = SPqcd.u16[idx] >> 11;
 1467|   146k|      float mantissa;
 1468|   146k|      mantissa = (float)((SPqcd.u16[idx] & 0x7FF) | 0x800) * arr[subband];
 1469|   146k|      mantissa /= (float)(1 << 11);
 1470|   146k|      mantissa /= (float)(1u << eps);
 1471|   146k|      return mantissa;
 1472|   146k|    }
_ZNK4ojph5local9param_qcd17propose_precisionEPKNS0_9param_codE:
 1476|  1.58M|    {
 1477|  1.58M|      ui32 comp_idx = cod->get_comp_idx();
 1478|  1.58M|      ui32 precision = 0;
 1479|  1.58M|      const param_cod *main =
 1480|  1.58M|        cod->get_coc(param_cod::OJPH_COD_DEFAULT);
 1481|  1.58M|      if (main->is_employing_color_transform() && comp_idx < 3)
  ------------------
  |  Branch (1481:11): [True: 95.9k, False: 1.49M]
  |  Branch (1481:51): [True: 8.28k, False: 87.6k]
  ------------------
 1482|  8.28k|      {
 1483|  33.1k|        for (ui32 i = 0; i < 3; ++i) {
  ------------------
  |  Branch (1483:26): [True: 24.8k, False: 8.28k]
  ------------------
 1484|  24.8k|          const param_qcd* p = this->get_qcc(i);
 1485|  24.8k|          precision = ojph_max(precision, p->get_largest_Kmax());
  ------------------
  |  |   73|  24.8k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 1.71k, False: 23.1k]
  |  |  ------------------
  ------------------
 1486|  24.8k|        }
 1487|  8.28k|      }
 1488|  1.58M|      else {
 1489|  1.58M|        precision = get_largest_Kmax();
 1490|  1.58M|      }
 1491|       |      // ``precision'' now holds the largest K_max, which excludes the sign
 1492|       |      // bit.
 1493|       |      // + 1 for the sign bit
 1494|       |      // + 1 because my block decoder/encoder does not supports up to 30
 1495|       |      //     bits (not 31), so we bump it by one more bit.
 1496|  1.58M|      return precision + 1 + 1;
 1497|  1.58M|    }
_ZNK4ojph5local9param_qcd18get_num_guard_bitsEv:
 1501|  2.48M|    {
 1502|  2.48M|      return (Sqcd >> 5);
 1503|  2.48M|    }
_ZNK4ojph5local9param_qcd8get_KmaxEPKNS0_9param_dfsEjjj:
 1508|   853k|    {
 1509|   853k|      ui32 idx;
 1510|   853k|      if (dfs != NULL && dfs->exists())
  ------------------
  |  Branch (1510:11): [True: 8.55k, False: 844k]
  |  Branch (1510:26): [True: 8.50k, False: 57]
  ------------------
 1511|  8.50k|        idx = dfs->get_subband_idx(num_decompositions, resolution, subband);
 1512|   844k|      else
 1513|   844k|        idx = resolution ? (resolution - 1) * 3 + subband : 0;
  ------------------
  |  Branch (1513:15): [True: 790k, False: 53.9k]
  ------------------
 1514|   853k|      if (idx >= num_subbands) {
  ------------------
  |  Branch (1514:11): [True: 74.9k, False: 778k]
  ------------------
 1515|  74.9k|        OJPH_INFO(0x00050111, "Trying to access quantization step size for "
  ------------------
  |  |  285|  74.9k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  74.9k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 74.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1516|  74.9k|          "subband %d when the QCD/QCC marker segment specifies "
 1517|  74.9k|          "quantization step sizes for %d subbands only.  To continue "
 1518|  74.9k|          "decoding, we are using the step size for subband %d, which can "
 1519|  74.9k|          "produce incorrect results",
 1520|  74.9k|          idx + 1, num_subbands, num_subbands - 1);
 1521|  74.9k|        idx = num_subbands - 1;
 1522|  74.9k|      }
 1523|       |
 1524|   853k|      int irrev = Sqcd & 0x1F;
 1525|   853k|      ui32 num_bits = 0;
 1526|   853k|      if (irrev == 0) // reversible; this is (10.22) from the J2K book
  ------------------
  |  Branch (1526:11): [True: 517k, False: 335k]
  ------------------
 1527|   517k|      {
 1528|   517k|        num_bits = decode_SPqcd(SPqcd.u8[idx]);
 1529|   517k|        num_bits = num_bits == 0 ? 0 : num_bits - 1;
  ------------------
  |  Branch (1529:20): [True: 167k, False: 350k]
  ------------------
 1530|   517k|      }
 1531|   335k|      else if (irrev == 1)
  ------------------
  |  Branch (1531:16): [True: 0, False: 335k]
  ------------------
 1532|   335k|        assert(0);
 1533|   335k|      else if (irrev == 2) //scalar expounded
  ------------------
  |  Branch (1533:16): [True: 335k, False: 0]
  ------------------
 1534|   335k|        num_bits = (SPqcd.u16[idx] >> 11) - 1;
 1535|      0|      else
 1536|   335k|        assert(0);
 1537|       |
 1538|   853k|      return num_bits + get_num_guard_bits();
 1539|   853k|    }
_ZNK4ojph5local9param_qcd16get_largest_KmaxEv:
 1543|  1.62M|    {
 1544|  1.62M|      int irrev = Sqcd & 0x1F;
 1545|  1.62M|      ui32 num_bits = 0;
 1546|  1.62M|      if (irrev == 0) // reversible; this is (10.22) from the J2K book
  ------------------
  |  Branch (1546:11): [True: 1.02M, False: 604k]
  ------------------
 1547|  1.02M|      {
 1548|  17.6M|        for (ui32 i = 0; i < num_subbands; ++i) {
  ------------------
  |  Branch (1548:26): [True: 16.6M, False: 1.02M]
  ------------------
 1549|  16.6M|          ui32 t = decode_SPqcd(SPqcd.u8[i]);
 1550|  16.6M|          num_bits = ojph_max(num_bits, t == 0 ? 0 : t - 1);
  ------------------
  |  |   73|  33.2M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 11.6M, False: 4.94M]
  |  |  |  Branch (73:33): [True: 5.34M, False: 11.2M]
  |  |  |  Branch (73:46): [True: 340k, False: 4.60M]
  |  |  ------------------
  ------------------
 1551|  16.6M|        }
 1552|  1.02M|      }
 1553|   604k|      else if (irrev == 1)
  ------------------
  |  Branch (1553:16): [True: 0, False: 604k]
  ------------------
 1554|   604k|        assert(0);
 1555|   604k|      else if (irrev == 2) //scalar expounded
  ------------------
  |  Branch (1555:16): [True: 604k, False: 0]
  ------------------
 1556|   604k|      {
 1557|  7.87M|        for (ui32 i = 0; i < num_subbands; ++i) {
  ------------------
  |  Branch (1557:26): [True: 7.26M, False: 604k]
  ------------------
 1558|  7.26M|          ui32 t = (SPqcd.u16[i] >> 11) - 1;
 1559|  7.26M|          num_bits = ojph_max(num_bits, t);
  ------------------
  |  |   73|  7.26M|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 3.70M, False: 3.56M]
  |  |  ------------------
  ------------------
 1560|  7.26M|        }
 1561|   604k|      }
 1562|      0|      else
 1563|   604k|        assert(0);
 1564|       |
 1565|  1.62M|      return num_bits + get_num_guard_bits();
 1566|  1.62M|    }
_ZN4ojph5local9param_qcd4readEPNS_11infile_baseE:
 1693|  6.28k|    {
 1694|  6.28k|      if (file->read(&Lqcd, 2) != 2)
  ------------------
  |  Branch (1694:11): [True: 12, False: 6.27k]
  ------------------
 1695|     12|        OJPH_ERROR(0x00050081, "error reading QCD marker");
  ------------------
  |  |  289|     12|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     12|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1696|  6.28k|      Lqcd = swap_byte(Lqcd);
 1697|  6.28k|      if (file->read(&Sqcd, 1) != 1)
  ------------------
  |  Branch (1697:11): [True: 2, False: 6.28k]
  ------------------
 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|  6.28k|      if ((Sqcd & 0x1F) == 0)
  ------------------
  |  Branch (1699:11): [True: 5.05k, False: 1.23k]
  ------------------
 1700|  5.05k|      {
 1701|  5.05k|        num_subbands = (Lqcd - 3);
 1702|  5.05k|        if (num_subbands == 0)
  ------------------
  |  Branch (1702:13): [True: 1, False: 5.05k]
  ------------------
 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|  5.05k|            "quantization informtion");
 1705|  5.05k|        if (num_subbands > 97 || Lqcd != 3 + num_subbands)
  ------------------
  |  Branch (1705:13): [True: 20, False: 5.03k]
  |  Branch (1705:34): [True: 0, False: 5.03k]
  ------------------
 1706|     19|          OJPH_ERROR(0x00050083, "wrong Lqcd value of %d in QCD marker", Lqcd);
  ------------------
  |  |  289|     19|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     19|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 19, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1707|  82.2k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1707:26): [True: 77.2k, False: 5.05k]
  ------------------
 1708|  77.2k|          if (file->read(&SPqcd.u8[i], 1) != 1)
  ------------------
  |  Branch (1708:15): [True: 11, False: 77.1k]
  ------------------
 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|  5.05k|      }
 1711|  1.23k|      else if ((Sqcd & 0x1F) == 1)
  ------------------
  |  Branch (1711:16): [True: 2, False: 1.23k]
  ------------------
 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|  1.23k|      else if ((Sqcd & 0x1F) == 2)
  ------------------
  |  Branch (1719:16): [True: 1.21k, False: 22]
  ------------------
 1720|  1.21k|      {
 1721|  1.21k|        num_subbands = (Lqcd - 3) / 2;
 1722|  1.21k|        if (num_subbands == 0)
  ------------------
  |  Branch (1722:13): [True: 1, False: 1.21k]
  ------------------
 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|  1.21k|            "quantization informtion");
 1725|  1.21k|        if (num_subbands > 97 || Lqcd != 3 + 2 * num_subbands)
  ------------------
  |  Branch (1725:13): [True: 17, False: 1.19k]
  |  Branch (1725:34): [True: 5, False: 1.19k]
  ------------------
 1726|     21|          OJPH_ERROR(0x00050086, "wrong Lqcd value of %d in QCD marker", Lqcd);
  ------------------
  |  |  289|     21|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     21|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1727|  12.2k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1727:26): [True: 11.0k, False: 1.21k]
  ------------------
 1728|  11.0k|        {
 1729|  11.0k|          if (file->read(&SPqcd.u16[i], 2) != 2)
  ------------------
  |  Branch (1729:15): [True: 15, False: 11.0k]
  ------------------
 1730|     15|            OJPH_ERROR(0x00050087, "error reading QCD marker");
  ------------------
  |  |  289|     15|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     15|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1731|  11.0k|          SPqcd.u16[i] = swap_byte(SPqcd.u16[i]);
 1732|  11.0k|        }
 1733|  1.21k|      }
 1734|     22|      else
 1735|     22|        OJPH_ERROR(0x00050088, "wrong Sqcd value in QCD marker");
  ------------------
  |  |  289|     22|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     22|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1736|  6.28k|    }
_ZN4ojph5local9param_qcd8read_qccEPNS_11infile_baseEj:
 1740|    247|    {
 1741|    247|      if (file->read(&Lqcd, 2) != 2)
  ------------------
  |  Branch (1741:11): [True: 2, False: 245]
  ------------------
 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|    247|      Lqcd = swap_byte(Lqcd);
 1744|    247|      if (num_comps < 257)
  ------------------
  |  Branch (1744:11): [True: 237, False: 10]
  ------------------
 1745|    237|      {
 1746|    237|        ui8 v;
 1747|    237|        if (file->read(&v, 1) != 1)
  ------------------
  |  Branch (1747:13): [True: 1, False: 236]
  ------------------
 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|    237|        comp_idx = v;
 1750|    237|      }
 1751|     10|      else
 1752|     10|      {
 1753|     10|        if (file->read(&comp_idx, 2) != 2)
  ------------------
  |  Branch (1753:13): [True: 1, False: 9]
  ------------------
 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|     10|        comp_idx = swap_byte(comp_idx);
 1756|     10|      }
 1757|    247|      if (file->read(&Sqcd, 1) != 1)
  ------------------
  |  Branch (1757:11): [True: 1, False: 246]
  ------------------
 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|    247|      ui32 offset = num_comps < 257 ? 4 : 5;
  ------------------
  |  Branch (1759:21): [True: 235, False: 12]
  ------------------
 1760|    247|      if ((Sqcd & 0x1F) == 0)
  ------------------
  |  Branch (1760:11): [True: 131, False: 116]
  ------------------
 1761|    131|      {
 1762|    131|        num_subbands = (Lqcd - offset);
 1763|    131|        if (num_subbands == 0)
  ------------------
  |  Branch (1763:13): [True: 1, False: 130]
  ------------------
 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|    131|            "quantization informtion");
 1766|    131|        if (num_subbands > 97 || Lqcd != offset + num_subbands)
  ------------------
  |  Branch (1766:13): [True: 19, False: 112]
  |  Branch (1766:34): [True: 0, False: 112]
  ------------------
 1767|     18|          OJPH_ERROR(0x000500A5, "wrong Lqcd value of %d in QCC marker", Lqcd);
  ------------------
  |  |  289|     18|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     18|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 18, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1768|  2.04k|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1768:26): [True: 1.91k, False: 131]
  ------------------
 1769|  1.91k|          if (file->read(&SPqcd.u8[i], 1) != 1)
  ------------------
  |  Branch (1769:15): [True: 15, False: 1.89k]
  ------------------
 1770|     15|            OJPH_ERROR(0x000500A6, "error reading QCC marker");
  ------------------
  |  |  289|     15|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     15|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1771|    131|      }
 1772|    116|      else if ((Sqcd & 0x1F) == 1)
  ------------------
  |  Branch (1772:16): [True: 1, False: 115]
  ------------------
 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|    115|      else if ((Sqcd & 0x1F) == 2)
  ------------------
  |  Branch (1780:16): [True: 102, False: 13]
  ------------------
 1781|    102|      {
 1782|    102|        num_subbands = (Lqcd - offset) / 2;
 1783|    102|        if (num_subbands == 0)
  ------------------
  |  Branch (1783:13): [True: 1, False: 101]
  ------------------
 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|    102|            "quantization informtion");
 1786|    102|        if (num_subbands > 97 || Lqcd != offset + 2 * num_subbands)
  ------------------
  |  Branch (1786:13): [True: 14, False: 88]
  |  Branch (1786:34): [True: 3, False: 85]
  ------------------
 1787|     16|          OJPH_ERROR(0x000500A8, "wrong Lqcc value of %d in QCC marker", Lqcd);
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1788|    943|        for (ui32 i = 0; i < num_subbands; ++i)
  ------------------
  |  Branch (1788:26): [True: 841, False: 102]
  ------------------
 1789|    841|        {
 1790|    841|          if (file->read(&SPqcd.u16[i], 2) != 2)
  ------------------
  |  Branch (1790:15): [True: 13, False: 828]
  ------------------
 1791|     13|            OJPH_ERROR(0x000500A9, "error reading QCC marker");
  ------------------
  |  |  289|     13|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     13|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1792|    841|          SPqcd.u16[i] = swap_byte(SPqcd.u16[i]);
 1793|    841|        }
 1794|    102|      }
 1795|     13|      else
 1796|     13|        OJPH_ERROR(0x000500AA, "wrong Sqcc value in QCC marker");
  ------------------
  |  |  289|     13|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     13|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1797|    247|    }
_ZN4ojph5local9param_qcd7get_qccEj:
 1801|    157|    {
 1802|       |      // cast object to constant
 1803|    157|      const param_qcd* const_p = const_cast<const param_qcd*>(this);
 1804|       |      // call using the constant object, then cast to non-const
 1805|    157|      return const_cast<param_qcd*>(const_p->get_qcc(comp_idx));
 1806|    157|    }
_ZNK4ojph5local9param_qcd7get_qccEj:
 1810|  1.61M|    {
 1811|  1.61M|      assert(this->type == QCD_MAIN || this->top_qcd->type == QCD_MAIN);
 1812|  1.61M|      const param_qcd *p, *q;
 1813|  1.61M|      if (this->type == QCD_MAIN)
  ------------------
  |  Branch (1813:11): [True: 1.61M, False: 2.46k]
  ------------------
 1814|  1.61M|        q = p = this;
 1815|  2.46k|      else
 1816|  2.46k|        q = p = this->top_qcd;
 1817|  3.23M|      while (p && p->comp_idx != comp_idx)
  ------------------
  |  Branch (1817:14): [True: 1.62M, False: 1.60M]
  |  Branch (1817:19): [True: 1.62M, False: 6.22k]
  ------------------
 1818|  1.62M|        p = p->next;
 1819|  1.61M|      return p ? p : q;
  ------------------
  |  Branch (1819:14): [True: 6.22k, False: 1.60M]
  ------------------
 1820|  1.61M|    }
_ZN4ojph5local9param_qcd14add_qcc_objectEj:
 1824|    247|    {
 1825|    247|      assert(type == QCD_MAIN);
 1826|    247|      param_qcd *p = this;
 1827|    279|      while (p->next != NULL)
  ------------------
  |  Branch (1827:14): [True: 32, False: 247]
  ------------------
 1828|     32|        p = p->next;
 1829|    247|      if (avail)
  ------------------
  |  Branch (1829:11): [True: 0, False: 247]
  ------------------
 1830|      0|      {
 1831|      0|        p->next = avail;
 1832|      0|        avail = avail->next;
 1833|      0|        p->next->init(this, (ui16)comp_idx);
 1834|      0|      }
 1835|    247|      else
 1836|    247|        p->next = new param_qcd(this, (ui16)comp_idx);
 1837|    247|      return p->next;
 1838|    247|    }
_ZNK4ojph5local9param_nlt23get_nonlinear_transformEjRhRbS2_:
 1956|  55.4k|    {
 1957|  55.4k|      assert(Cnlt == special_comp_num::ALL_COMPS);
 1958|  55.4k|      const param_nlt* p = get_nlt_object(comp_num);
 1959|  55.4k|      p = (p && p->enabled) ? p : this;
  ------------------
  |  Branch (1959:12): [True: 18, False: 55.4k]
  |  Branch (1959:17): [True: 18, False: 0]
  ------------------
 1960|  55.4k|      if (p->enabled)
  ------------------
  |  Branch (1960:11): [True: 19, False: 55.4k]
  ------------------
 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|  55.4k|      return false;
 1969|  55.4k|    }
_ZN4ojph5local9param_nlt4readEPNS_11infile_baseE:
 2001|  1.02k|    {
 2002|  1.02k|      ui8 buf[6];
 2003|       |
 2004|  1.02k|      if (file->read(buf, 6) != 6)
  ------------------
  |  Branch (2004:11): [True: 12, False: 1.00k]
  ------------------
 2005|     12|        OJPH_ERROR(0x00050141, "error reading NLT marker segment");
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2006|       |
 2007|  1.02k|      ui16 length = swap_byte(*(ui16*)buf);
 2008|  1.02k|      if (length != 6 || (buf[5] != 3 && buf[5] != 0)) // wrong length or type
  ------------------
  |  Branch (2008:11): [True: 37, False: 984]
  |  Branch (2008:27): [True: 735, False: 249]
  |  Branch (2008:42): [True: 11, False: 724]
  ------------------
 2009|     36|        OJPH_ERROR(0x00050142, "Unsupported NLT type %d\n", buf[5]);
  ------------------
  |  |  289|     36|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     36|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 36, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2010|       |
 2011|  1.02k|      ui16 comp = swap_byte(*(ui16*)(buf + 2));
 2012|  1.02k|      param_nlt* p = get_nlt_object(comp);
 2013|  1.02k|      if (p == NULL)
  ------------------
  |  Branch (2013:11): [True: 327, False: 694]
  ------------------
 2014|    327|        p = add_object(comp);
 2015|  1.02k|      p->enabled = true;
 2016|  1.02k|      p->Cnlt = comp;
 2017|  1.02k|      p->BDnlt = buf[4];
 2018|  1.02k|      p->Tnlt = buf[5];
 2019|  1.02k|    }
_ZN4ojph5local9param_nlt14get_nlt_objectEj:
 2023|    973|    {
 2024|       |      // cast object to constant
 2025|    973|      const param_nlt* const_p = const_cast<const param_nlt*>(this);
 2026|       |      // call using the constant object, then cast to non-const
 2027|    973|      return const_cast<param_nlt*>(const_p->get_nlt_object(comp_num));
 2028|    973|    }
_ZNK4ojph5local9param_nlt14get_nlt_objectEj:
 2032|  56.4k|    {
 2033|  56.4k|      const param_nlt* p = this;
 2034|   115k|      while (p && p->Cnlt != comp_num)
  ------------------
  |  Branch (2034:14): [True: 59.7k, False: 55.7k]
  |  Branch (2034:19): [True: 59.0k, False: 664]
  ------------------
 2035|  59.0k|        p = p->next;
 2036|  56.4k|      return p;
 2037|  56.4k|    }
_ZN4ojph5local9param_nlt10add_objectEj:
 2041|    327|    {
 2042|    327|      assert(comp_num != special_comp_num::ALL_COMPS);
 2043|    327|      assert(Cnlt == special_comp_num::ALL_COMPS);
 2044|    327|      param_nlt* p = this;
 2045|  1.04k|      while (p->next != NULL) {
  ------------------
  |  Branch (2045:14): [True: 721, False: 327]
  ------------------
 2046|    721|        assert(p->Cnlt != comp_num);
 2047|    721|        p = p->next;
 2048|    721|      }
 2049|    327|      if (avail)
  ------------------
  |  Branch (2049:11): [True: 0, False: 327]
  ------------------
 2050|      0|      {
 2051|      0|        p->next = avail;
 2052|      0|        avail = avail->next;
 2053|      0|        p->next->init();
 2054|      0|      }
 2055|    327|      else
 2056|    327|        p->next = new param_nlt;
 2057|    327|      p = p->next;
 2058|    327|      p->Cnlt = (ui16)comp_num;
 2059|    327|      return p;
 2060|    327|    }
_ZN4ojph5local9param_sot4readEPNS_11infile_baseEb:
 2142|  92.7k|    {
 2143|  92.7k|      if (resilient)
  ------------------
  |  Branch (2143:11): [True: 92.7k, False: 0]
  ------------------
 2144|  92.7k|      {
 2145|  92.7k|        if (file->read(&Lsot, 2) != 2)
  ------------------
  |  Branch (2145:13): [True: 87, False: 92.7k]
  ------------------
 2146|     87|        {
 2147|     87|          OJPH_INFO(0x00050091, "error reading SOT marker");
  ------------------
  |  |  285|     87|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     87|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 87, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2148|     87|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2149|     87|          return false;
 2150|     87|        }
 2151|  92.7k|        Lsot = swap_byte(Lsot);
 2152|  92.7k|        if (Lsot != 10)
  ------------------
  |  Branch (2152:13): [True: 11.7k, False: 80.9k]
  ------------------
 2153|  11.7k|        {
 2154|  11.7k|          OJPH_INFO(0x00050092, "error in SOT length");
  ------------------
  |  |  285|  11.7k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  11.7k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 11.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2155|  11.7k|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2156|  11.7k|          return false;
 2157|  11.7k|        }
 2158|  80.9k|        if (file->read(&Isot, 2) != 2)
  ------------------
  |  Branch (2158:13): [True: 18, False: 80.9k]
  ------------------
 2159|     18|        {
 2160|     18|          OJPH_INFO(0x00050093, "error reading tile index");
  ------------------
  |  |  285|     18|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     18|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 18, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2161|     18|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2162|     18|          return false;
 2163|     18|        }
 2164|  80.9k|        Isot = swap_byte(Isot);
 2165|  80.9k|        if (Isot == 0xFFFF)
  ------------------
  |  Branch (2165:13): [True: 559, False: 80.3k]
  ------------------
 2166|    559|        {
 2167|    559|          OJPH_INFO(0x00050094, "tile index in SOT marker cannot be 0xFFFF");
  ------------------
  |  |  285|    559|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|    559|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 559, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2168|    559|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2169|    559|          return false;
 2170|    559|        }
 2171|  80.3k|        if (file->read(&Psot, 4) != 4)
  ------------------
  |  Branch (2171:13): [True: 55, False: 80.2k]
  ------------------
 2172|     55|        {
 2173|     55|          OJPH_INFO(0x00050095, "error reading SOT marker");
  ------------------
  |  |  285|     55|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     55|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 55, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2174|     55|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2175|     55|          return false;
 2176|     55|        }
 2177|  80.2k|        Psot = swap_byte(Psot);
 2178|  80.2k|        if (file->read(&TPsot, 1) != 1)
  ------------------
  |  Branch (2178:13): [True: 13, False: 80.2k]
  ------------------
 2179|     13|        {
 2180|     13|          OJPH_INFO(0x00050096, "error reading SOT marker");
  ------------------
  |  |  285|     13|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     13|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2181|     13|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2182|     13|          return false;
 2183|     13|        }
 2184|  80.2k|        if (file->read(&TNsot, 1) != 1)
  ------------------
  |  Branch (2184:13): [True: 14, False: 80.2k]
  ------------------
 2185|     14|        {
 2186|     14|          OJPH_INFO(0x00050097, "error reading SOT marker");
  ------------------
  |  |  285|     14|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     14|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2187|     14|          Lsot = 0; Isot = 0; Psot = 0; TPsot = 0; TNsot = 0;
 2188|     14|          return false;
 2189|     14|        }
 2190|  80.2k|      }
 2191|      0|      else
 2192|      0|      {
 2193|      0|        if (file->read(&Lsot, 2) != 2)
  ------------------
  |  Branch (2193:13): [True: 0, False: 0]
  ------------------
 2194|      0|          OJPH_ERROR(0x00050091, "error reading SOT marker");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2195|      0|        Lsot = swap_byte(Lsot);
 2196|      0|        if (Lsot != 10)
  ------------------
  |  Branch (2196:13): [True: 0, False: 0]
  ------------------
 2197|      0|          OJPH_ERROR(0x00050092, "error in SOT length");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2198|      0|        if (file->read(&Isot, 2) != 2)
  ------------------
  |  Branch (2198:13): [True: 0, False: 0]
  ------------------
 2199|      0|          OJPH_ERROR(0x00050093, "error reading SOT tile index");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2200|      0|        Isot = swap_byte(Isot);
 2201|      0|        if (Isot == 0xFFFF)
  ------------------
  |  Branch (2201:13): [True: 0, False: 0]
  ------------------
 2202|      0|          OJPH_ERROR(0x00050094, "tile index in SOT marker cannot be 0xFFFF");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|      0|        if (file->read(&Psot, 4) != 4)
  ------------------
  |  Branch (2203:13): [True: 0, False: 0]
  ------------------
 2204|      0|          OJPH_ERROR(0x00050095, "error reading SOT marker");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2205|      0|        Psot = swap_byte(Psot);
 2206|      0|        if (file->read(&TPsot, 1) != 1)
  ------------------
  |  Branch (2206:13): [True: 0, False: 0]
  ------------------
 2207|      0|          OJPH_ERROR(0x00050096, "error reading SOT marker");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2208|      0|        if (file->read(&TNsot, 1) != 1)
  ------------------
  |  Branch (2208:13): [True: 0, False: 0]
  ------------------
 2209|      0|          OJPH_ERROR(0x00050097, "error reading SOT marker");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2210|      0|      }
 2211|  80.2k|      return true;
 2212|  92.7k|    }
_ZNK4ojph5local9param_dfs7get_dfsEi:
 2281|  31.5k|    {
 2282|  31.5k|      const param_dfs* p = this;
 2283|  55.8k|      while (p && p->Sdfs != index)
  ------------------
  |  Branch (2283:14): [True: 55.8k, False: 5]
  |  Branch (2283:19): [True: 24.2k, False: 31.5k]
  ------------------
 2284|  24.2k|        p = p->next;
 2285|  31.5k|      return p;
 2286|  31.5k|    }
_ZNK4ojph5local9param_dfs12get_dwt_typeEj:
 2290|  57.3k|    {
 2291|  57.3k|      decomp_level = ojph_min(decomp_level, Ids);
  ------------------
  |  |   76|  57.3k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 44.3k, False: 12.9k]
  |  |  ------------------
  ------------------
 2292|  57.3k|      ui32 d = decomp_level - 1;          // decomp_level starts from 1
 2293|  57.3k|      ui32 idx = d >> 2;                  // complete bytes
 2294|  57.3k|      ui32 bits = d & 0x3;                // bit within the bytes
 2295|  57.3k|      ui32 val = (Ddfs[idx] >> (6 - 2 * bits)) & 0x3;
 2296|  57.3k|      return (dfs_dwt_type)val;
 2297|  57.3k|    }
_ZNK4ojph5local9param_dfs15get_subband_idxEjjj:
 2302|  13.7k|    {
 2303|  13.7k|      assert((resolution == 0 && subband == 0) ||
 2304|  13.7k|              (resolution > 0 && subband > 0 && subband < 4));
 2305|       |
 2306|  13.7k|      ui32 ns[4] = { 0, 3, 1, 1 };
 2307|       |
 2308|  13.7k|      ui32 idx = 0;
 2309|  13.7k|      if (resolution > 0)
  ------------------
  |  Branch (2309:11): [True: 11.0k, False: 2.65k]
  ------------------
 2310|  11.0k|      {
 2311|  11.0k|        idx = 0;
 2312|  11.0k|        ui32 i = 1;
 2313|  31.1k|        for (; i < resolution; ++i)
  ------------------
  |  Branch (2313:16): [True: 20.0k, False: 11.0k]
  ------------------
 2314|  20.0k|          idx += ns[get_dwt_type(num_decompositions - i + 1)];
 2315|  11.0k|        dfs_dwt_type t = get_dwt_type(num_decompositions - i + 1);
 2316|  11.0k|        idx += subband;
 2317|  11.0k|        if (t == VERT_DWT && subband == 2)
  ------------------
  |  Branch (2317:13): [True: 4.62k, False: 6.46k]
  |  Branch (2317:30): [True: 4.62k, False: 0]
  ------------------
 2318|  4.62k|          --idx;
 2319|  11.0k|      }
 2320|       |
 2321|  13.7k|      return idx;
 2322|  13.7k|    }
_ZNK4ojph5local9param_dfs16get_res_downsampEj:
 2326|  2.37k|    {
 2327|  2.37k|      point factor(1, 1);
 2328|  2.37k|      ui32 decomp_level = 1;
 2329|  7.93k|      while (skipped_resolutions > 0)
  ------------------
  |  Branch (2329:14): [True: 5.55k, False: 2.37k]
  ------------------
 2330|  5.55k|      {
 2331|  5.55k|        param_dfs::dfs_dwt_type type = get_dwt_type(decomp_level);
 2332|  5.55k|        if (type == BIDIR_DWT)
  ------------------
  |  Branch (2332:13): [True: 716, False: 4.83k]
  ------------------
 2333|    716|        { factor.x *= 2; factor.y *= 2; }
 2334|  4.83k|        else if (type == HORZ_DWT)
  ------------------
  |  Branch (2334:18): [True: 1.13k, False: 3.70k]
  ------------------
 2335|  1.13k|          factor.x *= 2;
 2336|  3.70k|        else if (type == VERT_DWT)
  ------------------
  |  Branch (2336:18): [True: 1.73k, False: 1.97k]
  ------------------
 2337|  1.73k|          factor.y *= 2;
 2338|       |
 2339|  5.55k|        ++decomp_level;
 2340|  5.55k|        --skipped_resolutions;
 2341|  5.55k|      }
 2342|  2.37k|      return factor;
 2343|  2.37k|    }
_ZN4ojph5local9param_dfs4readEPNS_11infile_baseE:
 2347|  1.64M|    {
 2348|  1.64M|      if (Ldfs != 0) { // this param_dfs is used
  ------------------
  |  Branch (2348:11): [True: 821k, False: 822k]
  ------------------
 2349|   821k|        param_dfs* p = this;
 2350|  12.7G|        while (p->next != NULL)
  ------------------
  |  Branch (2350:16): [True: 12.7G, False: 821k]
  ------------------
 2351|  12.7G|          p = p->next;
 2352|   821k|        if (avail)
  ------------------
  |  Branch (2352:13): [True: 0, False: 821k]
  ------------------
 2353|      0|        {
 2354|      0|          p->next = avail;
 2355|      0|          avail = avail->next;
 2356|      0|          p->next->init();
 2357|      0|        }
 2358|   821k|        else
 2359|   821k|          p->next = new param_dfs;
 2360|   821k|        p = p->next;
 2361|   821k|        return p->read(file);
 2362|   821k|      }
 2363|       |
 2364|   822k|      if (file->read(&Ldfs, 2) != 2)
  ------------------
  |  Branch (2364:11): [True: 26, False: 822k]
  ------------------
 2365|     26|        OJPH_ERROR(0x000500D1, "error reading DFS-Ldfs parameter");
  ------------------
  |  |  289|     26|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     26|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 26, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2366|   822k|      Ldfs = swap_byte(Ldfs);
 2367|   822k|      if (file->read(&Sdfs, 2) != 2)
  ------------------
  |  Branch (2367:11): [True: 8, False: 822k]
  ------------------
 2368|      8|        OJPH_ERROR(0x000500D2, "error reading DFS-Sdfs parameter");
  ------------------
  |  |  289|      8|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      8|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2369|   822k|      Sdfs = swap_byte(Sdfs);
 2370|   822k|      if (Sdfs > 15)
  ------------------
  |  Branch (2370:11): [True: 68, False: 822k]
  ------------------
 2371|     68|        OJPH_ERROR(0x000500D3, "The DFS-Sdfs parameter is %d, which is "
  ------------------
  |  |  289|     68|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     68|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 68, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2372|   822k|          "larger than the permissible 15", Sdfs);
 2373|   822k|      ui8 t, l_Ids = 0;
 2374|   822k|      if (file->read(&l_Ids, 1) != 1)
  ------------------
  |  Branch (2374:11): [True: 19, False: 822k]
  ------------------
 2375|     19|        OJPH_ERROR(0x000500D4, "error reading DFS-Ids 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2376|   822k|      constexpr int max_Ddfs = sizeof(Ddfs) * 4;
 2377|   822k|      if (l_Ids > max_Ddfs)
  ------------------
  |  Branch (2377:11): [True: 3.02k, False: 819k]
  ------------------
 2378|  3.02k|        OJPH_INFO(0x000500D5, "The DFS-Ids parameter is %d; while this is "
  ------------------
  |  |  285|  3.02k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  3.02k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3.02k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2379|   822k|          "valid, the number is unnessarily large -- you do not need more "
 2380|   822k|          "than %d.  Please contact me regarding this issue.",
 2381|   822k|          l_Ids, max_Ddfs);
 2382|   822k|      Ids = l_Ids < max_Ddfs ? l_Ids : max_Ddfs;
  ------------------
  |  Branch (2382:13): [True: 818k, False: 3.52k]
  ------------------
 2383|   861k|      for (int i = 0; i < Ids; i += 4)
  ------------------
  |  Branch (2383:23): [True: 39.3k, False: 822k]
  ------------------
 2384|  39.3k|        if (file->read(&Ddfs[i / 4], 1) != 1)
  ------------------
  |  Branch (2384:13): [True: 17, False: 39.2k]
  ------------------
 2385|     17|          OJPH_ERROR(0x000500D6, "error reading DFS-Ddfs parameters");
  ------------------
  |  |  289|   822k|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     17|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 17, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2386|   887k|      for (int i = Ids; i < l_Ids; i += 4)
  ------------------
  |  Branch (2386:25): [True: 64.6k, False: 822k]
  ------------------
 2387|  64.6k|        if (file->read(&t, 1) != 1)
  ------------------
  |  Branch (2387:13): [True: 16, False: 64.6k]
  ------------------
 2388|     16|          OJPH_ERROR(0x000500D7, "error reading DFS-Ddfs parameters");
  ------------------
  |  |  289|   822k|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2389|   822k|      return true;
 2390|  1.64M|    }
_ZN4ojph5local9param_atk7get_atkEi:
 2402|  5.34k|    {
 2403|  5.34k|      assert(top_atk == NULL);
 2404|       |
 2405|  5.34k|      if (Latk == 0)
  ------------------
  |  Branch (2405:11): [True: 4.87k, False: 472]
  ------------------
 2406|  4.87k|      {
 2407|       |        // This atk object is not used, initialize it to either 0 (irv97)
 2408|       |        // or 1 (rev53), and use it.  If index is not 0 nor 1, then index
 2409|       |        // must have been read from file previously, otherwise it is an
 2410|       |        // error.
 2411|  4.87k|        if (index == 0) { this->init_irv97(); return this; }
  ------------------
  |  Branch (2411:13): [True: 873, False: 4.00k]
  ------------------
 2412|  4.00k|        else if (index == 1) { this->init_rev53(); return this; }
  ------------------
  |  Branch (2412:18): [True: 3.99k, False: 9]
  ------------------
 2413|  4.87k|      }
 2414|       |
 2415|    481|      param_atk* p = this;
 2416|    869|      while (p && p->get_index() != index)
  ------------------
  |  Branch (2416:14): [True: 676, False: 193]
  |  Branch (2416:19): [True: 388, False: 288]
  ------------------
 2417|    388|        p = p->next;
 2418|       |
 2419|    481|      if (p == NULL && (index == 0 || index == 1))
  ------------------
  |  Branch (2419:11): [True: 193, False: 288]
  |  Branch (2419:25): [True: 40, False: 153]
  |  Branch (2419:39): [True: 74, False: 79]
  ------------------
 2420|    114|      {
 2421|       |        // The index was not found, add an atk object only if the index is
 2422|       |        // either 0 or 1
 2423|    114|        p = add_object();
 2424|    114|        if (index == 0)
  ------------------
  |  Branch (2424:13): [True: 40, False: 74]
  ------------------
 2425|     40|          p->init_irv97();
 2426|     74|        else if (index == 1)
  ------------------
  |  Branch (2426:18): [True: 74, False: 0]
  ------------------
 2427|     74|          p->init_rev53();
 2428|    114|      }
 2429|       |
 2430|    481|      return p;
 2431|  5.34k|    }
_ZN4ojph5local9param_atk16read_coefficientEPNS_11infile_baseERfRi:
 2435|  1.54k|    {
 2436|  1.54k|      int coeff_type = get_coeff_type();
 2437|  1.54k|      if (coeff_type == 0) { // 8bit
  ------------------
  |  Branch (2437:11): [True: 227, False: 1.32k]
  ------------------
 2438|    227|        ui8 v;
 2439|    227|        if (file->read(&v, 1) != 1) return false;
  ------------------
  |  Branch (2439:13): [True: 1, False: 226]
  ------------------
 2440|    226|        bytes -= 1;
 2441|    226|        K = v;
 2442|    226|      }
 2443|  1.32k|      else if (coeff_type == 1) { // 16bit
  ------------------
  |  Branch (2443:16): [True: 120, False: 1.20k]
  ------------------
 2444|    120|        ui16 v;
 2445|    120|        if (file->read(&v, 2) != 2) return false;
  ------------------
  |  Branch (2445:13): [True: 3, False: 117]
  ------------------
 2446|    117|        bytes -= 2;
 2447|    117|        K = swap_byte(v);
 2448|    117|      }
 2449|  1.20k|      else if (coeff_type == 2) { // float
  ------------------
  |  Branch (2449:16): [True: 509, False: 693]
  ------------------
 2450|    509|        union {
 2451|    509|          float f;
 2452|    509|          ui32 i;
 2453|    509|        } v;
 2454|    509|        if (file->read(&v.i, 4) != 4) return false;
  ------------------
  |  Branch (2454:13): [True: 4, False: 505]
  ------------------
 2455|    505|        bytes -= 4;
 2456|    505|        v.i = swap_byte(v.i);
 2457|    505|        K = v.f;
 2458|    505|      }
 2459|    693|      else if (coeff_type == 3) { // double
  ------------------
  |  Branch (2459:16): [True: 225, False: 468]
  ------------------
 2460|    225|        union {
 2461|    225|          double d;
 2462|    225|          ui64 i;
 2463|    225|        } v;
 2464|    225|        if (file->read(&v.i, 8) != 8) return false;
  ------------------
  |  Branch (2464:13): [True: 6, False: 219]
  ------------------
 2465|    219|        bytes -= 8;
 2466|    219|        v.i = swap_byte(v.i);
 2467|    219|        K = (float)v.d;
 2468|    219|      }
 2469|    468|      else if (coeff_type == 4) { // 128 bit float
  ------------------
  |  Branch (2469:16): [True: 223, False: 245]
  ------------------
 2470|    223|        ui64 v, v1;
 2471|    223|        if (file->read(&v, 8) != 8) return false;
  ------------------
  |  Branch (2471:13): [True: 5, False: 218]
  ------------------
 2472|    218|        bytes -= 8;
 2473|    218|        if (file->read(&v1, 8) != 8) return false; // v1 not needed
  ------------------
  |  Branch (2473:13): [True: 7, False: 211]
  ------------------
 2474|    211|        bytes -= 8;
 2475|    211|        v = swap_byte(v);
 2476|       |
 2477|    211|        union {
 2478|    211|          float f;
 2479|    211|          ui32 i;
 2480|    211|        } 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|    211|        si32 e = (si32)((v >> 48) & 0x7FFF);   // exponent
 2485|    211|        e -= 16383;
 2486|    211|        e += 127;
 2487|    211|        e = e & 0xFF;                          // removes MSBs if negative
 2488|    211|        e <<= 23;                              // move bits to their location
 2489|    211|        s.i = 0;
 2490|    211|        s.i |= ((ui32)(v >> 32) & 0x80000000); // copy sign bit
 2491|    211|        s.i |= (ui32)e;                        // copy exponent
 2492|    211|        s.i |= (ui32)((v >> 25) & 0x007FFFFF); // copy 23 mantissa
 2493|    211|        K = s.f;
 2494|    211|      }
 2495|  1.52k|      return true;
 2496|  1.54k|    }
_ZN4ojph5local9param_atk16read_coefficientEPNS_11infile_baseERsRi:
 2501|    320|    {
 2502|    320|      int coeff_type = get_coeff_type();
 2503|    320|      if (coeff_type == 0) {
  ------------------
  |  Branch (2503:11): [True: 107, False: 213]
  ------------------
 2504|    107|        si8 v;
 2505|    107|        if (file->read(&v, 1) != 1) return false;
  ------------------
  |  Branch (2505:13): [True: 5, False: 102]
  ------------------
 2506|    102|        bytes -= 1;
 2507|    102|        K = v;
 2508|    102|      }
 2509|    213|      else if (coeff_type == 1) {
  ------------------
  |  Branch (2509:16): [True: 213, False: 0]
  ------------------
 2510|    213|        si16 v;
 2511|    213|        if (file->read(&v, 2) != 2) return false;
  ------------------
  |  Branch (2511:13): [True: 2, False: 211]
  ------------------
 2512|    211|        bytes -= 2;
 2513|    211|        K = (si16)swap_byte((ui16)v);
 2514|    211|      }
 2515|      0|      else
 2516|      0|        return false;
 2517|    313|      return true;
 2518|    320|    }
_ZN4ojph5local9param_atk4readEPNS_11infile_baseE:
 2522|    329|    {
 2523|    329|      if (Latk != 0) // this param_atk is used
  ------------------
  |  Branch (2523:11): [True: 80, False: 249]
  ------------------
 2524|     80|        return add_object()->read(file);
 2525|       |
 2526|    249|      if (file->read(&Latk, 2) != 2)
  ------------------
  |  Branch (2526:11): [True: 3, False: 246]
  ------------------
 2527|      3|        OJPH_ERROR(0x000500E1, "error reading ATK-Latk parameter");
  ------------------
  |  |  289|      3|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      3|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2528|    249|      Latk = swap_byte(Latk);
 2529|    249|      si32 bytes = Latk - 2;
 2530|    249|      ojph::ui16 temp_Satk;
 2531|    249|      if (file->read(&temp_Satk, 2) != 2)
  ------------------
  |  Branch (2531:11): [True: 3, False: 246]
  ------------------
 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|    249|      bytes -= 2;
 2534|    249|      temp_Satk = swap_byte(temp_Satk);
 2535|    249|      int tmp_idx = temp_Satk & 0xFF;
 2536|    249|      if ((top_atk && top_atk->get_atk(tmp_idx) != NULL)
  ------------------
  |  Branch (2536:12): [True: 78, False: 171]
  |  Branch (2536:23): [True: 10, False: 68]
  ------------------
 2537|    233|        || tmp_idx == 0 || tmp_idx == 1)
  ------------------
  |  Branch (2537:12): [True: 1, False: 232]
  |  Branch (2537:28): [True: 1, False: 231]
  ------------------
 2538|     12|        OJPH_ERROR(0x000500F3, "ATK-Satk parameter sets ATK marker index to "
  ------------------
  |  |  289|     12|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     12|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2539|    249|          "the illegal value of %d. ATK-Satk should be in (2-255) and, I "
 2540|    249|          "believe, must not be repeated; otherwise, it would be unclear "
 2541|    249|          "what marker segment must be employed when an index is repeated.",
 2542|    249|          tmp_idx);
 2543|    249|      Satk = temp_Satk;
 2544|    249|      if (is_m_init0() == false)  // only even-indexed is supported
  ------------------
  |  Branch (2544:11): [True: 5, False: 244]
  ------------------
 2545|      5|        OJPH_ERROR(0x000500E3, "ATK-Satk parameter sets m_init to 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2546|    249|          "requiring odd-indexed subsequence in first reconstruction step, "
 2547|    249|          "which is not supported yet.");
 2548|    249|      if (is_whole_sample() == false)  // ARB filter not supported
  ------------------
  |  Branch (2548:11): [True: 5, False: 244]
  ------------------
 2549|      5|        OJPH_ERROR(0x000500E4, "ATK-Satk parameter specified ARB filter, "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2550|    249|          "which is not supported yet.");
 2551|    249|      if (is_reversible() && get_coeff_type() >= 2) // reversible & float
  ------------------
  |  Branch (2551:11): [True: 70, False: 179]
  |  Branch (2551:30): [True: 2, False: 68]
  ------------------
 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|    249|          "It employs floats with reversible filtering.");
 2554|    249|      if (is_using_ws_extension() == false)  // only sym. ext is supported
  ------------------
  |  Branch (2554:11): [True: 1, False: 248]
  ------------------
 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|    249|          "boundary extension, which is not supported yet.");
 2557|    249|      if (is_reversible() == false)
  ------------------
  |  Branch (2557:11): [True: 150, False: 99]
  ------------------
 2558|    150|        if (read_coefficient(file, Katk, bytes) == false)
  ------------------
  |  Branch (2558:13): [True: 10, False: 140]
  ------------------
 2559|     10|          OJPH_ERROR(0x000500E7, "error reading ATK-Katk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2560|    249|      if (file->read(&Natk, 1) != 1)
  ------------------
  |  Branch (2560:11): [True: 5, False: 244]
  ------------------
 2561|      5|        OJPH_ERROR(0x000500E8, "error reading ATK-Natk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2562|    249|      bytes -= 1;
 2563|    249|      if (Natk > max_steps) {
  ------------------
  |  Branch (2563:11): [True: 85, False: 164]
  ------------------
 2564|     85|        if (d != d_store) // was this allocated -- very unlikely
  ------------------
  |  Branch (2564:13): [True: 0, False: 85]
  ------------------
 2565|      0|          delete[] d;
 2566|     85|        d = new lifting_step[Natk];
 2567|     85|        max_steps = Natk;
 2568|     85|      }
 2569|       |
 2570|    249|      if (is_reversible())
  ------------------
  |  Branch (2570:11): [True: 68, False: 181]
  ------------------
 2571|     68|      {
 2572|    419|        for (int s = 0; s < Natk; ++s)
  ------------------
  |  Branch (2572:25): [True: 351, False: 68]
  ------------------
 2573|    351|        {
 2574|    351|          if (file->read(&d[s].rev.Eatk, 1) != 1)
  ------------------
  |  Branch (2574:15): [True: 6, False: 345]
  ------------------
 2575|      6|            OJPH_ERROR(0x000500E9, "error reading ATK-Eatk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2576|    351|          bytes -= 1;
 2577|    351|          if (file->read(&d[s].rev.Batk, 2) != 2)
  ------------------
  |  Branch (2577:15): [True: 10, False: 341]
  ------------------
 2578|     10|            OJPH_ERROR(0x000500EA, "error reading ATK-Batk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2579|    351|          bytes -= 2;
 2580|    351|          d[s].rev.Batk = (si16)swap_byte((ui16)d[s].rev.Batk);
 2581|    351|          ui8 LCatk;
 2582|    351|          if (file->read(&LCatk, 1) != 1)
  ------------------
  |  Branch (2582:15): [True: 3, False: 348]
  ------------------
 2583|      3|            OJPH_ERROR(0x000500EB, "error reading ATK-LCatk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2584|    351|          bytes -= 1;
 2585|    351|          if (LCatk == 0)
  ------------------
  |  Branch (2585:15): [True: 2, False: 349]
  ------------------
 2586|      2|            OJPH_ERROR(0x000500EC, "Encountered a ATK-LCatk value of zero; "
  ------------------
  |  |  289|      2|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      2|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2587|    351|              "something is wrong.");
 2588|    351|          if (LCatk > 1)
  ------------------
  |  Branch (2588:15): [True: 10, False: 341]
  ------------------
 2589|     10|            OJPH_ERROR(0x000500ED, "ATK-LCatk value greater than 1; "
  ------------------
  |  |  289|     10|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     10|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2590|    351|              "that is, a multitap filter is not supported");
 2591|    351|          if (read_coefficient(file, d[s].rev.Aatk, bytes) == false)
  ------------------
  |  Branch (2591:15): [True: 7, False: 344]
  ------------------
 2592|      7|            OJPH_ERROR(0x000500EE, "Error reding ATK-Aatk parameter");
  ------------------
  |  |  289|      7|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      7|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2593|    351|        }
 2594|     68|      }
 2595|    181|      else
 2596|    181|      {
 2597|  1.61k|        for (int s = 0; s < Natk; ++s)
  ------------------
  |  Branch (2597:25): [True: 1.43k, False: 181]
  ------------------
 2598|  1.43k|        {
 2599|  1.43k|          ui8 LCatk;
 2600|  1.43k|          if (file->read(&LCatk, 1) != 1)
  ------------------
  |  Branch (2600:15): [True: 15, False: 1.42k]
  ------------------
 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.43k|          bytes -= 1;
 2603|  1.43k|          if (LCatk == 0)
  ------------------
  |  Branch (2603:15): [True: 6, False: 1.43k]
  ------------------
 2604|      6|            OJPH_ERROR(0x000500F0, "Encountered a ATK-LCatk value of zero; "
  ------------------
  |  |  289|      6|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      6|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2605|  1.43k|              "something is wrong.");
 2606|  1.43k|          if (LCatk > 1)
  ------------------
  |  Branch (2606:15): [True: 16, False: 1.42k]
  ------------------
 2607|     16|            OJPH_ERROR(0x000500F1, "ATK-LCatk value greater than 1; "
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2608|  1.43k|              "that is, a multitap filter is not supported.");
 2609|  1.43k|          if (read_coefficient(file, d[s].irv.Aatk, bytes) == false)
  ------------------
  |  Branch (2609:15): [True: 16, False: 1.42k]
  ------------------
 2610|     16|            OJPH_ERROR(0x000500F2, "Error reding ATK-Aatk parameter");
  ------------------
  |  |  289|     16|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     16|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2611|  1.43k|        }
 2612|    181|      }
 2613|    249|      if (bytes != 0)
  ------------------
  |  Branch (2613:11): [True: 20, False: 229]
  ------------------
 2614|     20|        OJPH_ERROR(0x000500F3, "The length of an ATK marker segment "
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2615|    249|          "(ATK-Latk) is not correct");
 2616|       |
 2617|    249|      return true;
 2618|    329|    }
_ZN4ojph5local9param_atk10init_irv97Ev:
 2622|    913|    {
 2623|    913|      Satk = 0x4a00;     // illegal because ATK = 0
 2624|    913|      Katk = (float)1.230174104914001;
 2625|    913|      Natk = 4;
 2626|       |      // next is (A-4) in T.801 second line
 2627|    913|      Latk = (ui16)(5 + Natk + sizeof(float) * (1 + Natk));
 2628|    913|      d[0].irv.Aatk = (float)0.443506852043971;
 2629|    913|      d[1].irv.Aatk = (float)0.882911075530934;
 2630|    913|      d[2].irv.Aatk = (float)-0.052980118572961;
 2631|    913|      d[3].irv.Aatk = (float)-1.586134342059924;
 2632|    913|    }
_ZN4ojph5local9param_atk10init_rev53Ev:
 2636|  4.06k|    {
 2637|  4.06k|      Satk = 0x5801;     // illegal because ATK = 1
 2638|  4.06k|      Natk = 2;
 2639|       |      // next is (A-4) in T.801 fourth line
 2640|  4.06k|      Latk = (ui16)(5 + 2 * Natk + sizeof(ui8) * (Natk + Natk));
 2641|  4.06k|      d[0].rev.Aatk = 1;
 2642|  4.06k|      d[0].rev.Batk = 2;
 2643|  4.06k|      d[0].rev.Eatk = 2;
 2644|  4.06k|      d[1].rev.Aatk = -1;
 2645|  4.06k|      d[1].rev.Batk = 1;
 2646|  4.06k|      d[1].rev.Eatk = 1;
 2647|  4.06k|    }
_ZN4ojph5local9param_atk10add_objectEv:
 2651|    194|    {
 2652|    194|      assert(top_atk = NULL);
 2653|    194|      param_atk *p = this;
 2654|    328|      while (p->next != NULL)
  ------------------
  |  Branch (2654:14): [True: 134, False: 194]
  ------------------
 2655|    134|        p = p->next;
 2656|    194|      if (avail)
  ------------------
  |  Branch (2656:11): [True: 0, False: 194]
  ------------------
 2657|      0|      {
 2658|      0|        p->next = avail;
 2659|      0|        avail = avail->next;
 2660|      0|      }
 2661|    194|      else
 2662|    194|        p->next = new param_atk;
 2663|    194|      p = p->next;
 2664|    194|      p->init(this);
 2665|    194|      return p;
 2666|    194|    }
ojph_params.cpp:_ZN4ojph5localL9swap_byteEt:
  491|  2.13M|    {
  492|  2.13M|      return (ui16)((t << 8) | (t >> 8));
  493|  2.13M|    }
ojph_params.cpp:_ZN4ojph5localL9swap_byteEj:
  498|   132k|    {
  499|   132k|      ui32 u = swap_byte((ui16)(t & 0xFFFFu));
  500|   132k|      u <<= 16;
  501|   132k|      u |= swap_byte((ui16)(t >> 16));
  502|   132k|      return u;
  503|   132k|    }
ojph_params.cpp:_ZN4ojph5localL9swap_byteEm:
  508|    430|    {
  509|    430|      ui64 u = swap_byte((ui32)(t & 0xFFFFFFFFu));
  510|    430|      u <<= 32;
  511|    430|      u |= swap_byte((ui32)(t >> 32));
  512|    430|      return u;
  513|    430|    }

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

_ZN4ojph5local8precinct5parseEiPjPNS_21mem_elastic_allocatorERjPNS_11infile_baseEb:
  332|   536k|    {
  333|   536k|      assert(data_left > 0);
  334|   536k|      bit_read_buf bb;
  335|   536k|      bb_init(&bb, data_left, file);
  336|   536k|      if (may_use_sop)
  ------------------
  |  Branch (336:11): [True: 30.5k, False: 506k]
  ------------------
  337|  30.5k|        bb_skip_sop(&bb);
  338|       |
  339|   536k|      bool empty_packet = true;
  340|  1.46M|      for (int s = 0; s < 4; ++s)
  ------------------
  |  Branch (340:23): [True: 1.34M, False: 120k]
  ------------------
  341|  1.34M|      {
  342|  1.34M|        if (bands[s].empty)
  ------------------
  |  Branch (342:13): [True: 610k, False: 732k]
  ------------------
  343|   610k|          continue;
  344|       |
  345|   732k|        if (cb_idxs[s].siz.w == 0 || cb_idxs[s].siz.h == 0)
  ------------------
  |  Branch (345:13): [True: 4.96k, False: 727k]
  |  Branch (345:38): [True: 18.9k, False: 708k]
  ------------------
  346|  23.9k|          continue;
  347|       |
  348|   708k|        if (empty_packet) //one bit to check if the packet is empty
  ------------------
  |  Branch (348:13): [True: 534k, False: 173k]
  ------------------
  349|   534k|        {
  350|   534k|          ui32 bit;
  351|   534k|          bb_read_bit(&bb, bit);
  352|   534k|          if (bit == 0) //empty packet
  ------------------
  |  Branch (352:15): [True: 390k, False: 143k]
  ------------------
  353|   390k|          { bb_terminate(&bb, uses_eph); data_left = bb.bytes_left; return; }
  354|   143k|          empty_packet = false;
  355|   143k|        }
  356|       |
  357|   317k|        ui32 num_levels = 1 +
  358|   317k|          ojph_max(log2ceil(cb_idxs[s].siz.w), log2ceil(cb_idxs[s].siz.h));
  ------------------
  |  |   73|   317k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 3.79k, False: 313k]
  |  |  ------------------
  ------------------
  359|       |
  360|       |        //create quad trees for inclusion and missing msbs
  361|   317k|        tag_tree inc_tag, inc_tag_flags, mmsb_tag, mmsb_tag_flags;
  362|   317k|        inc_tag.init(scratch, lev_idx, num_levels, cb_idxs[s].siz, 0);
  363|   317k|        *inc_tag.get(0, 0, num_levels) = 0;
  364|   317k|        inc_tag_flags.init(scratch + tag_tree_size, lev_idx, num_levels,
  365|   317k|          cb_idxs[s].siz, 0);
  366|   317k|        *inc_tag_flags.get(0, 0, num_levels) = 0;
  367|   317k|        mmsb_tag.init(scratch + (tag_tree_size<<1), lev_idx, num_levels,
  368|   317k|          cb_idxs[s].siz, 0);
  369|   317k|        *mmsb_tag.get(0, 0, num_levels) = 0;
  370|   317k|        mmsb_tag_flags.init(scratch + (tag_tree_size<<1) + tag_tree_size,
  371|   317k|          lev_idx, num_levels, cb_idxs[s].siz, 0);
  372|   317k|        *mmsb_tag_flags.get(0, 0, num_levels) = 0;
  373|       |
  374|       |        //
  375|   317k|        ui32 band_width = bands[s].num_blocks.w;
  376|   317k|        ui32 width = cb_idxs[s].siz.w;
  377|   317k|        ui32 height = cb_idxs[s].siz.h;
  378|   600k|        for (ui32 y = 0; y < height; ++y)
  ------------------
  |  Branch (378:26): [True: 307k, False: 292k]
  ------------------
  379|   307k|        {
  380|   307k|          coded_cb_header *cp = bands[s].coded_cbs;
  381|   307k|          cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
  382|   605k|          for (ui32 x = 0; x < width; ++x, ++cp)
  ------------------
  |  Branch (382:28): [True: 323k, False: 282k]
  ------------------
  383|   323k|          {
  384|       |            //process inclusion
  385|   323k|            bool empty_cb = false;
  386|   497k|            for (ui32 cl = num_levels; cl > 0; --cl)
  ------------------
  |  Branch (386:40): [True: 348k, False: 149k]
  ------------------
  387|   348k|            {
  388|   348k|              ui32 cur_lev = cl - 1;
  389|   348k|              empty_cb = *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) == 1;
  390|   348k|              if (empty_cb)
  ------------------
  |  Branch (390:19): [True: 13.1k, False: 334k]
  ------------------
  391|  13.1k|                break;
  392|       |              //check received
  393|   334k|              if (*inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
  ------------------
  |  Branch (393:19): [True: 317k, False: 17.2k]
  ------------------
  394|   317k|              {
  395|   317k|                ui32 bit;
  396|   317k|                if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (396:21): [True: 115, False: 317k]
  ------------------
  397|    115|                { data_left = 0; throw "error reading from file p1"; }
  398|   317k|                empty_cb = (bit == 0);
  399|   317k|                *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)(1 - bit);
  400|   317k|                *inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
  401|   317k|              }
  402|   334k|              if (empty_cb)
  ------------------
  |  Branch (402:19): [True: 160k, False: 174k]
  ------------------
  403|   160k|                break;
  404|   334k|            }
  405|       |
  406|   322k|            if (empty_cb)
  ------------------
  |  Branch (406:17): [True: 173k, False: 149k]
  ------------------
  407|   173k|              continue;
  408|       |
  409|       |            //process missing msbs
  410|   149k|            ui32 mmsbs = 0;
  411|   305k|            for (ui32 levp1 = num_levels; levp1 > 0; --levp1)
  ------------------
  |  Branch (411:43): [True: 156k, False: 149k]
  ------------------
  412|   156k|            {
  413|   156k|              ui32 cur_lev = levp1 - 1;
  414|   156k|              mmsbs = *mmsb_tag.get(x>>levp1, y>>levp1, levp1);
  415|       |              //check received
  416|   156k|              if (*mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
  ------------------
  |  Branch (416:19): [True: 155k, False: 1.61k]
  ------------------
  417|   155k|              {
  418|   155k|                ui32 bit = 0;
  419|   459k|                while (bit == 0)
  ------------------
  |  Branch (419:24): [True: 304k, False: 154k]
  ------------------
  420|   304k|                {
  421|   304k|                  if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (421:23): [True: 514, False: 303k]
  ------------------
  422|    514|                  { data_left = 0; throw "error reading from file p2"; }
  423|   303k|                  mmsbs += 1 - bit;
  424|   303k|                }
  425|   154k|                *mmsb_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)mmsbs;
  426|   154k|                *mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
  427|   154k|              }
  428|   156k|            }
  429|       |
  430|   149k|            if (mmsbs > cp->Kmax)
  ------------------
  |  Branch (430:17): [True: 3.61k, False: 145k]
  ------------------
  431|  3.61k|              throw "error in parsing a tile header; "
  432|  3.61k|              "missing msbs are larger or equal to Kmax. The most likely "
  433|  3.61k|              "cause is a corruption in the bitstream.";
  434|   145k|            cp->missing_msbs = mmsbs;
  435|       |
  436|       |            //get number of passes
  437|   145k|            ui32 bit, num_passes = 1;
  438|   145k|            if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (438:17): [True: 399, False: 145k]
  ------------------
  439|    399|            { data_left = 0; throw "error reading from file p3"; }
  440|   145k|            if (bit)
  ------------------
  |  Branch (440:17): [True: 125k, False: 19.8k]
  ------------------
  441|   125k|            {
  442|   125k|              num_passes = 2;
  443|   125k|              if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (443:19): [True: 246, False: 124k]
  ------------------
  444|    246|              { data_left = 0; throw "error reading from file p4"; }
  445|   124k|              if (bit)
  ------------------
  |  Branch (445:19): [True: 97.8k, False: 27.1k]
  ------------------
  446|  97.8k|              {
  447|  97.8k|                if (bb_read_bits(&bb, 2, bit) == false)
  ------------------
  |  Branch (447:21): [True: 328, False: 97.5k]
  ------------------
  448|    328|                { data_left = 0; throw "error reading from file p5";  }
  449|  97.5k|                num_passes = 3 + bit;
  450|  97.5k|                if (bit == 3)
  ------------------
  |  Branch (450:21): [True: 79.9k, False: 17.5k]
  ------------------
  451|  79.9k|                {
  452|  79.9k|                  if (bb_read_bits(&bb, 5, bit) == false)
  ------------------
  |  Branch (452:23): [True: 407, False: 79.5k]
  ------------------
  453|    407|                  { data_left = 0; throw "error reading from file p6"; }
  454|  79.5k|                  num_passes = 6 + bit;
  455|  79.5k|                  if (bit == 31)
  ------------------
  |  Branch (455:23): [True: 15.3k, False: 64.1k]
  ------------------
  456|  15.3k|                  {
  457|  15.3k|                    if (bb_read_bits(&bb, 7, bit) == false)
  ------------------
  |  Branch (457:25): [True: 68, False: 15.3k]
  ------------------
  458|     68|                    { data_left = 0; throw "error reading from file p7"; }
  459|  15.3k|                    num_passes = 37 + bit;
  460|  15.3k|                  }
  461|  79.5k|                }
  462|  97.5k|              }
  463|   124k|            }
  464|   143k|            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|   143k|            ui32 num_phld_passes = (num_passes - 1) / 3;
  476|   143k|            cp->missing_msbs += num_phld_passes;
  477|       |
  478|   143k|            num_phld_passes *= 3;
  479|   143k|            cp->num_passes = num_passes - num_phld_passes;
  480|   143k|            cp->pass_length[0] = cp->pass_length[1] = 0;
  481|       |
  482|   143k|            int Lblock = 3;
  483|   143k|            bit = 1;
  484|  1.37M|            while (bit)
  ------------------
  |  Branch (484:20): [True: 1.23M, False: 143k]
  ------------------
  485|  1.23M|            {
  486|       |              // add any extra bits here
  487|  1.23M|              if (bb_read_bit(&bb, bit) == false)
  ------------------
  |  Branch (487:19): [True: 300, False: 1.23M]
  ------------------
  488|    300|              { data_left = 0; throw "error reading from file p8"; }
  489|  1.23M|              Lblock += bit;
  490|  1.23M|            }
  491|       |
  492|   143k|            int bits = Lblock + 31 -
  493|   143k|              (int)count_leading_zeros(num_phld_passes + 1);
  494|   143k|            if (bb_read_bits(&bb, bits, bit) == false)
  ------------------
  |  Branch (494:17): [True: 314, False: 143k]
  ------------------
  495|    314|            { data_left = 0; throw "error reading from file p9"; }
  496|   143k|            if (bit < 2)
  ------------------
  |  Branch (496:17): [True: 12.0k, False: 131k]
  ------------------
  497|  12.0k|              throw "The cleanup segment of an HT codeblock cannot contain "
  498|  12.0k|                "less than 2 bytes";
  499|   131k|            if (bit >= 65535)
  ------------------
  |  Branch (499:17): [True: 5.65k, False: 125k]
  ------------------
  500|  5.65k|              throw "The cleanup segment of an HT codeblock must contain "
  501|  5.65k|                "less than 65535 bytes";
  502|   125k|            cp->pass_length[0] = bit;
  503|       |
  504|   125k|            if (cp->num_passes > 1)
  ------------------
  |  Branch (504:17): [True: 96.1k, False: 29.5k]
  ------------------
  505|  96.1k|            {
  506|       |              //bits = Lblock + 31 - count_leading_zeros(cp->num_passes - 1);
  507|       |              // The following is simpler than the above, I think?
  508|  96.1k|              bits = Lblock + (cp->num_passes > 2 ? 1 : 0);
  ------------------
  |  Branch (508:32): [True: 51.6k, False: 44.4k]
  ------------------
  509|  96.1k|              if (bb_read_bits(&bb, bits, bit) == false)
  ------------------
  |  Branch (509:19): [True: 285, False: 95.8k]
  ------------------
  510|    285|              { data_left = 0; throw "error reading from file p10"; }
  511|  95.8k|              if (bit >= 2047)
  ------------------
  |  Branch (511:19): [True: 596, False: 95.2k]
  ------------------
  512|    596|                throw "The refinement segment (SigProp and MagRep passes) of "
  513|    596|                  "an HT codeblock must contain less than 2047 bytes";
  514|  95.2k|              cp->pass_length[1] = bit;
  515|  95.2k|            }
  516|   125k|          }
  517|   307k|        }
  518|   317k|      }
  519|   120k|      if (empty_packet)
  ------------------
  |  Branch (519:11): [True: 636, False: 120k]
  ------------------
  520|    636|      { // all subbands are empty
  521|    636|        ui32 bit = 0;
  522|    636|        bb_read_bit(&bb, bit);
  523|       |        //assert(bit == 0);
  524|    636|      }
  525|   120k|      bb_terminate(&bb, uses_eph);
  526|       |      //read codeblock data
  527|   530k|      for (int s = 0; s < 4; ++s)
  ------------------
  |  Branch (527:23): [True: 410k, False: 120k]
  ------------------
  528|   410k|      {
  529|   410k|        if (bands[s].empty)
  ------------------
  |  Branch (529:13): [True: 140k, False: 269k]
  ------------------
  530|   140k|          continue;
  531|       |
  532|   269k|        ui32 band_width = bands[s].num_blocks.w;
  533|   269k|        ui32 width = cb_idxs[s].siz.w;
  534|   269k|        ui32 height = cb_idxs[s].siz.h;
  535|   536k|        for (ui32 y = 0; y < height; ++y)
  ------------------
  |  Branch (535:26): [True: 266k, False: 269k]
  ------------------
  536|   266k|        {
  537|   266k|          coded_cb_header *cp = bands[s].coded_cbs;
  538|   266k|          cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
  539|   541k|          for (ui32 x = 0; x < width; ++x, ++cp)
  ------------------
  |  Branch (539:28): [True: 275k, False: 266k]
  ------------------
  540|   275k|          {
  541|   275k|            ui32 num_bytes = cp->pass_length[0] + cp->pass_length[1];
  542|   275k|            if (data_left)
  ------------------
  |  Branch (542:17): [True: 259k, False: 16.0k]
  ------------------
  543|   259k|            {
  544|   259k|              if (num_bytes)
  ------------------
  |  Branch (544:19): [True: 111k, False: 148k]
  ------------------
  545|   111k|              {
  546|   111k|                if (skipped)
  ------------------
  |  Branch (546:21): [True: 7.28k, False: 103k]
  ------------------
  547|  7.28k|                { //no need to read
  548|  7.28k|                  si64 cur_loc = file->tell();
  549|  7.28k|                  ui32 t = ojph_min(num_bytes, bb.bytes_left);
  ------------------
  |  |   76|  7.28k|#define ojph_min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (76:25): [True: 6.82k, False: 454]
  |  |  ------------------
  ------------------
  550|  7.28k|                  file->seek(t, infile_base::OJPH_SEEK_CUR);
  551|  7.28k|                  ui32 bytes_read = (ui32)(file->tell() - cur_loc);
  552|  7.28k|                  cp->pass_length[0] = cp->pass_length[1] = 0;
  553|  7.28k|                  bb.bytes_left -= bytes_read;
  554|  7.28k|                  assert(bytes_read == t || bb.bytes_left == 0);
  555|  7.28k|                }
  556|   103k|                else
  557|   103k|                {
  558|   103k|                  if (!bb_read_chunk(&bb, num_bytes, cp->next_coded, elastic))
  ------------------
  |  Branch (558:23): [True: 11.5k, False: 92.3k]
  ------------------
  559|  11.5k|                  {
  560|       |                    //no need to decode a broken codeblock
  561|  11.5k|                    cp->pass_length[0] = cp->pass_length[1] = 0;
  562|  11.5k|                    data_left = 0;
  563|  11.5k|                  }
  564|   103k|                }
  565|   111k|              }
  566|   259k|            }
  567|  16.0k|            else
  568|  16.0k|              cp->pass_length[0] = cp->pass_length[1] = 0;
  569|   275k|          }
  570|   266k|        }
  571|   269k|      }
  572|   120k|      data_left = bb.bytes_left;
  573|   120k|    }
ojph_precinct.cpp:_ZN4ojph5localL8log2ceilEj:
   88|   916k|    {
   89|   916k|      ui32 t = 31 - count_leading_zeros(x);
   90|   916k|      return t + (x & (x - 1) ? 1 : 0);
  ------------------
  |  Branch (90:19): [True: 1.35k, False: 914k]
  ------------------
   91|   916k|    }
_ZN4ojph5local8tag_tree4initEPhPjjNS_4sizeEi:
   61|  1.22M|      {
   62|  3.71M|        for (ui32 i = 0; i <= num_levels; ++i) //on extra level
  ------------------
  |  Branch (62:26): [True: 2.49M, False: 1.22M]
  ------------------
   63|  2.49M|          levs[i] = buf + lev_idx[i];
   64|  18.2M|        for (ui32 i = num_levels + 1; i < 16; ++i)
  ------------------
  |  Branch (64:39): [True: 17.0M, False: 1.22M]
  ------------------
   65|  17.0M|          levs[i] = (ui8*)INT_MAX; //make it crash on error
   66|  1.22M|        width = s.w;
   67|  1.22M|        height = s.h;
   68|  2.49M|        for (ui32 i = 0; i < num_levels; ++i)
  ------------------
  |  Branch (68:26): [True: 1.26M, False: 1.22M]
  ------------------
   69|  1.26M|        {
   70|  1.26M|          ui32 size = 1u << ((num_levels - 1 - i) << 1);
   71|  1.26M|          memset(levs[i], init_val, size);
   72|  1.26M|        }
   73|  1.22M|        *levs[num_levels] = 0;
   74|  1.22M|        this->num_levels = num_levels;
   75|  1.22M|      }
_ZN4ojph5local8tag_tree3getEjjj:
   78|  3.16M|      {
   79|  3.16M|        return levs[lev] + (x + y * ((width + (1 << lev) - 1) >> lev));
   80|  3.16M|      }

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

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

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

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

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

_ZN4ojph5local4tile9pre_allocEPNS0_10codestreamERKNS_4rectES6_Rj:
   58|  74.6k|    {
   59|  74.6k|      mem_fixed_allocator* allocator = codestream->get_allocator();
   60|       |
   61|       |      //allocate tiles_comp
   62|  74.6k|      const param_siz *szp = codestream->get_siz();
   63|  74.6k|      ui32 num_comps = szp->get_num_components();
   64|  74.6k|      allocator->pre_alloc_obj<tile_comp>(num_comps);
   65|  74.6k|      allocator->pre_alloc_obj<rect>(num_comps); //for comp_rects
   66|  74.6k|      allocator->pre_alloc_obj<rect>(num_comps); //for recon_comp_rects
   67|  74.6k|      allocator->pre_alloc_obj<ui32>(num_comps); //for line_offsets
   68|  74.6k|      allocator->pre_alloc_obj<ui32>(num_comps); //for num_bits
   69|  74.6k|      allocator->pre_alloc_obj<bool>(num_comps); //for is_signed
   70|  74.6k|      allocator->pre_alloc_obj<bool>(num_comps); //for reversible
   71|  74.6k|      allocator->pre_alloc_obj<ui8>(num_comps);  //for nlt_type3
   72|  74.6k|      allocator->pre_alloc_obj<ui32>(num_comps); //for cur_line
   73|       |
   74|  74.6k|      {
   75|  74.6k|        ui32 tilepart_div = codestream->get_tilepart_div();
   76|  74.6k|        ui32 t = tilepart_div & OJPH_TILEPART_MASK;
   77|  74.6k|        if (t == OJPH_TILEPART_NO_DIVISIONS)
  ------------------
  |  Branch (77:13): [True: 74.6k, False: 0]
  ------------------
   78|  74.6k|          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|  74.6k|        if (num_tileparts > 255)
  ------------------
  |  Branch (98:13): [True: 0, False: 74.6k]
  ------------------
   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|  74.6k|            "cannot have more than 255 tile parts.", num_tileparts);
  101|  74.6k|      }
  102|       |
  103|  74.6k|      ui32 tx0 = tile_rect.org.x;
  104|  74.6k|      ui32 ty0 = tile_rect.org.y;
  105|  74.6k|      ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
  106|  74.6k|      ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
  107|  74.6k|      ui32 recon_tx0 = recon_tile_rect.org.x;
  108|  74.6k|      ui32 recon_ty0 = recon_tile_rect.org.y;
  109|  74.6k|      ui32 recon_tx1 = recon_tile_rect.org.x + recon_tile_rect.siz.w;
  110|  74.6k|      ui32 recon_ty1 = recon_tile_rect.org.y + recon_tile_rect.siz.h;
  111|       |
  112|  74.6k|      ui32 width = 0;
  113|   132k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (113:24): [True: 58.1k, False: 74.6k]
  ------------------
  114|  58.1k|      {
  115|  58.1k|        point downsamp = szp->get_downsampling(i);
  116|       |
  117|  58.1k|        ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
  ------------------
  |  |   70|  58.1k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  118|  58.1k|        ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
  ------------------
  |  |   70|  58.1k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  119|  58.1k|        ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
  ------------------
  |  |   70|  58.1k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  120|  58.1k|        ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
  ------------------
  |  |   70|  58.1k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  121|  58.1k|        ui32 recon_tcx0 = ojph_div_ceil(recon_tx0, downsamp.x);
  ------------------
  |  |   70|  58.1k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  122|  58.1k|        ui32 recon_tcy0 = ojph_div_ceil(recon_ty0, downsamp.y);
  ------------------
  |  |   70|  58.1k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  123|  58.1k|        ui32 recon_tcx1 = ojph_div_ceil(recon_tx1, downsamp.x);
  ------------------
  |  |   70|  58.1k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  124|  58.1k|        ui32 recon_tcy1 = ojph_div_ceil(recon_ty1, downsamp.y);
  ------------------
  |  |   70|  58.1k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  125|       |
  126|  58.1k|        rect comp_rect;
  127|  58.1k|        comp_rect.org.x = tcx0;
  128|  58.1k|        comp_rect.org.y = tcy0;
  129|  58.1k|        comp_rect.siz.w = tcx1 - tcx0;
  130|  58.1k|        comp_rect.siz.h = tcy1 - tcy0;
  131|       |
  132|  58.1k|        rect recon_comp_rect;
  133|  58.1k|        recon_comp_rect.org.x = recon_tcx0;
  134|  58.1k|        recon_comp_rect.org.y = recon_tcy0;
  135|  58.1k|        recon_comp_rect.siz.w = recon_tcx1 - recon_tcx0;
  136|  58.1k|        recon_comp_rect.siz.h = recon_tcy1 - recon_tcy0;
  137|       |
  138|  58.1k|        tile_comp::pre_alloc(codestream, i, comp_rect, recon_comp_rect);
  139|  58.1k|        width = ojph_max(width, recon_comp_rect.siz.w);
  ------------------
  |  |   73|  58.1k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 3.64k, False: 54.5k]
  |  |  ------------------
  ------------------
  140|  58.1k|      }
  141|       |
  142|       |      //allocate lines
  143|  74.6k|      const param_cod* cdp = codestream->get_cod();
  144|  74.6k|      if (cdp->is_employing_color_transform())
  ------------------
  |  Branch (144:11): [True: 3.87k, False: 70.7k]
  ------------------
  145|  3.87k|      {
  146|  3.87k|        bool reversible[3];
  147|  15.5k|        for (ui32 i = 0; i < 3; ++i)
  ------------------
  |  Branch (147:26): [True: 11.6k, False: 3.87k]
  ------------------
  148|  11.6k|          reversible[i] = codestream->get_coc(i)->is_reversible();
  149|  3.87k|        if (reversible[0] != reversible[1] || reversible[1] != reversible[2])
  ------------------
  |  Branch (149:13): [True: 17, False: 3.86k]
  |  Branch (149:47): [True: 0, False: 3.86k]
  ------------------
  150|     17|          OJPH_ERROR(0x000300A2, "When the colour transform is employed. "
  ------------------
  |  |  289|    102|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|     17|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 17, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (289:52): [True: 14, False: 3]
  |  |  |  Branch (289:52): [True: 3, False: 14]
  |  |  |  Branch (289:52): [True: 3, False: 14]
  |  |  ------------------
  ------------------
  151|  3.87k|            "all colour components must undergo either reversible or "
  152|  3.87k|            "irreversible wavelet transform; if not, then it is not clear "
  153|  3.87k|            "what colour transform should be used (reversible or "
  154|  3.87k|            "irreversible).  Here we found that the first three colour "
  155|  3.87k|            "components uses %s, %s, and %s transforms, respectively.",
  156|  3.87k|            reversible[0] ? "reversible" : "irreversible",
  157|  3.87k|            reversible[1] ? "reversible" : "irreversible",
  158|  3.87k|            reversible[2] ? "reversible" : "irreversible");
  159|       |
  160|  3.87k|        allocator->pre_alloc_obj<line_buf>(3);
  161|  3.87k|        if (reversible[0])
  ------------------
  |  Branch (161:13): [True: 573, False: 3.30k]
  ------------------
  162|  2.29k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (162:27): [True: 1.71k, False: 573]
  ------------------
  163|  1.71k|            allocator->pre_alloc_data<si32>(width, 0);
  164|  3.30k|        else
  165|  13.1k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (165:27): [True: 9.86k, False: 3.30k]
  ------------------
  166|  9.86k|            allocator->pre_alloc_data<float>(width, 0);
  167|  3.87k|      }
  168|  74.6k|    }
_ZN4ojph5local4tile14finalize_allocEPNS0_10codestreamERKNS_4rectEjRjS7_:
  174|  73.5k|    {
  175|       |      //this->parent = codestream;
  176|  73.5k|      mem_fixed_allocator* allocator = codestream->get_allocator();
  177|       |
  178|  73.5k|      sot.init(0, (ui16)tile_idx, 0, 1);
  179|  73.5k|      prog_order = codestream->access_cod().get_progression_order();
  180|       |
  181|       |      //allocate tiles_comp
  182|  73.5k|      const param_siz *szp = codestream->get_siz();
  183|  73.5k|      const param_nlt *nlp = codestream->get_nlt();
  184|       |
  185|  73.5k|      this->num_bytes = 0;
  186|  73.5k|      num_comps = szp->get_num_components();
  187|  73.5k|      skipped_res_for_read = codestream->get_skipped_res_for_read();
  188|  73.5k|      comps = allocator->post_alloc_obj<tile_comp>(num_comps);
  189|  73.5k|      comp_rects = allocator->post_alloc_obj<rect>(num_comps);
  190|  73.5k|      recon_comp_rects = allocator->post_alloc_obj<rect>(num_comps);
  191|  73.5k|      line_offsets = allocator->post_alloc_obj<ui32>(num_comps);
  192|  73.5k|      num_bits = allocator->post_alloc_obj<ui32>(num_comps);
  193|  73.5k|      is_signed = allocator->post_alloc_obj<bool>(num_comps);
  194|  73.5k|      reversible = allocator->post_alloc_obj<bool>(num_comps);
  195|  73.5k|      nlt_type3 = allocator->post_alloc_obj<ui8>(num_comps);
  196|  73.5k|      cur_line = allocator->post_alloc_obj<ui32>(num_comps);
  197|       |
  198|  73.5k|      profile = codestream->get_profile();
  199|  73.5k|      tilepart_div = codestream->get_tilepart_div();
  200|  73.5k|      need_tlm = codestream->is_tlm_needed();
  201|  73.5k|      {
  202|  73.5k|        ui32 tilepart_div = codestream->get_tilepart_div();
  203|  73.5k|        ui32 t = tilepart_div & OJPH_TILEPART_MASK;
  204|  73.5k|        if (t == OJPH_TILEPART_NO_DIVISIONS)
  ------------------
  |  Branch (204:13): [True: 73.5k, False: 0]
  ------------------
  205|  73.5k|          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|  73.5k|        if (num_tileparts > 255)
  ------------------
  |  Branch (225:13): [True: 0, False: 73.5k]
  ------------------
  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|  73.5k|          "cannot have more than 255 tile parts.", num_tileparts);
  228|  73.5k|      }
  229|       |
  230|  73.5k|      this->resilient = codestream->is_resilient();
  231|  73.5k|      this->tile_rect = tile_rect;
  232|       |
  233|  73.5k|      ui32 tx0 = tile_rect.org.x;
  234|  73.5k|      ui32 ty0 = tile_rect.org.y;
  235|  73.5k|      ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
  236|  73.5k|      ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
  237|       |
  238|  73.5k|      ui32 width = 0;
  239|   129k|      for (ui32 i = 0; i < num_comps; ++i)
  ------------------
  |  Branch (239:24): [True: 55.6k, False: 73.5k]
  ------------------
  240|  55.6k|      {
  241|  55.6k|        ui8 bd; bool is; // used for nlt_type3
  242|       |
  243|  55.6k|        point downsamp = szp->get_downsampling(i);
  244|  55.6k|        point recon_downsamp = szp->get_recon_downsampling(i);
  245|       |
  246|  55.6k|        ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
  ------------------
  |  |   70|  55.6k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  247|  55.6k|        ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
  ------------------
  |  |   70|  55.6k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  248|  55.6k|        ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
  ------------------
  |  |   70|  55.6k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  249|  55.6k|        ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
  ------------------
  |  |   70|  55.6k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  250|  55.6k|        ui32 recon_tcx0 = ojph_div_ceil(tx0, recon_downsamp.x);
  ------------------
  |  |   70|  55.6k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  251|  55.6k|        ui32 recon_tcy0 = ojph_div_ceil(ty0, recon_downsamp.y);
  ------------------
  |  |   70|  55.6k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  252|  55.6k|        ui32 recon_tcx1 = ojph_div_ceil(tx1, recon_downsamp.x);
  ------------------
  |  |   70|  55.6k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  253|  55.6k|        ui32 recon_tcy1 = ojph_div_ceil(ty1, recon_downsamp.y);
  ------------------
  |  |   70|  55.6k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  254|       |
  255|  55.6k|        line_offsets[i] =
  256|  55.6k|          recon_tcx0 - ojph_div_ceil(tx0 - offset, recon_downsamp.x);
  ------------------
  |  |   70|  55.6k|#define ojph_div_ceil(a, b) (((a) + (b) - 1) / (b))
  ------------------
  257|  55.6k|        comp_rects[i].org.x = tcx0;
  258|  55.6k|        comp_rects[i].org.y = tcy0;
  259|  55.6k|        comp_rects[i].siz.w = tcx1 - tcx0;
  260|  55.6k|        comp_rects[i].siz.h = tcy1 - tcy0;
  261|  55.6k|        recon_comp_rects[i].org.x = recon_tcx0;
  262|  55.6k|        recon_comp_rects[i].org.y = recon_tcy0;
  263|  55.6k|        recon_comp_rects[i].siz.w = recon_tcx1 - recon_tcx0;
  264|  55.6k|        recon_comp_rects[i].siz.h = recon_tcy1 - recon_tcy0;
  265|       |
  266|  55.6k|        comps[i].finalize_alloc(codestream, this, i, comp_rects[i],
  267|  55.6k|          recon_comp_rects[i]);
  268|  55.6k|        width = ojph_max(width, recon_comp_rects[i].siz.w);
  ------------------
  |  |   73|  55.6k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 2.71k, False: 52.9k]
  |  |  ------------------
  ------------------
  269|       |
  270|  55.6k|        num_bits[i] = szp->get_bit_depth(i);
  271|  55.6k|        is_signed[i] = szp->is_signed(i);
  272|  55.6k|        bool result = nlp->get_nonlinear_transform(i, bd, is, nlt_type3[i]);
  273|  55.6k|        if (result == true && (bd != num_bits[i] || is != is_signed[i]))
  ------------------
  |  Branch (273:13): [True: 19, False: 55.6k]
  |  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|  55.6k|            "is_signed = %s) from SIZ marker segment, and BDnlt "
  276|  55.6k|            "(bit_depth = %d, is_signed = %s) from NLT marker segment, "
  277|  55.6k|            "for component %d", i, num_bits[i],
  278|  55.6k|            is_signed[i] ? "True" : "False", bd, is ? "True" : "False");
  279|  55.6k|        if (result == false)
  ------------------
  |  Branch (279:13): [True: 55.4k, False: 203]
  ------------------
  280|  55.4k|          nlt_type3[i] = param_nlt::nonlinearity::OJPH_NLT_NO_NLT;
  281|  55.6k|        cur_line[i] = 0;
  282|  55.6k|        reversible[i] = codestream->get_coc(i)->is_reversible();
  283|  55.6k|      }
  284|       |
  285|  73.5k|      offset += tile_rect.siz.w;
  286|       |
  287|       |      //allocate lines
  288|  73.5k|      const param_cod* cdp = codestream->get_cod();
  289|  73.5k|      this->employ_color_transform = cdp->is_employing_color_transform();
  290|  73.5k|      if (this->employ_color_transform)
  ------------------
  |  Branch (290:11): [True: 3.02k, False: 70.5k]
  ------------------
  291|  3.02k|      {
  292|  3.02k|        num_lines = 3;
  293|  3.02k|        lines = allocator->post_alloc_obj<line_buf>(num_lines);
  294|  3.02k|        if (reversible[0])
  ------------------
  |  Branch (294:13): [True: 581, False: 2.44k]
  ------------------
  295|  2.32k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (295:27): [True: 1.74k, False: 581]
  ------------------
  296|  1.74k|            lines[i].wrap(
  297|  1.74k|              allocator->post_alloc_data<si32>(width, 0), width, 0);
  298|  2.44k|        else
  299|  9.77k|          for (int i = 0; i < 3; ++i)
  ------------------
  |  Branch (299:27): [True: 7.32k, False: 2.44k]
  ------------------
  300|  7.32k|            lines[i].wrap(
  301|  7.32k|              allocator->post_alloc_data<float>(width, 0), width, 0);
  302|  3.02k|      }
  303|  70.5k|      else
  304|  70.5k|      {
  305|       |        lines = NULL;
  306|  70.5k|        num_lines = 0;
  307|  70.5k|      }
  308|  73.5k|      next_tile_part = 0;
  309|  73.5k|    }
_ZN4ojph5local4tile4pullEPNS_8line_bufEj:
  406|  2.32M|    {
  407|  2.32M|      constexpr ui8 type3 =
  408|  2.32M|        param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
  409|       |
  410|  2.32M|      assert(comp_num < num_comps);
  411|  2.32M|      if (cur_line[comp_num] >= recon_comp_rects[comp_num].siz.h)
  ------------------
  |  Branch (411:11): [True: 32.7k, False: 2.28M]
  ------------------
  412|  32.7k|        return false;
  413|       |
  414|  2.28M|      cur_line[comp_num]++;
  415|       |
  416|  2.28M|      ui32 comp_width = recon_comp_rects[comp_num].siz.w;
  417|  2.28M|      if (comp_width == 0)
  ------------------
  |  Branch (417:11): [True: 81.8k, False: 2.20M]
  ------------------
  418|  81.8k|        return true; // nothing to pull, but not an error
  419|       |
  420|  2.20M|      if (!employ_color_transform || num_comps == 1)
  ------------------
  |  Branch (420:11): [True: 2.00M, False: 200k]
  |  Branch (420:38): [True: 179k, False: 20.8k]
  ------------------
  421|  2.18M|      {
  422|  2.18M|        line_buf *src_line = comps[comp_num].pull_line();
  423|  2.18M|        if (reversible[comp_num])
  ------------------
  |  Branch (423:13): [True: 2.08M, False: 101k]
  ------------------
  424|  2.08M|        {
  425|  2.08M|          si64 shift = (si64)1 << (num_bits[comp_num] - 1);
  426|  2.08M|          if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (426:15): [True: 5.14k, False: 2.08M]
  |  Branch (426:38): [True: 0, False: 5.14k]
  ------------------
  427|      0|            rev_convert_nlt_type3(src_line, 0, tgt_line,
  428|      0|              line_offsets[comp_num], shift + 1, comp_width);
  429|  2.08M|          else {
  430|  2.08M|            shift = is_signed[comp_num] ? 0 : shift;
  ------------------
  |  Branch (430:21): [True: 5.14k, False: 2.08M]
  ------------------
  431|  2.08M|            rev_convert(src_line, 0, tgt_line,
  432|  2.08M|              line_offsets[comp_num], shift, comp_width);
  433|  2.08M|          }
  434|  2.08M|        }
  435|   101k|        else
  436|   101k|        {
  437|   101k|          if (nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (437:15): [True: 452, False: 101k]
  ------------------
  438|    452|            irv_convert_to_integer_nlt_type3(src_line, tgt_line,
  439|    452|              line_offsets[comp_num], num_bits[comp_num],
  440|    452|              is_signed[comp_num], comp_width);
  441|   101k|          else
  442|   101k|            irv_convert_to_integer(src_line, tgt_line,
  443|   101k|              line_offsets[comp_num], num_bits[comp_num],
  444|   101k|              is_signed[comp_num], comp_width);
  445|   101k|        }
  446|  2.18M|      }
  447|  20.8k|      else
  448|  20.8k|      {
  449|  20.8k|        assert(num_comps >= 3);
  450|  20.8k|        if (comp_num == 0)
  ------------------
  |  Branch (450:13): [True: 5.05k, False: 15.8k]
  ------------------
  451|  5.05k|        {
  452|  5.05k|          if (reversible[comp_num])
  ------------------
  |  Branch (452:15): [True: 3.88k, False: 1.16k]
  ------------------
  453|  3.88k|            rct_backward(comps[0].pull_line(), comps[1].pull_line(),
  454|  3.88k|              comps[2].pull_line(), lines + 0, lines + 1,
  455|  3.88k|              lines + 2, comp_width);
  456|  1.16k|          else
  457|  1.16k|            ict_backward(comps[0].pull_line()->f32, comps[1].pull_line()->f32,
  458|  1.16k|              comps[2].pull_line()->f32, lines[0].f32, lines[1].f32,
  459|  1.16k|              lines[2].f32, comp_width);
  460|  5.05k|        }
  461|  20.8k|        if (reversible[comp_num])
  ------------------
  |  Branch (461:13): [True: 14.4k, False: 6.39k]
  ------------------
  462|  14.4k|        {
  463|  14.4k|          si64 shift = (si64)1 << (num_bits[comp_num] - 1);
  464|  14.4k|          line_buf* src_line;
  465|  14.4k|          if (comp_num < 3)
  ------------------
  |  Branch (465:15): [True: 14.4k, False: 0]
  ------------------
  466|  14.4k|            src_line = lines + comp_num;
  467|      0|          else
  468|      0|            src_line = comps[comp_num].pull_line();
  469|  14.4k|          if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (469:15): [True: 1.46k, False: 12.9k]
  |  Branch (469:38): [True: 0, False: 1.46k]
  ------------------
  470|      0|            rev_convert_nlt_type3(src_line, 0, tgt_line,
  471|      0|              line_offsets[comp_num], shift + 1, comp_width);
  472|  14.4k|          else {
  473|  14.4k|            shift = is_signed[comp_num] ? 0 : shift;
  ------------------
  |  Branch (473:21): [True: 1.46k, False: 12.9k]
  ------------------
  474|  14.4k|            rev_convert(src_line, 0, tgt_line,
  475|  14.4k|              line_offsets[comp_num], shift, comp_width);
  476|  14.4k|          }
  477|  14.4k|        }
  478|  6.39k|        else
  479|  6.39k|        {
  480|  6.39k|          line_buf* lbp;
  481|  6.39k|          if (comp_num < 3)
  ------------------
  |  Branch (481:15): [True: 6.39k, False: 0]
  ------------------
  482|  6.39k|            lbp = lines + comp_num;
  483|      0|          else
  484|      0|            lbp = comps[comp_num].pull_line();
  485|  6.39k|          if (nlt_type3[comp_num] == type3)
  ------------------
  |  Branch (485:15): [True: 0, False: 6.39k]
  ------------------
  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.39k|          else
  490|  6.39k|            irv_convert_to_integer(lbp, tgt_line,
  491|  6.39k|              line_offsets[comp_num], num_bits[comp_num],
  492|  6.39k|              is_signed[comp_num], comp_width);
  493|  6.39k|        }
  494|  20.8k|      }
  495|       |
  496|  2.20M|      return true;
  497|  2.28M|    }
_ZN4ojph5local4tile17parse_tile_headerERKNS0_9param_sotEPNS_11infile_baseERKm:
  759|  75.9k|    {
  760|  75.9k|      if (sot.get_tile_part_index() != next_tile_part)
  ------------------
  |  Branch (760:11): [True: 73.3k, False: 2.63k]
  ------------------
  761|  73.3k|      {
  762|  73.3k|        if (resilient)
  ------------------
  |  Branch (762:13): [True: 73.3k, False: 4]
  ------------------
  763|  73.3k|          OJPH_INFO(0x00030091, "wrong tile part index")
  ------------------
  |  |  285|  73.3k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  73.3k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 73.3k, 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|  73.3k|      }
  767|  75.9k|      ++next_tile_part;
  768|       |
  769|       |      //tile_end_location used on failure
  770|  75.9k|      ui64 tile_end_location = tile_start_location + sot.get_payload_length();
  771|       |
  772|  75.9k|      ui32 data_left = sot.get_payload_length(); //bytes left to parse
  773|  75.9k|      data_left -= (ui32)((ui64)file->tell() - tile_start_location);
  774|       |
  775|  75.9k|      if (data_left == 0)
  ------------------
  |  Branch (775:11): [True: 81, False: 75.9k]
  ------------------
  776|     81|        return;
  777|       |
  778|  75.9k|      ui32 max_decompositions = 0;
  779|   158k|      for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (779:24): [True: 82.9k, False: 75.9k]
  ------------------
  780|  82.9k|        max_decompositions = ojph_max(max_decompositions,
  ------------------
  |  |   73|   158k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 242, False: 82.7k]
  |  |  ------------------
  ------------------
  781|  75.9k|          comps[c].get_num_decompositions());
  782|       |
  783|  75.9k|      try
  784|  75.9k|      {
  785|       |        //sequence the reading of precincts according to progression order
  786|  75.9k|        if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
  ------------------
  |  Branch (786:13): [True: 23.0k, False: 52.8k]
  |  Branch (786:43): [True: 4.03k, False: 48.8k]
  ------------------
  787|  27.0k|        {
  788|  27.0k|          max_decompositions -= skipped_res_for_read;
  789|  8.59G|          for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (789:28): [True: 8.59G, False: 27.0k]
  ------------------
  790|  8.59G|            for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (790:30): [True: 159k, False: 8.59G]
  ------------------
  791|   159k|              if (data_left > 0)
  ------------------
  |  Branch (791:19): [True: 157k, False: 1.81k]
  ------------------
  792|   157k|                comps[c].parse_precincts(r, data_left, file);
  793|  27.0k|        }
  794|  48.8k|        else if (prog_order == OJPH_PO_RPCL)
  ------------------
  |  Branch (794:18): [True: 15.8k, False: 33.0k]
  ------------------
  795|  15.8k|        {
  796|  15.8k|          max_decompositions -= skipped_res_for_read;
  797|  88.1k|          for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (797:28): [True: 72.2k, False: 15.8k]
  ------------------
  798|  72.2k|          {
  799|   179k|            while (true)
  ------------------
  |  Branch (799:20): [True: 169k, Folded]
  ------------------
  800|   169k|            {
  801|   169k|              bool found = false;
  802|   169k|              ui32 comp_num = 0;
  803|   169k|              point smallest(INT_MAX, INT_MAX), cur;
  804|   354k|              for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (804:32): [True: 185k, False: 169k]
  ------------------
  805|   185k|              {
  806|   185k|                if (!comps[c].get_top_left_precinct(r, cur))
  ------------------
  |  Branch (806:21): [True: 67.1k, False: 118k]
  ------------------
  807|  67.1k|                  continue;
  808|   118k|                else
  809|   118k|                  found = true;
  810|       |
  811|   118k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (811:21): [True: 109k, False: 8.44k]
  ------------------
  812|   109k|                { smallest = cur; comp_num = c; }
  813|  8.44k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (813:26): [True: 7.00k, False: 1.43k]
  |  Branch (813:49): [True: 1.65k, False: 5.35k]
  ------------------
  814|  1.65k|                { smallest = cur; comp_num = c; }
  815|   118k|              }
  816|   169k|              if (found == true && data_left > 0)
  ------------------
  |  Branch (816:19): [True: 108k, False: 60.5k]
  |  Branch (816:36): [True: 107k, False: 1.23k]
  ------------------
  817|   107k|                comps[comp_num].parse_one_precinct(r, data_left, file);
  818|  61.7k|              else
  819|  61.7k|                break;
  820|   169k|            }
  821|  72.2k|          }
  822|  15.8k|        }
  823|  33.0k|        else if (prog_order == OJPH_PO_PCRL)
  ------------------
  |  Branch (823:18): [True: 14.7k, False: 18.2k]
  ------------------
  824|  14.7k|        {
  825|   175k|          while (true)
  ------------------
  |  Branch (825:18): [True: 165k, Folded]
  ------------------
  826|   165k|          {
  827|   165k|            bool found = false;
  828|   165k|            ui32 comp_num = 0;
  829|   165k|            ui32 res_num = 0;
  830|   165k|            point smallest(INT_MAX, INT_MAX), cur;
  831|   361k|            for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (831:30): [True: 195k, False: 165k]
  ------------------
  832|   195k|            {
  833|  1.37M|              for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
  ------------------
  |  Branch (833:32): [True: 1.17M, False: 195k]
  ------------------
  834|  1.17M|              {
  835|  1.17M|                if (!comps[c].get_top_left_precinct(r, cur))
  ------------------
  |  Branch (835:21): [True: 304k, False: 870k]
  ------------------
  836|   304k|                  continue;
  837|   870k|                else
  838|   870k|                  found = true;
  839|       |
  840|   870k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (840:21): [True: 408k, False: 462k]
  ------------------
  841|   408k|                { smallest = cur; comp_num = c; res_num = r; }
  842|   462k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (842:26): [True: 352k, False: 109k]
  |  Branch (842:49): [True: 137k, False: 214k]
  ------------------
  843|   137k|                { smallest = cur; comp_num = c; res_num = r; }
  844|   324k|                else if (cur.y == smallest.y && cur.x == smallest.x &&
  ------------------
  |  Branch (844:26): [True: 214k, False: 109k]
  |  Branch (844:49): [True: 198k, False: 15.9k]
  ------------------
  845|   198k|                         c < comp_num)
  ------------------
  |  Branch (845:26): [True: 0, False: 198k]
  ------------------
  846|      0|                { smallest = cur; comp_num = c; res_num = r; }
  847|   324k|                else if (cur.y == smallest.y && cur.x == smallest.x &&
  ------------------
  |  Branch (847:26): [True: 214k, False: 109k]
  |  Branch (847:49): [True: 198k, False: 15.9k]
  ------------------
  848|   198k|                         c == comp_num && r < res_num)
  ------------------
  |  Branch (848:26): [True: 183k, False: 15.4k]
  |  Branch (848:43): [True: 0, False: 183k]
  ------------------
  849|      0|                { smallest = cur; comp_num = c; res_num = r; }
  850|   870k|              }
  851|   195k|            }
  852|   165k|            if (found == true && data_left > 0)
  ------------------
  |  Branch (852:17): [True: 161k, False: 3.69k]
  |  Branch (852:34): [True: 161k, False: 478]
  ------------------
  853|   161k|              comps[comp_num].parse_one_precinct(res_num, data_left, file);
  854|  4.17k|            else
  855|  4.17k|              break;
  856|   165k|          }
  857|  14.7k|        }
  858|  18.2k|        else if (prog_order == OJPH_PO_CPRL)
  ------------------
  |  Branch (858:18): [True: 18.0k, False: 256]
  ------------------
  859|  18.0k|        {
  860|  36.1k|          for (ui32 c = 0; c < num_comps; ++c)
  ------------------
  |  Branch (860:28): [True: 18.1k, False: 18.0k]
  ------------------
  861|  18.1k|          {
  862|   184k|            while (true)
  ------------------
  |  Branch (862:20): [True: 170k, Folded]
  ------------------
  863|   170k|            {
  864|   170k|              bool found = false;
  865|   170k|              ui32 res_num = 0;
  866|   170k|              point smallest(INT_MAX, INT_MAX), cur;
  867|  1.19M|              for (ui32 r = 0; r <= max_decompositions; ++r)
  ------------------
  |  Branch (867:32): [True: 1.02M, False: 170k]
  ------------------
  868|  1.02M|              {
  869|  1.02M|                if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
  ------------------
  |  Branch (869:21): [True: 108k, False: 915k]
  ------------------
  870|   108k|                  continue;
  871|   915k|                else
  872|   915k|                  found = true;
  873|       |
  874|   915k|                if (cur.y < smallest.y)
  ------------------
  |  Branch (874:21): [True: 416k, False: 499k]
  ------------------
  875|   416k|                { smallest = cur; res_num = r; }
  876|   499k|                else if (cur.y == smallest.y && cur.x < smallest.x)
  ------------------
  |  Branch (876:26): [True: 460k, False: 38.6k]
  |  Branch (876:49): [True: 107k, False: 352k]
  ------------------
  877|   107k|                { smallest = cur; res_num = r; }
  878|   915k|              }
  879|   170k|              if (found == true && data_left > 0)
  ------------------
  |  Branch (879:19): [True: 167k, False: 3.56k]
  |  Branch (879:36): [True: 166k, False: 576]
  ------------------
  880|   166k|                comps[c].parse_one_precinct(res_num, data_left, file);
  881|  4.13k|              else
  882|  4.13k|                break;
  883|   170k|            }
  884|  18.1k|          }
  885|  18.0k|        }
  886|    256|        else
  887|  18.2k|          assert(0);
  888|       |
  889|  75.9k|      }
  890|  75.9k|      catch (const char *error)
  891|  75.9k|      {
  892|  46.7k|        if (resilient)
  ------------------
  |  Branch (892:13): [True: 46.7k, False: 1]
  ------------------
  893|  46.7k|          OJPH_INFO(0x00030092, "%s", error)
  ------------------
  |  |  285|  46.7k|  { ojph::get_info()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  46.7k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 46.7k, 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|  46.7k|      }
  897|  75.9k|      file->seek((si64)tile_end_location, infile_base::OJPH_SEEK_SET);
  898|  75.9k|    }

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

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

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

_ZN4ojph5local23ojph_decode_codeblock64EPhPmjjjjjjjb:
  771|  45.2k|    {
  772|       |      // static bool insufficient_precision = false;
  773|       |      // static bool modify_code = false;
  774|       |      // static bool truncate_spp_mrp = false;
  775|       |
  776|  45.2k|      if (num_passes > 1 && lengths2 == 0)
  ------------------
  |  Branch (776:11): [True: 35.0k, False: 10.2k]
  |  Branch (776:29): [True: 6.19k, False: 28.8k]
  ------------------
  777|  6.19k|      {
  778|  6.19k|        OJPH_WARN(0x00010001, "A malformed codeblock that has more than "
  ------------------
  |  |  287|  6.19k|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|  6.19k|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 6.19k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  779|  6.19k|                              "one coding pass, but zero length for "
  780|  6.19k|                              "2nd and potential 3rd pass.");
  781|  6.19k|        num_passes = 1;
  782|  6.19k|      }
  783|       |
  784|  45.2k|      if (num_passes > 3)
  ------------------
  |  Branch (784:11): [True: 0, False: 45.2k]
  ------------------
  785|      0|      {
  786|      0|        OJPH_WARN(0x00010002, "We do not support more than 3 coding passes; "
  ------------------
  |  |  287|      0|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  787|      0|                              "This codeblocks has %d passes.",
  788|      0|                              num_passes);
  789|      0|        return false;
  790|      0|      }
  791|       |
  792|       |      // if (missing_msbs > 30) // p < 0
  793|       |      // {
  794|       |      //   if (insufficient_precision == false) 
  795|       |      //   {
  796|       |      //     insufficient_precision = true;
  797|       |      //     OJPH_WARN(0x00010003, "32 bits are not enough to decode this "
  798|       |      //                           "codeblock. This message will not be "
  799|       |      //                           "displayed again.");
  800|       |      //   }
  801|       |      //   return false;
  802|       |      // }       
  803|       |      // else if (missing_msbs == 30) // p == 0
  804|       |      // { // not enough precision to decode and set the bin center to 1
  805|       |      //   if (modify_code == false) {
  806|       |      //     modify_code = true;
  807|       |      //     OJPH_WARN(0x00010004, "Not enough precision to decode the cleanup "
  808|       |      //                           "pass. The code can be modified to support "
  809|       |      //                           "this case. This message will not be "
  810|       |      //                           "displayed again.");
  811|       |      //   }
  812|       |      //    return false;         // 32 bits are not enough to decode this
  813|       |      //  }
  814|       |      // else if (missing_msbs == 29) // if p is 1, then num_passes must be 1
  815|       |      // {
  816|       |      //   if (num_passes > 1) {
  817|       |      //     num_passes = 1;
  818|       |      //     if (truncate_spp_mrp == false) {
  819|       |      //       truncate_spp_mrp = true;
  820|       |      //       OJPH_WARN(0x00010005, "Not enough precision to decode the SgnProp "
  821|       |      //                             "nor MagRef passes; both will be skipped. "
  822|       |      //                             "This message will not be displayed "
  823|       |      //                             "again.");
  824|       |      //     }
  825|       |      //   }
  826|       |      // }
  827|  45.2k|      ui32 p = 62 - missing_msbs; // The least significant bitplane for CUP
  828|       |      // There is a way to handle the case of p == 0, but a different path
  829|       |      // is required
  830|       |
  831|  45.2k|      if (lengths1 < 2)
  ------------------
  |  Branch (831:11): [True: 0, False: 45.2k]
  ------------------
  832|      0|      {
  833|      0|        OJPH_WARN(0x00010006, "Wrong codeblock length.");
  ------------------
  |  |  287|      0|  { ojph::get_warning()[0](t, __OJPHFILE__, __LINE__, __VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  834|      0|        return false;
  835|      0|      }
  836|       |
  837|       |      // read scup and fix the bytes there
  838|  45.2k|      int lcup, scup;
  839|  45.2k|      lcup = (int)lengths1;  // length of CUP
  840|       |      //scup is the length of MEL + VLC
  841|  45.2k|      scup = (((int)coded_data[lcup-1]) << 4) + (coded_data[lcup-2] & 0xF);
  842|  45.2k|      if (scup < 2 || scup > lcup || scup > 4079) //something is wrong
  ------------------
  |  Branch (842:11): [True: 6.09k, False: 39.1k]
  |  Branch (842:23): [True: 18.4k, False: 20.6k]
  |  Branch (842:38): [True: 253, False: 20.4k]
  ------------------
  843|  24.8k|        return false;
  844|       |
  845|       |      // The temporary storage scratch holds two types of data in an 
  846|       |      // interleaved fashion. The interleaving allows us to use one
  847|       |      // memory pointer.
  848|       |      // We have one entry for a decoded VLC code, and one entry for UVLC.
  849|       |      // Entries are 16 bits each, corresponding to one quad, 
  850|       |      // but since we want to use XMM registers of the SSE family 
  851|       |      // of SIMD; we allocated 16 bytes or more per quad row; that is,
  852|       |      // the width is no smaller than 16 bytes (or 8 entries), and the
  853|       |      // height is 512 quads
  854|       |      // Each VLC entry contains, in the following order, starting 
  855|       |      // from MSB
  856|       |      // e_k (4bits), e_1 (4bits), rho (4bits), useless for step 2 (4bits)
  857|       |      // Each entry in UVLC contains u_q
  858|       |      // One extra row to handle the case of SPP propagating downwards
  859|       |      // when codeblock width is 4
  860|  20.4k|      ui16 scratch[8 * 513] = {0};       // 8 kB
  861|       |
  862|       |      // We need an extra two entries (one inf and one u_q) beyond
  863|       |      // the last column. 
  864|       |      // If the block width is 4 (2 quads), then we use sstr of 8 
  865|       |      // (enough for 4 quads). If width is 8 (4 quads) we use 
  866|       |      // sstr is 16 (enough for 8 quads). For a width of 16 (8 
  867|       |      // quads), we use 24 (enough for 12 quads).
  868|  20.4k|      ui32 sstr = ((width + 2u) + 7u) & ~7u; // multiples of 8
  869|       |
  870|  20.4k|      ui32 mmsbp2 = missing_msbs + 2;
  871|       |
  872|       |      // The cleanup pass is decoded in two steps; in step one,
  873|       |      // the VLC and MEL segments are decoded, generating a record that 
  874|       |      // has 2 bytes per quad. The 2 bytes contain, u, rho, e^1 & e^k.
  875|       |      // This information should be sufficient for the next step.
  876|       |      // In step 2, we decode the MagSgn segment.
  877|       |
  878|       |      // step 1 decoding VLC and MEL segments
  879|  20.4k|      {
  880|       |        // init structures
  881|  20.4k|        dec_mel_st mel;
  882|  20.4k|        mel_init(&mel, coded_data, lcup, scup);
  883|  20.4k|        rev_struct vlc;
  884|  20.4k|        rev_init8(&vlc, coded_data, lcup, scup);
  885|       |
  886|  20.4k|        int run = mel_get_run(&mel); // decode runs of events from MEL bitstrm
  887|       |                                     // data represented as runs of 0 events
  888|       |                                     // See mel_decode description
  889|       |
  890|  20.4k|        ui64 vlc_val;
  891|  20.4k|        ui32 c_q = 0;
  892|  20.4k|        ui16 *sp = scratch;
  893|       |        //initial quad row
  894|   110k|        for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (894:26): [True: 90.5k, False: 20.4k]
  ------------------
  895|  90.5k|        {
  896|       |          // decode VLC
  897|       |          /////////////
  898|       |
  899|       |          // first quad
  900|  90.5k|          vlc_val = rev_fetch64(&vlc);
  901|       |
  902|       |          //decode VLC using the context c_q and the head of VLC bitstream
  903|  90.5k|          ui16 t0 = vlc_tbl0[ c_q + (vlc_val & 0x7F) ];
  904|       |
  905|       |          // if context is zero, use one MEL event
  906|  90.5k|          if (c_q == 0) //zero context
  ------------------
  |  Branch (906:15): [True: 51.1k, False: 39.4k]
  ------------------
  907|  51.1k|          {
  908|  51.1k|            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|  51.1k|            t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (913:18): [True: 30.7k, False: 20.3k]
  ------------------
  914|       |
  915|       |            // is run -1 or -2? this means a run has been consumed
  916|  51.1k|            if (run < 0) 
  ------------------
  |  Branch (916:17): [True: 46.9k, False: 4.12k]
  ------------------
  917|  46.9k|              run = mel_get_run(&mel);  // get another run
  918|  51.1k|          }
  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|  90.5k|          sp[0] = t0;
  924|  90.5k|          x += 2;
  925|       |
  926|       |          // prepare context for the next quad; eqn. 1 in ITU T.814
  927|  90.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|  90.5k|          vlc_val = rev_advance64(&vlc, t0 & 0x7);
  931|       |
  932|       |          //second quad
  933|  90.5k|          ui16 t1 = 0;
  934|       |
  935|       |          //decode VLC using the context c_q and the head of VLC bitstream
  936|  90.5k|          t1 = vlc_tbl0[c_q + (vlc_val & 0x7F)]; 
  937|       |
  938|       |          // if context is zero, use one MEL event
  939|  90.5k|          if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (939:15): [True: 30.5k, False: 59.9k]
  |  Branch (939:27): [True: 26.6k, False: 3.97k]
  ------------------
  940|  26.6k|          {
  941|  26.6k|            run -= 2; //subtract 2, since events number if multiplied by 2
  942|       |
  943|       |            // if event is 0, discard decoded t1
  944|  26.6k|            t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (944:18): [True: 10.2k, False: 16.3k]
  ------------------
  945|       |
  946|  26.6k|            if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (946:17): [True: 17.3k, False: 9.21k]
  ------------------
  947|  17.3k|              run = mel_get_run(&mel); // if yes, then get another run
  948|  26.6k|          }
  949|  90.5k|          t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (949:16): [True: 77.2k, False: 13.2k]
  ------------------
  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|  90.5k|          sp[2] = t1;
  955|  90.5k|          x += 2;
  956|       |
  957|       |          //prepare context for the next quad, eqn. 1 in ITU T.814
  958|  90.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|  90.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|  90.5k|          ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
  967|  90.5k|          if (uvlc_mode == 0xc0)// if both u_offset are set, get an event from
  ------------------
  |  Branch (967:15): [True: 23.5k, False: 67.0k]
  ------------------
  968|  23.5k|          {                     // the MEL run of events
  969|  23.5k|            run -= 2; //subtract 2, since events number if multiplied by 2
  970|       |
  971|  23.5k|            uvlc_mode += (run == -1) ? 0x40 : 0; // increment uvlc_mode by
  ------------------
  |  Branch (971:26): [True: 11.9k, False: 11.6k]
  ------------------
  972|       |                                                 // is 0x40
  973|       |
  974|  23.5k|            if (run < 0)//if run is consumed (run is -1 or -2), get another run
  ------------------
  |  Branch (974:17): [True: 20.0k, False: 3.43k]
  ------------------
  975|  20.0k|              run = mel_get_run(&mel);
  976|  23.5k|          }
  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|  90.5k|          ui32 idx = uvlc_mode + (ui32)(vlc_val & 0x3F);
  984|  90.5k|          ui32 uvlc_entry = uvlc_tbl0[idx];
  985|  90.5k|          ui16 u_bias = uvlc_bias[idx];          
  986|       |          //remove total prefix length
  987|  90.5k|          vlc_val = rev_advance64(&vlc, uvlc_entry & 0x7); 
  988|  90.5k|          uvlc_entry >>= 3; 
  989|       |          //extract suffixes for quad 0 and 1
  990|  90.5k|          ui32 len = uvlc_entry & 0xF;             // suffix length for 2 quads
  991|  90.5k|          ui32 tmp = (ui32)(vlc_val&((1<<len)-1)); // suffix value for 2 quads
  992|  90.5k|          vlc_val = rev_advance64(&vlc, len);
  993|  90.5k|          uvlc_entry >>= 4;
  994|       |          // quad 0 length
  995|  90.5k|          len = uvlc_entry & 0x7; // quad 0 suffix length
  996|  90.5k|          uvlc_entry >>= 3;
  997|  90.5k|          ui16 u_q0 = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
  998|  90.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|  90.5k|          ui16 u_ext; bool cond0, cond1;
 1002|  90.5k|          cond0 = u_q0 - (u_bias & 0x3) > 32;
 1003|  90.5k|          u_ext = (ui16)(cond0 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1003:26): [True: 279, False: 90.2k]
  ------------------
 1004|  90.5k|          vlc_val = rev_advance64(&vlc, cond0 ? 4 : 0);
  ------------------
  |  Branch (1004:41): [True: 279, False: 90.2k]
  ------------------
 1005|  90.5k|          u_q0 = (ui16)(u_q0 + (u_ext << 2));
 1006|  90.5k|          sp[1] = (ui16)(u_q0 + 1); // kappa = 1
 1007|  90.5k|          cond1 = u_q1 - (u_bias >> 2) > 32;
 1008|  90.5k|          u_ext = (ui16)(cond1 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1008:26): [True: 230, False: 90.3k]
  ------------------
 1009|  90.5k|          vlc_val = rev_advance64(&vlc, cond1 ? 4 : 0);
  ------------------
  |  Branch (1009:41): [True: 230, False: 90.3k]
  ------------------
 1010|  90.5k|          u_q1 = (ui16)(u_q1 + (u_ext << 2));
 1011|  90.5k|          sp[3] = (ui16)(u_q1 + 1); // kappa = 1
 1012|  90.5k|        }
 1013|  20.4k|        sp[0] = sp[1] = 0;
 1014|       |
 1015|       |        //non initial quad rows
 1016|  67.7k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1016:26): [True: 47.3k, False: 20.4k]
  ------------------
 1017|  47.3k|        {
 1018|  47.3k|          c_q = 0;                                // context
 1019|  47.3k|          ui16 *sp = scratch + (y >> 1) * sstr;   // this row of quads
 1020|       |
 1021|   168k|          for (ui32 x = 0; x < width; sp += 4)
  ------------------
  |  Branch (1021:28): [True: 121k, False: 47.3k]
  ------------------
 1022|   121k|          {
 1023|       |            // decode VLC
 1024|       |            /////////////
 1025|       |
 1026|       |            // sigma_q (n, ne, nf)
 1027|   121k|            c_q |= ((sp[0 - (si32)sstr] & 0xA0U) << 2);
 1028|   121k|            c_q |= ((sp[2 - (si32)sstr] & 0x20U) << 4);
 1029|       |
 1030|       |            // first quad
 1031|   121k|            vlc_val = rev_fetch64(&vlc);
 1032|       |
 1033|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1034|   121k|            ui16 t0 = vlc_tbl1[ c_q + (vlc_val & 0x7F) ];
 1035|       |
 1036|       |            // if context is zero, use one MEL event
 1037|   121k|            if (c_q == 0) //zero context
  ------------------
  |  Branch (1037:17): [True: 71.9k, False: 49.5k]
  ------------------
 1038|  71.9k|            {
 1039|  71.9k|              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|  71.9k|              t0 = (run == -1) ? t0 : 0;
  ------------------
  |  Branch (1044:20): [True: 29.2k, False: 42.6k]
  ------------------
 1045|       |
 1046|       |              // is run -1 or -2? this means a run has been consumed
 1047|  71.9k|              if (run < 0) 
  ------------------
  |  Branch (1047:19): [True: 43.1k, False: 28.7k]
  ------------------
 1048|  43.1k|                run = mel_get_run(&mel);  // get another run
 1049|  71.9k|            }
 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|   121k|            sp[0] = t0;
 1055|   121k|            x += 2;
 1056|       |
 1057|       |            // prepare context for the next quad; eqn. 2 in ITU T.814
 1058|       |            // sigma_q (w, sw)
 1059|   121k|            c_q = ((t0 & 0x40U) << 2) | ((t0 & 0x80U) << 1);
 1060|       |            // sigma_q (nw)
 1061|   121k|            c_q |= sp[0 - (si32)sstr] & 0x80;
 1062|       |            // sigma_q (n, ne, nf)
 1063|   121k|            c_q |= ((sp[2 - (si32)sstr] & 0xA0U) << 2);
 1064|   121k|            c_q |= ((sp[4 - (si32)sstr] & 0x20U) << 4);
 1065|       |
 1066|       |            //remove data from vlc stream (0 bits are removed if vlc is unused)
 1067|   121k|            vlc_val = rev_advance64(&vlc, t0 & 0x7);
 1068|       |
 1069|       |            //second quad
 1070|   121k|            ui16 t1 = 0;
 1071|       |
 1072|       |            //decode VLC using the context c_q and the head of VLC bitstream
 1073|   121k|            t1 = vlc_tbl1[ c_q + (vlc_val & 0x7F)]; 
 1074|       |
 1075|       |            // if context is zero, use one MEL event
 1076|   121k|            if (c_q == 0 && x < width) //zero context
  ------------------
  |  Branch (1076:17): [True: 69.8k, False: 51.6k]
  |  Branch (1076:29): [True: 48.9k, False: 20.8k]
  ------------------
 1077|  48.9k|            {
 1078|  48.9k|              run -= 2; //subtract 2, since events number if multiplied by 2
 1079|       |
 1080|       |              // if event is 0, discard decoded t1
 1081|  48.9k|              t1 = (run == -1) ? t1 : 0;
  ------------------
  |  Branch (1081:20): [True: 14.0k, False: 34.8k]
  ------------------
 1082|       |
 1083|  48.9k|              if (run < 0) // have we consumed all events in a run
  ------------------
  |  Branch (1083:19): [True: 21.4k, False: 27.5k]
  ------------------
 1084|  21.4k|                run = mel_get_run(&mel); // if yes, then get another run
 1085|  48.9k|            }
 1086|   121k|            t1 = x < width ? t1 : 0;
  ------------------
  |  Branch (1086:18): [True: 90.2k, False: 31.2k]
  ------------------
 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|   121k|            sp[2] = t1;
 1092|   121k|            x += 2;
 1093|       |
 1094|       |            // partial c_q, will be completed when we process the next quad
 1095|       |            // sigma_q (w, sw)
 1096|   121k|            c_q = ((t1 & 0x40U) << 2) | ((t1 & 0x80U) << 1);
 1097|       |            // sigma_q (nw)
 1098|   121k|            c_q |= sp[2 - (si32)sstr] & 0x80;
 1099|       |
 1100|       |            //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1101|   121k|            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|   121k|            ui32 uvlc_mode = ((t0 & 0x8U) << 3) | ((t1 & 0x8U) << 4);
 1107|   121k|            ui32 uvlc_entry = uvlc_tbl1[uvlc_mode + (vlc_val & 0x3F)];
 1108|       |            //remove total prefix length
 1109|   121k|            vlc_val = rev_advance64(&vlc, uvlc_entry & 0x7);
 1110|   121k|            uvlc_entry >>= 3;
 1111|       |            //extract suffixes for quad 0 and 1
 1112|   121k|            ui32 len = uvlc_entry & 0xF;             //suffix length for 2 quads
 1113|   121k|            ui32 tmp = (ui32)(vlc_val&((1<<len)-1)); //suffix value for 2 quads
 1114|   121k|            vlc_val = rev_advance64(&vlc, len);
 1115|   121k|            uvlc_entry >>= 4;
 1116|       |            // quad 0 length
 1117|   121k|            len = uvlc_entry & 0x7; // quad 0 suffix length
 1118|   121k|            uvlc_entry >>= 3;
 1119|   121k|            ui16 u_q0 = (ui16)((uvlc_entry & 7) + (tmp & ~(0xFFU << len)));
 1120|   121k|            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|   121k|            ui16 u_ext; bool cond0, cond1;
 1124|   121k|            cond0 = u_q0 > 32;
 1125|   121k|            u_ext = (ui16)(cond0 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1125:28): [True: 105, False: 121k]
  ------------------
 1126|   121k|            vlc_val = rev_advance64(&vlc, cond0 ? 4 : 0);
  ------------------
  |  Branch (1126:43): [True: 105, False: 121k]
  ------------------
 1127|   121k|            u_q0 = (ui16)(u_q0 + (u_ext << 2));
 1128|   121k|            sp[1] = u_q0;
 1129|   121k|            cond1 = u_q1 > 32;
 1130|   121k|            u_ext = (ui16)(cond1 ? (vlc_val & 0xF) : 0);
  ------------------
  |  Branch (1130:28): [True: 92, False: 121k]
  ------------------
 1131|   121k|            vlc_val = rev_advance64(&vlc, cond1 ? 4 : 0);
  ------------------
  |  Branch (1131:43): [True: 92, False: 121k]
  ------------------
 1132|   121k|            u_q1 = (ui16)(u_q1 + (u_ext << 2));
 1133|   121k|            sp[3] = u_q1;
 1134|   121k|          }
 1135|  47.3k|          sp[0] = sp[1] = 0;
 1136|  47.3k|        }
 1137|  20.4k|      }
 1138|       |
 1139|       |      // step2 we decode magsgn
 1140|  20.4k|      {
 1141|       |        // We allocate a scratch row for storing v_n values.
 1142|       |        // We have 512 quads horizontally.
 1143|       |        // We need an extra entry to handle the case of vp[1]
 1144|       |        // when vp is at the last column.
 1145|       |        // Here, we allocate 4 instead of 1 to make the buffer size
 1146|       |        // a multipled of 16 bytes.
 1147|  20.4k|        const int v_n_size = 512 + 4;
 1148|  20.4k|        ui64 v_n_scratch[v_n_size] = {0};  // 4+ kB
 1149|       |
 1150|  20.4k|        frwd_struct64 magsgn;
 1151|  20.4k|        frwd_init8<0xFF>(&magsgn, coded_data, lcup - scup);
 1152|       |
 1153|  20.4k|        const ui16 *sp = scratch;
 1154|  20.4k|        ui64 *vp = v_n_scratch;
 1155|  20.4k|        ui64 *dp = decoded_data;
 1156|       |
 1157|  20.4k|        ui64 prev_v_n = 0;
 1158|   151k|        for (ui32 x = 0; x < width; sp += 2, ++vp)
  ------------------
  |  Branch (1158:26): [True: 143k, False: 7.69k]
  ------------------
 1159|   143k|        {
 1160|   143k|          ui32 inf = sp[0];
 1161|   143k|          ui32 U_q = sp[1];
 1162|   143k|          if (U_q > mmsbp2)
  ------------------
  |  Branch (1162:15): [True: 2.54k, False: 141k]
  ------------------
 1163|  2.54k|            return false;
 1164|       |
 1165|   141k|          ui64 v_n;
 1166|   141k|          ui64 val = 0;
 1167|   141k|          ui32 bit = 0;
 1168|   141k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1168:15): [True: 38.4k, False: 102k]
  ------------------
 1169|  38.4k|          {
 1170|       |            //get 32 bits of magsgn data
 1171|  38.4k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1172|  38.4k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1173|  38.4k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1174|       |
 1175|  38.4k|            val = ms_val << 63;                           // get sign bit
 1176|  38.4k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1177|  38.4k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1178|  38.4k|            v_n |= 1;                                     // add center of bin    
 1179|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1180|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1181|  38.4k|            val |= (v_n + 2) << (p - 1);
 1182|  38.4k|          }
 1183|   141k|          dp[0] = val;
 1184|       |
 1185|   141k|          v_n = 0;
 1186|   141k|          val = 0;
 1187|   141k|          bit = 1;
 1188|   141k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1188:15): [True: 59.8k, False: 81.1k]
  ------------------
 1189|  59.8k|          {
 1190|       |            //get 32 bits of magsgn data
 1191|  59.8k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1192|  59.8k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1193|  59.8k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1194|       |
 1195|  59.8k|            val = ms_val << 63;                           // get sign bit
 1196|  59.8k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1197|  59.8k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1198|  59.8k|            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|  59.8k|            val |= (v_n + 2) << (p - 1);
 1202|  59.8k|          }
 1203|   141k|          dp[stride] = val;
 1204|   141k|          vp[0] = prev_v_n | v_n;
 1205|   141k|          prev_v_n = 0;
 1206|   141k|          ++dp;
 1207|   141k|          if (++x >= width)
  ------------------
  |  Branch (1207:15): [True: 10.2k, False: 130k]
  ------------------
 1208|  10.2k|          { ++vp; break; }
 1209|       |
 1210|   130k|          val = 0;
 1211|   130k|          bit = 2;
 1212|   130k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1212:15): [True: 35.9k, False: 94.8k]
  ------------------
 1213|  35.9k|          {
 1214|       |            //get 32 bits of magsgn data
 1215|  35.9k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1216|  35.9k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1217|  35.9k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1218|       |
 1219|  35.9k|            val = ms_val << 63;                           // get sign bit
 1220|  35.9k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1221|  35.9k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1222|  35.9k|            v_n |= 1;                                     // add center of bin    
 1223|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1224|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1225|  35.9k|            val |= (v_n + 2) << (p - 1);
 1226|  35.9k|          }
 1227|   130k|          dp[0] = val;
 1228|       |
 1229|   130k|          v_n = 0;
 1230|   130k|          val = 0;
 1231|   130k|          bit = 3;
 1232|   130k|          if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1232:15): [True: 34.5k, False: 96.3k]
  ------------------
 1233|  34.5k|          {
 1234|       |            //get 32 bits of magsgn data
 1235|  34.5k|            ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1236|  34.5k|            ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1237|  34.5k|            frwd_advance(&magsgn, m_n);                 //consume m_n
 1238|       |
 1239|  34.5k|            val = ms_val << 63;                           // get sign bit
 1240|  34.5k|            v_n = ms_val & ((1ULL << m_n) - 1);           // keep only m_n bits
 1241|  34.5k|            v_n |= (ui64)((inf >> (8 + bit)) & 1) << m_n; // add EMB e_1 as MSB
 1242|  34.5k|            v_n |= 1;                                     // add center of bin    
 1243|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1244|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1245|  34.5k|            val |= (v_n + 2) << (p - 1);
 1246|  34.5k|          }
 1247|   130k|          dp[stride] = val;
 1248|   130k|          prev_v_n = v_n;
 1249|   130k|          ++dp;
 1250|   130k|          ++x;
 1251|   130k|        }
 1252|  17.8k|        vp[0] = prev_v_n;
 1253|       |
 1254|  59.4k|        for (ui32 y = 2; y < height; y += 2)
  ------------------
  |  Branch (1254:26): [True: 42.3k, False: 17.1k]
  ------------------
 1255|  42.3k|        {
 1256|  42.3k|          const ui16 *sp = scratch + (y >> 1) * sstr;
 1257|  42.3k|          ui64 *vp = v_n_scratch;
 1258|  42.3k|          ui64 *dp = decoded_data + y * stride;
 1259|       |
 1260|  42.3k|          prev_v_n = 0;
 1261|   187k|          for (ui32 x = 0; x < width; sp += 2, ++vp)
  ------------------
  |  Branch (1261:28): [True: 171k, False: 15.4k]
  ------------------
 1262|   171k|          {
 1263|   171k|            ui32 inf = sp[0];
 1264|   171k|            ui32 u_q = sp[1];
 1265|       |
 1266|   171k|            ui32 gamma = inf & 0xF0; gamma &= gamma - 0x10; //is gamma_q 1?
 1267|   171k|            ui32 emax = 63 - count_leading_zeros(2 | vp[0] | vp[1]); // emax-1
 1268|   171k|            ui32 kappa = gamma ? emax : 1;
  ------------------
  |  Branch (1268:26): [True: 13.4k, False: 158k]
  ------------------
 1269|       |
 1270|   171k|            ui32 U_q = u_q + kappa;
 1271|   171k|            if (U_q > mmsbp2)
  ------------------
  |  Branch (1271:17): [True: 744, False: 171k]
  ------------------
 1272|    744|              return false;
 1273|       |
 1274|   171k|            ui64 v_n;
 1275|   171k|            ui64 val = 0;
 1276|   171k|            ui32 bit = 0;
 1277|   171k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1277:17): [True: 37.6k, False: 133k]
  ------------------
 1278|  37.6k|            {
 1279|       |              //get 32 bits of magsgn data
 1280|  37.6k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1281|  37.6k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1282|  37.6k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1283|       |
 1284|  37.6k|              val = ms_val << 63;                         // get sign bit
 1285|  37.6k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1286|  37.6k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1287|  37.6k|              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|  37.6k|              val |= (v_n + 2) << (p - 1);
 1291|  37.6k|            }
 1292|   171k|            dp[0] = val;
 1293|       |
 1294|   171k|            v_n = 0;
 1295|   171k|            val = 0;
 1296|   171k|            bit = 1;
 1297|   171k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1297:17): [True: 12.6k, False: 158k]
  ------------------
 1298|  12.6k|            {
 1299|       |              //get 32 bits of magsgn data
 1300|  12.6k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1301|  12.6k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1302|  12.6k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1303|       |
 1304|  12.6k|              val = ms_val << 63;                         // get sign bit
 1305|  12.6k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1306|  12.6k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1307|  12.6k|              v_n |= 1;                                   // add center of bin    
 1308|       |              //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1309|       |              //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1310|  12.6k|              val |= (v_n + 2) << (p - 1);
 1311|  12.6k|            }
 1312|   171k|            dp[stride] = val;
 1313|   171k|            vp[0] = prev_v_n | v_n;
 1314|   171k|            prev_v_n = 0;
 1315|   171k|            ++dp;
 1316|   171k|            if (++x >= width)
  ------------------
  |  Branch (1316:17): [True: 26.0k, False: 145k]
  ------------------
 1317|  26.0k|            { ++vp; break; }
 1318|       |
 1319|   145k|            val = 0;
 1320|   145k|            bit = 2;
 1321|   145k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1321:17): [True: 9.18k, False: 135k]
  ------------------
 1322|  9.18k|            {
 1323|       |              //get 32 bits of magsgn data
 1324|  9.18k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1325|  9.18k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1326|  9.18k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1327|       |
 1328|  9.18k|              val = ms_val << 63;                         // get sign bit
 1329|  9.18k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1330|  9.18k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1331|  9.18k|              v_n |= 1;                                   // add center of bin    
 1332|       |              //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1333|       |              //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1334|  9.18k|              val |= (v_n + 2) << (p - 1);
 1335|  9.18k|            }
 1336|   145k|            dp[0] = val;
 1337|       |
 1338|   145k|            v_n = 0;
 1339|   145k|            val = 0;
 1340|   145k|            bit = 3;
 1341|   145k|            if (inf & (1 << (4 + bit)))
  ------------------
  |  Branch (1341:17): [True: 8.37k, False: 136k]
  ------------------
 1342|  8.37k|            {
 1343|       |              //get 32 bits of magsgn data
 1344|  8.37k|              ui64 ms_val = frwd_fetch64<0xFF>(&magsgn); 
 1345|  8.37k|              ui32 m_n = U_q - ((inf >> (12 + bit)) & 1); // remove e_k
 1346|  8.37k|              frwd_advance(&magsgn, m_n);                 //consume m_n
 1347|       |
 1348|  8.37k|              val = ms_val << 63;                         // get sign bit
 1349|  8.37k|              v_n = ms_val & ((1ULL << m_n) - 1);         // keep only m_n bits
 1350|  8.37k|              v_n |= (ui64)((inf >> (8+bit)) & 1) << m_n; // add EMB e_1 as MSB
 1351|  8.37k|              v_n |= 1;                                   // add center of bin    
 1352|       |              //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1353|       |              //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1354|  8.37k|              val |= (v_n + 2) << (p - 1);
 1355|  8.37k|            }
 1356|   145k|            dp[stride] = val;
 1357|   145k|            prev_v_n = v_n;
 1358|   145k|            ++dp;
 1359|   145k|            ++x;
 1360|   145k|          }
 1361|  41.5k|          vp[0] = prev_v_n;
 1362|  41.5k|        }
 1363|  17.8k|      }
 1364|       |
 1365|  17.1k|      if (num_passes > 1)
  ------------------
  |  Branch (1365:11): [True: 14.3k, False: 2.81k]
  ------------------
 1366|  14.3k|      {
 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|  14.3k|        ui16* const sigma = scratch;
 1372|       |
 1373|  14.3k|        ui32 mstr = (width + 3u) >> 2;   // divide by 4, since each
 1374|       |                                         // ui16 contains 4 columns
 1375|  14.3k|        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|  14.3k|        {
 1381|  14.3k|          ui32 y;
 1382|  42.3k|          for (y = 0; y < height; y += 4)
  ------------------
  |  Branch (1382:23): [True: 27.9k, False: 14.3k]
  ------------------
 1383|  27.9k|          {
 1384|  27.9k|            ui16* sp = scratch + (y >> 1) * sstr;
 1385|  27.9k|            ui16* dp = sigma + (y >> 2) * mstr;
 1386|   112k|            for (ui32 x = 0; x < width; x += 4, sp += 4, ++dp) {
  ------------------
  |  Branch (1386:30): [True: 84.3k, False: 27.9k]
  ------------------
 1387|  84.3k|              ui32 t0 = 0, t1 = 0;
 1388|  84.3k|              t0  = ((sp[0     ] & 0x30u) >> 4)  | ((sp[0     ] & 0xC0u) >> 2);
 1389|  84.3k|              t0 |= ((sp[2     ] & 0x30u) << 4)  | ((sp[2     ] & 0xC0u) << 6);
 1390|  84.3k|              t1  = ((sp[0+sstr] & 0x30u) >> 2)  | ((sp[0+sstr] & 0xC0u)     );
 1391|  84.3k|              t1 |= ((sp[2+sstr] & 0x30u) << 6)  | ((sp[2+sstr] & 0xC0u) << 8);
 1392|  84.3k|              dp[0] = (ui16)(t0 | t1);
 1393|  84.3k|            }
 1394|  27.9k|            dp[0] = 0; // set an extra entry on the right with 0
 1395|  27.9k|          }
 1396|  14.3k|          {
 1397|       |            // reset one row after the codeblock
 1398|  14.3k|            ui16* dp = sigma + (y >> 2) * mstr;
 1399|  77.3k|            for (ui32 x = 0; x < width; x += 4, ++dp)
  ------------------
  |  Branch (1399:30): [True: 63.0k, False: 14.3k]
  ------------------
 1400|  63.0k|              dp[0] = 0;
 1401|  14.3k|            dp[0] = 0; // set an extra entry on the right with 0
 1402|  14.3k|          }
 1403|  14.3k|        }
 1404|       |
 1405|       |        // We perform Significance Propagation Pass here
 1406|  14.3k|        {
 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|  14.3k|          ui16 prev_row_sig[256 + 8] = {0}; // 528 Bytes
 1417|       |
 1418|  14.3k|          frwd_struct64 sigprop;
 1419|  14.3k|          frwd_init<0>(&sigprop, coded_data + lengths1, (int)lengths2);
 1420|       |
 1421|  42.3k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1421:28): [True: 27.9k, False: 14.3k]
  ------------------
 1422|  27.9k|          {
 1423|  27.9k|            ui32 pattern = 0xFFFFu; // a pattern needed samples
 1424|  27.9k|            if (height - y < 4) {
  ------------------
  |  Branch (1424:17): [True: 6.97k, False: 20.9k]
  ------------------
 1425|  6.97k|              pattern = 0x7777u;
 1426|  6.97k|              if (height - y < 3) {
  ------------------
  |  Branch (1426:19): [True: 6.33k, False: 642]
  ------------------
 1427|  6.33k|                pattern = 0x3333u;
 1428|  6.33k|                if (height - y < 2)
  ------------------
  |  Branch (1428:21): [True: 2.49k, False: 3.83k]
  ------------------
 1429|  2.49k|                  pattern = 0x1111u;
 1430|  6.33k|              }
 1431|  6.97k|            }
 1432|       |
 1433|       |            // prev holds sign. info. for the previous quad, together
 1434|       |            // with the rows on top of it and below it.
 1435|  27.9k|            ui32 prev = 0;
 1436|  27.9k|            ui16 *prev_sig = prev_row_sig;
 1437|  27.9k|            ui16 *cur_sig = sigma + (y >> 2) * mstr;
 1438|  27.9k|            ui64 *dpp = decoded_data + y * stride;
 1439|   112k|            for (ui32 x = 0; x < width; x += 4, ++cur_sig, ++prev_sig)
  ------------------
  |  Branch (1439:30): [True: 84.3k, False: 27.9k]
  ------------------
 1440|  84.3k|            {
 1441|       |              // only rows and columns inside the stripe are included
 1442|  84.3k|              si32 s = (si32)x + 4 - (si32)width;
 1443|  84.3k|              s = ojph_max(s, 0);
  ------------------
  |  |   73|  84.3k|#define ojph_max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (73:25): [True: 20.0k, False: 64.2k]
  |  |  ------------------
  ------------------
 1444|  84.3k|              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|  84.3k|              ui32 ps = *(ui32*)prev_sig;
 1459|  84.3k|              ui32 ns = *(ui32*)(cur_sig + mstr);
 1460|  84.3k|              ui32 u = (ps & 0x88888888) >> 3; // the row on top
 1461|  84.3k|              if (!stripe_causal)
  ------------------
  |  Branch (1461:19): [True: 84.0k, False: 276]
  ------------------
 1462|  84.0k|                u |= (ns & 0x11111111) << 3;   // the row below
 1463|       |
 1464|  84.3k|              ui32 cs = *(ui32*)cur_sig;
 1465|       |              // vertical integration
 1466|  84.3k|              ui32 mbr =  cs;                // this sig. info.
 1467|  84.3k|              mbr |= (cs & 0x77777777) << 1; //above neighbors
 1468|  84.3k|              mbr |= (cs & 0xEEEEEEEE) >> 1; //below neighbors
 1469|  84.3k|              mbr |= u;
 1470|       |              // horizontal integration
 1471|  84.3k|              ui32 t = mbr;
 1472|  84.3k|              mbr |= t << 4;      // neighbors on the left
 1473|  84.3k|              mbr |= t >> 4;      // neighbors on the right
 1474|  84.3k|              mbr |= prev >> 12;  // significance of previous group
 1475|       |
 1476|       |              // remove outside samples, and already significant samples
 1477|  84.3k|              mbr &= pattern;
 1478|  84.3k|              mbr &= ~cs;
 1479|       |
 1480|       |              // find samples that become significant during the SPP
 1481|  84.3k|              ui32 new_sig = mbr;
 1482|  84.3k|              if (new_sig)
  ------------------
  |  Branch (1482:19): [True: 64.1k, False: 20.1k]
  ------------------
 1483|  64.1k|              {
 1484|  64.1k|                ui64 cwd = frwd_fetch<0>(&sigprop);
 1485|       |
 1486|  64.1k|                ui32 cnt = 0;
 1487|  64.1k|                ui32 col_mask = 0xFu;
 1488|  64.1k|                ui32 inv_sig = ~cs & pattern;
 1489|   320k|                for (int i = 0; i < 16; i += 4, col_mask <<= 4)
  ------------------
  |  Branch (1489:33): [True: 256k, False: 64.1k]
  ------------------
 1490|   256k|                {
 1491|   256k|                  if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1491:23): [True: 71.7k, False: 184k]
  ------------------
 1492|  71.7k|                    continue;
 1493|       |
 1494|       |                  //scan one column
 1495|   184k|                  ui32 sample_mask = 0x1111u & col_mask;
 1496|   184k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1496:23): [True: 121k, False: 63.8k]
  ------------------
 1497|   121k|                  {
 1498|   121k|                    new_sig &= ~sample_mask;
 1499|   121k|                    if (cwd & 1)
  ------------------
  |  Branch (1499:25): [True: 50.7k, False: 70.3k]
  ------------------
 1500|  50.7k|                    {
 1501|  50.7k|                      ui32 t = 0x33u << i;
 1502|  50.7k|                      new_sig |= t & inv_sig;
 1503|  50.7k|                    }
 1504|   121k|                    cwd >>= 1; ++cnt;
 1505|   121k|                  }
 1506|       |
 1507|   184k|                  sample_mask <<= 1;
 1508|   184k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1508:23): [True: 96.3k, False: 88.5k]
  ------------------
 1509|  96.3k|                  {
 1510|  96.3k|                    new_sig &= ~sample_mask;
 1511|  96.3k|                    if (cwd & 1)
  ------------------
  |  Branch (1511:25): [True: 28.7k, False: 67.5k]
  ------------------
 1512|  28.7k|                    {
 1513|  28.7k|                      ui32 t = 0x76u << i;
 1514|  28.7k|                      new_sig |= t & inv_sig;
 1515|  28.7k|                    }
 1516|  96.3k|                    cwd >>= 1; ++cnt;
 1517|  96.3k|                  }
 1518|       |
 1519|   184k|                  sample_mask <<= 1;
 1520|   184k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1520:23): [True: 119k, False: 65.7k]
  ------------------
 1521|   119k|                  {
 1522|   119k|                    new_sig &= ~sample_mask;
 1523|   119k|                    if (cwd & 1)
  ------------------
  |  Branch (1523:25): [True: 39.8k, False: 79.3k]
  ------------------
 1524|  39.8k|                    {
 1525|  39.8k|                      ui32 t = 0xECu << i;
 1526|  39.8k|                      new_sig |= t & inv_sig;
 1527|  39.8k|                    }
 1528|   119k|                    cwd >>= 1; ++cnt;
 1529|   119k|                  }
 1530|       |
 1531|   184k|                  sample_mask <<= 1;
 1532|   184k|                  if (new_sig & sample_mask)
  ------------------
  |  Branch (1532:23): [True: 87.1k, False: 97.7k]
  ------------------
 1533|  87.1k|                  {
 1534|  87.1k|                    new_sig &= ~sample_mask;
 1535|  87.1k|                    if (cwd & 1)
  ------------------
  |  Branch (1535:25): [True: 39.0k, False: 48.0k]
  ------------------
 1536|  39.0k|                    {
 1537|  39.0k|                      ui32 t = 0xC8u << i;
 1538|  39.0k|                      new_sig |= t & inv_sig;
 1539|  39.0k|                    }
 1540|  87.1k|                    cwd >>= 1; ++cnt;
 1541|  87.1k|                  }
 1542|   184k|                }
 1543|       |
 1544|  64.1k|                if (new_sig)
  ------------------
  |  Branch (1544:21): [True: 34.6k, False: 29.5k]
  ------------------
 1545|  34.6k|                {
 1546|       |                  // new_sig has newly-discovered sig. samples during SPP
 1547|       |                  // find the signs and update decoded_data
 1548|  34.6k|                  ui64 *dp = dpp + x;
 1549|  34.6k|                  ui64 val = 3u << (p - 2);
 1550|  34.6k|                  col_mask = 0xFu;
 1551|   173k|                  for (int i = 0; i < 4; ++i, ++dp, col_mask <<= 4)
  ------------------
  |  Branch (1551:35): [True: 138k, False: 34.6k]
  ------------------
 1552|   138k|                  {
 1553|   138k|                    if ((col_mask & new_sig) == 0)
  ------------------
  |  Branch (1553:25): [True: 60.9k, False: 77.5k]
  ------------------
 1554|  60.9k|                      continue;
 1555|       |
 1556|       |                    //scan 4 signs
 1557|  77.5k|                    ui32 sample_mask = 0x1111u & col_mask;
 1558|  77.5k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1558:25): [True: 50.7k, False: 26.8k]
  ------------------
 1559|  50.7k|                    {
 1560|  50.7k|                      assert(dp[0] == 0);
 1561|  50.7k|                      dp[0] = (cwd << 63) | val;
 1562|  50.7k|                      cwd >>= 1; ++cnt;
 1563|  50.7k|                    }
 1564|       |
 1565|  77.5k|                    sample_mask += sample_mask;
 1566|  77.5k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1566:25): [True: 28.7k, False: 48.8k]
  ------------------
 1567|  28.7k|                    {
 1568|  28.7k|                      assert(dp[stride] == 0);
 1569|  28.7k|                      dp[stride] = (cwd << 63) | val;
 1570|  28.7k|                      cwd >>= 1; ++cnt;
 1571|  28.7k|                    }
 1572|       |
 1573|  77.5k|                    sample_mask += sample_mask;
 1574|  77.5k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1574:25): [True: 39.8k, False: 37.7k]
  ------------------
 1575|  39.8k|                    {
 1576|  39.8k|                      assert(dp[2 * stride] == 0);
 1577|  39.8k|                      dp[2 * stride] = (cwd << 63) | val;
 1578|  39.8k|                      cwd >>= 1; ++cnt;
 1579|  39.8k|                    }
 1580|       |
 1581|  77.5k|                    sample_mask += sample_mask;
 1582|  77.5k|                    if (new_sig & sample_mask)
  ------------------
  |  Branch (1582:25): [True: 39.0k, False: 38.5k]
  ------------------
 1583|  39.0k|                    {
 1584|  39.0k|                      assert(dp[3 * stride] == 0);
 1585|  39.0k|                      dp[3 * stride] = (cwd << 63) | val;
 1586|  39.0k|                      cwd >>= 1; ++cnt;
 1587|  39.0k|                    }
 1588|  77.5k|                  }
 1589|  34.6k|                }
 1590|  64.1k|                frwd_advance(&sigprop, cnt);
 1591|  64.1k|              }
 1592|       |
 1593|  84.3k|              new_sig |= cs;
 1594|  84.3k|              *prev_sig = (ui16)(new_sig);
 1595|       |
 1596|       |              // vertical integration for the new sig. info.
 1597|  84.3k|              t = new_sig;
 1598|  84.3k|              new_sig |= (t & 0x7777) << 1; //above neighbors
 1599|  84.3k|              new_sig |= (t & 0xEEEE) >> 1; //below neighbors
 1600|       |              // add sig. info. from the row on top and below
 1601|  84.3k|              prev = new_sig | u;
 1602|       |              // we need only the bits in 0xF000
 1603|  84.3k|              prev &= 0xF000;
 1604|  84.3k|            }
 1605|  27.9k|          }
 1606|  14.3k|        }
 1607|       |
 1608|       |        // We perform Magnitude Refinement Pass here
 1609|  14.3k|        if (num_passes > 2)
  ------------------
  |  Branch (1609:13): [True: 11.1k, False: 3.22k]
  ------------------
 1610|  11.1k|        {
 1611|  11.1k|          rev_struct magref;
 1612|  11.1k|          rev_init_mrp(&magref, coded_data, (int)lengths1, (int)lengths2);
 1613|       |
 1614|  33.8k|          for (ui32 y = 0; y < height; y += 4)
  ------------------
  |  Branch (1614:28): [True: 22.7k, False: 11.1k]
  ------------------
 1615|  22.7k|          {
 1616|  22.7k|            ui32 *cur_sig = (ui32*)(sigma + (y >> 2) * mstr);
 1617|  22.7k|            ui64 *dpp = decoded_data + y * stride;
 1618|  22.7k|            ui64 half = 1ULL << (p - 2);
 1619|  67.8k|            for (ui32 i = 0; i < width; i += 8)
  ------------------
  |  Branch (1619:30): [True: 45.0k, False: 22.7k]
  ------------------
 1620|  45.0k|            {
 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|  45.0k|              ui32 cwd = rev_fetch_mrp(&magref); // get 32 bit data
 1625|  45.0k|              ui32 sig = *cur_sig++; // 32 bit that will be processed now
 1626|  45.0k|              ui32 col_mask = 0xFu;  // a mask for a column in sig
 1627|  45.0k|              if (sig) // if any of the 32 bits are set
  ------------------
  |  Branch (1627:19): [True: 37.2k, False: 7.85k]
  ------------------
 1628|  37.2k|              {
 1629|   334k|                for (int j = 0; j < 8; ++j) //one column at a time
  ------------------
  |  Branch (1629:33): [True: 297k, False: 37.2k]
  ------------------
 1630|   297k|                {
 1631|   297k|                  if (sig & col_mask) // lowest nibble
  ------------------
  |  Branch (1631:23): [True: 117k, False: 180k]
  ------------------
 1632|   117k|                  {
 1633|   117k|                    ui64 *dp = dpp + i + j; // next column in decoded samples
 1634|   117k|                    ui32 sample_mask = 0x11111111u & col_mask; //LSB
 1635|       |
 1636|   585k|                    for (int k = 0; k < 4; ++k) {
  ------------------
  |  Branch (1636:37): [True: 468k, False: 117k]
  ------------------
 1637|   468k|                      if (sig & sample_mask) //if LSB is set
  ------------------
  |  Branch (1637:27): [True: 193k, False: 275k]
  ------------------
 1638|   193k|                      {
 1639|   193k|                        assert(dp[0] != 0); // decoded value cannot be zero
 1640|   193k|                        assert((dp[0] & half) == 0); // no half
 1641|   193k|                        ui64 sym = cwd & 1;          // get it value
 1642|   193k|                        sym = (1 - sym) << (p - 1); // previous center of bin
 1643|   193k|                        sym |= half;            // put half the center of bin
 1644|   193k|                        dp[0] ^= sym;    // remove old bin center and put new
 1645|   193k|                        cwd >>= 1;       // consume word
 1646|   193k|                      }
 1647|   468k|                      sample_mask += sample_mask; //next row
 1648|   468k|                      dp += stride; // next samples row
 1649|   468k|                    }
 1650|   117k|                  }
 1651|   297k|                  col_mask <<= 4; //next column
 1652|   297k|                }
 1653|  37.2k|              }
 1654|       |              // consume data according to the number of bits set
 1655|  45.0k|              rev_advance_mrp(&magref, population_count(sig));
 1656|  45.0k|            }
 1657|  22.7k|          }
 1658|  11.1k|        }
 1659|  14.3k|      }
 1660|  17.1k|      return true;
 1661|  17.8k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL8mel_initEPNS0_10dec_mel_stEPhii:
  222|  20.4k|    {
  223|  20.4k|      melp->data = bbuf + lcup - scup; // move the pointer to the start of MEL
  224|  20.4k|      melp->bits = 0;                  // 0 bits in tmp
  225|  20.4k|      melp->tmp = 0;                   //
  226|  20.4k|      melp->unstuff = false;           // no unstuffing
  227|  20.4k|      melp->size = scup - 1;           // size is the length of MEL+VLC-1
  228|  20.4k|      melp->k = 0;                     // 0 for state 
  229|  20.4k|      melp->num_runs = 0;              // num_runs is 0
  230|  20.4k|      melp->runs = 0;                  //
  231|       |
  232|       |      //This code is borrowed; original is for a different architecture
  233|       |      //These few lines take care of the case where data is not at a multiple
  234|       |      // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the MEL segment
  235|  20.4k|      int num = 4 - (int)(intptr_t(melp->data) & 0x3);
  236|  72.4k|      for (int i = 0; i < num; ++i) { // this code is similar to mel_read
  ------------------
  |  Branch (236:23): [True: 51.9k, False: 20.4k]
  ------------------
  237|  51.9k|        assert(melp->unstuff == false || melp->data[0] <= 0x8F);
  238|  51.9k|        ui64 d = (melp->size > 0) ? *melp->data : 0xFF;//if buffer is consumed
  ------------------
  |  Branch (238:18): [True: 48.2k, False: 3.76k]
  ------------------
  239|       |                                                       //set data to 0xFF
  240|  51.9k|        if (melp->size == 1) d |= 0xF; //if this is MEL+VLC-1, set LSBs to 0xF
  ------------------
  |  Branch (240:13): [True: 4.11k, False: 47.8k]
  ------------------
  241|       |                                       // see the standard
  242|  51.9k|        melp->data += melp->size-- > 0; //increment if the end is not reached
  243|  51.9k|        int d_bits = 8 - melp->unstuff; //if unstuffing is needed, reduce by 1
  244|  51.9k|        melp->tmp = (melp->tmp << d_bits) | d; //store bits in tmp
  245|  51.9k|        melp->bits += d_bits;  //increment tmp by number of bits
  246|  51.9k|        melp->unstuff = ((d & 0xFF) == 0xFF); //true of next byte needs 
  247|       |                                              //unstuffing
  248|  51.9k|      }
  249|  20.4k|      melp->tmp <<= (64 - melp->bits); //push all the way up so the first bit
  250|       |                                       // is the MSB
  251|  20.4k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL9rev_init8EPNS0_10rev_structEPhii:
  344|  20.4k|    {
  345|       |      //first byte has only the upper 4 bits
  346|  20.4k|      vlcp->data = data + lcup - 2;
  347|       |
  348|       |      //size can not be larger than this, in fact it should be smaller
  349|  20.4k|      vlcp->size = scup - 2;
  350|       |
  351|  20.4k|      ui8 val = *vlcp->data--; // read one byte (this is a half byte)
  352|       |
  353|       |      // the first byte is treated different to other bytes, because only
  354|       |      // the MSB nibble is part of the VLC code.
  355|  20.4k|      val = (ui8)(val >> 4);
  356|  20.4k|      ui8 t = ((val & 0x7) == 0x7) ? 1 : 0; // unstuffing is needed
  ------------------
  |  Branch (356:15): [True: 4.73k, False: 15.7k]
  ------------------
  357|  20.4k|      val = (ui8)(val & (0xFU >> t)); // protect against erroneous 1 in MSB
  358|  20.4k|      vlcp->tmp = val;
  359|  20.4k|      vlcp->bits = 4 - t;
  360|  20.4k|      vlcp->unstuff = val > 0x8; //this is useful for the next byte
  361|  20.4k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL11mel_get_runEPNS0_10dec_mel_stE:
  261|   169k|    {
  262|   169k|      if (melp->num_runs == 0)  //if no runs, decode more bit from MEL segment
  ------------------
  |  Branch (262:11): [True: 36.3k, False: 133k]
  ------------------
  263|  36.3k|        mel_decode(melp);
  264|       |
  265|   169k|      int t = melp->runs & 0x7F; //retrieve one run
  266|   169k|      melp->runs >>= 7;  // remove the retrieved run
  267|   169k|      melp->num_runs--;
  268|   169k|      return t; // return run
  269|   169k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10mel_decodeEPNS0_10dec_mel_stE:
  171|  36.3k|    {
  172|  36.3k|      static const int mel_exp[13] = { //MEL exponents
  173|  36.3k|        0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5
  174|  36.3k|      };
  175|       |
  176|  36.3k|      if (melp->bits < 6) // if there are less than 6 bits in tmp
  ------------------
  |  Branch (176:11): [True: 5.55k, False: 30.7k]
  ------------------
  177|  5.55k|        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|   285k|      while (melp->bits >= 6 && melp->num_runs < 8)
  ------------------
  |  Branch (182:14): [True: 276k, False: 8.95k]
  |  Branch (182:33): [True: 248k, False: 27.3k]
  ------------------
  183|   248k|      {
  184|   248k|        int eval = mel_exp[melp->k]; // number of bits associated with state
  185|   248k|        int run = 0;
  186|   248k|        if (melp->tmp & (1ull<<63)) //The next bit to decode (stored in MSB)
  ------------------
  |  Branch (186:13): [True: 98.4k, False: 150k]
  ------------------
  187|  98.4k|        { //one is found
  188|  98.4k|          run = 1 << eval;  
  189|  98.4k|          run--; // consecutive runs of 0 events - 1
  190|  98.4k|          melp->k = melp->k + 1 < 12 ? melp->k + 1 : 12;//increment, max is 12
  ------------------
  |  Branch (190:21): [True: 93.6k, False: 4.79k]
  ------------------
  191|  98.4k|          melp->tmp <<= 1; // consume one bit from tmp
  192|  98.4k|          melp->bits -= 1;
  193|  98.4k|          run = run << 1; // a stretch of zeros not terminating in one
  194|  98.4k|        }
  195|   150k|        else
  196|   150k|        { //0 is found
  197|   150k|          run = (int)(melp->tmp >> (63 - eval)) & ((1 << eval) - 1);
  198|   150k|          melp->k = melp->k - 1 > 0 ? melp->k - 1 : 0; //decrement, min is 0
  ------------------
  |  Branch (198:21): [True: 19.9k, False: 130k]
  ------------------
  199|   150k|          melp->tmp <<= eval + 1; //consume eval + 1 bits (max is 6)
  200|   150k|          melp->bits -= eval + 1;
  201|   150k|          run = (run << 1) + 1; // a stretch of zeros terminating with one
  202|   150k|        }
  203|   248k|        eval = melp->num_runs * 7;           // 7 bits per run
  204|   248k|        melp->runs &= ~((ui64)0x3F << eval); // 6 bits are sufficient
  205|   248k|        melp->runs |= ((ui64)run) << eval;   // store the value in runs
  206|   248k|        melp->num_runs++;                    // increment count  
  207|   248k|      }
  208|  36.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL8mel_readEPNS0_10dec_mel_stE:
   94|  5.55k|    {
   95|  5.55k|      if (melp->bits > 32)  //there are enough bits in the tmp variable
  ------------------
  |  Branch (95:11): [True: 0, False: 5.55k]
  ------------------
   96|      0|        return;             // return without reading new data
   97|       |
   98|  5.55k|      ui32 val = 0xFFFFFFFF;       // feed in 0xFF if buffer is exhausted
   99|  5.55k|      if (melp->size > 4) {        // if there is data in the MEL segment
  ------------------
  |  Branch (99:11): [True: 3.55k, False: 2.00k]
  ------------------
  100|  3.55k|        val = *(ui32*)melp->data;  // read 32 bits from MEL data
  101|  3.55k|        melp->data += 4;           // advance pointer
  102|  3.55k|        melp->size -= 4;           // reduce counter
  103|  3.55k|      }
  104|  2.00k|      else if (melp->size > 0)
  ------------------
  |  Branch (104:16): [True: 1.35k, False: 648]
  ------------------
  105|  1.35k|      { // 4 or less
  106|  1.35k|        int i = 0;
  107|  2.27k|        while (melp->size > 1) {   
  ------------------
  |  Branch (107:16): [True: 922, False: 1.35k]
  ------------------
  108|    922|          ui32 v = *melp->data++;    // read one byte at a time
  109|    922|          ui32 m = ~(0xFFu << i);    // mask of location
  110|    922|          val = (val & m) | (v << i);// put one byte in its correct location
  111|    922|          --melp->size;
  112|    922|          i += 8;
  113|    922|        }
  114|       |        // size equal to 1
  115|  1.35k|        ui32 v = *melp->data++;    // the one before the last is different 
  116|  1.35k|        v |= 0xF;                  // MEL and VLC segments can overlap
  117|  1.35k|        ui32 m = ~(0xFFu << i);
  118|  1.35k|        val = (val & m) | (v << i);
  119|  1.35k|        --melp->size;
  120|  1.35k|      }
  121|       |      
  122|       |      // next we unstuff them before adding them to the buffer
  123|  5.55k|      int bits = 32 - melp->unstuff; // number of bits in val, subtract 1 if
  124|       |                                     // the previously read byte requires 
  125|       |                                     // unstuffing
  126|       |
  127|       |      // data is unstuffed and accumulated in t
  128|       |      // bits has the number of bits in t
  129|  5.55k|      ui32 t = val & 0xFF; 
  130|  5.55k|      bool unstuff = ((val & 0xFF) == 0xFF); // true if we need unstuffing
  131|  5.55k|      bits -= unstuff; // there is one less bit in t if unstuffing is needed
  132|  5.55k|      t = t << (8 - unstuff); // move up to make room for the next byte
  133|       |
  134|       |      //this is a repeat of the above
  135|  5.55k|      t |= (val>>8) & 0xFF;
  136|  5.55k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  137|  5.55k|      bits -= unstuff;
  138|  5.55k|      t = t << (8 - unstuff);
  139|       |
  140|  5.55k|      t |= (val>>16) & 0xFF;
  141|  5.55k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  142|  5.55k|      bits -= unstuff;
  143|  5.55k|      t = t << (8 - unstuff);
  144|       |
  145|  5.55k|      t |= (val>>24) & 0xFF;
  146|  5.55k|      melp->unstuff = (((val >> 24) & 0xFF) == 0xFF);
  147|       |
  148|       |      // move t to tmp, and push the result all the way up, so we read from
  149|       |      // the MSB
  150|  5.55k|      melp->tmp |= ((ui64)t) << (64 - bits - melp->bits);
  151|  5.55k|      melp->bits += bits; //increment the number of bits in tmp
  152|  5.55k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL11rev_fetch64EPNS0_10rev_structE:
  372|   212k|    {
  373|   492k|      while (vlcp->bits <= 56)
  ------------------
  |  Branch (373:14): [True: 280k, False: 212k]
  ------------------
  374|   280k|        rev_read8(vlcp); // read 8 bits, but unstuffing might reduce this
  375|   212k|      return vlcp->tmp;  // return unstuff decoded bits
  376|   212k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL9rev_read8EPNS0_10rev_structE:
  306|   280k|    {
  307|       |      // process 1 bytes
  308|   280k|      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|   280k|      if (vlcp->size > 0)  // if there are more than 3 bytes left in VLC
  ------------------
  |  Branch (314:11): [True: 148k, False: 132k]
  ------------------
  315|   148k|      {
  316|   148k|        val = *vlcp->data; // then read 8 bits
  317|   148k|        --vlcp->data;      // increment data pointer
  318|   148k|        --vlcp->size;      // decrement number of bytes in the buffer
  319|   148k|      }
  320|       |
  321|       |      // accumulate in tmp, and increment bits, check if unstuffing is needed
  322|   280k|      ui8 t = (vlcp->unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0;
  ------------------
  |  Branch (322:16): [True: 35.3k, False: 245k]
  |  Branch (322:33): [True: 11.4k, False: 23.8k]
  ------------------
  323|   280k|      val = (ui8)(val & (0xFFU >> t)); // protect against erroneous 1 in MSB
  324|   280k|      vlcp->tmp |= (ui64)val << vlcp->bits;
  325|   280k|      vlcp->bits += 8 - t;
  326|   280k|      vlcp->unstuff = val > 0x8F;
  327|   280k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL13rev_advance64EPNS0_10rev_structEj:
  386|  1.27M|    {
  387|       |      assert(num_bits <= vlcp->bits); // vlcp->tmp must have more than num_bits
  388|  1.27M|      vlcp->tmp >>= num_bits;         // remove bits
  389|  1.27M|      vlcp->bits -= num_bits;         // decrement the number of bits
  390|  1.27M|      return vlcp->tmp;
  391|  1.27M|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL12frwd_advanceEPNS0_13frwd_struct64Ej:
  707|   300k|    {
  708|       |      assert(num_bits <= msp->bits);
  709|   300k|      msp->tmp >>= num_bits;  // consume num_bits
  710|   300k|      msp->bits -= num_bits;
  711|   300k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12rev_init_mrpEPNS0_10rev_structEPhii:
  470|  11.1k|    {
  471|  11.1k|      mrp->data = data + lcup + len2 - 1;
  472|  11.1k|      mrp->size = len2;
  473|  11.1k|      mrp->unstuff = true;
  474|  11.1k|      mrp->bits = 0;
  475|  11.1k|      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|  11.1k|      int num = 1 + (int)(intptr_t(mrp->data) & 0x3);
  482|  39.7k|      for (int i = 0; i < num; ++i) {
  ------------------
  |  Branch (482:23): [True: 28.6k, False: 11.1k]
  ------------------
  483|  28.6k|        ui64 d;
  484|       |        //read a byte, 0 if no more data
  485|  28.6k|        d = (mrp->size-- > 0) ? *mrp->data-- : 0; 
  ------------------
  |  Branch (485:13): [True: 27.0k, False: 1.55k]
  ------------------
  486|       |        //check if unstuffing is needed
  487|  28.6k|        ui32 d_bits = 8 - ((mrp->unstuff && ((d & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (487:29): [True: 17.2k, False: 11.4k]
  |  Branch (487:45): [True: 4.71k, False: 12.5k]
  ------------------
  488|  28.6k|        mrp->tmp |= d << mrp->bits; // move data to vlcp->tmp
  489|  28.6k|        mrp->bits += d_bits;
  490|  28.6k|        mrp->unstuff = d > 0x8F; // for next byte
  491|  28.6k|      }
  492|  11.1k|      rev_read_mrp(mrp);
  493|  11.1k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12rev_read_mrpEPNS0_10rev_structE:
  406|  16.0k|    {
  407|       |      //process 4 bytes at a time
  408|  16.0k|      if (mrp->bits > 32)
  ------------------
  |  Branch (408:11): [True: 0, False: 16.0k]
  ------------------
  409|      0|        return;
  410|  16.0k|      ui32 val = 0;
  411|  16.0k|      if (mrp->size > 3) // If there are 3 byte or more
  ------------------
  |  Branch (411:11): [True: 12.3k, False: 3.72k]
  ------------------
  412|  12.3k|      { // (mrp->data - 3) move pointer back to read 32 bits at once
  413|  12.3k|        val = *(ui32*)(mrp->data - 3); // read 32 bits
  414|  12.3k|        mrp->data -= 4;                // move back pointer
  415|  12.3k|        mrp->size -= 4;                // reduce count
  416|  12.3k|      }
  417|  3.72k|      else if (mrp->size > 0)
  ------------------
  |  Branch (417:16): [True: 1.58k, False: 2.14k]
  ------------------
  418|  1.58k|      {
  419|  1.58k|        int i = 24;
  420|  5.38k|        while (mrp->size > 0) {   
  ------------------
  |  Branch (420:16): [True: 3.79k, False: 1.58k]
  ------------------
  421|  3.79k|          ui32 v = *mrp->data--; // read one byte at a time
  422|  3.79k|          val |= (v << i);       // put byte in its correct location
  423|  3.79k|          --mrp->size;
  424|  3.79k|          i -= 8;
  425|  3.79k|        }
  426|  1.58k|      }
  427|       |
  428|       |      //accumulate in tmp, and keep count in bits
  429|  16.0k|      ui32 bits, tmp = val >> 24;
  430|       |
  431|       |      //test if the last byte > 0x8F (unstuff must be true) and this is 0x7F
  432|  16.0k|      bits = 8 - ((mrp->unstuff && (((val >> 24) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (432:20): [True: 6.08k, False: 9.95k]
  |  Branch (432:36): [True: 3.91k, False: 2.17k]
  ------------------
  433|  16.0k|      bool unstuff = (val >> 24) > 0x8F;
  434|       |
  435|       |      //process the next byte
  436|  16.0k|      tmp |= ((val >> 16) & 0xFF) << bits;
  437|  16.0k|      bits += 8 - ((unstuff && (((val >> 16) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (437:21): [True: 7.26k, False: 8.77k]
  |  Branch (437:32): [True: 4.00k, False: 3.26k]
  ------------------
  438|  16.0k|      unstuff = ((val >> 16) & 0xFF) > 0x8F;
  439|       |
  440|  16.0k|      tmp |= ((val >> 8) & 0xFF) << bits;
  441|  16.0k|      bits += 8 - ((unstuff && (((val >> 8) & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (441:21): [True: 6.71k, False: 9.32k]
  |  Branch (441:32): [True: 3.39k, False: 3.32k]
  ------------------
  442|  16.0k|      unstuff = ((val >> 8) & 0xFF) > 0x8F;
  443|       |
  444|  16.0k|      tmp |= (val & 0xFF) << bits;
  445|  16.0k|      bits += 8 - ((unstuff && ((val & 0x7F) == 0x7F)) ? 1 : 0);
  ------------------
  |  Branch (445:21): [True: 5.70k, False: 10.3k]
  |  Branch (445:32): [True: 3.27k, False: 2.43k]
  ------------------
  446|  16.0k|      unstuff = (val & 0xFF) > 0x8F;
  447|       |
  448|  16.0k|      mrp->tmp |= (ui64)tmp << mrp->bits; // move data to mrp pointer
  449|  16.0k|      mrp->bits += bits;
  450|  16.0k|      mrp->unstuff = unstuff;             // next byte
  451|  16.0k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL13rev_fetch_mrpEPNS0_10rev_structE:
  504|  45.0k|    {
  505|  45.0k|      if (mrp->bits < 32) // if there are less than 32 bits in mrp->tmp
  ------------------
  |  Branch (505:11): [True: 4.59k, False: 40.4k]
  ------------------
  506|  4.59k|      {
  507|  4.59k|        rev_read_mrp(mrp);    // read 30-32 bits from mrp
  508|  4.59k|        if (mrp->bits < 32)   // if there is a space of 32 bits
  ------------------
  |  Branch (508:13): [True: 325, False: 4.27k]
  ------------------
  509|    325|          rev_read_mrp(mrp);  // read more
  510|  4.59k|      }
  511|  45.0k|      return (ui32)mrp->tmp;  // return the head of mrp->tmp
  512|  45.0k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL15rev_advance_mrpEPNS0_10rev_structEj:
  522|  45.0k|    {
  523|       |      assert(num_bits <= mrp->bits); // we must not consume more than mrp->bits
  524|  45.0k|      mrp->tmp >>= num_bits;  // discard the lowest num_bits bits
  525|  45.0k|      mrp->bits -= num_bits;
  526|  45.0k|      return (ui32)mrp->tmp;  // return data after consumption
  527|  45.0k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_init8ILh255EEEvPNS0_13frwd_struct64EPKhi:
  690|  20.4k|    {
  691|  20.4k|      msp->data = data;
  692|  20.4k|      msp->tmp = 0;
  693|  20.4k|      msp->bits = 0;
  694|  20.4k|      msp->unstuff = 0;
  695|  20.4k|      msp->size = size;
  696|  20.4k|      frwd_read8<X>(msp); // read 8 bits
  697|  20.4k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_read8ILh255EEEvPNS0_13frwd_struct64E:
  626|   211k|    {
  627|   211k|      ui8 val = X;
  628|   211k|      if (msp->size > 0) {
  ------------------
  |  Branch (628:11): [True: 169k, False: 41.4k]
  ------------------
  629|   169k|        val = *msp->data;  // read 8 bits
  630|   169k|        ++msp->data;      // increment pointer
  631|   169k|        --msp->size;      // reduce size
  632|   169k|      }
  633|       |
  634|       |      // unstuff and accumulate
  635|   211k|      ui8 t = msp->unstuff ? 1 : 0;
  ------------------
  |  Branch (635:15): [True: 38.4k, False: 172k]
  ------------------
  636|   211k|      val = (ui8)(val & (0xFFU >> t));
  637|   211k|      msp->unstuff = (val == 0xFF);
  638|   211k|      msp->tmp |= ((ui64)val) << msp->bits;  // move data to msp->tmp
  639|   211k|      msp->bits += 8 - t;
  640|   211k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL12frwd_fetch64ILh255EEEmPNS0_13frwd_struct64E:
  743|   236k|    {
  744|   427k|      while (msp->bits <= 56)
  ------------------
  |  Branch (744:14): [True: 190k, False: 236k]
  ------------------
  745|   190k|        frwd_read8<X>(msp);
  746|   236k|      return msp->tmp;
  747|   236k|    }    
ojph_block_decoder64.cpp:_ZN4ojph5localL9frwd_initILi0EEEvPNS0_13frwd_struct64EPKhi:
  654|  14.3k|    {
  655|  14.3k|      msp->data = data;
  656|  14.3k|      msp->tmp = 0;
  657|  14.3k|      msp->bits = 0;
  658|  14.3k|      msp->unstuff = 0;
  659|  14.3k|      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|  14.3k|      int num = 4 - (int)(intptr_t(msp->data) & 0x3);
  666|  50.1k|      for (int i = 0; i < num; ++i)
  ------------------
  |  Branch (666:23): [True: 35.8k, False: 14.3k]
  ------------------
  667|  35.8k|      {
  668|  35.8k|        ui64 d;
  669|       |        //read a byte if the buffer is not exhausted, otherwise set it to X
  670|  35.8k|        d = msp->size-- > 0 ? *msp->data++ : X;
  ------------------
  |  Branch (670:13): [True: 33.9k, False: 1.87k]
  ------------------
  671|  35.8k|        msp->tmp |= (d << msp->bits);      // store data in msp->tmp
  672|  35.8k|        msp->bits += 8 - msp->unstuff;     // number of bits added to msp->tmp
  673|  35.8k|        msp->unstuff = ((d & 0xFF) == 0xFF); // unstuffing for next byte
  674|  35.8k|      }
  675|  14.3k|      frwd_read<X>(msp); // read 32 bits more
  676|  14.3k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL9frwd_readILi0EEEvPNS0_13frwd_struct64E:
  562|  30.0k|    {
  563|  30.0k|      assert(msp->bits <= 32); // assert that there is a space for 32 bits
  564|       |
  565|  30.0k|      ui32 val = 0;
  566|  30.0k|      if (msp->size > 3) {
  ------------------
  |  Branch (566:11): [True: 18.0k, False: 12.0k]
  ------------------
  567|  18.0k|        val = *(ui32*)msp->data;  // read 32 bits
  568|  18.0k|        msp->data += 4;           // increment pointer
  569|  18.0k|        msp->size -= 4;           // reduce size
  570|  18.0k|      }
  571|  12.0k|      else if (msp->size > 0)
  ------------------
  |  Branch (571:16): [True: 5.03k, False: 7.00k]
  ------------------
  572|  5.03k|      {
  573|  5.03k|        int i = 0;
  574|  5.03k|        val = X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (574:15): [Folded, False: 5.03k]
  ------------------
  575|  14.7k|        while (msp->size > 0) {   
  ------------------
  |  Branch (575:16): [True: 9.75k, False: 5.03k]
  ------------------
  576|  9.75k|          ui32 v = *msp->data++;    // read one byte at a time
  577|  9.75k|          ui32 m = ~(0xFFu << i);    // mask of location
  578|  9.75k|          val = (val & m) | (v << i);// put one byte in its correct location
  579|  9.75k|          --msp->size;
  580|  9.75k|          i += 8;          
  581|  9.75k|        }
  582|  5.03k|      }
  583|  7.00k|      else
  584|  7.00k|        val = X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (584:15): [Folded, False: 7.00k]
  ------------------
  585|       |
  586|       |      // we accumulate in t and keep a count of the number of bits in bits
  587|  30.0k|      ui32 bits = 8 - msp->unstuff;        
  588|  30.0k|      ui32 t = val & 0xFF;
  589|  30.0k|      bool unstuff = ((val & 0xFF) == 0xFF);  // Do we need unstuffing next?
  590|       |
  591|  30.0k|      t |= ((val >> 8) & 0xFF) << bits;
  592|  30.0k|      bits += 8 - unstuff;
  593|  30.0k|      unstuff = (((val >> 8) & 0xFF) == 0xFF);
  594|       |
  595|  30.0k|      t |= ((val >> 16) & 0xFF) << bits;
  596|  30.0k|      bits += 8 - unstuff;
  597|  30.0k|      unstuff = (((val >> 16) & 0xFF) == 0xFF);
  598|       |
  599|  30.0k|      t |= ((val >> 24) & 0xFF) << bits;
  600|  30.0k|      bits += 8 - unstuff;
  601|  30.0k|      msp->unstuff = (((val >> 24) & 0xFF) == 0xFF); // for next byte
  602|       |
  603|  30.0k|      msp->tmp |= ((ui64)t) << msp->bits;  // move data to msp->tmp
  604|  30.0k|      msp->bits += bits;
  605|  30.0k|    }
ojph_block_decoder64.cpp:_ZN4ojph5localL10frwd_fetchILi0EEEjPNS0_13frwd_struct64E:
  723|  64.1k|    {
  724|  64.1k|      if (msp->bits < 32)
  ------------------
  |  Branch (724:11): [True: 15.3k, False: 48.8k]
  ------------------
  725|  15.3k|      {
  726|  15.3k|        frwd_read<X>(msp);
  727|  15.3k|        if (msp->bits < 32) //need to test
  ------------------
  |  Branch (727:13): [True: 440, False: 14.8k]
  ------------------
  728|    440|          frwd_read<X>(msp);
  729|  15.3k|      }
  730|  64.1k|      return (ui32)msp->tmp;
  731|  64.1k|    }

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

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

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

_ZN4ojph5local36initialize_block_encoder_tables_avx2Ev:
  225|  2.33M|    bool initialize_block_encoder_tables_avx2() {
  226|  2.33M|      static bool tables_initialized = false;
  227|  2.33M|      static std::once_flag tables_initialized_flag;
  228|  2.33M|      std::call_once(tables_initialized_flag, []() {
  229|  2.33M|        memset(vlc_tbl0, 0, 2048 * sizeof(ui32));
  230|  2.33M|        memset(vlc_tbl1, 0, 2048 * sizeof(ui32));
  231|  2.33M|        tables_initialized = vlc_init_tables();
  232|  2.33M|        tables_initialized = tables_initialized && uvlc_init_tables();
  233|  2.33M|      });
  234|  2.33M|      return tables_initialized;
  235|  2.33M|    }
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|  85.7k|  {
  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|  85.7k|  }
_ZN4ojph17calc_aligned_sizeINS_5local4tileELj8EEEmm:
  302|  9.51k|  size_t calc_aligned_size(size_t size) {
  303|  9.51k|    size = size * sizeof(T) + N - 1;
  304|  9.51k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  9.51k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  9.51k|    return size;
  307|  9.51k|  }
ojph_codestream_local.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  57.4k|  {
  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|  57.4k|  }
_ZN4ojph17calc_aligned_sizeINS_8line_bufELj8EEEmm:
  302|   924k|  size_t calc_aligned_size(size_t size) {
  303|   924k|    size = size * sizeof(T) + N - 1;
  304|   924k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   924k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   924k|    return size;
  307|   924k|  }
_ZN4ojph17calc_aligned_sizeINS_4sizeELj8EEEmm:
  302|  18.6k|  size_t calc_aligned_size(size_t size) {
  303|  18.6k|    size = size * sizeof(T) + N - 1;
  304|  18.6k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  18.6k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  18.6k|    return size;
  307|  18.6k|  }
_ZN4ojph17calc_aligned_sizeIiLj64EEEmm:
  302|   896k|  size_t calc_aligned_size(size_t size) {
  303|   896k|    size = size * sizeof(T) + N - 1;
  304|   896k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   896k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   896k|    return size;
  307|   896k|  }
_ZN4ojph17calc_aligned_sizeIhLj8EEEmm:
  302|   157k|  size_t calc_aligned_size(size_t size) {
  303|   157k|    size = size * sizeof(T) + N - 1;
  304|   157k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   157k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   157k|    return size;
  307|   157k|  }
_ZN4ojph9align_ptrIhLj8EEEPT_S2_:
  312|  78.2k|  inline T *align_ptr(T *ptr) {
  313|  78.2k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  78.2k|    p += N - 1;
  315|  78.2k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  78.2k|    return reinterpret_cast<T *>(p);
  317|  78.2k|  }
_ZN4ojph9align_ptrINS_5local4tileELj8EEEPT_S4_:
  312|  4.74k|  inline T *align_ptr(T *ptr) {
  313|  4.74k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  4.74k|    p += N - 1;
  315|  4.74k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  4.74k|    return reinterpret_cast<T *>(p);
  317|  4.74k|  }
_ZN4ojph9align_ptrINS_8line_bufELj8EEEPT_S3_:
  312|   454k|  inline T *align_ptr(T *ptr) {
  313|   454k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   454k|    p += N - 1;
  315|   454k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   454k|    return reinterpret_cast<T *>(p);
  317|   454k|  }
_ZN4ojph9align_ptrINS_4sizeELj8EEEPT_S3_:
  312|  9.12k|  inline T *align_ptr(T *ptr) {
  313|  9.12k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  9.12k|    p += N - 1;
  315|  9.12k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  9.12k|    return reinterpret_cast<T *>(p);
  317|  9.12k|  }
_ZN4ojph9align_ptrIiLj64EEEPT_S2_:
  312|   447k|  inline T *align_ptr(T *ptr) {
  313|   447k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   447k|    p += N - 1;
  315|   447k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   447k|    return reinterpret_cast<T *>(p);
  317|   447k|  }
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|    486|  {
  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|    486|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  2.03M|  {
  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.03M|  }
_ZN4ojph17calc_aligned_sizeINS_5local9tile_compELj8EEEmm:
  302|   148k|  size_t calc_aligned_size(size_t size) {
  303|   148k|    size = size * sizeof(T) + N - 1;
  304|   148k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   148k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   148k|    return size;
  307|   148k|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  1.36M|  {
  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.36M|  }
_ZN4ojph17calc_aligned_sizeINS_4rectELj8EEEmm:
  302|   296k|  size_t calc_aligned_size(size_t size) {
  303|   296k|    size = size * sizeof(T) + N - 1;
  304|   296k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   296k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   296k|    return size;
  307|   296k|  }
_ZN4ojph17calc_aligned_sizeIjLj8EEEmm:
  302|   444k|  size_t calc_aligned_size(size_t size) {
  303|   444k|    size = size * sizeof(T) + N - 1;
  304|   444k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   444k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   444k|    return size;
  307|   444k|  }
_ZN4ojph17calc_aligned_sizeIbLj8EEEmm:
  302|   296k|  size_t calc_aligned_size(size_t size) {
  303|   296k|    size = size * sizeof(T) + N - 1;
  304|   296k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   296k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   296k|    return size;
  307|   296k|  }
_ZN4ojph17calc_aligned_sizeIfLj64EEEmm:
  302|   547k|  size_t calc_aligned_size(size_t size) {
  303|   547k|    size = size * sizeof(T) + N - 1;
  304|   547k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   547k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   547k|    return size;
  307|   547k|  }
_ZN4ojph9align_ptrINS_5local9tile_compELj8EEEPT_S4_:
  312|  73.5k|  inline T *align_ptr(T *ptr) {
  313|  73.5k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  73.5k|    p += N - 1;
  315|  73.5k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  73.5k|    return reinterpret_cast<T *>(p);
  317|  73.5k|  }
_ZN4ojph9align_ptrINS_4rectELj8EEEPT_S3_:
  312|   147k|  inline T *align_ptr(T *ptr) {
  313|   147k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   147k|    p += N - 1;
  315|   147k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   147k|    return reinterpret_cast<T *>(p);
  317|   147k|  }
_ZN4ojph9align_ptrIjLj8EEEPT_S2_:
  312|   220k|  inline T *align_ptr(T *ptr) {
  313|   220k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   220k|    p += N - 1;
  315|   220k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   220k|    return reinterpret_cast<T *>(p);
  317|   220k|  }
_ZN4ojph9align_ptrIbLj8EEEPT_S2_:
  312|   147k|  inline T *align_ptr(T *ptr) {
  313|   147k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   147k|    p += N - 1;
  315|   147k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   147k|    return reinterpret_cast<T *>(p);
  317|   147k|  }
_ZN4ojph9align_ptrIfLj64EEEPT_S2_:
  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_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|   169k|  {
  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|   169k|  }
_ZN4ojph17calc_aligned_sizeINS_5local10resolutionELj8EEEmm:
  302|   670k|  size_t calc_aligned_size(size_t size) {
  303|   670k|    size = size * sizeof(T) + N - 1;
  304|   670k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   670k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   670k|    return size;
  307|   670k|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|   113k|  {
  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|   113k|  }
_ZN4ojph9align_ptrINS_5local10resolutionELj8EEEPT_S4_:
  312|   328k|  inline T *align_ptr(T *ptr) {
  313|   328k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   328k|    p += N - 1;
  315|   328k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   328k|    return reinterpret_cast<T *>(p);
  317|   328k|  }
ojph_file.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_mem.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_message.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_colour.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_colour_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_colour_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_colour_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_colour_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_transform_avx512.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_resolution.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  7.41M|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|  7.41M|  }
_ZN4ojph17calc_aligned_sizeINS_5local7subbandELj8EEEmm:
  302|   670k|  size_t calc_aligned_size(size_t size) {
  303|   670k|    size = size * sizeof(T) + N - 1;
  304|   670k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   670k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   670k|    return size;
  307|   670k|  }
ojph_resolution.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  4.97M|  {
  207|       |  #ifdef OJPH_COMPILER_MSVC
  208|       |    unsigned long result = 0;
  209|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  210|       |      _BitScanReverse64(&result, val);
  211|       |    #elif (defined OJPH_ARCH_I386)
  212|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  213|       |      if (msb == 0)
  214|       |        _BitScanReverse(&result, lsb);
  215|       |      else {
  216|       |        _BitScanReverse(&result, msb);
  217|       |        result += 32;
  218|       |      }
  219|       |    #else
  220|       |      #error Error unsupport MSVC version
  221|       |    #endif
  222|       |    return 63 ^ (ui32)result;
  223|       |  #elif (defined OJPH_COMPILER_GNUC)
  224|       |    return (ui32)__builtin_clzll(val);
  225|       |  #else
  226|       |    val |= (val >> 1);
  227|       |    val |= (val >> 2);
  228|       |    val |= (val >> 4);
  229|       |    val |= (val >> 8);
  230|       |    val |= (val >> 16);
  231|       |    val |= (val >> 32);
  232|       |    return 64 - population_count64(val);
  233|       |  #endif
  234|  4.97M|  }
_ZN4ojph17calc_aligned_sizeINS_5local8precinctELj8EEEmm:
  302|   238k|  size_t calc_aligned_size(size_t size) {
  303|   238k|    size = size * sizeof(T) + N - 1;
  304|   238k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   238k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   238k|    return size;
  307|   238k|  }
_ZN4ojph17calc_aligned_sizeINS_11lifting_bufELj8EEEmm:
  302|   559k|  size_t calc_aligned_size(size_t size) {
  303|   559k|    size = size * sizeof(T) + N - 1;
  304|   559k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   559k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   559k|    return size;
  307|   559k|  }
_ZN4ojph17calc_aligned_sizeIlLj64EEEmm:
  302|  1.33M|  size_t calc_aligned_size(size_t size) {
  303|  1.33M|    size = size * sizeof(T) + N - 1;
  304|  1.33M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  1.33M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  1.33M|    return size;
  307|  1.33M|  }
_ZN4ojph9align_ptrINS_5local7subbandELj8EEEPT_S4_:
  312|   328k|  inline T *align_ptr(T *ptr) {
  313|   328k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   328k|    p += N - 1;
  315|   328k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   328k|    return reinterpret_cast<T *>(p);
  317|   328k|  }
_ZN4ojph9align_ptrINS_5local8precinctELj8EEEPT_S4_:
  312|   117k|  inline T *align_ptr(T *ptr) {
  313|   117k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   117k|    p += N - 1;
  315|   117k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   117k|    return reinterpret_cast<T *>(p);
  317|   117k|  }
_ZN4ojph9align_ptrINS_11lifting_bufELj8EEEPT_S3_:
  312|   274k|  inline T *align_ptr(T *ptr) {
  313|   274k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   274k|    p += N - 1;
  315|   274k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   274k|    return reinterpret_cast<T *>(p);
  317|   274k|  }
_ZN4ojph9align_ptrIlLj64EEEPT_S2_:
  312|   665k|  inline T *align_ptr(T *ptr) {
  313|   665k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   665k|    p += N - 1;
  315|   665k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   665k|    return reinterpret_cast<T *>(p);
  317|   665k|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  2.08M|  {
  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.08M|  }
_ZN4ojph17calc_aligned_sizeINS_5local9codeblockELj8EEEmm:
  302|   348k|  size_t calc_aligned_size(size_t size) {
  303|   348k|    size = size * sizeof(T) + N - 1;
  304|   348k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   348k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   348k|    return size;
  307|   348k|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  1.39M|  {
  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.39M|  }
_ZN4ojph17calc_aligned_sizeINS_5local15coded_cb_headerELj8EEEmm:
  302|   348k|  size_t calc_aligned_size(size_t size) {
  303|   348k|    size = size * sizeof(T) + N - 1;
  304|   348k|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|   348k|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|   348k|    return size;
  307|   348k|  }
_ZN4ojph9align_ptrINS_5local9codeblockELj8EEEPT_S4_:
  312|   172k|  inline T *align_ptr(T *ptr) {
  313|   172k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   172k|    p += N - 1;
  315|   172k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   172k|    return reinterpret_cast<T *>(p);
  317|   172k|  }
_ZN4ojph9align_ptrINS_5local15coded_cb_headerELj8EEEPT_S4_:
  312|   172k|  inline T *align_ptr(T *ptr) {
  313|   172k|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|   172k|    p += N - 1;
  315|   172k|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|   172k|    return reinterpret_cast<T *>(p);
  317|   172k|  }
ojph_arch.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|      2|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|      2|  }
ojph_codeblock.cpp:_ZN4ojphL19count_leading_zerosEj:
  178|  7.05M|  {
  179|       |  #ifdef OJPH_COMPILER_MSVC
  180|       |    unsigned long result = 0;
  181|       |    _BitScanReverse(&result, val);
  182|       |    return 31 ^ (ui32)result;
  183|       |  #elif (defined OJPH_COMPILER_GNUC)
  184|       |    return (ui32)__builtin_clz(val);
  185|       |  #else
  186|       |    val |= (val >> 1);
  187|       |    val |= (val >> 2);
  188|       |    val |= (val >> 4);
  189|       |    val |= (val >> 8);
  190|       |    val |= (val >> 16);
  191|       |    return 32 - population_count(val);
  192|       |  #endif
  193|  7.05M|  }
_ZN4ojph17calc_aligned_sizeIjLj64EEEmm:
  302|  2.30M|  size_t calc_aligned_size(size_t size) {
  303|  2.30M|    size = size * sizeof(T) + N - 1;
  304|  2.30M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  2.30M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  2.30M|    return size;
  307|  2.30M|  }
ojph_codeblock.cpp:_ZN4ojphL19count_leading_zerosEm:
  206|  4.71M|  {
  207|       |  #ifdef OJPH_COMPILER_MSVC
  208|       |    unsigned long result = 0;
  209|       |    #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
  210|       |      _BitScanReverse64(&result, val);
  211|       |    #elif (defined OJPH_ARCH_I386)
  212|       |      ui32 msb = (ui32)(val >> 32), lsb = (ui32)val;
  213|       |      if (msb == 0)
  214|       |        _BitScanReverse(&result, lsb);
  215|       |      else {
  216|       |        _BitScanReverse(&result, msb);
  217|       |        result += 32;
  218|       |      }
  219|       |    #else
  220|       |      #error Error unsupport MSVC version
  221|       |    #endif
  222|       |    return 63 ^ (ui32)result;
  223|       |  #elif (defined OJPH_COMPILER_GNUC)
  224|       |    return (ui32)__builtin_clzll(val);
  225|       |  #else
  226|       |    val |= (val >> 1);
  227|       |    val |= (val >> 2);
  228|       |    val |= (val >> 4);
  229|       |    val |= (val >> 8);
  230|       |    val |= (val >> 16);
  231|       |    val |= (val >> 32);
  232|       |    return 64 - population_count64(val);
  233|       |  #endif
  234|  4.71M|  }
_ZN4ojph17calc_aligned_sizeImLj64EEEmm:
  302|  2.41M|  size_t calc_aligned_size(size_t size) {
  303|  2.41M|    size = size * sizeof(T) + N - 1;
  304|  2.41M|    size &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  305|  2.41M|    size >>= (63 - count_leading_zeros((ui64)sizeof(T)));
  306|  2.41M|    return size;
  307|  2.41M|  }
_ZN4ojph9align_ptrIjLj64EEEPT_S2_:
  312|  1.12M|  inline T *align_ptr(T *ptr) {
  313|  1.12M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  1.12M|    p += N - 1;
  315|  1.12M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  1.12M|    return reinterpret_cast<T *>(p);
  317|  1.12M|  }
_ZN4ojph9align_ptrImLj64EEEPT_S2_:
  312|  1.20M|  inline T *align_ptr(T *ptr) {
  313|  1.20M|    intptr_t p = reinterpret_cast<intptr_t>(ptr);
  314|  1.20M|    p += N - 1;
  315|  1.20M|    p &= ~((1ULL << (31 - count_leading_zeros(N))) - 1);
  316|  1.20M|    return reinterpret_cast<T *>(p);
  317|  1.20M|  }
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|  1.05M|  {
  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|  1.05M|  }
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|   171k|  {
  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|   171k|  }
ojph_block_decoder64.cpp:_ZN4ojphL16population_countEj:
  157|  45.0k|  {
  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|  45.0k|  }
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|   101k|  {
  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|   101k|  }
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|  43.9M|    explicit size(ui32 w = 0, ui32 h = 0) : w(w), h(h) {}
_ZNK4ojph4size4areaEv:
   53|  3.78M|    ui64 area() const { return (ui64)w * (ui64)h; }
_ZN4ojph5pointC2Ejj:
   59|  50.8M|    explicit point(ui32 x = 0, ui32 y = 0) : x(x), y(y) {}

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

_ZN4ojph19mem_fixed_allocatorC2Ev:
   62|  6.44k|    {
   63|       |      store = NULL; allocated_data = 0;
   64|  6.44k|      restart();
   65|  6.44k|    }
_ZN4ojph19mem_fixed_allocatorD2Ev:
   67|  6.44k|    {
   68|  6.44k|      if (store) free(store);
  ------------------
  |  Branch (68:11): [True: 4.74k, False: 1.69k]
  ------------------
   69|  6.44k|    }
_ZN4ojph19mem_fixed_allocator5allocEv:
   84|  4.74k|    {
   85|  4.74k|      assert(preallocation);
   86|  4.74k|      if (size_data + size_obj > allocated_data)
  ------------------
  |  Branch (86:11): [True: 4.74k, False: 0]
  ------------------
   87|  4.74k|      {
   88|       |        // We should be here once only, because, in subsequent, calls we
   89|       |        // should have size_data + size_obj <= allocated_data
   90|  4.74k|        free(store);
   91|  4.74k|        allocated_data = size_data + size_obj;
   92|  4.74k|        allocated_data = allocated_data + (allocated_data + 19) / 20; // 5%
   93|  4.74k|        store = malloc(allocated_data);
   94|  4.74k|        if (store == NULL)
  ------------------
  |  Branch (94:13): [True: 0, False: 4.74k]
  ------------------
   95|      0|          OJPH_ERROR(0x00090001, "malloc failed");
  ------------------
  |  |  289|      0|  { ojph::get_error()[0](t, __OJPHFILE__, __LINE__,__VA_ARGS__); }
  |  |  ------------------
  |  |  |  |  277|      0|    (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   96|  4.74k|      }
   97|  4.74k|      avail_obj = store;
   98|  4.74k|      avail_data = (ui8*)store + size_obj;
   99|  4.74k|      avail_size_obj = size_obj;
  100|  4.74k|      avail_size_data = size_data;
  101|  4.74k|      preallocation = false;
  102|  4.74k|    }
_ZN4ojph19mem_fixed_allocator7restartEv:
  105|  12.8k|    {
  106|       |      avail_obj = avail_data = NULL;
  107|  12.8k|      avail_size_obj = avail_size_data = size_obj = size_data = 0;
  108|  12.8k|      preallocation = true;
  109|  12.8k|    }
_ZN4ojph11lifting_bufC2Ev:
  195|  1.16M|    lifting_buf() { line = NULL;  active = false; }
_ZN4ojph11coded_listsC2Ej:
  204|   103k|    {
  205|       |      next_list = NULL;
  206|   103k|      avail_size = buf_size = size;
  207|   103k|      this->buf = (ui8*)this + sizeof(coded_lists);
  208|   103k|    }
_ZN4ojph21mem_elastic_allocatorC2Ej:
  225|  6.44k|    : chunk_size(chunk_size)
  226|  6.44k|    { cur_store = store = avail = NULL; total_allocated = 0; }
_ZN4ojph21mem_elastic_allocatorD2Ev:
  229|  6.44k|    {
  230|  9.57k|      while (store) { // stores in use
  ------------------
  |  Branch (230:14): [True: 3.12k, False: 6.44k]
  ------------------
  231|  3.12k|        stores_list* t = store->next_store;
  232|  3.12k|        free(store);
  233|  3.12k|        store = t;
  234|  3.12k|      }
  235|  6.44k|      while (avail) { // available stores
  ------------------
  |  Branch (235:14): [True: 0, False: 6.44k]
  ------------------
  236|      0|        stores_list* t = avail->next_store;
  237|      0|        free(avail);
  238|      0|        avail = t;
  239|      0|      }
  240|  6.44k|    }
_ZN4ojph21mem_elastic_allocator11stores_list18stores_list_size16Ev:
  253|  6.25k|      {
  254|  6.25k|        return (ui32) ((sizeof (stores_list) + 15u) & ~15u);
  255|  6.25k|      }
_ZN4ojph21mem_elastic_allocator11stores_listC2Ej:
  257|  3.12k|      {
  258|       |        this->next_store = NULL;
  259|  3.12k|        this->orig_size = this->available = available_bytes;
  260|  3.12k|        this->orig_data = this->data = (ui8*)this + stores_list_size16();
  261|  3.12k|      }
_ZN4ojph21mem_elastic_allocator11stores_list16eval_store_bytesEj:
  269|  3.12k|      { // calculates how many bytes need to be allocated
  270|  3.12k|        return available_bytes + stores_list_size16();
  271|  3.12k|      }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local4tileEEEvm:
   79|  4.77k|    {
   80|  4.77k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  4.77k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local4tileELi8EEEvmjRm:
  128|  4.77k|    {
  129|  4.77k|      assert(preallocation);
  130|  4.77k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  4.77k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  4.77k|      total += 2*N - 1;
  133|       |
  134|  4.77k|      sz += total;
  135|  4.77k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_8line_bufEEEvm:
   79|   470k|    {
   80|   470k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   470k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_8line_bufELi8EEEvmjRm:
  128|   470k|    {
  129|   470k|      assert(preallocation);
  130|   470k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   470k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   470k|      total += 2*N - 1;
  133|       |
  134|   470k|      sz += total;
  135|   470k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_4sizeEEEvm:
   79|  9.49k|    {
   80|  9.49k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  9.49k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_4sizeELi8EEEvmjRm:
  128|  9.49k|    {
  129|  9.49k|      assert(preallocation);
  130|  9.49k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  9.49k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  9.49k|      total += 2*N - 1;
  133|       |
  134|  9.49k|      sz += total;
  135|  9.49k|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIiEEvmj:
   73|   448k|    {
   74|   448k|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|   448k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIiLi64EEEvmjRm:
  128|   448k|    {
  129|   448k|      assert(preallocation);
  130|   448k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   448k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   448k|      total += 2*N - 1;
  133|       |
  134|   448k|      sz += total;
  135|   448k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objIhEEvm:
   79|  79.3k|    {
   80|  79.3k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  79.3k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIhLi8EEEvmjRm:
  128|  79.3k|    {
  129|  79.3k|      assert(preallocation);
  130|  79.3k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  79.3k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  79.3k|      total += 2*N - 1;
  133|       |
  134|  79.3k|      sz += total;
  135|  79.3k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objIhEEPT_m:
  120|  78.2k|    {
  121|  78.2k|      return post_alloc_local<T, object_alignment>
  122|  78.2k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  78.2k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIhLi8EEEPT_mjRmRPv:
  140|  78.2k|    {
  141|  78.2k|      assert(!preallocation);
  142|  78.2k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  78.2k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  78.2k|      total += 2*N - 1;
  145|       |
  146|  78.2k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  78.2k|      avail_p = (ui8*)avail_p + total;
  148|  78.2k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  78.2k|      return p;
  151|  78.2k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local4tileEEEPT_m:
  120|  4.74k|    {
  121|  4.74k|      return post_alloc_local<T, object_alignment>
  122|  4.74k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  4.74k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local4tileELi8EEEPT_mjRmRPv:
  140|  4.74k|    {
  141|  4.74k|      assert(!preallocation);
  142|  4.74k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  4.74k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  4.74k|      total += 2*N - 1;
  145|       |
  146|  4.74k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  4.74k|      avail_p = (ui8*)avail_p + total;
  148|  4.74k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  4.74k|      return p;
  151|  4.74k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_8line_bufEEEPT_m:
  120|   454k|    {
  121|   454k|      return post_alloc_local<T, object_alignment>
  122|   454k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   454k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_8line_bufELi8EEEPT_mjRmRPv:
  140|   454k|    {
  141|   454k|      assert(!preallocation);
  142|   454k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   454k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   454k|      total += 2*N - 1;
  145|       |
  146|   454k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   454k|      avail_p = (ui8*)avail_p + total;
  148|   454k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   454k|      return p;
  151|   454k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_4sizeEEEPT_m:
  120|  9.12k|    {
  121|  9.12k|      return post_alloc_local<T, object_alignment>
  122|  9.12k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  9.12k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_4sizeELi8EEEPT_mjRmRPv:
  140|  9.12k|    {
  141|  9.12k|      assert(!preallocation);
  142|  9.12k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  9.12k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  9.12k|      total += 2*N - 1;
  145|       |
  146|  9.12k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  9.12k|      avail_p = (ui8*)avail_p + total;
  148|  9.12k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  9.12k|      return p;
  151|  9.12k|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIiEEPT_mj:
  113|   447k|    {
  114|   447k|      return post_alloc_local<T, byte_alignment>
  115|   447k|        (num_ele, pre_size, avail_size_data, avail_data);
  116|   447k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIiLi64EEEPT_mjRmRPv:
  140|   447k|    {
  141|   447k|      assert(!preallocation);
  142|   447k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   447k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   447k|      total += 2*N - 1;
  145|       |
  146|   447k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   447k|      avail_p = (ui8*)avail_p + total;
  148|   447k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   447k|      return p;
  151|   447k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local9tile_compEEEvm:
   79|  74.6k|    {
   80|  74.6k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|  74.6k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local9tile_compELi8EEEvmjRm:
  128|  74.6k|    {
  129|  74.6k|      assert(preallocation);
  130|  74.6k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  74.6k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  74.6k|      total += 2*N - 1;
  133|       |
  134|  74.6k|      sz += total;
  135|  74.6k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_4rectEEEvm:
   79|   149k|    {
   80|   149k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   149k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_4rectELi8EEEvmjRm:
  128|   149k|    {
  129|   149k|      assert(preallocation);
  130|   149k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   149k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   149k|      total += 2*N - 1;
  133|       |
  134|   149k|      sz += total;
  135|   149k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objIjEEvm:
   79|   223k|    {
   80|   223k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   223k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIjLi8EEEvmjRm:
  128|   223k|    {
  129|   223k|      assert(preallocation);
  130|   223k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   223k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   223k|      total += 2*N - 1;
  133|       |
  134|   223k|      sz += total;
  135|   223k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objIbEEvm:
   79|   149k|    {
   80|   149k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   149k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIbLi8EEEvmjRm:
  128|   149k|    {
  129|   149k|      assert(preallocation);
  130|   149k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   149k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   149k|      total += 2*N - 1;
  133|       |
  134|   149k|      sz += total;
  135|   149k|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIfEEvmj:
   73|   308k|    {
   74|   308k|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|   308k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIfLi64EEEvmjRm:
  128|   308k|    {
  129|   308k|      assert(preallocation);
  130|   308k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   308k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   308k|      total += 2*N - 1;
  133|       |
  134|   308k|      sz += total;
  135|   308k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local9tile_compEEEPT_m:
  120|  73.5k|    {
  121|  73.5k|      return post_alloc_local<T, object_alignment>
  122|  73.5k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|  73.5k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local9tile_compELi8EEEPT_mjRmRPv:
  140|  73.5k|    {
  141|  73.5k|      assert(!preallocation);
  142|  73.5k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  73.5k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  73.5k|      total += 2*N - 1;
  145|       |
  146|  73.5k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  73.5k|      avail_p = (ui8*)avail_p + total;
  148|  73.5k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  73.5k|      return p;
  151|  73.5k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_4rectEEEPT_m:
  120|   147k|    {
  121|   147k|      return post_alloc_local<T, object_alignment>
  122|   147k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   147k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_4rectELi8EEEPT_mjRmRPv:
  140|   147k|    {
  141|   147k|      assert(!preallocation);
  142|   147k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   147k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   147k|      total += 2*N - 1;
  145|       |
  146|   147k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   147k|      avail_p = (ui8*)avail_p + total;
  148|   147k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   147k|      return p;
  151|   147k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objIjEEPT_m:
  120|   220k|    {
  121|   220k|      return post_alloc_local<T, object_alignment>
  122|   220k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   220k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIjLi8EEEPT_mjRmRPv:
  140|   220k|    {
  141|   220k|      assert(!preallocation);
  142|   220k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   220k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   220k|      total += 2*N - 1;
  145|       |
  146|   220k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   220k|      avail_p = (ui8*)avail_p + total;
  148|   220k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   220k|      return p;
  151|   220k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objIbEEPT_m:
  120|   147k|    {
  121|   147k|      return post_alloc_local<T, object_alignment>
  122|   147k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   147k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIbLi8EEEPT_mjRmRPv:
  140|   147k|    {
  141|   147k|      assert(!preallocation);
  142|   147k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   147k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   147k|      total += 2*N - 1;
  145|       |
  146|   147k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   147k|      avail_p = (ui8*)avail_p + total;
  148|   147k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   147k|      return p;
  151|   147k|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIfEEPT_mj:
  113|   238k|    {
  114|   238k|      return post_alloc_local<T, byte_alignment>
  115|   238k|        (num_ele, pre_size, avail_size_data, avail_data);
  116|   238k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIfLi64EEEPT_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_allocator13pre_alloc_objINS_5local10resolutionEEEvm:
   79|   342k|    {
   80|   342k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   342k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local10resolutionELi8EEEvmjRm:
  128|   342k|    {
  129|   342k|      assert(preallocation);
  130|   342k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   342k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   342k|      total += 2*N - 1;
  133|       |
  134|   342k|      sz += total;
  135|   342k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local10resolutionEEEPT_m:
  120|   328k|    {
  121|   328k|      return post_alloc_local<T, object_alignment>
  122|   328k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   328k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local10resolutionELi8EEEPT_mjRmRPv:
  140|   328k|    {
  141|   328k|      assert(!preallocation);
  142|   328k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   328k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   328k|      total += 2*N - 1;
  145|       |
  146|   328k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   328k|      avail_p = (ui8*)avail_p + total;
  148|   328k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   328k|      return p;
  151|   328k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local7subbandEEEvm:
   79|   342k|    {
   80|   342k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   342k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local7subbandELi8EEEvmjRm:
  128|   342k|    {
  129|   342k|      assert(preallocation);
  130|   342k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   342k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   342k|      total += 2*N - 1;
  133|       |
  134|   342k|      sz += total;
  135|   342k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local8precinctEEEvm:
   79|   120k|    {
   80|   120k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   120k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local8precinctELi8EEEvmjRm:
  128|   120k|    {
  129|   120k|      assert(preallocation);
  130|   120k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   120k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   120k|      total += 2*N - 1;
  133|       |
  134|   120k|      sz += total;
  135|   120k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_11lifting_bufEEEvm:
   79|   285k|    {
   80|   285k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   285k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_11lifting_bufELi8EEEvmjRm:
  128|   285k|    {
  129|   285k|      assert(preallocation);
  130|   285k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   285k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   285k|      total += 2*N - 1;
  133|       |
  134|   285k|      sz += total;
  135|   285k|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIlEEvmj:
   73|   665k|    {
   74|   665k|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|   665k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIlLi64EEEvmjRm:
  128|   665k|    {
  129|   665k|      assert(preallocation);
  130|   665k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   665k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   665k|      total += 2*N - 1;
  133|       |
  134|   665k|      sz += total;
  135|   665k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local7subbandEEEPT_m:
  120|   328k|    {
  121|   328k|      return post_alloc_local<T, object_alignment>
  122|   328k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   328k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local7subbandELi8EEEPT_mjRmRPv:
  140|   328k|    {
  141|   328k|      assert(!preallocation);
  142|   328k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   328k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   328k|      total += 2*N - 1;
  145|       |
  146|   328k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   328k|      avail_p = (ui8*)avail_p + total;
  148|   328k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   328k|      return p;
  151|   328k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local8precinctEEEPT_m:
  120|   117k|    {
  121|   117k|      return post_alloc_local<T, object_alignment>
  122|   117k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   117k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local8precinctELi8EEEPT_mjRmRPv:
  140|   117k|    {
  141|   117k|      assert(!preallocation);
  142|   117k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   117k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   117k|      total += 2*N - 1;
  145|       |
  146|   117k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   117k|      avail_p = (ui8*)avail_p + total;
  148|   117k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   117k|      return p;
  151|   117k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_11lifting_bufEEEPT_m:
  120|   274k|    {
  121|   274k|      return post_alloc_local<T, object_alignment>
  122|   274k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   274k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_11lifting_bufELi8EEEPT_mjRmRPv:
  140|   274k|    {
  141|   274k|      assert(!preallocation);
  142|   274k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   274k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   274k|      total += 2*N - 1;
  145|       |
  146|   274k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   274k|      avail_p = (ui8*)avail_p + total;
  148|   274k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   274k|      return p;
  151|   274k|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIlEEPT_mj:
  113|   665k|    {
  114|   665k|      return post_alloc_local<T, byte_alignment>
  115|   665k|        (num_ele, pre_size, avail_size_data, avail_data);
  116|   665k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIlLi64EEEPT_mjRmRPv:
  140|   665k|    {
  141|   665k|      assert(!preallocation);
  142|   665k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   665k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   665k|      total += 2*N - 1;
  145|       |
  146|   665k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   665k|      avail_p = (ui8*)avail_p + total;
  148|   665k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   665k|      return p;
  151|   665k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local9codeblockEEEvm:
   79|   176k|    {
   80|   176k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   176k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local9codeblockELi8EEEvmjRm:
  128|   176k|    {
  129|   176k|      assert(preallocation);
  130|   176k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   176k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   176k|      total += 2*N - 1;
  133|       |
  134|   176k|      sz += total;
  135|   176k|    }
_ZN4ojph19mem_fixed_allocator13pre_alloc_objINS_5local15coded_cb_headerEEEvm:
   79|   176k|    {
   80|   176k|      pre_alloc_local<T, object_alignment>(num_ele, 0, size_obj);
   81|   176k|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localINS_5local15coded_cb_headerELi8EEEvmjRm:
  128|   176k|    {
  129|   176k|      assert(preallocation);
  130|   176k|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|   176k|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|   176k|      total += 2*N - 1;
  133|       |
  134|   176k|      sz += total;
  135|   176k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local9codeblockEEEPT_m:
  120|   172k|    {
  121|   172k|      return post_alloc_local<T, object_alignment>
  122|   172k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   172k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local9codeblockELi8EEEPT_mjRmRPv:
  140|   172k|    {
  141|   172k|      assert(!preallocation);
  142|   172k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   172k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   172k|      total += 2*N - 1;
  145|       |
  146|   172k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   172k|      avail_p = (ui8*)avail_p + total;
  148|   172k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   172k|      return p;
  151|   172k|    }
_ZN4ojph19mem_fixed_allocator14post_alloc_objINS_5local15coded_cb_headerEEEPT_m:
  120|   172k|    {
  121|   172k|      return post_alloc_local<T, object_alignment>
  122|   172k|        (num_ele, 0, avail_size_obj, avail_obj);
  123|   172k|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localINS_5local15coded_cb_headerELi8EEEPT_mjRmRPv:
  140|   172k|    {
  141|   172k|      assert(!preallocation);
  142|   172k|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|   172k|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|   172k|      total += 2*N - 1;
  145|       |
  146|   172k|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|   172k|      avail_p = (ui8*)avail_p + total;
  148|   172k|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|   172k|      return p;
  151|   172k|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataIjEEvmj:
   73|  1.17M|    {
   74|  1.17M|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|  1.17M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localIjLi64EEEvmjRm:
  128|  1.17M|    {
  129|  1.17M|      assert(preallocation);
  130|  1.17M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.17M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.17M|      total += 2*N - 1;
  133|       |
  134|  1.17M|      sz += total;
  135|  1.17M|    }
_ZN4ojph19mem_fixed_allocator14pre_alloc_dataImEEvmj:
   73|  1.21M|    {
   74|  1.21M|      pre_alloc_local<T, byte_alignment>(num_ele, pre_size, size_data);
   75|  1.21M|    }
_ZN4ojph19mem_fixed_allocator15pre_alloc_localImLi64EEEvmjRm:
  128|  1.21M|    {
  129|  1.21M|      assert(preallocation);
  130|  1.21M|      num_ele = calc_aligned_size<T, N>(num_ele);
  131|  1.21M|      size_t total = (num_ele + pre_size) * sizeof(T);
  132|  1.21M|      total += 2*N - 1;
  133|       |
  134|  1.21M|      sz += total;
  135|  1.21M|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataIjEEPT_mj:
  113|  1.12M|    {
  114|  1.12M|      return post_alloc_local<T, byte_alignment>
  115|  1.12M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  1.12M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localIjLi64EEEPT_mjRmRPv:
  140|  1.12M|    {
  141|  1.12M|      assert(!preallocation);
  142|  1.12M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  1.12M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  1.12M|      total += 2*N - 1;
  145|       |
  146|  1.12M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  1.12M|      avail_p = (ui8*)avail_p + total;
  148|  1.12M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  1.12M|      return p;
  151|  1.12M|    }
_ZN4ojph19mem_fixed_allocator15post_alloc_dataImEEPT_mj:
  113|  1.20M|    {
  114|  1.20M|      return post_alloc_local<T, byte_alignment>
  115|  1.20M|        (num_ele, pre_size, avail_size_data, avail_data);
  116|  1.20M|    }
_ZN4ojph19mem_fixed_allocator16post_alloc_localImLi64EEEPT_mjRmRPv:
  140|  1.20M|    {
  141|  1.20M|      assert(!preallocation);
  142|  1.20M|      num_ele = calc_aligned_size<T, N>(num_ele);
  143|  1.20M|      size_t total = (num_ele + pre_size) * sizeof(T);
  144|  1.20M|      total += 2*N - 1;
  145|       |
  146|  1.20M|      T* p = align_ptr<T, N>((T*)avail_p + pre_size);
  147|  1.20M|      avail_p = (ui8*)avail_p + total;
  148|  1.20M|      avail_sz -= total;
  149|       |      assert((avail_sz & 0x8000000000000000llu) == 0);
  150|  1.20M|      return p;
  151|  1.20M|    }

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

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

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

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

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

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

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

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

