LLVMFuzzerTestOneInput:
   29|  16.2k|{
   30|  16.2k|  auto reader = std::make_shared<StreamReader_memory>(data, size, false);
   31|       |
   32|       |  // --- OSS-Fuzz assumes a bug if the allocated memory exceeds 2560 MB.
   33|       |  //     Set a lower allocation limit to prevent this.
   34|       |
   35|       |  // Use a context for tracking the memory usage and set the reduced limit.
   36|  16.2k|  HeifContext ctx;
   37|  16.2k|  ctx.get_security_limits()->max_total_memory = UINT64_C(2) * 1024 * 1024 * 1024;
   38|       |
   39|  16.2k|  BitstreamRange range(reader, size);
   40|   170k|  for (;;) {
   41|   170k|    std::shared_ptr<Box> box;
   42|   170k|    Error error = Box::read(range, &box, ctx.get_security_limits());
   43|   170k|    if (error != Error::Ok || range.error()) {
  ------------------
  |  Branch (43:9): [True: 16.2k, False: 154k]
  |  Branch (43:31): [True: 0, False: 154k]
  ------------------
   44|  16.2k|      break;
   45|  16.2k|    }
   46|       |
   47|   154k|    box->get_type();
   48|   154k|    box->get_type_string();
   49|   154k|    Indent indent;
   50|   154k|    box->dump(indent);
   51|   154k|  }
   52|       |
   53|  16.2k|  return 0;
   54|  16.2k|}

heif_polarization_angle_is_no_filter:
  587|  30.1k|{
  588|  30.1k|  uint32_t bits;
  589|  30.1k|  memcpy(&bits, &angle, sizeof(bits));
  590|  30.1k|  return bits == 0xFFFFFFFF;
  591|  30.1k|}

_Z30initialize_heif_tai_clock_infoP19heif_tai_clock_info:
   29|  1.70k|{
   30|  1.70k|  taic->version = 1;
   31|  1.70k|  taic->time_uncertainty = heif_tai_clock_info_time_uncertainty_unknown;
  ------------------
  |  |   52|  1.70k|#define heif_tai_clock_info_time_uncertainty_unknown UINT64_C(0xFFFFFFFFFFFFFFFF)
  ------------------
   32|  1.70k|  taic->clock_resolution = 0;
   33|  1.70k|  taic->clock_drift_rate = heif_tai_clock_info_clock_drift_rate_unknown;
  ------------------
  |  |   53|  1.70k|#define heif_tai_clock_info_clock_drift_rate_unknown INT32_C(0x7FFFFFFF)
  ------------------
   34|  1.70k|  taic->clock_type = heif_tai_clock_info_clock_type_unknown;
  ------------------
  |  |   54|  1.70k|#define heif_tai_clock_info_clock_type_unknown 0
  ------------------
   35|  1.70k|}
_Z36initialize_heif_tai_timestamp_packetP25heif_tai_timestamp_packet:
   47|    300|{
   48|    300|  itai->version = 1;
   49|    300|  itai->tai_timestamp = 0;
   50|    300|  itai->synchronization_state = false;
   51|    300|  itai->timestamp_generation_failure = false;
   52|    300|  itai->timestamp_is_modified = false;
   53|    300|}

_ZN19StreamReader_memoryC2EPKhmb:
   78|  16.2k|    : m_length(size)
   79|  16.2k|{
   80|  16.2k|  if (copy) {
  ------------------
  |  Branch (80:7): [True: 0, False: 16.2k]
  ------------------
   81|      0|    m_owned_data = new uint8_t[m_length];
   82|      0|    memcpy(m_owned_data, data, size);
   83|       |
   84|      0|    m_data = m_owned_data;
   85|      0|  }
   86|  16.2k|  else {
   87|  16.2k|    m_data = data;
   88|  16.2k|  }
   89|  16.2k|}
_ZN19StreamReader_memoryD2Ev:
   92|  16.2k|{
   93|  16.2k|  if (m_owned_data) {
  ------------------
  |  Branch (93:7): [True: 0, False: 16.2k]
  ------------------
   94|      0|    delete[] m_owned_data;
   95|      0|  }
   96|  16.2k|}
_ZNK19StreamReader_memory12get_positionEv:
   99|   698k|{
  100|   698k|  return m_position;
  101|   698k|}
_ZN19StreamReader_memory18wait_for_file_sizeEm:
  104|   603k|{
  105|   603k|  return (target_size > m_length) ? grow_status::size_beyond_eof : grow_status::size_reached;
  ------------------
  |  Branch (105:10): [True: 11.1k, False: 591k]
  ------------------
  106|   603k|}
_ZN19StreamReader_memory4readEPvm:
  109|  58.1M|{
  110|  58.1M|  uint64_t end_pos = m_position + size;
  111|  58.1M|  if (end_pos > m_length) {
  ------------------
  |  Branch (111:7): [True: 0, False: 58.1M]
  ------------------
  112|      0|    return false;
  113|      0|  }
  114|       |
  115|  58.1M|  memcpy(data, &m_data[m_position], size);
  116|  58.1M|  m_position += size;
  117|       |
  118|  58.1M|  return true;
  119|  58.1M|}
_ZN19StreamReader_memory4seekEm:
  122|  82.6k|{
  123|  82.6k|  if (position > m_length)
  ------------------
  |  Branch (123:7): [True: 0, False: 82.6k]
  ------------------
  124|      0|    return false;
  125|       |
  126|  82.6k|  m_position = position;
  127|  82.6k|  return true;
  128|  82.6k|}
_ZN14BitstreamRangeC2ENSt3__110shared_ptrI12StreamReaderEEmPS_:
  156|   320k|    : m_istr(std::move(istr)), m_parent_range(parent), m_remaining(length)
  157|   320k|{
  158|   320k|  if (parent) {
  ------------------
  |  Branch (158:7): [True: 304k, False: 16.2k]
  ------------------
  159|   304k|    m_nesting_level = parent->m_nesting_level + 1;
  160|   304k|  }
  161|   320k|}
_ZN14BitstreamRange5read8Ev:
  184|  17.9M|{
  185|  17.9M|  if (!prepare_read(1)) {
  ------------------
  |  Branch (185:7): [True: 191k, False: 17.7M]
  ------------------
  186|   191k|    return 0;
  187|   191k|  }
  188|       |
  189|  17.7M|  uint8_t buf;
  190|       |
  191|  17.7M|  auto istr = get_istream();
  192|  17.7M|  bool success = istr->read((char*) &buf, 1);
  193|       |
  194|  17.7M|  if (!success) {
  ------------------
  |  Branch (194:7): [True: 0, False: 17.7M]
  ------------------
  195|      0|    set_eof_while_reading();
  196|      0|    return 0;
  197|      0|  }
  198|       |
  199|  17.7M|  return buf;
  200|  17.7M|}
_ZN14BitstreamRange6read16Ev:
  204|  7.06M|{
  205|  7.06M|  if (!prepare_read(2)) {
  ------------------
  |  Branch (205:7): [True: 22.4k, False: 7.04M]
  ------------------
  206|  22.4k|    return 0;
  207|  22.4k|  }
  208|       |
  209|  7.04M|  uint8_t buf[2];
  210|       |
  211|  7.04M|  auto istr = get_istream();
  212|  7.04M|  bool success = istr->read((char*) buf, 2);
  213|       |
  214|  7.04M|  if (!success) {
  ------------------
  |  Branch (214:7): [True: 0, False: 7.04M]
  ------------------
  215|      0|    set_eof_while_reading();
  216|      0|    return 0;
  217|      0|  }
  218|       |
  219|  7.04M|  return static_cast<uint16_t>((buf[0] << 8) | (buf[1]));
  220|  7.04M|}
_ZN14BitstreamRange7read16sEv:
  224|   141k|{
  225|   141k|  uint16_t v = read16();
  226|       |
  227|   141k|  if (v & 0x8000) {
  ------------------
  |  Branch (227:7): [True: 8.55k, False: 133k]
  ------------------
  228|  8.55k|    auto val = static_cast<int16_t>((~v) & 0x7fff);
  229|  8.55k|    return static_cast<int16_t>(-val - 1);
  230|  8.55k|  }
  231|   133k|  else {
  232|   133k|    return static_cast<int16_t>(v);
  233|   133k|  }
  234|   141k|}
_ZN14BitstreamRange6read24Ev:
  238|    214|{
  239|    214|  if (!prepare_read(3)) {
  ------------------
  |  Branch (239:7): [True: 0, False: 214]
  ------------------
  240|      0|    return 0;
  241|      0|  }
  242|       |
  243|    214|  uint8_t buf[3];
  244|       |
  245|    214|  auto istr = get_istream();
  246|    214|  bool success = istr->read((char*) buf, 3);
  247|       |
  248|    214|  if (!success) {
  ------------------
  |  Branch (248:7): [True: 0, False: 214]
  ------------------
  249|      0|    set_eof_while_reading();
  250|      0|    return 0;
  251|      0|  }
  252|       |
  253|    214|  return (uint32_t) ((buf[0] << 16) |
  254|    214|                     (buf[1] << 8) |
  255|    214|                     (buf[2]));
  256|    214|}
_ZN14BitstreamRange6read32Ev:
  259|   893M|{
  260|   893M|  if (!prepare_read(4)) {
  ------------------
  |  Branch (260:7): [True: 888M, False: 5.47M]
  ------------------
  261|   888M|    return 0;
  262|   888M|  }
  263|       |
  264|  5.47M|  uint8_t buf[4];
  265|       |
  266|  5.47M|  auto istr = get_istream();
  267|  5.47M|  bool success = istr->read((char*) buf, 4);
  268|       |
  269|  5.47M|  if (!success) {
  ------------------
  |  Branch (269:7): [True: 0, False: 5.47M]
  ------------------
  270|      0|    set_eof_while_reading();
  271|      0|    return 0;
  272|      0|  }
  273|       |
  274|  5.47M|  return four_bytes_to_uint32(buf[0], buf[1], buf[2], buf[3]);
  275|  5.47M|}
_ZN14BitstreamRange9read_uintEi:
  279|   502k|{
  280|   502k|  switch (len)
  281|   502k|  {
  282|   432k|    case 8:
  ------------------
  |  Branch (282:5): [True: 432k, False: 70.0k]
  ------------------
  283|   432k|      return read8();
  284|  68.2k|    case 16:
  ------------------
  |  Branch (284:5): [True: 68.2k, False: 434k]
  ------------------
  285|  68.2k|      return read16();
  286|    214|    case 24:
  ------------------
  |  Branch (286:5): [True: 214, False: 502k]
  ------------------
  287|    214|      return read24();
  288|  1.32k|    case 32:
  ------------------
  |  Branch (288:5): [True: 1.32k, False: 501k]
  ------------------
  289|  1.32k|      return read32();
  290|    277|    case 64:
  ------------------
  |  Branch (290:5): [True: 277, False: 502k]
  ------------------
  291|    277|      return read64();
  292|      0|    default:
  ------------------
  |  Branch (292:5): [True: 0, False: 502k]
  ------------------
  293|      0|      assert(false);
  ------------------
  |  Branch (293:7): [Folded, False: 0]
  ------------------
  294|      0|      return 0;
  295|   502k|  }
  296|   502k|}
_ZN14BitstreamRange7read32sEv:
  300|  91.3k|{
  301|  91.3k|  uint32_t v = read32();
  302|       |
  303|  91.3k|  if (v & 0x80000000) {
  ------------------
  |  Branch (303:7): [True: 9.68k, False: 81.6k]
  ------------------
  304|  9.68k|    return -static_cast<int32_t>((~v) & 0x7fffffff) -1;
  305|  9.68k|  }
  306|  81.6k|  else {
  307|  81.6k|    return static_cast<int32_t>(v);
  308|  81.6k|  }
  309|  91.3k|}
_ZN14BitstreamRange6read64Ev:
  313|  3.84k|{
  314|  3.84k|  if (!prepare_read(8)) {
  ------------------
  |  Branch (314:7): [True: 75, False: 3.77k]
  ------------------
  315|     75|    return 0;
  316|     75|  }
  317|       |
  318|  3.77k|  uint8_t buf[8];
  319|       |
  320|  3.77k|  auto istr = get_istream();
  321|  3.77k|  bool success = istr->read((char*) buf, 8);
  322|       |
  323|  3.77k|  if (!success) {
  ------------------
  |  Branch (323:7): [True: 0, False: 3.77k]
  ------------------
  324|      0|    set_eof_while_reading();
  325|      0|    return 0;
  326|      0|  }
  327|       |
  328|  3.77k|  return ((static_cast<uint64_t>(buf[0]) << 56) |
  329|  3.77k|          (static_cast<uint64_t>(buf[1]) << 48) |
  330|  3.77k|          (static_cast<uint64_t>(buf[2]) << 40) |
  331|  3.77k|          (static_cast<uint64_t>(buf[3]) << 32) |
  332|  3.77k|          (static_cast<uint64_t>(buf[4]) << 24) |
  333|  3.77k|          (static_cast<uint64_t>(buf[5]) << 16) |
  334|  3.77k|          (static_cast<uint64_t>(buf[6]) << 8) |
  335|  3.77k|          (static_cast<uint64_t>(buf[7])));
  336|  3.77k|}
_ZN14BitstreamRange7read64sEv:
  340|    235|{
  341|    235|  uint64_t v = read64();
  342|       |
  343|    235|  if (v & 0x8000000000000000) {
  ------------------
  |  Branch (343:7): [True: 163, False: 72]
  ------------------
  344|    163|    return -static_cast<int64_t >((~v) & 0x7fffffffffffffff) -1;
  345|    163|  }
  346|     72|  else {
  347|     72|    return static_cast<int64_t >(v);
  348|     72|  }
  349|    235|}
_ZN14BitstreamRange12read_float32Ev:
  353|   888M|{
  354|   888M|#if __cpp_lib_bit_cast >= 201806L
  355|   888M|  uint32_t i = read32();
  356|   888M|  return std::bit_cast<float>(i); // this works directly on the value layout, thus we do not have to worry about memory layout
  357|       |#else
  358|       |  // compiler too old to support bit_cast
  359|       |
  360|       |  // TODO: I am not sure this works everywhere as there seem to be systems where
  361|       |  //       the float byte order is different from the integer endianness
  362|       |  //       https://en.wikipedia.org/wiki/Endianness#Floating_point
  363|       |  uint32_t i = read32();
  364|       |  float f;
  365|       |  memcpy(&f, &i, sizeof(float));
  366|       |  return f;
  367|       |#endif
  368|   888M|}
_ZN14BitstreamRange11read_stringEv:
  389|  24.2k|{
  390|  24.2k|  std::string str;
  391|       |
  392|       |  // Reading a string when no more data is available, returns an empty string.
  393|       |  // Such a case happens, for example, when reading a 'url' box without content.
  394|  24.2k|  if (eof()) {
  ------------------
  |  Branch (394:7): [True: 5.11k, False: 19.1k]
  ------------------
  395|  5.11k|    return std::string();
  396|  5.11k|  }
  397|       |
  398|  19.1k|  auto istr = get_istream();
  399|       |
  400|  27.7M|  for (;;) {
  401|  27.7M|    if (!prepare_read(1)) {
  ------------------
  |  Branch (401:9): [True: 0, False: 27.7M]
  ------------------
  402|      0|      return std::string();
  403|      0|    }
  404|       |
  405|  27.7M|    char c;
  406|  27.7M|    bool success = istr->read(&c, 1);
  407|       |
  408|  27.7M|    if (!success) {
  ------------------
  |  Branch (408:9): [True: 0, False: 27.7M]
  ------------------
  409|      0|      set_eof_while_reading();
  410|      0|      return std::string();
  411|      0|    }
  412|       |
  413|  27.7M|    if (c == 0 || m_remaining==0) {
  ------------------
  |  Branch (413:9): [True: 18.5k, False: 27.7M]
  |  Branch (413:19): [True: 603, False: 27.7M]
  ------------------
  414|  19.1k|      break;
  415|  19.1k|    }
  416|  27.7M|    else {
  417|  27.7M|      str += (char) c;
  418|  27.7M|    }
  419|  27.7M|  }
  420|       |
  421|  19.1k|  return str;
  422|  19.1k|}
_ZN14BitstreamRange17read_fixed_stringEi:
  426|    994|{
  427|    994|  std::string str;
  428|       |
  429|    994|  if (!prepare_read(len)) {
  ------------------
  |  Branch (429:7): [True: 64, False: 930]
  ------------------
  430|     64|    return std::string();
  431|     64|  }
  432|       |
  433|    930|  auto istr = get_istream();
  434|       |
  435|    930|  uint8_t n;
  436|    930|  bool success = istr->read(&n, 1);
  437|    930|  if (!success || n > len - 1) {
  ------------------
  |  Branch (437:7): [True: 0, False: 930]
  |  Branch (437:19): [True: 374, False: 556]
  ------------------
  438|    374|    return {};
  439|    374|  }
  440|       |
  441|  5.84k|  for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (441:19): [True: 5.28k, False: 556]
  ------------------
  442|  5.28k|    char c;
  443|  5.28k|    success = istr->read(&c, 1);
  444|       |
  445|  5.28k|    if (!success) {
  ------------------
  |  Branch (445:9): [True: 0, False: 5.28k]
  ------------------
  446|      0|      set_eof_while_reading();
  447|      0|      return std::string();
  448|      0|    }
  449|       |
  450|  5.28k|    str += (char) c;
  451|  5.28k|  }
  452|       |
  453|    556|  istr->seek_cur(len-n-1);
  454|       |
  455|    556|  return str;
  456|    556|}
_ZN14BitstreamRange21read_string_until_eofEv:
  460|  1.06k|{
  461|  1.06k|  size_t n = get_remaining_bytes();
  462|       |
  463|  1.06k|  [[maybe_unused]] bool success = prepare_read(n);
  464|  1.06k|  assert(success); // we are reading exactly the rest of the box
  ------------------
  |  Branch (464:3): [True: 1.06k, False: 0]
  ------------------
  465|       |
  466|  1.06k|  std::string str;
  467|  1.06k|  str.resize(n);
  468|  1.06k|  get_istream()->read(str.data(), n);
  469|       |
  470|  1.06k|  return str;
  471|  1.06k|}
_ZN14BitstreamRange4readEPhm:
  475|   104k|{
  476|   104k|  if (!prepare_read(n)) {
  ------------------
  |  Branch (476:7): [True: 73, False: 104k]
  ------------------
  477|     73|    return false;
  478|     73|  }
  479|       |
  480|   104k|  auto istr = get_istream();
  481|   104k|  bool success = istr->read(data, n);
  482|       |
  483|   104k|  if (!success) {
  ------------------
  |  Branch (483:7): [True: 0, False: 104k]
  ------------------
  484|      0|    set_eof_while_reading();
  485|      0|  }
  486|       |
  487|   104k|  return success;
  488|   104k|}
_ZN14BitstreamRange12prepare_readEm:
  492|  1.21G|{
  493|       |  // Note: we do not test for negative nBytes anymore because we now use the unsigned size_t
  494|       |
  495|  1.21G|  if (m_remaining < nBytes) {
  ------------------
  |  Branch (495:7): [True: 888M, False: 322M]
  ------------------
  496|       |    // --- not enough data left in box -> move to end of box and set error flag
  497|       |
  498|   888M|    skip_to_end_of_box();
  499|       |
  500|   888M|    m_error = true;
  501|   888M|    return false;
  502|   888M|  }
  503|   322M|  else {
  504|       |    // --- this is the normal case (m_remaining >= nBytes)
  505|       |
  506|   322M|    if (m_parent_range) {
  ------------------
  |  Branch (506:9): [True: 264M, False: 58.1M]
  ------------------
  507|   264M|      if (!m_parent_range->prepare_read(nBytes)) {
  ------------------
  |  Branch (507:11): [True: 0, False: 264M]
  ------------------
  508|      0|        return false;
  509|      0|      }
  510|   264M|    }
  511|       |
  512|   322M|    m_remaining -= nBytes;
  513|       |
  514|   322M|    return true;
  515|   322M|  }
  516|  1.21G|}
_ZN14BitstreamRange24wait_for_available_bytesEm:
  520|   603k|{
  521|   603k|  int64_t target_size = m_istr->get_position() + nBytes;
  522|       |
  523|   603k|  return m_istr->wait_for_file_size(target_size);
  524|   603k|}
_ZN14BitstreamRange31skip_without_advancing_file_posEm:
  528|   465k|{
  529|   465k|  assert(n <= m_remaining);
  ------------------
  |  Branch (529:3): [True: 465k, False: 0]
  ------------------
  530|       |
  531|   465k|  m_remaining -= n;
  532|       |
  533|   465k|  if (m_parent_range) {
  ------------------
  |  Branch (533:7): [True: 385k, False: 80.7k]
  ------------------
  534|   385k|    m_parent_range->skip_without_advancing_file_pos(n);
  535|   385k|  }
  536|   465k|}
_ZN9BitReaderC2EPKhm:
  540|  9.36k|  : data_start(buffer),
  541|  9.36k|    data_length(len)
  542|  9.36k|{
  543|  9.36k|  data = buffer;
  544|  9.36k|  bytes_remaining = len;
  545|       |
  546|  9.36k|  nextbits = 0;
  547|  9.36k|  nextbits_cnt = 0;
  548|       |
  549|  9.36k|  refill();
  550|  9.36k|}
_ZN9BitReader8get_bitsEi:
  566|   628k|{
  567|   628k|  assert(n <= 32);
  ------------------
  |  Branch (567:3): [True: 628k, False: 0]
  ------------------
  568|       |
  569|   628k|  if (nextbits_cnt < n) {
  ------------------
  |  Branch (569:7): [True: 71.4k, False: 557k]
  ------------------
  570|  71.4k|    refill();
  571|  71.4k|  }
  572|       |
  573|   628k|  uint64_t val = nextbits;
  574|   628k|  val >>= 64 - n;
  575|       |
  576|   628k|#if AVOID_FUZZER_FALSE_POSITIVE
  577|       |  // Shifting an unsigned integer left such that some MSBs fall out is well defined in C++ despite the fuzzer claiming otherwise.
  578|   628k|  nextbits &= (0xffffffffffffffffULL >> n);
  579|   628k|#endif
  580|       |
  581|   628k|  nextbits <<= n;
  582|   628k|  nextbits_cnt -= n;
  583|       |
  584|   628k|  return static_cast<uint32_t>(val);
  585|   628k|}
_ZN9BitReader9get_bits8Ei:
  589|   143k|{
  590|   143k|  assert(n>0 && n <= 8);
  ------------------
  |  Branch (590:3): [True: 143k, False: 0]
  |  Branch (590:3): [True: 143k, False: 0]
  |  Branch (590:3): [True: 143k, False: 0]
  ------------------
  591|   143k|  return static_cast<uint8_t>(get_bits(n));
  592|   143k|}
_ZN9BitReader10get_bits16Ei:
  595|  36.8k|{
  596|  36.8k|  assert(n>0 && n <= 16);
  ------------------
  |  Branch (596:3): [True: 36.8k, False: 0]
  |  Branch (596:3): [True: 36.8k, False: 0]
  |  Branch (596:3): [True: 36.8k, False: 0]
  ------------------
  597|  36.8k|  return static_cast<uint16_t>(get_bits(n));
  598|  36.8k|}
_ZN9BitReader10get_bits32Ei:
  601|   112k|{
  602|   112k|  assert(n>0 && n <= 32);
  ------------------
  |  Branch (602:3): [True: 112k, False: 0]
  |  Branch (602:3): [True: 112k, False: 0]
  |  Branch (602:3): [True: 112k, False: 0]
  ------------------
  603|   112k|  return static_cast<uint32_t>(get_bits(n));
  604|   112k|}
_ZN9BitReader11get_bits32sEv:
  607|  4.59k|{
  608|  4.59k|  uint32_t bits = get_bits(32);
  609|  4.59k|  return static_cast<int32_t>(bits);
  610|  4.59k|}
_ZN9BitReader8get_flagEv:
  614|   331k|{
  615|   331k|  return (get_bits(1) == 0x01);
  616|   331k|}
_ZN9BitReader10read_bytesEj:
  619|  5.18k|{
  620|       |  // TODO: this implementation isn't very efficient
  621|  5.18k|  std::vector<uint8_t> bytes;
  622|  79.0k|  for (uint32_t i = 0; i < n; i++) {
  ------------------
  |  Branch (622:24): [True: 73.8k, False: 5.18k]
  ------------------
  623|  73.8k|    bytes.push_back(get_bits8(8));
  624|  73.8k|  }
  625|  5.18k|  return bytes;
  626|  5.18k|}
_ZN9BitReader10skip_bytesEj:
  654|  17.9k|{
  655|       |  // This has to run in constant time. The number of bytes to skip is taken directly
  656|       |  // from 32-bit file fields (e.g. the 'uncC' row/tile alignment), so a byte-at-a-time
  657|       |  // loop spins for billions of iterations when a malformed file asks to skip far
  658|       |  // beyond the end of the data. MinimizedImageBox::parse() guards against the same
  659|       |  // failure mode by validating its declared chunk sizes up front.
  660|       |
  661|  17.9k|  uint64_t nBits = uint64_t{nBytes} * 8;
  662|       |
  663|       |  // --- consume the bits that are already buffered in 'nextbits'
  664|       |
  665|  17.9k|  if (nextbits_cnt > 0) {
  ------------------
  |  Branch (665:7): [True: 13.0k, False: 4.91k]
  ------------------
  666|  13.0k|    uint64_t from_buffer = std::min(nBits, static_cast<uint64_t>(nextbits_cnt));
  667|       |
  668|  13.0k|    if (from_buffer >= 64) {
  ------------------
  |  Branch (668:9): [True: 74, False: 12.9k]
  ------------------
  669|     74|      nextbits = 0;
  670|     74|    }
  671|  12.9k|    else {
  672|  12.9k|#if AVOID_FUZZER_FALSE_POSITIVE
  673|  12.9k|      nextbits &= (0xffffffffffffffffULL >> from_buffer);
  674|  12.9k|#endif
  675|  12.9k|      nextbits <<= from_buffer;
  676|  12.9k|    }
  677|       |
  678|  13.0k|    nextbits_cnt -= static_cast<int64_t>(from_buffer);
  679|  13.0k|    nBits -= from_buffer;
  680|  13.0k|  }
  681|       |
  682|  17.9k|  if (nBits == 0) {
  ------------------
  |  Branch (682:7): [True: 12.6k, False: 5.25k]
  ------------------
  683|  12.6k|    return;
  684|  12.6k|  }
  685|       |
  686|       |  // --- skip whole bytes directly in the input buffer, without pushing them
  687|       |  //     through the bit buffer
  688|       |
  689|  5.25k|  uint64_t whole_bytes = nBits / 8;
  690|  5.25k|  int residual_bits = static_cast<int>(nBits % 8);
  691|       |
  692|  5.25k|  if (whole_bytes >= bytes_remaining) {
  ------------------
  |  Branch (692:7): [True: 134, False: 5.12k]
  ------------------
  693|       |    // Skipping past the end of the data. Record the overshoot in 'nextbits_cnt' (which
  694|       |    // thereby goes negative) so that get_current_byte_index() keeps advancing exactly
  695|       |    // as it did with the previous bit-by-bit implementation.
  696|    134|    uint64_t overshoot_bits = (whole_bytes - bytes_remaining) * 8 + static_cast<uint64_t>(residual_bits);
  697|       |
  698|    134|    data += bytes_remaining;
  699|    134|    bytes_remaining = 0;
  700|    134|    nextbits = 0;
  701|    134|    nextbits_cnt -= static_cast<int64_t>(overshoot_bits);
  702|    134|    return;
  703|    134|  }
  704|       |
  705|  5.12k|  data += static_cast<size_t>(whole_bytes);
  706|  5.12k|  bytes_remaining -= static_cast<size_t>(whole_bytes);
  707|  5.12k|  nextbits = 0;
  708|  5.12k|  nextbits_cnt = 0;
  709|       |
  710|  5.12k|  refill();
  711|       |
  712|  5.12k|  if (residual_bits > 0) {
  ------------------
  |  Branch (712:7): [True: 0, False: 5.12k]
  ------------------
  713|      0|    skip_bits(residual_bits);
  714|      0|  }
  715|  5.12k|}
_ZN9BitReader9skip_bitsEi:
  718|  29.5k|{
  719|  29.5k|  if (nextbits_cnt < n) {
  ------------------
  |  Branch (719:7): [True: 9.18k, False: 20.3k]
  ------------------
  720|  9.18k|    refill();
  721|  9.18k|  }
  722|       |
  723|  29.5k|#if AVOID_FUZZER_FALSE_POSITIVE
  724|  29.5k|  nextbits &= (0xffffffffffffffffULL >> n);
  725|  29.5k|#endif
  726|       |
  727|  29.5k|  nextbits <<= n;
  728|  29.5k|  nextbits_cnt -= n;
  729|  29.5k|}
_ZN9BitReader21skip_to_byte_boundaryEv:
  742|  9.35k|{
  743|  9.35k|  int nskip = static_cast<int>(nextbits_cnt & 7);
  744|       |
  745|  9.35k|#if AVOID_FUZZER_FALSE_POSITIVE
  746|  9.35k|  nextbits &= (0xffffffffffffffffULL >> nskip);
  747|  9.35k|#endif
  748|       |
  749|  9.35k|  nextbits <<= nskip;
  750|  9.35k|  nextbits_cnt -= nskip;
  751|  9.35k|}
_ZN9BitReader6refillEv:
  792|  95.1k|{
  793|       |#if 0
  794|       |  // TODO: activate me once I'm sure this works
  795|       |  while (nextbits_cnt <= 64-8 && bytes_remaining) {
  796|       |    uint64_t newval = *data++;
  797|       |    bytes_remaining--;
  798|       |
  799|       |    nextbits_cnt += 8;
  800|       |    newval <<= 64-nextbits_cnt;
  801|       |    nextbits |= newval;
  802|       |  }
  803|       |#else
  804|  95.1k|  if (bytes_remaining == 0) {
  ------------------
  |  Branch (804:7): [True: 4.54k, False: 90.5k]
  ------------------
  805|       |    // Nothing to refill. Returning early also keeps the shift below out of range
  806|       |    // when nextbits_cnt is far negative after skipping past the end of the data.
  807|  4.54k|    return;
  808|  4.54k|  }
  809|       |
  810|  90.5k|  int64_t shift = 64 - nextbits_cnt;
  811|       |
  812|   665k|  while (shift >= 8 && bytes_remaining) {
  ------------------
  |  Branch (812:10): [True: 577k, False: 88.4k]
  |  Branch (812:24): [True: 575k, False: 2.05k]
  ------------------
  813|   575k|    uint64_t newval = *data++;
  814|   575k|    bytes_remaining--;
  815|       |
  816|   575k|    shift -= 8;
  817|   575k|    newval <<= shift;
  818|   575k|    nextbits |= newval;
  819|   575k|  }
  820|       |
  821|  90.5k|  nextbits_cnt = 64 - shift;
  822|  90.5k|#endif
  823|  90.5k|}

_ZNK14BitstreamRange5errorEv:
  383|  8.14M|  {
  384|  8.14M|    return m_error;
  385|  8.14M|  }
_ZN12StreamReader8seek_curEm:
   62|  82.6k|  {
   63|  82.6k|    return seek(get_position() + position_offset);
   64|  82.6k|  }
_ZN14BitstreamRange19skip_to_end_of_fileEv:
  328|     69|  {
  329|       |    // we do not actually move the file position here (because the stream may still be incomplete),
  330|       |    // but we set all m_remaining to zero
  331|     69|    m_remaining = 0;
  332|       |
  333|     69|    if (m_parent_range) {
  ------------------
  |  Branch (333:9): [True: 61, False: 8]
  ------------------
  334|     61|      m_parent_range->skip_to_end_of_file();
  335|     61|    }
  336|     69|  }
_ZN14BitstreamRange4skipEm:
  339|  26.6k|  {
  340|  26.6k|    size_t actual_skip = std::min(static_cast<size_t>(n), m_remaining);
  341|       |
  342|  26.6k|    if (m_parent_range) {
  ------------------
  |  Branch (342:9): [True: 26.6k, False: 0]
  ------------------
  343|       |      // also advance position in parent range
  344|  26.6k|      m_parent_range->skip_without_advancing_file_pos(actual_skip);
  345|  26.6k|    }
  346|       |
  347|  26.6k|    assert(actual_skip <= static_cast<uint64_t>(std::numeric_limits<int64_t>::max()));
  ------------------
  |  Branch (347:5): [True: 26.6k, False: 0]
  ------------------
  348|       |
  349|  26.6k|    m_istr->seek_cur(static_cast<int64_t>(actual_skip));
  350|  26.6k|    m_remaining -= actual_skip;
  351|  26.6k|  }
_ZN14BitstreamRange18skip_to_end_of_boxEv:
  354|   889M|  {
  355|   889M|    if (m_remaining > 0) {
  ------------------
  |  Branch (355:9): [True: 54.0k, False: 888M]
  ------------------
  356|  54.0k|      if (m_parent_range) {
  ------------------
  |  Branch (356:11): [True: 54.0k, False: 2]
  ------------------
  357|       |        // also advance position in parent range
  358|  54.0k|        m_parent_range->skip_without_advancing_file_pos(m_remaining);
  359|  54.0k|      }
  360|       |
  361|  54.0k|      m_istr->seek_cur(m_remaining);
  362|  54.0k|      m_remaining = 0;
  363|  54.0k|    }
  364|   889M|  }
_ZNK14BitstreamRange3eofEv:
  378|  13.2M|  {
  379|  13.2M|    return m_remaining == 0;
  380|  13.2M|  }
_ZNK14BitstreamRange9get_errorEv:
  388|  1.12M|  {
  389|  1.12M|    if (m_error) {
  ------------------
  |  Branch (389:9): [True: 9.02k, False: 1.11M]
  ------------------
  390|  9.02k|      return Error(heif_error_Invalid_input,
  391|  9.02k|                   heif_suberror_End_of_data);
  392|  9.02k|    }
  393|  1.11M|    else {
  394|  1.11M|      return Error::Ok;
  395|  1.11M|    }
  396|  1.12M|  }
_ZN14BitstreamRange11get_istreamEv:
  398|  30.7M|  std::shared_ptr<StreamReader> get_istream() { return m_istr; }
_ZNK14BitstreamRange17get_nesting_levelEv:
  400|   307k|  int get_nesting_level() const { return m_nesting_level; }
_ZNK14BitstreamRange19get_remaining_bytesEv:
  402|   392k|  size_t get_remaining_bytes() const { return m_remaining; }
_ZNK9BitReader22get_current_byte_indexEv:
  460|  17.9k|  {
  461|       |    // Computed in signed arithmetic: when we skipped past the end of the data,
  462|       |    // nextbits_cnt is negative and the index keeps growing beyond data_length (the
  463|       |    // 'uncC' alignment handling relies on that). Doing the subtraction in size_t
  464|       |    // would convert the negative operand first, which trips the 'integer' sanitizer.
  465|       |    // The result itself is always >= 0.
  466|  17.9k|    int64_t bytes_read = static_cast<int64_t>(data_length - bytes_remaining);
  467|  17.9k|    return static_cast<size_t>(bytes_read - nextbits_cnt / 8);
  468|  17.9k|  }
_ZNK9BitReader18get_bits_remainingEv:
  471|  9.35k|  {
  472|  9.35k|    return ((int64_t) bytes_remaining) * 8 + nextbits_cnt;
  473|  9.35k|  }
_ZN12StreamReaderD2Ev:
   42|  16.2k|  virtual ~StreamReader() = default;

_ZN8FractionC2Eii:
   64|  6.74k|{
   65|       |  // Reduce resolution of fraction until we are in a safe range.
   66|       |  // We need this as adding fractions may lead to very large denominators
   67|       |  // (e.g. 0x10000 * 0x10000 > 0x100000000 -> overflow, leading to integer 0)
   68|       |
   69|  6.74k|  numerator = num;
   70|  6.74k|  denominator = den;
   71|       |
   72|  39.5k|  while (denominator > MAX_FRACTION_VALUE || denominator < -MAX_FRACTION_VALUE) {
  ------------------
  |  Branch (72:10): [True: 32.8k, False: 6.74k]
  |  Branch (72:46): [True: 0, False: 6.74k]
  ------------------
   73|  32.8k|    numerator /= 2;
   74|  32.8k|    denominator /= 2;
   75|  32.8k|  }
   76|       |
   77|  23.5k|  while (denominator > 1 && (numerator > MAX_FRACTION_VALUE || numerator < -MAX_FRACTION_VALUE)) {
  ------------------
  |  Branch (77:10): [True: 19.5k, False: 4.05k]
  |  Branch (77:30): [True: 16.6k, False: 2.91k]
  |  Branch (77:64): [True: 217, False: 2.69k]
  ------------------
   78|  16.8k|    numerator /= 2;
   79|  16.8k|    denominator /= 2;
   80|  16.8k|  }
   81|  6.74k|}
_ZN8Fraction11from_signedEll:
   84|  7.18k|{
   85|  7.18k|  if (num < std::numeric_limits<int32_t>::min() || num > std::numeric_limits<int32_t>::max() ||
  ------------------
  |  Branch (85:7): [True: 0, False: 7.18k]
  |  Branch (85:52): [True: 191, False: 6.98k]
  ------------------
   86|  6.98k|      den < std::numeric_limits<int32_t>::min() || den > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (86:7): [True: 0, False: 6.98k]
  |  Branch (86:52): [True: 242, False: 6.74k]
  ------------------
   87|    433|    return Error(heif_error_Invalid_input,
   88|    433|                 heif_suberror_Invalid_fractional_number,
   89|    433|                 "Fraction value exceeds the supported range");
   90|    433|  }
   91|       |
   92|  6.74k|  Fraction f(static_cast<int32_t>(num), static_cast<int32_t>(den));
   93|  6.74k|  if (!f.is_valid()) {
  ------------------
  |  Branch (93:7): [True: 3.05k, False: 3.69k]
  ------------------
   94|  3.05k|    return Error(heif_error_Invalid_input,
   95|  3.05k|                 heif_suberror_Invalid_fractional_number,
   96|  3.05k|                 "Fraction with zero denominator");
   97|  3.05k|  }
   98|       |
   99|  3.69k|  return f;
  100|  6.74k|}
_ZN8Fraction13from_unsignedEjj:
  103|  3.59k|{
  104|  3.59k|  return from_signed(num, den);
  105|  3.59k|}
_ZNK8Fraction8is_validEv:
  178|  6.74k|{
  179|  6.74k|  return denominator != 0;
  180|  6.74k|}
_ZN9BoxHeaderC2Ev:
  183|   712k|BoxHeader::BoxHeader() = default;
_ZNK9BoxHeader8get_typeEv:
  187|   154k|{
  188|   154k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (188:7): [True: 5.68k, False: 148k]
  ------------------
  189|  5.68k|    return m_uuid_type;
  190|  5.68k|  }
  191|   148k|  else {
  192|   148k|    std::vector<uint8_t> type(4);
  193|   148k|    type[0] = static_cast<uint8_t>((m_type >> 24) & 0xFF);
  194|   148k|    type[1] = static_cast<uint8_t>((m_type >> 16) & 0xFF);
  195|   148k|    type[2] = static_cast<uint8_t>((m_type >> 8) & 0xFF);
  196|   148k|    type[3] = static_cast<uint8_t>((m_type >> 0) & 0xFF);
  197|   148k|    return type;
  198|   148k|  }
  199|   154k|}
_ZNK9BoxHeader15get_type_stringEv:
  203|   726k|{
  204|   726k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (204:7): [True: 20.0k, False: 706k]
  ------------------
  205|       |    // 8-4-4-4-12
  206|       |
  207|  20.0k|    std::ostringstream sstr;
  208|  20.0k|    sstr << std::hex;
  209|  20.0k|    sstr << std::setfill('0');
  210|       |
  211|   340k|    for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (211:21): [True: 320k, False: 20.0k]
  ------------------
  212|   320k|      if (i == 4 || i == 6 || i == 8 || i == 10) {
  ------------------
  |  Branch (212:11): [True: 20.0k, False: 300k]
  |  Branch (212:21): [True: 20.0k, False: 280k]
  |  Branch (212:31): [True: 20.0k, False: 260k]
  |  Branch (212:41): [True: 20.0k, False: 240k]
  ------------------
  213|  80.2k|        sstr << '-';
  214|  80.2k|      }
  215|       |
  216|   320k|      sstr << std::setw(2);
  217|   320k|      sstr << ((int) m_uuid_type[i]);
  218|   320k|    }
  219|       |
  220|  20.0k|    return sstr.str();
  221|  20.0k|  }
  222|   706k|  else {
  223|   706k|    return fourcc_to_string(m_type);
  224|   706k|  }
  225|   726k|}
_ZNK9BoxHeader13get_uuid_typeEv:
  229|  23.9k|{
  230|  23.9k|  if (m_type != fourcc("uuid")) {
  ------------------
  |  Branch (230:7): [True: 0, False: 23.9k]
  ------------------
  231|      0|    return {};
  232|      0|  }
  233|       |
  234|  23.9k|  return m_uuid_type;
  235|  23.9k|}
_ZN9BoxHeader13set_uuid_typeERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  239|  2.28k|{
  240|  2.28k|  m_type = fourcc("uuid");
  241|  2.28k|  m_uuid_type = type;
  242|  2.28k|}
_ZN9BoxHeader12parse_headerER14BitstreamRange:
  246|   332k|{
  247|   332k|  StreamReader::grow_status status;
  248|   332k|  status = range.wait_for_available_bytes(8);
  249|   332k|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (249:7): [True: 7.86k, False: 324k]
  ------------------
  250|       |    // TODO: return recoverable error at timeout
  251|  7.86k|    return Error(heif_error_Invalid_input,
  252|  7.86k|                 heif_suberror_End_of_data);
  253|  7.86k|  }
  254|       |
  255|   324k|  m_size = range.read32();
  256|   324k|  m_type = range.read32();
  257|       |
  258|   324k|  m_header_size = 8;
  259|       |
  260|   324k|  if (m_size == 1) {
  ------------------
  |  Branch (260:7): [True: 226, False: 324k]
  ------------------
  261|    226|    status = range.wait_for_available_bytes(8);
  262|    226|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (262:9): [True: 1, False: 225]
  ------------------
  263|       |      // TODO: return recoverable error at timeout
  264|      1|      return Error(heif_error_Invalid_input,
  265|      1|                   heif_suberror_End_of_data);
  266|      1|    }
  267|       |
  268|    225|    uint64_t high = range.read32();
  269|    225|    uint64_t low = range.read32();
  270|       |
  271|    225|    m_size = (high << 32) | low;
  272|    225|    m_header_size += 8;
  273|       |
  274|    225|    std::stringstream sstr;
  275|    225|    sstr << "Box size " << m_size << " exceeds security limit.";
  276|       |
  277|    225|    if (m_size > MAX_LARGE_BOX_SIZE) {
  ------------------
  |  Branch (277:9): [True: 14, False: 211]
  ------------------
  278|     14|      return Error(heif_error_Memory_allocation_error,
  279|     14|                   heif_suberror_Security_limit_exceeded,
  280|     14|                   sstr.str());
  281|     14|    }
  282|    225|  }
  283|       |
  284|   324k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (284:7): [True: 8.26k, False: 316k]
  ------------------
  285|  8.26k|    status = range.wait_for_available_bytes(16);
  286|  8.26k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (286:9): [True: 2, False: 8.25k]
  ------------------
  287|       |      // TODO: return recoverable error at timeout
  288|      2|      return Error(heif_error_Invalid_input,
  289|      2|                   heif_suberror_End_of_data);
  290|      2|    }
  291|       |
  292|  8.25k|    if (range.prepare_read(16)) {
  ------------------
  |  Branch (292:9): [True: 8.25k, False: 1]
  ------------------
  293|  8.25k|      m_uuid_type.resize(16);
  294|  8.25k|      bool success = range.get_istream()->read((char*) m_uuid_type.data(), 16);
  295|  8.25k|      assert(success);
  ------------------
  |  Branch (295:7): [True: 8.25k, False: 0]
  ------------------
  296|  8.25k|      (void) success;
  297|  8.25k|    }
  298|       |
  299|  8.25k|    m_header_size += 16;
  300|  8.25k|  }
  301|       |
  302|   324k|  return range.get_error();
  303|   324k|}
_ZNK9BoxHeader4dumpER6Indent:
  408|   253k|{
  409|   253k|  std::ostringstream sstr;
  410|   253k|  sstr << indent << "Box: " << get_type_string();
  411|   253k|  const char* debug_name = debug_box_name();
  412|   253k|  if (debug_name) {
  ------------------
  |  Branch (412:7): [True: 133k, False: 119k]
  ------------------
  413|   133k|    sstr << " ----- (" << debug_name << ")\n";
  414|   133k|  }
  415|   119k|  else {
  416|   119k|    sstr << " -----\n";
  417|   119k|  }
  418|       |
  419|   253k|  sstr << indent << "size: " << get_box_size() << "   (header size: " << get_header_size() << ")\n";
  420|       |
  421|   253k|  return sstr.str();
  422|   253k|}
_ZN3Box5parseER14BitstreamRangePK20heif_security_limits:
  426|  1.35k|{
  427|       |  // skip box
  428|       |
  429|  1.35k|  if (get_box_size() == size_until_end_of_file) {
  ------------------
  |  Branch (429:7): [True: 8, False: 1.34k]
  ------------------
  430|      8|    range.skip_to_end_of_file();
  431|      8|  }
  432|  1.34k|  else {
  433|  1.34k|    uint64_t content_size = get_box_size() - get_header_size();
  434|       |
  435|  1.34k|    assert(MAX_BOX_SIZE <= SIZE_MAX);
  ------------------
  |  Branch (435:5): [True: 1.34k, Folded]
  ------------------
  436|       |
  437|  1.34k|    if (content_size > MAX_BOX_SIZE) {
  ------------------
  |  Branch (437:9): [True: 0, False: 1.34k]
  ------------------
  438|      0|      return Error(heif_error_Invalid_input,
  439|      0|                   heif_suberror_Invalid_box_size);
  440|      0|    }
  441|       |
  442|  1.34k|    if (range.prepare_read(static_cast<size_t>(content_size))) {
  ------------------
  |  Branch (442:9): [True: 1.34k, False: 0]
  ------------------
  443|  1.34k|      range.get_istream()->seek_cur(get_box_size() - get_header_size());
  444|  1.34k|    }
  445|  1.34k|  }
  446|       |
  447|       |  // Note: seekg() clears the eof flag and it will not be set again afterwards,
  448|       |  // hence we have to test for the fail flag.
  449|       |
  450|  1.35k|  return range.get_error();
  451|  1.35k|}
_ZN7FullBox21parse_full_box_headerER14BitstreamRange:
  455|  77.9k|{
  456|  77.9k|  uint32_t data = range.read32();
  457|  77.9k|  m_version = static_cast<uint8_t>(data >> 24);
  458|  77.9k|  m_flags = data & 0x00FFFFFF;
  459|       |  //m_is_full_box = true;
  460|       |
  461|  77.9k|  m_header_size += 4;
  462|       |
  463|  77.9k|  return range.get_error();
  464|  77.9k|}
_ZN3Box4readER14BitstreamRangePNSt3__110shared_ptrIS_EEPK20heif_security_limits:
  468|   315k|{
  469|   315k|  BoxHeader hdr;
  470|   315k|  Error err = hdr.parse_header(range);
  471|   315k|  if (err) {
  ------------------
  |  Branch (471:7): [True: 7.89k, False: 307k]
  ------------------
  472|  7.89k|    return err;
  473|  7.89k|  }
  474|       |
  475|   307k|  if (range.error()) {
  ------------------
  |  Branch (475:7): [True: 0, False: 307k]
  ------------------
  476|      0|    return range.get_error();
  477|      0|  }
  478|       |
  479|   307k|  result->reset();
  480|       |
  481|   307k|  std::shared_ptr<Box> box;
  482|       |
  483|   307k|  switch (hdr.get_short_type()) {
  484|  6.27k|    case fourcc("ftyp"):
  ------------------
  |  Branch (484:5): [True: 6.27k, False: 301k]
  ------------------
  485|  6.27k|      box = std::make_shared<Box_ftyp>();
  486|  6.27k|      break;
  487|       |
  488|    448|    case fourcc("free"):
  ------------------
  |  Branch (488:5): [True: 448, False: 307k]
  ------------------
  489|    613|    case fourcc("skip"):
  ------------------
  |  Branch (489:5): [True: 165, False: 307k]
  ------------------
  490|    613|      box = std::make_shared<Box_free>();
  491|    613|      break;
  492|       |
  493|  2.97k|    case fourcc("meta"):
  ------------------
  |  Branch (493:5): [True: 2.97k, False: 304k]
  ------------------
  494|  2.97k|      box = std::make_shared<Box_meta>();
  495|  2.97k|      break;
  496|       |
  497|  2.17k|    case fourcc("hdlr"):
  ------------------
  |  Branch (497:5): [True: 2.17k, False: 305k]
  ------------------
  498|  2.17k|      box = std::make_shared<Box_hdlr>();
  499|  2.17k|      break;
  500|       |
  501|  2.17k|    case fourcc("pitm"):
  ------------------
  |  Branch (501:5): [True: 2.17k, False: 305k]
  ------------------
  502|  2.17k|      box = std::make_shared<Box_pitm>();
  503|  2.17k|      break;
  504|       |
  505|  1.46k|    case fourcc("iloc"):
  ------------------
  |  Branch (505:5): [True: 1.46k, False: 306k]
  ------------------
  506|  1.46k|      box = std::make_shared<Box_iloc>();
  507|  1.46k|      break;
  508|       |
  509|  2.03k|    case fourcc("iinf"):
  ------------------
  |  Branch (509:5): [True: 2.03k, False: 305k]
  ------------------
  510|  2.03k|      box = std::make_shared<Box_iinf>();
  511|  2.03k|      break;
  512|       |
  513|  3.17k|    case fourcc("infe"):
  ------------------
  |  Branch (513:5): [True: 3.17k, False: 304k]
  ------------------
  514|  3.17k|      box = std::make_shared<Box_infe>();
  515|  3.17k|      break;
  516|       |
  517|  28.3k|    case fourcc("iprp"):
  ------------------
  |  Branch (517:5): [True: 28.3k, False: 279k]
  ------------------
  518|  28.3k|      box = std::make_shared<Box_iprp>();
  519|  28.3k|      break;
  520|       |
  521|  10.9k|    case fourcc("ipco"):
  ------------------
  |  Branch (521:5): [True: 10.9k, False: 296k]
  ------------------
  522|  10.9k|      box = std::make_shared<Box_ipco>();
  523|  10.9k|      break;
  524|       |
  525|  2.07k|    case fourcc("ipma"):
  ------------------
  |  Branch (525:5): [True: 2.07k, False: 305k]
  ------------------
  526|  2.07k|      box = std::make_shared<Box_ipma>();
  527|  2.07k|      break;
  528|       |
  529|  1.73k|    case fourcc("ispe"):
  ------------------
  |  Branch (529:5): [True: 1.73k, False: 306k]
  ------------------
  530|  1.73k|      box = std::make_shared<Box_ispe>();
  531|  1.73k|      break;
  532|       |
  533|    925|    case fourcc("auxC"):
  ------------------
  |  Branch (533:5): [True: 925, False: 306k]
  ------------------
  534|    925|      box = std::make_shared<Box_auxC>();
  535|    925|      break;
  536|       |
  537|  4.94k|    case fourcc("irot"):
  ------------------
  |  Branch (537:5): [True: 4.94k, False: 302k]
  ------------------
  538|  4.94k|      box = std::make_shared<Box_irot>();
  539|  4.94k|      break;
  540|       |
  541|  2.07k|    case fourcc("imir"):
  ------------------
  |  Branch (541:5): [True: 2.07k, False: 305k]
  ------------------
  542|  2.07k|      box = std::make_shared<Box_imir>();
  543|  2.07k|      break;
  544|       |
  545|  1.79k|    case fourcc("clap"):
  ------------------
  |  Branch (545:5): [True: 1.79k, False: 305k]
  ------------------
  546|  1.79k|      box = std::make_shared<Box_clap>();
  547|  1.79k|      break;
  548|       |
  549|    835|    case fourcc("iscl"):
  ------------------
  |  Branch (549:5): [True: 835, False: 306k]
  ------------------
  550|    835|      box = std::make_shared<Box_iscl>();
  551|    835|      break;
  552|       |
  553|  9.03k|    case fourcc("iref"):
  ------------------
  |  Branch (553:5): [True: 9.03k, False: 298k]
  ------------------
  554|  9.03k|      box = std::make_shared<Box_iref>();
  555|  9.03k|      break;
  556|       |
  557|    556|    case fourcc("rref"):
  ------------------
  |  Branch (557:5): [True: 556, False: 307k]
  ------------------
  558|    556|      box = std::make_shared<Box_rref>();
  559|    556|      break;
  560|       |
  561|  3.74k|    case fourcc("hvcC"):
  ------------------
  |  Branch (561:5): [True: 3.74k, False: 304k]
  ------------------
  562|  3.74k|      box = std::make_shared<Box_hvcC>();
  563|  3.74k|      break;
  564|       |
  565|    206|    case fourcc("hvc1"):
  ------------------
  |  Branch (565:5): [True: 206, False: 307k]
  ------------------
  566|    206|      box = std::make_shared<Box_hvc1>();
  567|    206|      break;
  568|       |
  569|  2.07k|    case fourcc("av1C"):
  ------------------
  |  Branch (569:5): [True: 2.07k, False: 305k]
  ------------------
  570|  2.07k|      box = std::make_shared<Box_av1C>();
  571|  2.07k|      break;
  572|       |
  573|    114|    case fourcc("av01"):
  ------------------
  |  Branch (573:5): [True: 114, False: 307k]
  ------------------
  574|    114|      box = std::make_shared<Box_av01>();
  575|    114|      break;
  576|       |
  577|  1.57k|    case fourcc("vvcC"):
  ------------------
  |  Branch (577:5): [True: 1.57k, False: 306k]
  ------------------
  578|  1.57k|      box = std::make_shared<Box_vvcC>();
  579|  1.57k|      break;
  580|       |
  581|     57|    case fourcc("vvc1"):
  ------------------
  |  Branch (581:5): [True: 57, False: 307k]
  ------------------
  582|     57|      box = std::make_shared<Box_vvc1>();
  583|     57|      break;
  584|       |
  585|  3.39k|    case fourcc("idat"):
  ------------------
  |  Branch (585:5): [True: 3.39k, False: 304k]
  ------------------
  586|  3.39k|      box = std::make_shared<Box_idat>();
  587|  3.39k|      break;
  588|       |
  589|  2.41k|    case fourcc("grpl"):
  ------------------
  |  Branch (589:5): [True: 2.41k, False: 305k]
  ------------------
  590|  2.41k|      box = std::make_shared<Box_grpl>();
  591|  2.41k|      break;
  592|       |
  593|  1.20k|    case fourcc("pymd"):
  ------------------
  |  Branch (593:5): [True: 1.20k, False: 306k]
  ------------------
  594|  1.20k|      box = std::make_shared<Box_pymd>();
  595|  1.20k|      break;
  596|       |
  597|    208|    case fourcc("altr"):
  ------------------
  |  Branch (597:5): [True: 208, False: 307k]
  ------------------
  598|    208|      box = std::make_shared<Box_EntityToGroup>();
  599|    208|      break;
  600|       |
  601|    310|    case fourcc("ster"):
  ------------------
  |  Branch (601:5): [True: 310, False: 307k]
  ------------------
  602|    310|      box = std::make_shared<Box_ster>();
  603|    310|      break;
  604|       |
  605|  6.00k|    case fourcc("dinf"):
  ------------------
  |  Branch (605:5): [True: 6.00k, False: 301k]
  ------------------
  606|  6.00k|      box = std::make_shared<Box_dinf>();
  607|  6.00k|      break;
  608|       |
  609|    242|    case fourcc("dref"):
  ------------------
  |  Branch (609:5): [True: 242, False: 307k]
  ------------------
  610|    242|      box = std::make_shared<Box_dref>();
  611|    242|      break;
  612|       |
  613|  2.12k|    case fourcc("url "):
  ------------------
  |  Branch (613:5): [True: 2.12k, False: 305k]
  ------------------
  614|  2.12k|      box = std::make_shared<Box_url>();
  615|  2.12k|      break;
  616|       |
  617|  5.39k|    case fourcc("colr"):
  ------------------
  |  Branch (617:5): [True: 5.39k, False: 302k]
  ------------------
  618|  5.39k|      box = std::make_shared<Box_colr>();
  619|  5.39k|      break;
  620|       |
  621|  3.67k|    case fourcc("pixi"):
  ------------------
  |  Branch (621:5): [True: 3.67k, False: 304k]
  ------------------
  622|  3.67k|      box = std::make_shared<Box_pixi>();
  623|  3.67k|      break;
  624|       |
  625|  8.86k|    case fourcc("pasp"):
  ------------------
  |  Branch (625:5): [True: 8.86k, False: 298k]
  ------------------
  626|  8.86k|      box = std::make_shared<Box_pasp>();
  627|  8.86k|      break;
  628|       |
  629|  4.32k|    case fourcc("lsel"):
  ------------------
  |  Branch (629:5): [True: 4.32k, False: 303k]
  ------------------
  630|  4.32k|      box = std::make_shared<Box_lsel>();
  631|  4.32k|      break;
  632|       |
  633|  8.22k|    case fourcc("a1op"):
  ------------------
  |  Branch (633:5): [True: 8.22k, False: 299k]
  ------------------
  634|  8.22k|      box = std::make_shared<Box_a1op>();
  635|  8.22k|      break;
  636|       |
  637|  3.15k|    case fourcc("a1lx"):
  ------------------
  |  Branch (637:5): [True: 3.15k, False: 304k]
  ------------------
  638|  3.15k|      box = std::make_shared<Box_a1lx>();
  639|  3.15k|      break;
  640|       |
  641|    358|    case fourcc("clli"):
  ------------------
  |  Branch (641:5): [True: 358, False: 307k]
  ------------------
  642|    358|      box = std::make_shared<Box_clli>();
  643|    358|      break;
  644|       |
  645|  2.61k|    case fourcc("mdcv"):
  ------------------
  |  Branch (645:5): [True: 2.61k, False: 305k]
  ------------------
  646|  2.61k|      box = std::make_shared<Box_mdcv>();
  647|  2.61k|      break;
  648|       |
  649|    625|    case fourcc("amve"):
  ------------------
  |  Branch (649:5): [True: 625, False: 307k]
  ------------------
  650|    625|      box = std::make_shared<Box_amve>();
  651|    625|      break;
  652|       |
  653|    528|    case fourcc("ndwt"):
  ------------------
  |  Branch (653:5): [True: 528, False: 307k]
  ------------------
  654|    528|      box = std::make_shared<Box_ndwt>();
  655|    528|      break;
  656|       |
  657|  1.76k|    case fourcc("cmin"):
  ------------------
  |  Branch (657:5): [True: 1.76k, False: 305k]
  ------------------
  658|  1.76k|      box = std::make_shared<Box_cmin>();
  659|  1.76k|      break;
  660|       |
  661|  2.14k|    case fourcc("cmex"):
  ------------------
  |  Branch (661:5): [True: 2.14k, False: 305k]
  ------------------
  662|  2.14k|      box = std::make_shared<Box_cmex>();
  663|  2.14k|      break;
  664|       |
  665|  1.07k|    case fourcc("udes"):
  ------------------
  |  Branch (665:5): [True: 1.07k, False: 306k]
  ------------------
  666|  1.07k|      box = std::make_shared<Box_udes>();
  667|  1.07k|      break;
  668|       |
  669|  5.62k|    case fourcc("jpgC"):
  ------------------
  |  Branch (669:5): [True: 5.62k, False: 302k]
  ------------------
  670|  5.62k|      box = std::make_shared<Box_jpgC>();
  671|  5.62k|      break;
  672|       |
  673|    115|    case fourcc("mjpg"):
  ------------------
  |  Branch (673:5): [True: 115, False: 307k]
  ------------------
  674|    115|      box = std::make_shared<Box_mjpg>();
  675|    115|      break;
  676|       |
  677|    631|    case fourcc("elng"):
  ------------------
  |  Branch (677:5): [True: 631, False: 307k]
  ------------------
  678|    631|      box = std::make_shared<Box_elng>();
  679|    631|      break;
  680|       |
  681|       |
  682|      0|#if WITH_UNCOMPRESSED_CODEC
  683|    990|    case fourcc("cmpd"):
  ------------------
  |  Branch (683:5): [True: 990, False: 306k]
  ------------------
  684|    990|      box = std::make_shared<Box_cmpd>();
  685|    990|      break;
  686|       |
  687|  3.31k|    case fourcc("uncC"):
  ------------------
  |  Branch (687:5): [True: 3.31k, False: 304k]
  ------------------
  688|  3.31k|      box = std::make_shared<Box_uncC>();
  689|  3.31k|      break;
  690|       |
  691|    626|    case fourcc("cmpC"):
  ------------------
  |  Branch (691:5): [True: 626, False: 307k]
  ------------------
  692|    626|      box = std::make_shared<Box_cmpC>();
  693|    626|      break;
  694|       |
  695|    695|    case fourcc("icef"):
  ------------------
  |  Branch (695:5): [True: 695, False: 307k]
  ------------------
  696|    695|      box = std::make_shared<Box_icef>();
  697|    695|      break;
  698|       |
  699|    628|    case fourcc("cpat"):
  ------------------
  |  Branch (699:5): [True: 628, False: 307k]
  ------------------
  700|    628|      box = std::make_shared<Box_cpat>();
  701|    628|      break;
  702|       |
  703|    642|    case fourcc("splz"):
  ------------------
  |  Branch (703:5): [True: 642, False: 307k]
  ------------------
  704|    642|      box = std::make_shared<Box_splz>();
  705|    642|      break;
  706|       |
  707|    533|    case fourcc("sbpm"):
  ------------------
  |  Branch (707:5): [True: 533, False: 307k]
  ------------------
  708|    533|      box = std::make_shared<Box_sbpm>();
  709|    533|      break;
  710|       |
  711|    432|    case fourcc("snuc"):
  ------------------
  |  Branch (711:5): [True: 432, False: 307k]
  ------------------
  712|    432|      box = std::make_shared<Box_snuc>();
  713|    432|      break;
  714|       |
  715|    216|    case fourcc("cloc"):
  ------------------
  |  Branch (715:5): [True: 216, False: 307k]
  ------------------
  716|    216|      box = std::make_shared<Box_cloc>();
  717|    216|      break;
  718|       |
  719|    324|    case fourcc("uncv"):
  ------------------
  |  Branch (719:5): [True: 324, False: 307k]
  ------------------
  720|    324|      box = std::make_shared<Box_uncv>();
  721|    324|      break;
  722|      0|#endif
  723|       |
  724|       |    // --- JPEG 2000
  725|       |
  726|  6.21k|    case fourcc("j2kH"):
  ------------------
  |  Branch (726:5): [True: 6.21k, False: 301k]
  ------------------
  727|  6.21k|      box = std::make_shared<Box_j2kH>();
  728|  6.21k|      break;
  729|       |
  730|  5.48k|    case fourcc("cdef"):
  ------------------
  |  Branch (730:5): [True: 5.48k, False: 302k]
  ------------------
  731|  5.48k|      box = std::make_shared<Box_cdef>();
  732|  5.48k|      break;
  733|       |
  734|  1.16k|    case fourcc("cmap"):
  ------------------
  |  Branch (734:5): [True: 1.16k, False: 306k]
  ------------------
  735|  1.16k|      box = std::make_shared<Box_cmap>();
  736|  1.16k|      break;
  737|       |
  738|  1.10k|    case fourcc("pclr"):
  ------------------
  |  Branch (738:5): [True: 1.10k, False: 306k]
  ------------------
  739|  1.10k|      box = std::make_shared<Box_pclr>();
  740|  1.10k|      break;
  741|       |
  742|    803|    case fourcc("j2kL"):
  ------------------
  |  Branch (742:5): [True: 803, False: 306k]
  ------------------
  743|    803|      box = std::make_shared<Box_j2kL>();
  744|    803|      break;
  745|       |
  746|    131|    case fourcc("j2ki"):
  ------------------
  |  Branch (746:5): [True: 131, False: 307k]
  ------------------
  747|    131|      box = std::make_shared<Box_j2ki>();
  748|    131|      break;
  749|       |
  750|       |
  751|       |    // --- mski
  752|       |
  753|    657|    case fourcc("mskC"):
  ------------------
  |  Branch (753:5): [True: 657, False: 307k]
  ------------------
  754|    657|      box = std::make_shared<Box_mskC>();
  755|    657|      break;
  756|       |
  757|       |    // --- TAI timestamps
  758|       |
  759|    300|    case fourcc("itai"):
  ------------------
  |  Branch (759:5): [True: 300, False: 307k]
  ------------------
  760|    300|      box = std::make_shared<Box_itai>();
  761|    300|      break;
  762|       |
  763|  1.70k|    case fourcc("taic"):
  ------------------
  |  Branch (763:5): [True: 1.70k, False: 306k]
  ------------------
  764|  1.70k|      box = std::make_shared<Box_taic>();
  765|  1.70k|      break;
  766|       |
  767|       |    // --- AVC (H.264)
  768|       |
  769|  3.95k|    case fourcc("avcC"):
  ------------------
  |  Branch (769:5): [True: 3.95k, False: 303k]
  ------------------
  770|  3.95k|      box = std::make_shared<Box_avcC>();
  771|  3.95k|      break;
  772|       |
  773|     59|    case fourcc("avc1"):
  ------------------
  |  Branch (773:5): [True: 59, False: 307k]
  ------------------
  774|     59|      box = std::make_shared<Box_avc1>();
  775|     59|      break;
  776|       |
  777|      0|#if HEIF_ENABLE_EXPERIMENTAL_FEATURES
  778|    663|    case fourcc("tilC"):
  ------------------
  |  Branch (778:5): [True: 663, False: 307k]
  ------------------
  779|    663|      box = std::make_shared<Box_tilC>();
  780|    663|      break;
  781|      0|#endif
  782|       |
  783|  9.37k|    case fourcc("mini"):
  ------------------
  |  Branch (783:5): [True: 9.37k, False: 298k]
  ------------------
  784|  9.37k|      box = std::make_shared<Box_mini>();
  785|  9.37k|      break;
  786|       |
  787|  1.35k|    case fourcc("mdat"):
  ------------------
  |  Branch (787:5): [True: 1.35k, False: 306k]
  ------------------
  788|       |      // avoid generating a 'Box_other'
  789|  1.35k|      box = std::make_shared<Box>();
  790|  1.35k|      break;
  791|       |
  792|  7.65k|    case fourcc("uuid"):
  ------------------
  |  Branch (792:5): [True: 7.65k, False: 300k]
  ------------------
  793|  7.65k|      if (hdr.get_uuid_type() == std::vector<uint8_t>{0x22, 0xcc, 0x04, 0xc7, 0xd6, 0xd9, 0x4e, 0x07, 0x9d, 0x90, 0x4e, 0xb6, 0xec, 0xba, 0xf3, 0xa3}) {
  ------------------
  |  Branch (793:11): [True: 880, False: 6.77k]
  ------------------
  794|    880|        box = std::make_shared<Box_cmin>();
  795|    880|      }
  796|  6.77k|      else if (hdr.get_uuid_type() == std::vector<uint8_t>{0x43, 0x63, 0xe9, 0x14, 0x5b, 0x7d, 0x4a, 0xab, 0x97, 0xae, 0xbe, 0xa6, 0x98, 0x03, 0xb4, 0x34}) {
  ------------------
  |  Branch (796:16): [True: 1.48k, False: 5.28k]
  ------------------
  797|  1.48k|        box = std::make_shared<Box_cmex>();
  798|  1.48k|      }
  799|  5.28k|      else if (hdr.get_uuid_type() == std::vector<uint8_t>{0x26, 0x1e, 0xf3, 0x74, 0x1d, 0x97, 0x5b, 0xba, 0xac, 0xbd, 0x9d, 0x2c, 0x8e, 0xa7, 0x35, 0x22}) {
  ------------------
  |  Branch (799:16): [True: 1.06k, False: 4.22k]
  ------------------
  800|  1.06k|        box = std::make_shared<Box_gimi_content_id>();
  801|  1.06k|      }
  802|  4.22k|#if WITH_UNCOMPRESSED_CODEC
  803|  4.22k|      else if (hdr.get_uuid_type() == std::vector<uint8_t>{0x9d, 0xb9, 0xdd, 0x6e, 0x37, 0x3c, 0x5a, 0x4e, 0x81, 0x10, 0x21, 0xfc, 0x83, 0xa9, 0x11, 0xfd}) {
  ------------------
  |  Branch (803:16): [True: 1.21k, False: 3.00k]
  ------------------
  804|  1.21k|        box = std::make_shared<Box_gimi_component_content_ids>();
  805|  1.21k|      }
  806|  3.00k|#endif
  807|  3.00k|      else {
  808|  3.00k|        box = std::make_shared<Box_other>(hdr.get_short_type());
  809|  3.00k|      }
  810|  7.65k|      break;
  811|       |
  812|       |    // --- sequences
  813|       |
  814|    469|    case fourcc("moov"):
  ------------------
  |  Branch (814:5): [True: 469, False: 307k]
  ------------------
  815|    469|      box = std::make_shared<Box_moov>();
  816|    469|      break;
  817|       |
  818|  2.27k|    case fourcc("mvhd"):
  ------------------
  |  Branch (818:5): [True: 2.27k, False: 305k]
  ------------------
  819|  2.27k|      box = std::make_shared<Box_mvhd>();
  820|  2.27k|      break;
  821|       |
  822|    324|    case fourcc("trak"):
  ------------------
  |  Branch (822:5): [True: 324, False: 307k]
  ------------------
  823|    324|      box = std::make_shared<Box_trak>();
  824|    324|      break;
  825|       |
  826|  1.37k|    case fourcc("tkhd"):
  ------------------
  |  Branch (826:5): [True: 1.37k, False: 306k]
  ------------------
  827|  1.37k|      box = std::make_shared<Box_tkhd>();
  828|  1.37k|      break;
  829|       |
  830|     73|    case fourcc("mdia"):
  ------------------
  |  Branch (830:5): [True: 73, False: 307k]
  ------------------
  831|     73|      box = std::make_shared<Box_mdia>();
  832|     73|      break;
  833|       |
  834|    598|    case fourcc("mdhd"):
  ------------------
  |  Branch (834:5): [True: 598, False: 307k]
  ------------------
  835|    598|      box = std::make_shared<Box_mdhd>();
  836|    598|      break;
  837|       |
  838|    435|    case fourcc("minf"):
  ------------------
  |  Branch (838:5): [True: 435, False: 307k]
  ------------------
  839|    435|      box = std::make_shared<Box_minf>();
  840|    435|      break;
  841|       |
  842|    467|    case fourcc("vmhd"):
  ------------------
  |  Branch (842:5): [True: 467, False: 307k]
  ------------------
  843|    467|      box = std::make_shared<Box_vmhd>();
  844|    467|      break;
  845|       |
  846|    810|    case fourcc("stbl"):
  ------------------
  |  Branch (846:5): [True: 810, False: 306k]
  ------------------
  847|    810|      box = std::make_shared<Box_stbl>();
  848|    810|      break;
  849|       |
  850|  1.40k|    case fourcc("stsd"):
  ------------------
  |  Branch (850:5): [True: 1.40k, False: 306k]
  ------------------
  851|  1.40k|      box = std::make_shared<Box_stsd>();
  852|  1.40k|      break;
  853|       |
  854|    320|    case fourcc("stts"):
  ------------------
  |  Branch (854:5): [True: 320, False: 307k]
  ------------------
  855|    320|      box = std::make_shared<Box_stts>();
  856|    320|      break;
  857|       |
  858|  1.16k|    case fourcc("ctts"):
  ------------------
  |  Branch (858:5): [True: 1.16k, False: 306k]
  ------------------
  859|  1.16k|      box = std::make_shared<Box_ctts>();
  860|  1.16k|      break;
  861|       |
  862|    315|    case fourcc("stsc"):
  ------------------
  |  Branch (862:5): [True: 315, False: 307k]
  ------------------
  863|    315|      box = std::make_shared<Box_stsc>();
  864|    315|      break;
  865|       |
  866|    531|    case fourcc("stco"):
  ------------------
  |  Branch (866:5): [True: 531, False: 307k]
  ------------------
  867|    531|      box = std::make_shared<Box_stco>();
  868|    531|      break;
  869|       |
  870|  1.03k|    case fourcc("stsz"):
  ------------------
  |  Branch (870:5): [True: 1.03k, False: 306k]
  ------------------
  871|  1.03k|      box = std::make_shared<Box_stsz>();
  872|  1.03k|      break;
  873|       |
  874|    465|    case fourcc("stss"):
  ------------------
  |  Branch (874:5): [True: 465, False: 307k]
  ------------------
  875|    465|      box = std::make_shared<Box_stss>();
  876|    465|      break;
  877|       |
  878|    692|    case fourcc("ccst"):
  ------------------
  |  Branch (878:5): [True: 692, False: 307k]
  ------------------
  879|    692|      box = std::make_shared<Box_ccst>();
  880|    692|      break;
  881|       |
  882|  1.34k|    case fourcc("auxi"):
  ------------------
  |  Branch (882:5): [True: 1.34k, False: 306k]
  ------------------
  883|  1.34k|      box = std::make_shared<Box_auxi>();
  884|  1.34k|      break;
  885|       |
  886|    478|    case fourcc("edts"):
  ------------------
  |  Branch (886:5): [True: 478, False: 307k]
  ------------------
  887|    478|      box = std::make_shared<Box_edts>();
  888|    478|      break;
  889|       |
  890|    917|    case fourcc("elst"):
  ------------------
  |  Branch (890:5): [True: 917, False: 306k]
  ------------------
  891|    917|      box = std::make_shared<Box_elst>();
  892|    917|      break;
  893|       |
  894|    749|    case fourcc("sbgp"):
  ------------------
  |  Branch (894:5): [True: 749, False: 307k]
  ------------------
  895|    749|      box = std::make_shared<Box_sbgp>();
  896|    749|      break;
  897|       |
  898|  1.67k|    case fourcc("sgpd"):
  ------------------
  |  Branch (898:5): [True: 1.67k, False: 306k]
  ------------------
  899|  1.67k|      box = std::make_shared<Box_sgpd>();
  900|  1.67k|      break;
  901|       |
  902|    696|    case fourcc("btrt"):
  ------------------
  |  Branch (902:5): [True: 696, False: 307k]
  ------------------
  903|    696|      box = std::make_shared<Box_btrt>();
  904|    696|      break;
  905|       |
  906|  1.05k|    case fourcc("saiz"):
  ------------------
  |  Branch (906:5): [True: 1.05k, False: 306k]
  ------------------
  907|  1.05k|      box = std::make_shared<Box_saiz>();
  908|  1.05k|      break;
  909|       |
  910|  1.48k|    case fourcc("saio"):
  ------------------
  |  Branch (910:5): [True: 1.48k, False: 306k]
  ------------------
  911|  1.48k|      box = std::make_shared<Box_saio>();
  912|  1.48k|      break;
  913|       |
  914|    852|    case fourcc("urim"):
  ------------------
  |  Branch (914:5): [True: 852, False: 306k]
  ------------------
  915|    852|      box = std::make_shared<Box_URIMetaSampleEntry>();
  916|    852|      break;
  917|       |
  918|    740|    case fourcc("uri "):
  ------------------
  |  Branch (918:5): [True: 740, False: 307k]
  ------------------
  919|    740|      box = std::make_shared<Box_uri>();
  920|    740|      break;
  921|       |
  922|    502|    case fourcc("nmhd"):
  ------------------
  |  Branch (922:5): [True: 502, False: 307k]
  ------------------
  923|    502|      box = std::make_shared<Box_nmhd>();
  924|    502|      break;
  925|       |
  926|  1.05k|    case fourcc("tref"):
  ------------------
  |  Branch (926:5): [True: 1.05k, False: 306k]
  ------------------
  927|  1.05k|      box = std::make_shared<Box_tref>();
  928|  1.05k|      break;
  929|       |
  930|    788|    case fourcc("sdtp"):
  ------------------
  |  Branch (930:5): [True: 788, False: 306k]
  ------------------
  931|    788|      box = std::make_shared<Box_sdtp>();
  932|    788|      break;
  933|       |
  934|       |    // OMAF
  935|    809|    case fourcc("prfr"):
  ------------------
  |  Branch (935:5): [True: 809, False: 306k]
  ------------------
  936|    809|      box = std::make_shared<Box_prfr>();
  937|    809|      break;
  938|       |
  939|  75.8k|    default:
  ------------------
  |  Branch (939:5): [True: 75.8k, False: 231k]
  ------------------
  940|  75.8k|      box = std::make_shared<Box_other>(hdr.get_short_type());
  941|  75.8k|      break;
  942|   307k|  }
  943|       |
  944|   307k|  box->set_short_header(hdr);
  945|       |
  946|   307k|  box->m_debug_box_type = hdr.get_type_string(); // only for debugging
  947|       |
  948|       |
  949|   307k|  if (range.get_nesting_level() > MAX_BOX_NESTING_LEVEL) {
  ------------------
  |  Branch (949:7): [True: 3, False: 307k]
  ------------------
  950|      3|    return Error(heif_error_Memory_allocation_error,
  951|      3|                 heif_suberror_Security_limit_exceeded,
  952|      3|                 "Security limit for maximum nesting of boxes has been exceeded");
  953|      3|  }
  954|       |
  955|   307k|  if (hdr.has_fixed_box_size()) {
  ------------------
  |  Branch (955:7): [True: 253k, False: 53.8k]
  ------------------
  956|       |    // Sanity checks
  957|   253k|    if (hdr.get_box_size() < hdr.get_header_size()) {
  ------------------
  |  Branch (957:9): [True: 35, False: 253k]
  ------------------
  958|     35|      std::stringstream sstr;
  959|     35|      sstr << "Box size (" << hdr.get_box_size() << " bytes) smaller than header size ("
  960|     35|           << hdr.get_header_size() << " bytes)";
  961|       |
  962|     35|      return {heif_error_Invalid_input,
  963|     35|              heif_suberror_Invalid_box_size,
  964|     35|              sstr.str()};
  965|     35|    }
  966|       |
  967|       |    // this is >= 0 because of above condition
  968|   253k|    auto nBytes = static_cast<uint64_t>(hdr.get_box_size() - hdr.get_header_size());
  969|   253k|    if (nBytes > SIZE_MAX) {
  ------------------
  |  Branch (969:9): [True: 0, False: 253k]
  ------------------
  970|      0|      return {heif_error_Memory_allocation_error,
  971|      0|              heif_suberror_Invalid_box_size,
  972|      0|              "Box size too large"};
  973|      0|    }
  974|       |
  975|       |    // Security check: make sure that box size does not exceed int64 size.
  976|       |
  977|   253k|    if (hdr.get_box_size() > (uint64_t) std::numeric_limits<int64_t>::max()) {
  ------------------
  |  Branch (977:9): [True: 0, False: 253k]
  ------------------
  978|      0|      return {heif_error_Invalid_input,
  979|      0|              heif_suberror_Invalid_box_size};
  980|      0|    }
  981|       |
  982|       |    // --- wait for data to arrive
  983|       |
  984|   253k|    auto status = range.wait_for_available_bytes(static_cast<size_t>(nBytes));
  985|   253k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (985:9): [True: 3.29k, False: 250k]
  ------------------
  986|       |      // TODO: return recoverable error at timeout
  987|  3.29k|      return {heif_error_Invalid_input,
  988|  3.29k|              heif_suberror_End_of_data};
  989|  3.29k|    }
  990|   253k|  }
  991|       |
  992|   304k|  auto box_size = static_cast<int64_t>(hdr.get_box_size());
  993|   304k|  int64_t box_size_without_header = hdr.has_fixed_box_size() ? (box_size - hdr.get_header_size()) : (int64_t)range.get_remaining_bytes();
  ------------------
  |  Branch (993:37): [True: 250k, False: 53.8k]
  ------------------
  994|       |
  995|       |  // Box size may not be larger than remaining bytes in parent box.
  996|       |
  997|   304k|  if ((int64_t)range.get_remaining_bytes() < box_size_without_header) {
  ------------------
  |  Branch (997:7): [True: 3, False: 304k]
  ------------------
  998|      3|    return {heif_error_Invalid_input,
  999|      3|            heif_suberror_Invalid_box_size};
 1000|      3|  }
 1001|       |
 1002|       |
 1003|       |  // Create child bitstream range and read box from that range.
 1004|       |
 1005|   304k|  BitstreamRange boxrange(range.get_istream(),
 1006|   304k|                          box_size_without_header,
 1007|   304k|                          &range);
 1008|       |
 1009|   304k|  err = box->parse(boxrange, limits);
 1010|   304k|  boxrange.skip_to_end_of_box();
 1011|       |
 1012|   304k|  if (err == Error::Ok) {
  ------------------
  |  Branch (1012:7): [True: 288k, False: 16.0k]
  ------------------
 1013|   288k|    *result = std::move(box);
 1014|   288k|  }
 1015|  16.0k|  else {
 1016|  16.0k|    parse_error_fatality fatality = box->get_parse_error_fatality();
 1017|       |
 1018|  16.0k|    box = std::make_shared<Box_Error>(box->get_short_type(), err, fatality);
 1019|       |
 1020|       |    // We return a Box_Error that represents the parse error.
 1021|  16.0k|    *result = std::move(box);
 1022|  16.0k|  }
 1023|       |
 1024|   304k|  return err;
 1025|   304k|}
_ZNK3Box4dumpER6Indent:
 1029|   182k|{
 1030|   182k|  std::ostringstream sstr;
 1031|       |
 1032|   182k|  sstr << BoxHeader::dump(indent);
 1033|       |
 1034|   182k|  return sstr.str();
 1035|   182k|}
_ZNK7FullBox4dumpER6Indent:
 1039|  20.6k|{
 1040|  20.6k|  std::ostringstream sstr;
 1041|       |
 1042|  20.6k|  sstr << Box::dump(indent);
 1043|       |
 1044|  20.6k|  sstr << indent << "version: " << ((int) m_version) << "\n"
 1045|  20.6k|       << indent << "flags: " << std::hex << m_flags << "\n";
 1046|       |
 1047|  20.6k|  return sstr.str();
 1048|  20.6k|}
_ZN3Box13read_childrenER14BitstreamRangejPK20heif_security_limits:
 1109|  63.1k|{
 1110|       |  // A freshly parsed box has no children yet, so m_children.size() below tracks
 1111|       |  // the number of children read so far.
 1112|  63.1k|  assert(m_children.empty());
  ------------------
  |  Branch (1112:3): [True: 63.1k, False: 0]
  ------------------
 1113|       |
 1114|       |  // Determine the applicable limit on the number of child boxes.
 1115|  63.1k|  uint32_t max_children;
 1116|  63.1k|  if (get_short_type() == fourcc("iinf")) {
  ------------------
  |  Branch (1116:7): [True: 1.46k, False: 61.6k]
  ------------------
 1117|  1.46k|    max_children = limits->max_items;
 1118|  1.46k|  }
 1119|  61.6k|  else {
 1120|  61.6k|    max_children = limits->max_children_per_box;
 1121|  61.6k|  }
 1122|       |
 1123|       |  // If the number of children is known in advance, reject an excessive count
 1124|       |  // directly instead of reading children until the accumulated count reaches
 1125|       |  // the limit.
 1126|  63.1k|  if (max_number != READ_CHILDREN_ALL) {
  ------------------
  |  Branch (1126:7): [True: 1.84k, False: 61.2k]
  ------------------
 1127|  1.84k|    if (max_children && max_number > max_children) {
  ------------------
  |  Branch (1127:9): [True: 1.84k, False: 0]
  |  Branch (1127:25): [True: 32, False: 1.81k]
  ------------------
 1128|     32|      std::stringstream sstr;
 1129|     32|      sstr << "Number of child boxes (" << max_number << ") in '" << get_type_string()
 1130|     32|           << "' box exceeds the security limit of " << max_children << ".";
 1131|       |
 1132|     32|      return Error(heif_error_Memory_allocation_error,
 1133|     32|                   heif_suberror_Security_limit_exceeded,
 1134|     32|                   sstr.str());
 1135|     32|    }
 1136|       |
 1137|       |    // The declared number of children cannot exceed what the remaining input
 1138|       |    // could possibly hold (each box occupies at least an 8-byte header). A
 1139|       |    // larger count means the box is truncated or malformed, so reject it
 1140|       |    // before reading anything. This also bounds the reservation below, which
 1141|       |    // matters when security limits are disabled and 'max_number' is otherwise
 1142|       |    // unbounded.
 1143|  1.81k|    size_t max_possible_children = range.get_remaining_bytes() / 8;
 1144|  1.81k|    if (max_number > max_possible_children) {
  ------------------
  |  Branch (1144:9): [True: 17, False: 1.79k]
  ------------------
 1145|     17|      std::stringstream sstr;
 1146|     17|      sstr << "'" << get_type_string() << "' box declares " << max_number
 1147|     17|           << " child boxes, but the remaining data can hold at most "
 1148|     17|           << max_possible_children << ".";
 1149|     17|      return Error(heif_error_Invalid_input,
 1150|     17|                   heif_suberror_End_of_data,
 1151|     17|                   sstr.str());
 1152|     17|    }
 1153|       |
 1154|  1.79k|    m_children.reserve(max_number);
 1155|  1.79k|  }
 1156|       |
 1157|   199k|  while (!range.eof() && !range.error()) {
  ------------------
  |  Branch (1157:10): [True: 140k, False: 59.2k]
  |  Branch (1157:26): [True: 140k, False: 0]
  ------------------
 1158|   140k|    std::shared_ptr<Box> box;
 1159|   140k|    Error error = Box::read(range, &box, limits);
 1160|   140k|    if (error != Error::Ok && (!box || box->get_parse_error_fatality() == parse_error_fatality::fatal)) {
  ------------------
  |  Branch (1160:9): [True: 10.8k, False: 129k]
  |  Branch (1160:32): [True: 302, False: 10.5k]
  |  Branch (1160:40): [True: 1.94k, False: 8.57k]
  ------------------
 1161|  2.24k|      return error;
 1162|  2.24k|    }
 1163|       |
 1164|   137k|    if (max_number == READ_CHILDREN_ALL) {
  ------------------
  |  Branch (1164:9): [True: 119k, False: 18.6k]
  ------------------
 1165|   119k|      if (max_children && m_children.size() > max_children) {
  ------------------
  |  Branch (1165:11): [True: 119k, False: 0]
  |  Branch (1165:27): [True: 56, False: 119k]
  ------------------
 1166|     56|        std::stringstream sstr;
 1167|     56|        sstr << "Maximum number of child boxes (" << max_children << ") in '" << get_type_string() << "' box exceeded.";
 1168|       |
 1169|       |        // Sanity check.
 1170|     56|        return Error(heif_error_Memory_allocation_error,
 1171|     56|                     heif_suberror_Security_limit_exceeded,
 1172|     56|                     sstr.str());
 1173|     56|      }
 1174|   119k|    }
 1175|       |
 1176|   137k|    m_children.push_back(std::move(box));
 1177|       |
 1178|       |    // Stop once we have read the expected number of children.
 1179|   137k|    if (max_number != READ_CHILDREN_ALL &&
  ------------------
  |  Branch (1179:9): [True: 18.6k, False: 119k]
  ------------------
 1180|  18.6k|        m_children.size() == max_number) {
  ------------------
  |  Branch (1180:9): [True: 1.54k, False: 17.1k]
  ------------------
 1181|  1.54k|      break;
 1182|  1.54k|    }
 1183|   137k|  }
 1184|       |
 1185|       |  // If a specific number of children was expected, we must have read exactly
 1186|       |  // that many. A short read means the box is truncated or malformed. Prefer
 1187|       |  // this specific error over the lower-level range error below, which would
 1188|       |  // otherwise mask it.
 1189|  60.7k|  if (max_number != READ_CHILDREN_ALL && m_children.size() != max_number) {
  ------------------
  |  Branch (1189:7): [True: 1.61k, False: 59.1k]
  |  Branch (1189:42): [True: 29, False: 1.58k]
  ------------------
 1190|     29|    std::stringstream sstr;
 1191|     29|    sstr << "'" << get_type_string() << "' box declares " << max_number
 1192|     29|         << " child boxes, but only " << m_children.size() << " could be read.";
 1193|     29|    return Error(heif_error_Invalid_input,
 1194|     29|                 heif_suberror_End_of_data,
 1195|     29|                 sstr.str());
 1196|     29|  }
 1197|       |
 1198|  60.7k|  return range.get_error();
 1199|  60.7k|}
_ZNK3Box13dump_childrenER6Indentb:
 1216|  57.8k|{
 1217|  57.8k|  std::ostringstream sstr;
 1218|       |
 1219|  57.8k|  bool first = true;
 1220|  57.8k|  int idx=1;
 1221|       |
 1222|  57.8k|  indent++;
 1223|   100k|  for (const auto& childBox : m_children) {
  ------------------
  |  Branch (1223:29): [True: 100k, False: 57.8k]
  ------------------
 1224|   100k|    if (first) {
  ------------------
  |  Branch (1224:9): [True: 48.8k, False: 51.5k]
  ------------------
 1225|  48.8k|      first = false;
 1226|  48.8k|    }
 1227|  51.5k|    else {
 1228|  51.5k|      sstr << indent << "\n";
 1229|  51.5k|    }
 1230|       |
 1231|   100k|    if (with_index) {
  ------------------
  |  Branch (1231:9): [True: 23.5k, False: 76.8k]
  ------------------
 1232|  23.5k|      sstr << indent << "index: " << idx << "\n";
 1233|  23.5k|      idx++;
 1234|  23.5k|    }
 1235|       |
 1236|   100k|    sstr << childBox->dump(indent);
 1237|   100k|  }
 1238|  57.8k|  indent--;
 1239|       |
 1240|  57.8k|  return sstr.str();
 1241|  57.8k|}
_ZN9Box_other5parseER14BitstreamRangePK20heif_security_limits:
 1265|  75.8k|{
 1266|  75.8k|  if (has_fixed_box_size()) {
  ------------------
  |  Branch (1266:7): [True: 71.6k, False: 4.17k]
  ------------------
 1267|  71.6k|    size_t len;
 1268|  71.6k|    if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (1268:9): [True: 71.6k, False: 0]
  ------------------
 1269|  71.6k|      auto len64 = get_box_size() - get_header_size();
 1270|  71.6k|      if (len64 > MAX_BOX_SIZE) {
  ------------------
  |  Branch (1270:11): [True: 0, False: 71.6k]
  ------------------
 1271|      0|        return {heif_error_Invalid_input,
 1272|      0|                heif_suberror_Security_limit_exceeded,
 1273|      0|                "Box size too large"};
 1274|      0|      }
 1275|       |
 1276|  71.6k|      len = static_cast<size_t>(len64);
 1277|       |
 1278|  71.6k|      m_data.resize(len);
 1279|  71.6k|      range.read(m_data.data(), len);
 1280|  71.6k|    }
 1281|      0|    else {
 1282|      0|      return {heif_error_Invalid_input,
 1283|      0|              heif_suberror_Invalid_box_size};
 1284|      0|    }
 1285|  71.6k|  }
 1286|  4.17k|  else {
 1287|       |    // TODO: boxes until end of file (we will probably never need this)
 1288|  4.17k|  }
 1289|       |
 1290|  75.8k|  return range.get_error();
 1291|  75.8k|}
_ZNK9Box_other4dumpER6Indent:
 1311|  63.8k|{
 1312|  63.8k|  std::ostringstream sstr;
 1313|       |
 1314|  63.8k|  sstr << BoxHeader::dump(indent);
 1315|       |
 1316|       |  // --- show raw box content
 1317|       |
 1318|  63.8k|  size_t len = 0;
 1319|  63.8k|  if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (1319:7): [True: 60.2k, False: 3.54k]
  ------------------
 1320|       |    // We can cast because if it does not fit, it would fail during parsing.
 1321|  60.2k|    len = static_cast<size_t>(get_box_size() - get_header_size());
 1322|  60.2k|  }
 1323|  3.54k|  else {
 1324|  3.54k|    sstr << indent << "invalid box size " << get_box_size() << " (smaller than header)\n";
 1325|  3.54k|    return sstr.str();
 1326|  3.54k|  }
 1327|       |
 1328|  60.2k|  sstr << write_raw_data_as_hex(m_data.data(), len,
 1329|  60.2k|                                indent.get_string() + "data: ",
 1330|  60.2k|                                indent.get_string() + "      ");
 1331|       |
 1332|  60.2k|  return sstr.str();
 1333|  63.8k|}
_ZNK9Box_Error4dumpER6Indent:
 1337|  4.13k|{
 1338|  4.13k|  std::ostringstream sstr;
 1339|  4.13k|  sstr << indent << '\'' << fourcc_to_string(m_box_type_with_parse_error) << "' parse error: " << m_error.message << "\n";
 1340|  4.13k|  sstr << indent << "fatality: ";
 1341|  4.13k|  switch (m_fatality) {
  ------------------
  |  Branch (1341:11): [True: 4.13k, False: 0]
  ------------------
 1342|      0|    case parse_error_fatality::fatal: sstr << "fatal\n"; break;
  ------------------
  |  Branch (1342:5): [True: 0, False: 4.13k]
  ------------------
 1343|    904|    case parse_error_fatality::ignorable: sstr << "ignorable\n"; break;
  ------------------
  |  Branch (1343:5): [True: 904, False: 3.22k]
  ------------------
 1344|  3.22k|    case parse_error_fatality::optional: sstr << "optional\n"; break;
  ------------------
  |  Branch (1344:5): [True: 3.22k, False: 904]
  ------------------
 1345|  4.13k|  }
 1346|       |
 1347|  4.13k|  return sstr.str();
 1348|  4.13k|}
_ZNK9Box_Error24get_parse_error_fatalityEv:
 1351|  10.5k|{
 1352|  10.5k|  return m_fatality;
 1353|  10.5k|}
_ZN8Box_ftyp5parseER14BitstreamRangePK20heif_security_limits:
 1357|  6.27k|{
 1358|  6.27k|  m_major_brand = range.read32();
 1359|  6.27k|  m_minor_version = range.read32();
 1360|       |
 1361|  6.27k|  uint64_t box_size = get_box_size();
 1362|  6.27k|  if (box_size < 8 || box_size - 8 < get_header_size()) {
  ------------------
  |  Branch (1362:7): [True: 2, False: 6.27k]
  |  Branch (1362:23): [True: 4, False: 6.26k]
  ------------------
 1363|       |    // Sanity check.
 1364|      6|    return Error(heif_error_Invalid_input,
 1365|      6|                 heif_suberror_Invalid_box_size,
 1366|      6|                 "ftyp box too small (less than 8 bytes)");
 1367|      6|  }
 1368|       |
 1369|  6.26k|  uint64_t n_minor_brands = (get_box_size() - get_header_size() - 8) / 4;
 1370|       |
 1371|  6.26k|  if (limits->max_number_of_file_brands && n_minor_brands > limits->max_number_of_file_brands) {
  ------------------
  |  Branch (1371:7): [True: 6.26k, False: 0]
  |  Branch (1371:44): [True: 8, False: 6.25k]
  ------------------
 1372|      8|    return {
 1373|      8|      heif_error_Memory_allocation_error,
 1374|      8|      heif_suberror_Security_limit_exceeded,
 1375|      8|      "Number of minor brands in file exceeds security limit"
 1376|      8|    };
 1377|      8|  }
 1378|       |
 1379|  29.4k|  for (uint64_t i = 0; i < n_minor_brands && !range.error(); i++) {
  ------------------
  |  Branch (1379:24): [True: 23.1k, False: 6.25k]
  |  Branch (1379:46): [True: 23.1k, False: 0]
  ------------------
 1380|  23.1k|    m_compatible_brands.push_back(range.read32());
 1381|  23.1k|  }
 1382|       |
 1383|  6.25k|  return range.get_error();
 1384|  6.26k|}
_ZNK8Box_ftyp4dumpER6Indent:
 1397|  5.39k|{
 1398|  5.39k|  std::ostringstream sstr;
 1399|       |
 1400|  5.39k|  sstr << BoxHeader::dump(indent);
 1401|       |
 1402|  5.39k|  sstr << indent << "major brand: " << fourcc_to_string(m_major_brand) << "\n"
 1403|  5.39k|       << indent << "minor version: ";
 1404|  5.39k|  if (m_minor_version < ('A' << 24)) {
  ------------------
  |  Branch (1404:7): [True: 4.95k, False: 442]
  ------------------
 1405|       |    // This is probably a version number
 1406|  4.95k|    sstr << m_minor_version;
 1407|  4.95k|  } else {
 1408|       |    // probably a 4CC, as used for mif3
 1409|    442|    sstr << fourcc_to_string(m_minor_version);
 1410|    442|  }
 1411|  5.39k|  sstr << "\n" << indent << "compatible brands: ";
 1412|       |
 1413|  5.39k|  bool first = true;
 1414|  20.5k|  for (uint32_t brand : m_compatible_brands) {
  ------------------
  |  Branch (1414:23): [True: 20.5k, False: 5.39k]
  ------------------
 1415|  20.5k|    if (first) { first = false; }
  ------------------
  |  Branch (1415:9): [True: 5.25k, False: 15.3k]
  ------------------
 1416|  15.3k|    else { sstr << ','; }
 1417|       |
 1418|  20.5k|    sstr << fourcc_to_string(brand);
 1419|  20.5k|  }
 1420|  5.39k|  sstr << "\n";
 1421|       |
 1422|  5.39k|  return sstr.str();
 1423|  5.39k|}
_ZN8Box_free5parseER14BitstreamRangePK20heif_security_limits:
 1452|    610|{
 1453|    610|  range.skip_to_end_of_box();
 1454|    610|  return range.get_error();
 1455|    610|}
_ZNK8Box_free4dumpER6Indent:
 1459|    492|{
 1460|    492|  std::ostringstream sstr;
 1461|    492|  sstr << BoxHeader::dump(indent);
 1462|    492|  return sstr.str();
 1463|    492|}
_ZN8Box_meta5parseER14BitstreamRangePK20heif_security_limits:
 1475|  2.97k|{
 1476|  2.97k|  parse_full_box_header(range);
 1477|       |
 1478|  2.97k|  if (get_version() != 0) {
  ------------------
  |  Branch (1478:7): [True: 4, False: 2.96k]
  ------------------
 1479|      4|    return unsupported_version_error("meta");
 1480|      4|  }
 1481|       |
 1482|       |  /*
 1483|       |  uint64_t boxSizeLimit;
 1484|       |  if (get_box_size() == BoxHeader::size_until_end_of_file) {
 1485|       |    boxSizeLimit = sizeLimit;
 1486|       |  }
 1487|       |  else {
 1488|       |    boxSizeLimit = get_box_size() - get_header_size();
 1489|       |  }
 1490|       |  */
 1491|       |
 1492|  2.96k|  return read_children(range, READ_CHILDREN_ALL, limits);
 1493|  2.97k|}
_ZNK8Box_meta4dumpER6Indent:
 1497|  2.60k|{
 1498|  2.60k|  std::ostringstream sstr;
 1499|  2.60k|  sstr << Box::dump(indent);
 1500|  2.60k|  sstr << dump_children(indent);
 1501|       |
 1502|  2.60k|  return sstr.str();
 1503|  2.60k|}
_ZNK7FullBox25unsupported_version_errorEPKc:
 1507|  1.84k|{
 1508|  1.84k|  std::stringstream sstr;
 1509|  1.84k|  sstr << box << " box data version " << ((int) m_version) << " is not implemented yet";
 1510|       |
 1511|  1.84k|  return {heif_error_Unsupported_feature,
 1512|  1.84k|          heif_suberror_Unsupported_data_version,
 1513|  1.84k|          sstr.str()};
 1514|  1.84k|}
_ZN8Box_hdlr5parseER14BitstreamRangePK20heif_security_limits:
 1518|  2.16k|{
 1519|  2.16k|  parse_full_box_header(range);
 1520|       |
 1521|  2.16k|  if (get_version() != 0) {
  ------------------
  |  Branch (1521:7): [True: 1, False: 2.16k]
  ------------------
 1522|      1|    return unsupported_version_error("hdlr");
 1523|      1|  }
 1524|       |
 1525|  2.16k|  m_pre_defined = range.read32();
 1526|  2.16k|  m_handler_type = range.read32();
 1527|       |
 1528|  8.65k|  for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (1528:19): [True: 6.49k, False: 2.16k]
  ------------------
 1529|  6.49k|    m_reserved[i] = range.read32();
 1530|  6.49k|  }
 1531|       |
 1532|  2.16k|  m_name = range.read_string();
 1533|       |
 1534|  2.16k|  return range.get_error();
 1535|  2.16k|}
_ZNK8Box_hdlr4dumpER6Indent:
 1539|  1.75k|{
 1540|  1.75k|  std::ostringstream sstr;
 1541|  1.75k|  sstr << Box::dump(indent);
 1542|  1.75k|  sstr << indent << "pre_defined: " << m_pre_defined << "\n"
 1543|  1.75k|       << indent << "handler_type: " << fourcc_to_string(m_handler_type) << "\n"
 1544|  1.75k|       << indent << "name: " << m_name << "\n";
 1545|       |
 1546|  1.75k|  return sstr.str();
 1547|  1.75k|}
_ZN8Box_pitm5parseER14BitstreamRangePK20heif_security_limits:
 1570|  2.17k|{
 1571|  2.17k|  parse_full_box_header(range);
 1572|       |
 1573|  2.17k|  if (get_version() > 1) {
  ------------------
  |  Branch (1573:7): [True: 3, False: 2.17k]
  ------------------
 1574|      3|    return unsupported_version_error("pitm");
 1575|      3|  }
 1576|       |
 1577|       |
 1578|  2.17k|  if (get_version() == 0) {
  ------------------
  |  Branch (1578:7): [True: 1.78k, False: 393]
  ------------------
 1579|  1.78k|    m_item_ID = range.read16();
 1580|  1.78k|  }
 1581|    393|  else {
 1582|    393|    m_item_ID = range.read32();
 1583|    393|  }
 1584|       |
 1585|  2.17k|  return range.get_error();
 1586|  2.17k|}
_ZNK8Box_pitm4dumpER6Indent:
 1590|  1.94k|{
 1591|  1.94k|  std::ostringstream sstr;
 1592|  1.94k|  sstr << Box::dump(indent);
 1593|  1.94k|  sstr << indent << "item_ID: " << m_item_ID << "\n";
 1594|       |
 1595|  1.94k|  return sstr.str();
 1596|  1.94k|}
_ZN8Box_iloc5parseER14BitstreamRangePK20heif_security_limits:
 1629|  1.46k|{
 1630|  1.46k|  parse_full_box_header(range);
 1631|       |
 1632|  1.46k|  if (get_version() > 2) {
  ------------------
  |  Branch (1632:7): [True: 1, False: 1.46k]
  ------------------
 1633|      1|    return unsupported_version_error("iloc");
 1634|      1|  }
 1635|       |
 1636|  1.46k|  const int version = get_version();
 1637|       |
 1638|  1.46k|  uint16_t values4 = range.read16();
 1639|       |
 1640|  1.46k|  int offset_size = (values4 >> 12) & 0xF;
 1641|  1.46k|  int length_size = (values4 >> 8) & 0xF;
 1642|  1.46k|  int base_offset_size = (values4 >> 4) & 0xF;
 1643|  1.46k|  int index_size = 0;
 1644|       |
 1645|  1.46k|  if (version == 1 || version == 2) {
  ------------------
  |  Branch (1645:7): [True: 235, False: 1.23k]
  |  Branch (1645:23): [True: 238, False: 993]
  ------------------
 1646|    473|    index_size = (values4 & 0xF);
 1647|    473|  }
 1648|       |
 1649|  1.46k|  uint32_t item_count = 0;
 1650|  1.46k|  if (version < 2) {
  ------------------
  |  Branch (1650:7): [True: 1.22k, False: 238]
  ------------------
 1651|  1.22k|    item_count = range.read16();
 1652|  1.22k|  }
 1653|    238|  else if (version == 2) {
  ------------------
  |  Branch (1653:12): [True: 238, False: 0]
  ------------------
 1654|    238|    item_count = range.read32();
 1655|    238|  }
 1656|       |
 1657|       |  // Sanity check. (This might be obsolete now as we check for range.error() below).
 1658|  1.46k|  if (limits->max_items && item_count > limits->max_items) {
  ------------------
  |  Branch (1658:7): [True: 1.46k, False: 0]
  |  Branch (1658:28): [True: 45, False: 1.42k]
  ------------------
 1659|     45|    std::stringstream sstr;
 1660|     45|    sstr << "iloc box contains " << item_count << " items, which exceeds the security limit of "
 1661|     45|         << limits->max_items << " items.";
 1662|       |
 1663|     45|    return Error(heif_error_Memory_allocation_error,
 1664|     45|                 heif_suberror_Security_limit_exceeded,
 1665|     45|                 sstr.str());
 1666|     45|  }
 1667|       |
 1668|  6.66k|  for (uint32_t i = 0; i < item_count; i++) {
  ------------------
  |  Branch (1668:24): [True: 5.38k, False: 1.27k]
  ------------------
 1669|  5.38k|    Item item;
 1670|       |
 1671|  5.38k|    if (range.eof()) {
  ------------------
  |  Branch (1671:9): [True: 93, False: 5.29k]
  ------------------
 1672|     93|      std::stringstream sstr;
 1673|     93|      sstr << "iloc box should contain " << item_count << " items, but we can only read " << i << " items.";
 1674|       |
 1675|     93|      return {heif_error_Invalid_input,
 1676|     93|              heif_suberror_End_of_data,
 1677|     93|              sstr.str()};
 1678|     93|    }
 1679|       |
 1680|  5.29k|    if (version < 2) {
  ------------------
  |  Branch (1680:9): [True: 5.08k, False: 208]
  ------------------
 1681|  5.08k|      item.item_ID = range.read16();
 1682|  5.08k|    }
 1683|    208|    else if (version == 2) {
  ------------------
  |  Branch (1683:14): [True: 208, False: 0]
  ------------------
 1684|    208|      item.item_ID = range.read32();
 1685|    208|    }
 1686|       |
 1687|  5.29k|    if (version >= 1) {
  ------------------
  |  Branch (1687:9): [True: 1.44k, False: 3.84k]
  ------------------
 1688|  1.44k|      values4 = range.read16();
 1689|  1.44k|      item.construction_method = (values4 & 0xF);
 1690|  1.44k|    }
 1691|       |
 1692|  5.29k|    item.data_reference_index = range.read16();
 1693|       |
 1694|  5.29k|    item.base_offset = 0;
 1695|  5.29k|    if (base_offset_size == 4) {
  ------------------
  |  Branch (1695:9): [True: 534, False: 4.76k]
  ------------------
 1696|    534|      item.base_offset = range.read32();
 1697|    534|    }
 1698|  4.76k|    else if (base_offset_size == 8) {
  ------------------
  |  Branch (1698:14): [True: 212, False: 4.54k]
  ------------------
 1699|    212|      item.base_offset = ((uint64_t) range.read32()) << 32;
 1700|    212|      item.base_offset |= range.read32();
 1701|    212|    }
 1702|       |
 1703|  5.29k|    uint16_t extent_count = range.read16();
 1704|       |
 1705|       |    // Sanity check.
 1706|  5.29k|    auto max_iloc_extents = limits->max_iloc_extents_per_item;
 1707|  5.29k|    if (max_iloc_extents && extent_count > max_iloc_extents) {
  ------------------
  |  Branch (1707:9): [True: 5.29k, False: 0]
  |  Branch (1707:29): [True: 9, False: 5.28k]
  ------------------
 1708|      9|      std::stringstream sstr;
 1709|      9|      sstr << "Number of extents in iloc box (" << extent_count << ") exceeds security limit ("
 1710|      9|           << max_iloc_extents << ")\n";
 1711|       |
 1712|      9|      return Error(heif_error_Memory_allocation_error,
 1713|      9|                   heif_suberror_Security_limit_exceeded,
 1714|      9|                   sstr.str());
 1715|      9|    }
 1716|       |
 1717|  18.5k|    for (int e = 0; e < extent_count; e++) {
  ------------------
  |  Branch (1717:21): [True: 13.3k, False: 5.24k]
  ------------------
 1718|  13.3k|      Extent extent;
 1719|       |
 1720|  13.3k|      if (range.eof()) {
  ------------------
  |  Branch (1720:11): [True: 45, False: 13.3k]
  ------------------
 1721|     45|        std::stringstream sstr;
 1722|     45|        sstr << "iloc item should contain " << extent_count << " extents, but we can only read " << e << " extents.";
 1723|       |
 1724|     45|        return {heif_error_Invalid_input,
 1725|     45|                heif_suberror_End_of_data,
 1726|     45|                sstr.str()};
 1727|     45|      }
 1728|       |
 1729|  13.3k|      if ((version == 1 || version == 2) && index_size > 0) {
  ------------------
  |  Branch (1729:12): [True: 2.06k, False: 11.2k]
  |  Branch (1729:28): [True: 268, False: 10.9k]
  |  Branch (1729:45): [True: 1.53k, False: 792]
  ------------------
 1730|  1.53k|        if (index_size == 4) {
  ------------------
  |  Branch (1730:13): [True: 439, False: 1.09k]
  ------------------
 1731|    439|          extent.index = range.read32();
 1732|    439|        }
 1733|  1.09k|        else if (index_size == 8) {
  ------------------
  |  Branch (1733:18): [True: 338, False: 761]
  ------------------
 1734|    338|          extent.index = ((uint64_t) range.read32()) << 32;
 1735|    338|          extent.index |= range.read32();
 1736|    338|        }
 1737|  1.53k|      }
 1738|       |
 1739|  13.3k|      extent.offset = 0;
 1740|  13.3k|      if (offset_size == 4) {
  ------------------
  |  Branch (1740:11): [True: 532, False: 12.7k]
  ------------------
 1741|    532|        extent.offset = range.read32();
 1742|    532|      }
 1743|  12.7k|      else if (offset_size == 8) {
  ------------------
  |  Branch (1743:16): [True: 195, False: 12.5k]
  ------------------
 1744|    195|        extent.offset = ((uint64_t) range.read32()) << 32;
 1745|    195|        extent.offset |= range.read32();
 1746|    195|      }
 1747|       |
 1748|       |
 1749|  13.3k|      extent.length = 0;
 1750|  13.3k|      if (length_size == 4) {
  ------------------
  |  Branch (1750:11): [True: 550, False: 12.7k]
  ------------------
 1751|    550|        extent.length = range.read32();
 1752|    550|      }
 1753|  12.7k|      else if (length_size == 8) {
  ------------------
  |  Branch (1753:16): [True: 226, False: 12.5k]
  ------------------
 1754|    226|        extent.length = ((uint64_t) range.read32()) << 32;
 1755|    226|        extent.length |= range.read32();
 1756|    226|      }
 1757|       |
 1758|  13.3k|      item.extents.push_back(extent);
 1759|  13.3k|    }
 1760|       |
 1761|  5.24k|    if (!range.error()) {
  ------------------
  |  Branch (1761:9): [True: 5.15k, False: 82]
  ------------------
 1762|  5.15k|      m_items.push_back(item);
 1763|  5.15k|    }
 1764|  5.24k|  }
 1765|       |
 1766|  1.27k|  return range.get_error();
 1767|  1.42k|}
_ZN8Box_ilocC2Ev:
 1771|  1.46k|{
 1772|  1.46k|  set_short_type(fourcc("iloc"));
 1773|       |
 1774|  1.46k|  set_use_tmp_file(false);
 1775|  1.46k|}
_ZN8Box_ilocD2Ev:
 1779|  1.46k|{
 1780|  1.46k|  if (m_use_tmpfile) {
  ------------------
  |  Branch (1780:7): [True: 0, False: 1.46k]
  ------------------
 1781|      0|    unlink(m_tmp_filename);
 1782|      0|  }
 1783|  1.46k|}
_ZN8Box_iloc16set_use_tmp_fileEb:
 1787|  1.46k|{
 1788|  1.46k|  m_use_tmpfile = flag;
 1789|  1.46k|  if (flag) {
  ------------------
  |  Branch (1789:7): [True: 0, False: 1.46k]
  ------------------
 1790|      0|#if !defined(_WIN32)
 1791|      0|    strcpy(m_tmp_filename, "/tmp/libheif-XXXXXX");
 1792|      0|    m_tmpfile_fd = mkstemp(m_tmp_filename);
 1793|       |#else
 1794|       |    // TODO Currently unused code. Implement when needed.
 1795|       |    assert(false);
 1796|       |#  if 0
 1797|       |    char tmpname[L_tmpnam_s];
 1798|       |    // TODO: check return value (errno_t)
 1799|       |    tmpnam_s(tmpname, L_tmpnam_s);
 1800|       |    _sopen_s(&m_tmpfile_fd, tmpname, _O_CREAT | _O_TEMPORARY | _O_TRUNC | _O_RDWR, _SH_DENYRW, _S_IREAD | _S_IWRITE);
 1801|       |#  endif
 1802|       |#endif
 1803|      0|  }
 1804|  1.46k|}
_ZNK8Box_iloc4dumpER6Indent:
 1808|  1.24k|{
 1809|  1.24k|  std::ostringstream sstr;
 1810|  1.24k|  sstr << Box::dump(indent);
 1811|       |
 1812|  2.74k|  for (const Item& item : m_items) {
  ------------------
  |  Branch (1812:25): [True: 2.74k, False: 1.24k]
  ------------------
 1813|  2.74k|    sstr << indent << "item ID: " << item.item_ID << "\n"
 1814|  2.74k|         << indent << "  construction method: " << ((int) item.construction_method) << "\n"
 1815|  2.74k|         << indent << "  data_reference_index: " << std::hex
 1816|  2.74k|         << item.data_reference_index << std::dec << "\n"
 1817|  2.74k|         << indent << "  base_offset: " << item.base_offset << "\n";
 1818|       |
 1819|  2.74k|    sstr << indent << "  extents: ";
 1820|  8.30k|    for (const Extent& extent : item.extents) {
  ------------------
  |  Branch (1820:31): [True: 8.30k, False: 2.74k]
  ------------------
 1821|  8.30k|      sstr << extent.offset << "," << extent.length;
 1822|  8.30k|      if (extent.index != 0) {
  ------------------
  |  Branch (1822:11): [True: 365, False: 7.94k]
  ------------------
 1823|    365|        sstr << ";index=" << extent.index;
 1824|    365|      }
 1825|  8.30k|      sstr << " ";
 1826|  8.30k|    }
 1827|  2.74k|    sstr << "\n";
 1828|  2.74k|  }
 1829|       |
 1830|  1.24k|  return sstr.str();
 1831|  1.24k|}
_ZN8Box_infe5parseER14BitstreamRangePK20heif_security_limits:
 2511|  3.17k|{
 2512|  3.17k|  parse_full_box_header(range);
 2513|       |
 2514|       |  // only versions 2,3 are required by HEIF
 2515|  3.17k|  if (get_version() > 3) {
  ------------------
  |  Branch (2515:7): [True: 2, False: 3.17k]
  ------------------
 2516|      2|    return unsupported_version_error("infe");
 2517|      2|  }
 2518|       |
 2519|  3.17k|  if (get_version() <= 1) {
  ------------------
  |  Branch (2519:7): [True: 311, False: 2.85k]
  ------------------
 2520|    311|    m_item_ID = range.read16();
 2521|    311|    m_item_protection_index = range.read16();
 2522|       |
 2523|    311|    m_item_name = range.read_string();
 2524|    311|    m_content_type = range.read_string();
 2525|    311|    m_content_encoding = range.read_string();
 2526|    311|  }
 2527|       |
 2528|  3.17k|  m_item_type_4cc = 0;
 2529|       |
 2530|  3.17k|  if (get_version() >= 2) {
  ------------------
  |  Branch (2530:7): [True: 2.85k, False: 311]
  ------------------
 2531|  2.85k|    m_hidden_item = (get_flags() & 1);
 2532|       |
 2533|  2.85k|    if (get_version() == 2) {
  ------------------
  |  Branch (2533:9): [True: 2.54k, False: 316]
  ------------------
 2534|  2.54k|      m_item_ID = range.read16();
 2535|  2.54k|    }
 2536|    316|    else {
 2537|    316|      m_item_ID = range.read32();
 2538|    316|    }
 2539|       |
 2540|  2.85k|    m_item_protection_index = range.read16();
 2541|  2.85k|    m_item_type_4cc = range.read32();
 2542|       |
 2543|  2.85k|    m_item_name = range.read_string();
 2544|  2.85k|    if (m_item_type_4cc == fourcc("mime")) {
  ------------------
  |  Branch (2544:9): [True: 314, False: 2.54k]
  ------------------
 2545|    314|      m_content_type = range.read_string();
 2546|    314|      m_content_encoding = range.read_string();
 2547|    314|    }
 2548|  2.54k|    else if (m_item_type_4cc == fourcc("uri ")) {
  ------------------
  |  Branch (2548:14): [True: 817, False: 1.72k]
  ------------------
 2549|    817|      m_item_uri_type = range.read_string();
 2550|    817|    }
 2551|  2.85k|  }
 2552|       |
 2553|  3.17k|  return range.get_error();
 2554|  3.17k|}
_ZNK8Box_infe4dumpER6Indent:
 2632|  2.63k|{
 2633|  2.63k|  std::ostringstream sstr;
 2634|  2.63k|  sstr << Box::dump(indent);
 2635|       |
 2636|  2.63k|  sstr << indent << "item_ID: " << m_item_ID << "\n"
 2637|  2.63k|       << indent << "item_protection_index: " << m_item_protection_index << "\n"
 2638|  2.63k|       << indent << "item_type: " << fourcc_to_string(m_item_type_4cc) << "\n"
 2639|  2.63k|       << indent << "item_name: " << m_item_name << "\n";
 2640|       |
 2641|  2.63k|  if (m_item_type_4cc == fourcc("mime")) {
  ------------------
  |  Branch (2641:7): [True: 258, False: 2.38k]
  ------------------
 2642|    258|    sstr << indent << "content_type: " << m_content_type << "\n"
 2643|    258|         << indent << "content_encoding: " << m_content_encoding << "\n";
 2644|    258|  }
 2645|       |
 2646|  2.63k|  if (m_item_type_4cc == fourcc("uri ")) {
  ------------------
  |  Branch (2646:7): [True: 578, False: 2.06k]
  ------------------
 2647|    578|    sstr << indent << "item uri type: " << m_item_uri_type << "\n";
 2648|    578|  }
 2649|       |
 2650|  2.63k|  sstr << indent << "hidden item: " << std::boolalpha << m_hidden_item << "\n";
 2651|       |
 2652|  2.63k|  return sstr.str();
 2653|  2.63k|}
_ZN8Box_iinf5parseER14BitstreamRangePK20heif_security_limits:
 2657|  2.03k|{
 2658|  2.03k|  parse_full_box_header(range);
 2659|       |
 2660|       |  // TODO: there are several images in circulation that have an iinf version=2. We should not enforce this with a hard error.
 2661|  2.03k|  if (false && get_version() > 1) {
  ------------------
  |  Branch (2661:7): [Folded, False: 2.03k]
  |  Branch (2661:16): [True: 0, False: 0]
  ------------------
 2662|      0|    return unsupported_version_error("iinf");
 2663|      0|  }
 2664|       |
 2665|  2.03k|  int nEntries_size = (get_version() > 0) ? 4 : 2;
  ------------------
  |  Branch (2665:23): [True: 284, False: 1.74k]
  ------------------
 2666|       |
 2667|  2.03k|  uint32_t item_count;
 2668|  2.03k|  if (nEntries_size == 2) {
  ------------------
  |  Branch (2668:7): [True: 1.74k, False: 284]
  ------------------
 2669|  1.74k|    item_count = range.read16();
 2670|  1.74k|  }
 2671|    284|  else {
 2672|    284|    item_count = range.read32();
 2673|    284|  }
 2674|       |
 2675|  2.03k|  if (item_count == 0) {
  ------------------
  |  Branch (2675:7): [True: 505, False: 1.52k]
  ------------------
 2676|    505|    return Error::Ok;
 2677|    505|  }
 2678|       |
 2679|       |  // Sanity check.
 2680|  1.52k|  if (limits->max_items && item_count > limits->max_items) {
  ------------------
  |  Branch (2680:7): [True: 1.52k, False: 0]
  |  Branch (2680:28): [True: 68, False: 1.46k]
  ------------------
 2681|     68|    std::stringstream sstr;
 2682|     68|    sstr << "iinf box contains " << item_count << " items, which exceeds the security limit of "
 2683|     68|         << limits->max_items << " items.";
 2684|       |
 2685|     68|    return Error(heif_error_Memory_allocation_error,
 2686|     68|                 heif_suberror_Security_limit_exceeded,
 2687|     68|                 sstr.str());
 2688|     68|  }
 2689|       |
 2690|  1.46k|  return read_children(range, item_count, limits);
 2691|  1.52k|}
_ZNK8Box_iinf4dumpER6Indent:
 2695|  1.71k|{
 2696|  1.71k|  std::ostringstream sstr;
 2697|  1.71k|  sstr << Box::dump(indent);
 2698|       |
 2699|  1.71k|  sstr << dump_children(indent);
 2700|       |
 2701|  1.71k|  return sstr.str();
 2702|  1.71k|}
_ZN8Box_iprp5parseER14BitstreamRangePK20heif_security_limits:
 2706|  28.3k|{
 2707|       |  //parse_full_box_header(range);
 2708|       |
 2709|  28.3k|  return read_children(range, READ_CHILDREN_ALL, limits);
 2710|  28.3k|}
_ZNK8Box_iprp4dumpER6Indent:
 2742|  27.0k|{
 2743|  27.0k|  std::ostringstream sstr;
 2744|  27.0k|  sstr << Box::dump(indent);
 2745|       |
 2746|  27.0k|  sstr << dump_children(indent);
 2747|       |
 2748|  27.0k|  return sstr.str();
 2749|  27.0k|}
_ZN8Box_ipco5parseER14BitstreamRangePK20heif_security_limits:
 2764|  10.9k|{
 2765|       |  //parse_full_box_header(range);
 2766|       |
 2767|  10.9k|  return read_children(range, READ_CHILDREN_ALL, limits);
 2768|  10.9k|}
_ZNK8Box_ipco4dumpER6Indent:
 2772|  9.82k|{
 2773|  9.82k|  std::ostringstream sstr;
 2774|  9.82k|  sstr << Box::dump(indent);
 2775|       |
 2776|  9.82k|  sstr << dump_children(indent, true);
 2777|       |
 2778|  9.82k|  return sstr.str();
 2779|  9.82k|}
_ZN8Box_pixi5parseER14BitstreamRangePK20heif_security_limits:
 2783|  3.67k|{
 2784|  3.67k|  parse_full_box_header(range);
 2785|       |
 2786|  3.67k|  if (get_version() != 0) {
  ------------------
  |  Branch (2786:7): [True: 544, False: 3.13k]
  ------------------
 2787|    544|    return unsupported_version_error("pixi");
 2788|    544|  }
 2789|       |
 2790|  3.13k|  StreamReader::grow_status status;
 2791|  3.13k|  uint8_t num_channels = range.read8();
 2792|  3.13k|  status = range.wait_for_available_bytes(num_channels);
 2793|  3.13k|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (2793:7): [True: 31, False: 3.10k]
  ------------------
 2794|       |    // TODO: return recoverable error at timeout
 2795|     31|    return Error(heif_error_Invalid_input,
 2796|     31|                 heif_suberror_End_of_data);
 2797|     31|  }
 2798|       |
 2799|  3.10k|  m_bits_per_channel.resize(num_channels);
 2800|  35.6k|  for (int i = 0; i < num_channels; i++) {
  ------------------
  |  Branch (2800:19): [True: 32.5k, False: 3.10k]
  ------------------
 2801|  32.5k|    m_bits_per_channel[i] = range.read8();
 2802|  32.5k|  }
 2803|       |
 2804|  3.10k|  return range.get_error();
 2805|  3.13k|}
_ZNK8Box_pixi4dumpER6Indent:
 2809|  2.13k|{
 2810|  2.13k|  std::ostringstream sstr;
 2811|  2.13k|  sstr << Box::dump(indent);
 2812|       |
 2813|  2.13k|  sstr << indent << "bits_per_channel: ";
 2814|       |
 2815|  7.07k|  for (size_t i = 0; i < m_bits_per_channel.size(); i++) {
  ------------------
  |  Branch (2815:22): [True: 4.94k, False: 2.13k]
  ------------------
 2816|  4.94k|    if (i > 0) sstr << ",";
  ------------------
  |  Branch (2816:9): [True: 3.33k, False: 1.61k]
  ------------------
 2817|  4.94k|    sstr << ((int) m_bits_per_channel[i]);
 2818|  4.94k|  }
 2819|       |
 2820|  2.13k|  sstr << "\n";
 2821|       |
 2822|  2.13k|  return sstr.str();
 2823|  2.13k|}
_ZN8Box_pasp5parseER14BitstreamRangePK20heif_security_limits:
 2848|  8.86k|{
 2849|       |  //parse_full_box_header(range);
 2850|       |
 2851|  8.86k|  hSpacing = range.read32();
 2852|  8.86k|  vSpacing = range.read32();
 2853|       |
 2854|  8.86k|  return range.get_error();
 2855|  8.86k|}
_ZNK8Box_pasp4dumpER6Indent:
 2859|  6.70k|{
 2860|  6.70k|  std::ostringstream sstr;
 2861|  6.70k|  sstr << Box::dump(indent);
 2862|       |
 2863|  6.70k|  sstr << indent << "hSpacing: " << hSpacing << "\n";
 2864|  6.70k|  sstr << indent << "vSpacing: " << vSpacing << "\n";
 2865|       |
 2866|  6.70k|  return sstr.str();
 2867|  6.70k|}
_ZN8Box_lsel5parseER14BitstreamRangePK20heif_security_limits:
 2884|  4.32k|{
 2885|  4.32k|  layer_id = range.read16();
 2886|       |
 2887|  4.32k|  return range.get_error();
 2888|  4.32k|}
_ZNK8Box_lsel4dumpER6Indent:
 2892|  3.27k|{
 2893|  3.27k|  std::ostringstream sstr;
 2894|  3.27k|  sstr << Box::dump(indent);
 2895|       |
 2896|  3.27k|  sstr << indent << "layer_id: " << layer_id << "\n";
 2897|       |
 2898|  3.27k|  return sstr.str();
 2899|  3.27k|}
_ZN8Box_clli5parseER14BitstreamRangePK20heif_security_limits:
 2915|    356|{
 2916|       |  //parse_full_box_header(range);
 2917|       |
 2918|    356|  clli.max_content_light_level = range.read16();
 2919|    356|  clli.max_pic_average_light_level = range.read16();
 2920|       |
 2921|    356|  return range.get_error();
 2922|    356|}
_ZNK8Box_clli4dumpER6Indent:
 2926|    197|{
 2927|    197|  std::ostringstream sstr;
 2928|    197|  sstr << Box::dump(indent);
 2929|       |
 2930|    197|  sstr << indent << "max_content_light_level: " << clli.max_content_light_level << "\n";
 2931|    197|  sstr << indent << "max_pic_average_light_level: " << clli.max_pic_average_light_level << "\n";
 2932|       |
 2933|    197|  return sstr.str();
 2934|    197|}
_ZN8Box_mdcvC2Ev:
 2951|  5.54k|{
 2952|  5.54k|  set_short_type(fourcc("mdcv"));
 2953|       |
 2954|  5.54k|  memset(&mdcv, 0, sizeof(heif_mastering_display_colour_volume));
 2955|  5.54k|}
_ZN8Box_mdcv5parseER14BitstreamRangePK20heif_security_limits:
 2959|  2.61k|{
 2960|       |  //parse_full_box_header(range);
 2961|       |
 2962|  10.4k|  for (int c = 0; c < 3; c++) {
  ------------------
  |  Branch (2962:19): [True: 7.84k, False: 2.61k]
  ------------------
 2963|  7.84k|    mdcv.display_primaries_x[c] = range.read16();
 2964|  7.84k|    mdcv.display_primaries_y[c] = range.read16();
 2965|  7.84k|  }
 2966|       |
 2967|  2.61k|  mdcv.white_point_x = range.read16();
 2968|  2.61k|  mdcv.white_point_y = range.read16();
 2969|  2.61k|  mdcv.max_display_mastering_luminance = range.read32();
 2970|  2.61k|  mdcv.min_display_mastering_luminance = range.read32();
 2971|       |
 2972|  2.61k|  return range.get_error();
 2973|  2.61k|}
_ZNK8Box_mdcv4dumpER6Indent:
 2977|  1.94k|{
 2978|  1.94k|  std::ostringstream sstr;
 2979|  1.94k|  sstr << Box::dump(indent);
 2980|       |
 2981|  1.94k|  sstr << indent << "display_primaries (x,y): ";
 2982|  1.94k|  sstr << "(" << mdcv.display_primaries_x[0] << ";" << mdcv.display_primaries_y[0] << "), ";
 2983|  1.94k|  sstr << "(" << mdcv.display_primaries_x[1] << ";" << mdcv.display_primaries_y[1] << "), ";
 2984|  1.94k|  sstr << "(" << mdcv.display_primaries_x[2] << ";" << mdcv.display_primaries_y[2] << ")\n";
 2985|       |
 2986|  1.94k|  sstr << indent << "white point (x,y): (" << mdcv.white_point_x << ";" << mdcv.white_point_y << ")\n";
 2987|  1.94k|  sstr << indent << "max display mastering luminance: " << mdcv.max_display_mastering_luminance << "\n";
 2988|  1.94k|  sstr << indent << "min display mastering luminance: " << mdcv.min_display_mastering_luminance << "\n";
 2989|       |
 2990|  1.94k|  return sstr.str();
 2991|  1.94k|}
_ZN8Box_amveC2Ev:
 3015|  4.31k|{
 3016|  4.31k|  set_short_type(fourcc("amve"));
 3017|       |
 3018|       |  // These values are not valid.
 3019|  4.31k|  amve.ambient_illumination = 0;
 3020|  4.31k|  amve.ambient_light_x = 0;
 3021|  4.31k|  amve.ambient_light_y = 0;
 3022|  4.31k|}
_ZN8Box_amve5parseER14BitstreamRangePK20heif_security_limits:
 3025|    624|{
 3026|    624|  amve.ambient_illumination = range.read32();
 3027|    624|  amve.ambient_light_x = range.read16();
 3028|    624|  amve.ambient_light_y = range.read16();
 3029|       |
 3030|    624|  return range.get_error();
 3031|    624|}
_ZNK8Box_amve4dumpER6Indent:
 3035|    325|{
 3036|    325|  std::ostringstream sstr;
 3037|    325|  sstr << Box::dump(indent);
 3038|       |
 3039|    325|  sstr << indent << "ambient_illumination: " << amve.ambient_illumination << "\n";
 3040|    325|  sstr << indent << "ambient_light_x: " << amve.ambient_light_x << "\n";
 3041|    325|  sstr << indent << "ambient_light_y: " << amve.ambient_light_y << "\n";
 3042|       |
 3043|    325|  return sstr.str();
 3044|    325|}
_ZN8Box_ndwt5parseER14BitstreamRangePK20heif_security_limits:
 3062|    523|{
 3063|    523|  parse_full_box_header(range);
 3064|       |
 3065|    523|  if (get_version() != 0) {
  ------------------
  |  Branch (3065:7): [True: 46, False: 477]
  ------------------
 3066|     46|    return unsupported_version_error("ndwt");
 3067|     46|  }
 3068|       |
 3069|    477|  m_diffuse_white_luminance = range.read32();
 3070|       |
 3071|    477|  return range.get_error();
 3072|    523|}
_ZNK8Box_ndwt4dumpER6Indent:
 3076|    459|{
 3077|    459|  std::ostringstream sstr;
 3078|    459|  sstr << Box::dump(indent);
 3079|       |
 3080|    459|  sstr << indent << "diffuse_white_luminance: " << m_diffuse_white_luminance << "\n";
 3081|       |
 3082|    459|  return sstr.str();
 3083|    459|}
_ZN8Box_cclvC2Ev:
 3099|  6.13k|{
 3100|  6.13k|  set_short_type(fourcc("cclv"));
 3101|       |
 3102|  6.13k|  m_ccv_primaries_valid = false;
 3103|  6.13k|}
_ZN8Box_cclv13set_primariesEiiiiii:
 3107|    765|{
 3108|    765|  m_ccv_primaries_valid = true;
 3109|    765|  m_ccv_primaries_x[0] = x0;
 3110|    765|  m_ccv_primaries_y[0] = y0;
 3111|    765|  m_ccv_primaries_x[1] = x1;
 3112|    765|  m_ccv_primaries_y[1] = y1;
 3113|    765|  m_ccv_primaries_x[2] = x2;
 3114|    765|  m_ccv_primaries_y[2] = y2;
 3115|    765|}
_ZN8Box_ispe5parseER14BitstreamRangePK20heif_security_limits:
 3299|  1.73k|{
 3300|  1.73k|  parse_full_box_header(range);
 3301|       |
 3302|  1.73k|  if (get_version() != 0) {
  ------------------
  |  Branch (3302:7): [True: 4, False: 1.73k]
  ------------------
 3303|      4|    return unsupported_version_error("ispe");
 3304|      4|  }
 3305|       |
 3306|  1.73k|  m_image_width = range.read32();
 3307|  1.73k|  m_image_height = range.read32();
 3308|       |
 3309|  1.73k|  return range.get_error();
 3310|  1.73k|}
_ZNK8Box_ispe4dumpER6Indent:
 3314|  1.41k|{
 3315|  1.41k|  std::ostringstream sstr;
 3316|  1.41k|  sstr << Box::dump(indent);
 3317|       |
 3318|  1.41k|  sstr << indent << "image width: " << m_image_width << "\n"
 3319|  1.41k|       << indent << "image height: " << m_image_height << "\n";
 3320|       |
 3321|  1.41k|  return sstr.str();
 3322|  1.41k|}
_ZN8Box_ipma5parseER14BitstreamRangePK20heif_security_limits:
 3351|  2.06k|{
 3352|  2.06k|  parse_full_box_header(range);
 3353|       |
 3354|       |  // TODO: is there any specification of allowed values for the ipma version in the HEIF standards?
 3355|       |
 3356|  2.06k|  if (get_version() > 1) {
  ------------------
  |  Branch (3356:7): [True: 7, False: 2.06k]
  ------------------
 3357|      7|    return unsupported_version_error("ipma");
 3358|      7|  }
 3359|       |
 3360|  2.06k|  uint32_t entry_cnt = range.read32();
 3361|       |
 3362|  2.06k|  if (limits->max_items && entry_cnt > limits->max_items) {
  ------------------
  |  Branch (3362:7): [True: 2.06k, False: 0]
  |  Branch (3362:28): [True: 38, False: 2.02k]
  ------------------
 3363|     38|    std::stringstream sstr;
 3364|     38|    sstr << "ipma box wants to define properties for " << entry_cnt
 3365|     38|         << " items, but the security limit has been set to " << limits->max_items << " items";
 3366|     38|    return {heif_error_Invalid_input,
 3367|     38|            heif_suberror_Security_limit_exceeded,
 3368|     38|            sstr.str()};
 3369|     38|  }
 3370|       |
 3371|  13.9k|  for (uint32_t i = 0; i < entry_cnt && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (3371:24): [True: 12.2k, False: 1.74k]
  |  Branch (3371:41): [True: 12.1k, False: 56]
  |  Branch (3371:59): [True: 11.9k, False: 227]
  ------------------
 3372|  11.9k|    Entry entry;
 3373|  11.9k|    if (get_version() < 1) {
  ------------------
  |  Branch (3373:9): [True: 6.61k, False: 5.34k]
  ------------------
 3374|  6.61k|      entry.item_ID = range.read16();
 3375|  6.61k|    }
 3376|  5.34k|    else {
 3377|  5.34k|      entry.item_ID = range.read32();
 3378|  5.34k|    }
 3379|       |
 3380|  11.9k|    int assoc_cnt = range.read8();
 3381|   449k|    for (int k = 0; k < assoc_cnt; k++) {
  ------------------
  |  Branch (3381:21): [True: 437k, False: 11.9k]
  ------------------
 3382|   437k|      PropertyAssociation association{};
 3383|       |
 3384|   437k|      uint16_t index;
 3385|   437k|      if (get_flags() & 1) {
  ------------------
  |  Branch (3385:11): [True: 1.39k, False: 436k]
  ------------------
 3386|  1.39k|        index = range.read16();
 3387|  1.39k|        association.essential = !!(index & 0x8000);
 3388|  1.39k|        association.property_index = (index & 0x7fff);
 3389|  1.39k|      }
 3390|   436k|      else {
 3391|   436k|        index = range.read8();
 3392|   436k|        association.essential = !!(index & 0x80);
 3393|   436k|        association.property_index = (index & 0x7f);
 3394|   436k|      }
 3395|       |
 3396|   437k|      entry.associations.push_back(association);
 3397|   437k|    }
 3398|       |
 3399|  11.9k|    m_entries.push_back(entry);
 3400|  11.9k|  }
 3401|       |
 3402|  2.02k|  return range.get_error();
 3403|  2.06k|}
_ZNK8Box_ipma4dumpER6Indent:
 3504|  1.77k|{
 3505|  1.77k|  std::ostringstream sstr;
 3506|  1.77k|  sstr << Box::dump(indent);
 3507|       |
 3508|  10.5k|  for (const Entry& entry : m_entries) {
  ------------------
  |  Branch (3508:27): [True: 10.5k, False: 1.77k]
  ------------------
 3509|  10.5k|    sstr << indent << "associations for item ID: " << entry.item_ID << "\n";
 3510|  10.5k|    indent++;
 3511|   402k|    for (const auto& assoc : entry.associations) {
  ------------------
  |  Branch (3511:28): [True: 402k, False: 10.5k]
  ------------------
 3512|   402k|      sstr << indent << "property index: " << assoc.property_index
 3513|   402k|           << " (essential: " << std::boolalpha << assoc.essential << ")\n";
 3514|   402k|    }
 3515|  10.5k|    indent--;
 3516|  10.5k|  }
 3517|       |
 3518|  1.77k|  return sstr.str();
 3519|  1.77k|}
_ZN8Box_auxC5parseER14BitstreamRangePK20heif_security_limits:
 3614|    922|{
 3615|    922|  parse_full_box_header(range);
 3616|       |
 3617|    922|  if (get_version() != 0) {
  ------------------
  |  Branch (3617:7): [True: 1, False: 921]
  ------------------
 3618|      1|    return unsupported_version_error("auxC");
 3619|      1|  }
 3620|       |
 3621|    921|  m_aux_type = range.read_string();
 3622|       |
 3623|  5.89M|  while (!range.eof()) {
  ------------------
  |  Branch (3623:10): [True: 5.89M, False: 921]
  ------------------
 3624|  5.89M|    m_aux_subtypes.push_back(range.read8());
 3625|  5.89M|  }
 3626|       |
 3627|    921|  return range.get_error();
 3628|    922|}
_ZNK8Box_auxC4dumpER6Indent:
 3648|    727|{
 3649|    727|  std::ostringstream sstr;
 3650|    727|  sstr << Box::dump(indent);
 3651|       |
 3652|    727|  sstr << indent << "aux type: " << m_aux_type << "\n"
 3653|    727|       << indent << "aux subtypes: ";
 3654|  5.89M|  for (uint8_t subtype : m_aux_subtypes) {
  ------------------
  |  Branch (3654:24): [True: 5.89M, False: 727]
  ------------------
 3655|  5.89M|    sstr << std::hex << std::setw(2) << std::setfill('0') << ((int) subtype) << " ";
 3656|  5.89M|  }
 3657|       |
 3658|    727|  sstr << "\n";
 3659|       |
 3660|    727|  return sstr.str();
 3661|    727|}
_ZN8Box_irot5parseER14BitstreamRangePK20heif_security_limits:
 3665|  4.94k|{
 3666|       |  //parse_full_box_header(range);
 3667|       |
 3668|  4.94k|  uint16_t rotation = range.read8();
 3669|  4.94k|  rotation &= 0x03;
 3670|       |
 3671|  4.94k|  m_rotation = rotation * 90;
 3672|       |
 3673|  4.94k|  return range.get_error();
 3674|  4.94k|}
_ZNK8Box_irot4dumpER6Indent:
 3690|  4.03k|{
 3691|  4.03k|  std::ostringstream sstr;
 3692|  4.03k|  sstr << Box::dump(indent);
 3693|       |
 3694|  4.03k|  sstr << indent << "rotation: " << m_rotation << " degrees (CCW)\n";
 3695|       |
 3696|  4.03k|  return sstr.str();
 3697|  4.03k|}
_ZN8Box_imir5parseER14BitstreamRangePK20heif_security_limits:
 3701|  2.07k|{
 3702|       |  //parse_full_box_header(range);
 3703|       |
 3704|  2.07k|  uint8_t axis = range.read8();
 3705|  2.07k|  if (axis & 1) {
  ------------------
  |  Branch (3705:7): [True: 109, False: 1.96k]
  ------------------
 3706|    109|    m_axis = heif_transform_mirror_direction_horizontal;
 3707|    109|  }
 3708|  1.96k|  else {
 3709|  1.96k|    m_axis = heif_transform_mirror_direction_vertical;
 3710|  1.96k|  }
 3711|       |
 3712|  2.07k|  return range.get_error();
 3713|  2.07k|}
_ZNK8Box_imir4dumpER6Indent:
 3729|  1.36k|{
 3730|  1.36k|  std::ostringstream sstr;
 3731|  1.36k|  sstr << Box::dump(indent);
 3732|       |
 3733|  1.36k|  sstr << indent << "mirror direction: ";
 3734|  1.36k|  switch (m_axis) {
  ------------------
  |  Branch (3734:11): [True: 1.36k, False: 0]
  ------------------
 3735|  1.25k|    case heif_transform_mirror_direction_vertical:
  ------------------
  |  Branch (3735:5): [True: 1.25k, False: 109]
  ------------------
 3736|  1.25k|      sstr << "vertical\n";
 3737|  1.25k|      break;
 3738|    109|    case heif_transform_mirror_direction_horizontal:
  ------------------
  |  Branch (3738:5): [True: 109, False: 1.25k]
  ------------------
 3739|    109|      sstr << "horizontal\n";
 3740|    109|      break;
 3741|      0|    case heif_transform_mirror_direction_invalid:
  ------------------
  |  Branch (3741:5): [True: 0, False: 1.36k]
  ------------------
 3742|      0|      sstr << "invalid\n";
 3743|      0|      break;
 3744|  1.36k|  }
 3745|       |
 3746|  1.36k|  return sstr.str();
 3747|  1.36k|}
_ZN8Box_iscl5parseER14BitstreamRangePK20heif_security_limits:
 3751|    832|{
 3752|    832|  parse_full_box_header(range);
 3753|       |
 3754|    832|  if (get_version() != 0) {
  ------------------
  |  Branch (3754:7): [True: 76, False: 756]
  ------------------
 3755|     76|    return unsupported_version_error("iscl");
 3756|     76|  }
 3757|       |
 3758|    756|  m_target_width_numerator = range.read16();
 3759|    756|  m_target_width_denominator = range.read16();
 3760|    756|  m_target_height_numerator = range.read16();
 3761|    756|  m_target_height_denominator = range.read16();
 3762|       |
 3763|    756|  if (m_target_width_numerator == 0 || m_target_width_denominator == 0 ||
  ------------------
  |  Branch (3763:7): [True: 40, False: 716]
  |  Branch (3763:40): [True: 92, False: 624]
  ------------------
 3764|    624|      m_target_height_numerator == 0 || m_target_height_denominator == 0) {
  ------------------
  |  Branch (3764:7): [True: 203, False: 421]
  |  Branch (3764:41): [True: 28, False: 393]
  ------------------
 3765|    363|    return {heif_error_Invalid_input,
 3766|    363|            heif_suberror_Invalid_fractional_number,
 3767|    363|            "iscl property has zero numerator or denominator"};
 3768|    363|  }
 3769|       |
 3770|    393|  return range.get_error();
 3771|    756|}
_ZNK8Box_iscl4dumpER6Indent:
 3790|    372|{
 3791|    372|  std::ostringstream sstr;
 3792|    372|  sstr << FullBox::dump(indent);
 3793|       |
 3794|    372|  sstr << indent << "horizontal scaling factor: " << m_target_width_numerator << " / " << m_target_width_denominator << "\n";
 3795|    372|  sstr << indent << "vertical scaling factor:   " << m_target_height_numerator << " / " << m_target_height_denominator << "\n";
 3796|       |
 3797|    372|  return sstr.str();
 3798|    372|}
_ZN8Box_clap5parseER14BitstreamRangePK20heif_security_limits:
 3802|  1.79k|{
 3803|       |  //parse_full_box_header(range);
 3804|       |
 3805|  1.79k|  uint32_t clean_aperture_width_num = range.read32();
 3806|  1.79k|  uint32_t clean_aperture_width_den = range.read32();
 3807|  1.79k|  uint32_t clean_aperture_height_num = range.read32();
 3808|  1.79k|  uint32_t clean_aperture_height_den = range.read32();
 3809|       |
 3810|       |  // Note: in the standard document 14496-12(2015), it says that the offset values should also be unsigned integers,
 3811|       |  // but this is obviously an error. Even the accompanying standard text says that offsets may be negative.
 3812|  1.79k|  int32_t horizontal_offset_num = (int32_t) range.read32();
 3813|  1.79k|  uint32_t horizontal_offset_den = (uint32_t) range.read32();
 3814|  1.79k|  int32_t vertical_offset_num = (int32_t) range.read32();
 3815|  1.79k|  uint32_t vertical_offset_den = (uint32_t) range.read32();
 3816|       |
 3817|       |  // The checked Fraction construction rejects values outside the int32_t range and
 3818|       |  // zero denominators.
 3819|  1.79k|  auto clean_aperture_width = Fraction::from_unsigned(clean_aperture_width_num, clean_aperture_width_den);
 3820|  1.79k|  auto clean_aperture_height = Fraction::from_unsigned(clean_aperture_height_num, clean_aperture_height_den);
 3821|  1.79k|  auto horizontal_offset = Fraction::from_signed(horizontal_offset_num, horizontal_offset_den);
 3822|  1.79k|  auto vertical_offset = Fraction::from_signed(vertical_offset_num, vertical_offset_den);
 3823|       |
 3824|  1.79k|  for (const Result<Fraction>* f : {&clean_aperture_width, &clean_aperture_height,
  ------------------
  |  Branch (3824:34): [True: 4.53k, False: 669]
  ------------------
 3825|  4.53k|                                    &horizontal_offset, &vertical_offset}) {
 3826|  4.53k|    if (!*f) {
  ------------------
  |  Branch (3826:9): [True: 1.12k, False: 3.40k]
  ------------------
 3827|  1.12k|      return f->error();
 3828|  1.12k|    }
 3829|  4.53k|  }
 3830|       |
 3831|    669|  m_clean_aperture_width = *clean_aperture_width;
 3832|    669|  m_clean_aperture_height = *clean_aperture_height;
 3833|    669|  m_horizontal_offset = *horizontal_offset;
 3834|    669|  m_vertical_offset = *vertical_offset;
 3835|       |
 3836|    669|  return range.get_error();
 3837|  1.79k|}
_ZNK8Box_clap4dumpER6Indent:
 3860|    496|{
 3861|    496|  std::ostringstream sstr;
 3862|    496|  sstr << Box::dump(indent);
 3863|       |
 3864|    496|  sstr << indent << "clean_aperture: " << m_clean_aperture_width.numerator
 3865|    496|       << "/" << m_clean_aperture_width.denominator << " x "
 3866|    496|       << m_clean_aperture_height.numerator << "/"
 3867|    496|       << m_clean_aperture_height.denominator << "\n";
 3868|    496|  sstr << indent << "offset: " << m_horizontal_offset.numerator << "/"
 3869|    496|       << m_horizontal_offset.denominator << " ; "
 3870|    496|       << m_vertical_offset.numerator << "/"
 3871|    496|       << m_vertical_offset.denominator << "\n";
 3872|       |
 3873|    496|  return sstr.str();
 3874|    496|}
_ZN8Box_iref5parseER14BitstreamRangePK20heif_security_limits:
 3973|  9.03k|{
 3974|  9.03k|  parse_full_box_header(range);
 3975|       |
 3976|  9.03k|  if (get_version() > 1) {
  ------------------
  |  Branch (3976:7): [True: 3, False: 9.03k]
  ------------------
 3977|      3|    return unsupported_version_error("iref");
 3978|      3|  }
 3979|       |
 3980|  22.9k|  while (!range.eof()) {
  ------------------
  |  Branch (3980:10): [True: 13.9k, False: 8.97k]
  ------------------
 3981|       |    // Cap the total number of reference entries, matching the item-count caps in
 3982|       |    // Box_iloc/Box_iinf/Box_ipma (and the per-entry nRefs cap below). Without it
 3983|       |    // the entry count is bounded only by the file size. That is a linear,
 3984|       |    // file-bounded allocation rather than an amplification, so this is a
 3985|       |    // consistency limit and not a security fix, but it rejects a pathological
 3986|       |    // 'iref' early with a clear error instead of parsing it in full.
 3987|       |    //
 3988|       |    // max_items is a heuristic ceiling here, not a semantically exact bound: the
 3989|       |    // number of entries is not strictly limited by the number of items, because
 3990|       |    // one item may be the source (from_item_ID) of several entries, one per
 3991|       |    // reference type (e.g. 'dimg', 'thmb', 'cdsc'). A well-formed file stays far
 3992|       |    // below max_items (default 1000) regardless, so the generous ceiling is fine
 3993|       |    // as a sanity limit; raise max_items if a legitimate file ever exceeds it.
 3994|  13.9k|    if (limits->max_items && m_references.size() >= limits->max_items) {
  ------------------
  |  Branch (3994:9): [True: 13.9k, False: 0]
  |  Branch (3994:30): [True: 1, False: 13.9k]
  ------------------
 3995|      1|      std::stringstream sstr;
 3996|      1|      sstr << "'iref' box contains more than " << limits->max_items
 3997|      1|           << " reference entries, which exceeds the security limit.";
 3998|       |
 3999|      1|      return {heif_error_Invalid_input,
 4000|      1|              heif_suberror_Security_limit_exceeded,
 4001|      1|              sstr.str()};
 4002|      1|    }
 4003|       |
 4004|  13.9k|    Reference ref;
 4005|       |
 4006|  13.9k|    Error err = ref.header.parse_header(range);
 4007|  13.9k|    if (err != Error::Ok) {
  ------------------
  |  Branch (4007:9): [True: 10, False: 13.9k]
  ------------------
 4008|     10|      return err;
 4009|     10|    }
 4010|       |
 4011|  13.9k|    int read_len = (get_version() == 0) ? 16 : 32;
  ------------------
  |  Branch (4011:20): [True: 13.6k, False: 262]
  ------------------
 4012|       |
 4013|  13.9k|    ref.from_item_ID = static_cast<uint32_t>(range.read_uint(read_len));
 4014|  13.9k|    uint16_t nRefs = range.read16();
 4015|       |
 4016|  13.9k|    if (nRefs==0) {
  ------------------
  |  Branch (4016:9): [True: 3, False: 13.9k]
  ------------------
 4017|      3|      return {heif_error_Invalid_input,
 4018|      3|              heif_suberror_Unspecified,
 4019|      3|              "Input file has an 'iref' box with no references."};
 4020|      3|    }
 4021|       |
 4022|  13.9k|    if (limits->max_items && nRefs > limits->max_items) {
  ------------------
  |  Branch (4022:9): [True: 13.9k, False: 0]
  |  Branch (4022:30): [True: 18, False: 13.9k]
  ------------------
 4023|     18|      std::stringstream sstr;
 4024|     18|      sstr << "Number of references in iref box (" << nRefs << ") exceeds the security limits of " << limits->max_items << " references.";
 4025|       |
 4026|     18|      return {heif_error_Invalid_input,
 4027|     18|              heif_suberror_Security_limit_exceeded,
 4028|     18|              sstr.str()};
 4029|     18|    }
 4030|       |
 4031|  68.9k|    for (int i = 0; i < nRefs; i++) {
  ------------------
  |  Branch (4031:21): [True: 55.0k, False: 13.9k]
  ------------------
 4032|  55.0k|      if (range.eof()) {
  ------------------
  |  Branch (4032:11): [True: 27, False: 55.0k]
  ------------------
 4033|     27|        std::stringstream sstr;
 4034|     27|        sstr << "iref box should contain " << nRefs << " references, but we can only read " << i << " references.";
 4035|       |
 4036|     27|        return {heif_error_Invalid_input,
 4037|     27|                heif_suberror_End_of_data,
 4038|     27|                sstr.str()};
 4039|     27|      }
 4040|       |
 4041|  55.0k|      ref.to_item_ID.push_back(static_cast<uint32_t>(range.read_uint(read_len)));
 4042|  55.0k|    }
 4043|       |
 4044|  13.9k|    m_references.push_back(ref);
 4045|  13.9k|  }
 4046|       |
 4047|       |
 4048|       |  // --- check for duplicate references
 4049|       |
 4050|  8.97k|  if (auto error = check_for_double_references()) {
  ------------------
  |  Branch (4050:12): [True: 44, False: 8.93k]
  ------------------
 4051|     44|    return error;
 4052|     44|  }
 4053|       |
 4054|       |
 4055|       |#if 0
 4056|       |  // Note: This input sanity check first did not work as expected.
 4057|       |  // Its idea was to prevent infinite recursions while decoding when the input file
 4058|       |  // contains cyclic references. However, apparently there are cases where cyclic
 4059|       |  // references are actually allowed, like with images that have premultiplied alpha channels:
 4060|       |  // | Box: iref -----
 4061|       |  // | size: 40   (header size: 12)
 4062|       |  // | reference with type 'auxl' from ID: 2 to IDs: 1
 4063|       |  // | reference with type 'prem' from ID: 1 to IDs: 2
 4064|       |  //
 4065|       |  // We now test for cyclic references during the image decoding.
 4066|       |  // We pass down the item IDs that have already been seen during the decoding process.
 4067|       |  // If we try to decode an image IDs that has already been seen previously, we throw an error.
 4068|       |  // The advantage is that the error only occurs when we are trying to decode the faulty image.
 4069|       |
 4070|       |  // --- check for cyclic references
 4071|       |
 4072|       |  for (const auto& ref : m_references) {
 4073|       |    if (ref.header.get_short_type() != fourcc("dimg") &&
 4074|       |        ref.header.get_short_type() != fourcc("auxl")) {
 4075|       |      continue;
 4076|       |    }
 4077|       |
 4078|       |    std::set<heif_item_id> reached_ids; // IDs that we have already reached in the DAG
 4079|       |    std::set<heif_item_id> todo;    // IDs that still need to be followed
 4080|       |
 4081|       |    bool reverse = (ref.header.get_short_type() != fourcc("auxl"));
 4082|       |
 4083|       |    if (!reverse) {
 4084|       |      todo.insert(ref.from_item_ID);  // start at base item
 4085|       |    }
 4086|       |    else {
 4087|       |      if (ref.to_item_ID.empty()) {
 4088|       |        continue;
 4089|       |      }
 4090|       |
 4091|       |      // TODO: what if aux image is assigned to multiple images?
 4092|       |      todo.insert(ref.to_item_ID[0]);  // start at base item
 4093|       |    }
 4094|       |
 4095|       |    while (!todo.empty()) {
 4096|       |      // transfer ID into set of reached IDs
 4097|       |      auto id = *todo.begin();
 4098|       |      todo.erase(id);
 4099|       |      reached_ids.insert(id);
 4100|       |
 4101|       |      // if this ID refers to another 'iref', follow it
 4102|       |
 4103|       |      for (const auto& succ_ref : m_references) {
 4104|       |        if (succ_ref.header.get_short_type() != fourcc("dimg") &&
 4105|       |            succ_ref.header.get_short_type() != fourcc("auxl")) {
 4106|       |          continue;
 4107|       |        }
 4108|       |
 4109|       |        heif_item_id from;
 4110|       |        std::vector<heif_item_id> to;
 4111|       |
 4112|       |        if (succ_ref.header.get_short_type() == fourcc("auxl")) {
 4113|       |          if (succ_ref.to_item_ID.empty()) {
 4114|       |            continue;
 4115|       |          }
 4116|       |
 4117|       |          from = succ_ref.to_item_ID[0];
 4118|       |          to = {succ_ref.from_item_ID};
 4119|       |        }
 4120|       |        else {
 4121|       |          from = succ_ref.from_item_ID;
 4122|       |          to = succ_ref.to_item_ID;
 4123|       |        }
 4124|       |
 4125|       |        if (from == id) {
 4126|       |
 4127|       |          // Check whether any successor IDs has been visited yet, which would be an error.
 4128|       |          // Otherwise, put that ID into the 'todo' set.
 4129|       |
 4130|       |          for (const auto& succ_ref_id : to) {
 4131|       |            if (reached_ids.find(succ_ref_id) != reached_ids.end()) {
 4132|       |              return Error(heif_error_Invalid_input,
 4133|       |                           heif_suberror_Unspecified,
 4134|       |                           "'iref' has cyclic references");
 4135|       |            }
 4136|       |
 4137|       |            todo.insert(succ_ref_id);
 4138|       |          }
 4139|       |        }
 4140|       |      }
 4141|       |    }
 4142|       |  }
 4143|       |#endif
 4144|       |
 4145|  8.93k|  build_index();
 4146|       |
 4147|  8.93k|  return range.get_error();
 4148|  8.97k|}
_ZNK8Box_iref27check_for_double_referencesEv:
 4152|  8.97k|{
 4153|  12.8k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (4153:24): [True: 12.8k, False: 8.93k]
  ------------------
 4154|  12.8k|    std::set<heif_item_id> to_ids;
 4155|  49.7k|    for (const auto to_id : ref.to_item_ID) {
  ------------------
  |  Branch (4155:27): [True: 49.7k, False: 12.7k]
  ------------------
 4156|  49.7k|      if (to_ids.find(to_id) == to_ids.end()) {
  ------------------
  |  Branch (4156:11): [True: 49.6k, False: 44]
  ------------------
 4157|  49.6k|        to_ids.insert(to_id);
 4158|  49.6k|      }
 4159|     44|      else {
 4160|     44|        return {heif_error_Invalid_input,
 4161|     44|                heif_suberror_Unspecified,
 4162|     44|                "'iref' has double references"};
 4163|     44|      }
 4164|  49.7k|    }
 4165|  12.8k|  }
 4166|       |
 4167|  8.93k|  return Error::Ok;
 4168|  8.97k|}
_ZNK8Box_iref4dumpER6Indent:
 4225|  7.35k|{
 4226|  7.35k|  std::ostringstream sstr;
 4227|  7.35k|  sstr << Box::dump(indent);
 4228|       |
 4229|  11.0k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (4229:24): [True: 11.0k, False: 7.35k]
  ------------------
 4230|  11.0k|    sstr << indent << "reference with type '" << ref.header.get_type_string() << "'"
 4231|  11.0k|         << " from ID: " << ref.from_item_ID
 4232|  11.0k|         << " to IDs: ";
 4233|  36.3k|    for (uint32_t id : ref.to_item_ID) {
  ------------------
  |  Branch (4233:22): [True: 36.3k, False: 11.0k]
  ------------------
 4234|  36.3k|      sstr << id << " ";
 4235|  36.3k|    }
 4236|  11.0k|    sstr << "\n";
 4237|  11.0k|  }
 4238|       |
 4239|  7.35k|  return sstr.str();
 4240|  7.35k|}
_ZN8Box_iref11build_indexEv:
 4244|  8.93k|{
 4245|  8.93k|  m_from_id_index.clear();
 4246|  8.93k|  m_from_id_index.reserve(m_references.size());
 4247|  21.5k|  for (size_t i = 0; i < m_references.size(); i++) {
  ------------------
  |  Branch (4247:22): [True: 12.5k, False: 8.93k]
  ------------------
 4248|  12.5k|    add_to_index(i);
 4249|  12.5k|  }
 4250|  8.93k|}
_ZN8Box_iref12add_to_indexEm:
 4254|  12.5k|{
 4255|  12.5k|  m_from_id_index[m_references[reference_index].from_item_ID].push_back(reference_index);
 4256|  12.5k|}
_ZN8Box_rref5parseER14BitstreamRangePK20heif_security_limits:
 4327|    554|{
 4328|    554|  parse_full_box_header(range);
 4329|       |
 4330|    554|  if (get_version() > 1) {
  ------------------
  |  Branch (4330:7): [True: 7, False: 547]
  ------------------
 4331|      7|    return unsupported_version_error("rref");
 4332|      7|  }
 4333|       |
 4334|    547|  size_t remainingBytes = range.get_remaining_bytes();
 4335|       |
 4336|       |  // The number of reference types should be stored in uint(8), but the
 4337|       |  // common test images C043, C044 store them as uint(32).
 4338|       |  // Let us detect this case by the number of data bytes in this box.
 4339|    547|  bool cnt_as_uint32 = (remainingBytes > 0 && remainingBytes % 4 == 0);
  ------------------
  |  Branch (4339:25): [True: 542, False: 5]
  |  Branch (4339:47): [True: 323, False: 219]
  ------------------
 4340|       |
 4341|    547|  uint8_t nRefTypes;
 4342|    547|  if (cnt_as_uint32) {
  ------------------
  |  Branch (4342:7): [True: 323, False: 224]
  ------------------
 4343|       |    // fix broken C043, C044 files
 4344|       |    // TODO: remove me when the files have been corrected as the above check can misfire when there is extra padding
 4345|    323|    nRefTypes = (uint8_t)range.read32();
 4346|    323|  }
 4347|    224|  else {
 4348|    224|    nRefTypes = range.read8();
 4349|    224|  }
 4350|       |
 4351|  3.72k|  for (uint8_t i = 0; i < nRefTypes; i++) {
  ------------------
  |  Branch (4351:23): [True: 3.20k, False: 519]
  ------------------
 4352|  3.20k|    uint32_t refType = range.read32();
 4353|       |
 4354|  3.20k|    if (range.error()) {
  ------------------
  |  Branch (4354:9): [True: 28, False: 3.17k]
  ------------------
 4355|     28|      std::stringstream sstr;
 4356|     28|      sstr << "rref box should contain " << ((int)nRefTypes) << " reference types, but we can only read " << m_reference_types.size() << " reference types.";
 4357|       |
 4358|     28|      return {
 4359|     28|        heif_error_Invalid_input,
 4360|     28|        heif_suberror_End_of_data,
 4361|     28|        sstr.str()
 4362|     28|      };
 4363|     28|    }
 4364|       |
 4365|  3.17k|    m_reference_types.push_back(refType);
 4366|  3.17k|  }
 4367|       |
 4368|    519|  return range.get_error();
 4369|    547|}
_ZNK8Box_rref4dumpER6Indent:
 4454|    482|{
 4455|    482|  std::ostringstream sstr;
 4456|    482|  sstr << Box::dump(indent);
 4457|       |
 4458|    482|  sstr << indent << "reference types: ";
 4459|  2.88k|  for (size_t i = 0; i < m_reference_types.size(); i++) {
  ------------------
  |  Branch (4459:22): [True: 2.39k, False: 482]
  ------------------
 4460|  2.39k|    if (i > 0) sstr << ", ";
  ------------------
  |  Branch (4460:9): [True: 2.08k, False: 318]
  ------------------
 4461|  2.39k|    sstr << fourcc_to_string(m_reference_types[i]);
 4462|  2.39k|  }
 4463|    482|  sstr << "\n";
 4464|       |
 4465|    482|  return sstr.str();
 4466|    482|}
_ZN8Box_idat5parseER14BitstreamRangePK20heif_security_limits:
 4470|  3.39k|{
 4471|       |  //parse_full_box_header(range);
 4472|       |
 4473|  3.39k|  m_data_start_pos = range.get_istream()->get_position();
 4474|       |
 4475|  3.39k|  return range.get_error();
 4476|  3.39k|}
_ZNK8Box_idat4dumpER6Indent:
 4492|  2.88k|{
 4493|  2.88k|  std::ostringstream sstr;
 4494|  2.88k|  sstr << Box::dump(indent);
 4495|       |
 4496|  2.88k|  if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (4496:7): [True: 2.45k, False: 432]
  ------------------
 4497|  2.45k|    sstr << indent << "number of data bytes: " << get_box_size() - get_header_size() << "\n";
 4498|  2.45k|  } else {
 4499|    432|     sstr << indent << "number of data bytes is invalid\n";
 4500|    432|  }
 4501|       |
 4502|  2.88k|  return sstr.str();
 4503|  2.88k|}
_ZN8Box_grpl5parseER14BitstreamRangePK20heif_security_limits:
 4566|  2.41k|{
 4567|       |  //parse_full_box_header(range);
 4568|       |
 4569|  2.41k|  return read_children(range, READ_CHILDREN_ALL, limits); // should we pass the parsing context 'grpl' or are the box types unique?
 4570|  2.41k|}
_ZNK8Box_grpl4dumpER6Indent:
 4574|  1.70k|{
 4575|  1.70k|  std::ostringstream sstr;
 4576|  1.70k|  sstr << Box::dump(indent);
 4577|  1.70k|  sstr << dump_children(indent);
 4578|  1.70k|  return sstr.str();
 4579|  1.70k|}
_ZN17Box_EntityToGroup5parseER14BitstreamRangePK20heif_security_limits:
 4583|  1.71k|{
 4584|  1.71k|  Error err = parse_full_box_header(range);
 4585|  1.71k|  if (err != Error::Ok) {
  ------------------
  |  Branch (4585:7): [True: 73, False: 1.64k]
  ------------------
 4586|     73|    return err;
 4587|     73|  }
 4588|       |
 4589|  1.64k|  group_id = range.read32();
 4590|  1.64k|  uint32_t nEntities = range.read32();
 4591|       |
 4592|  1.64k|  if (nEntities > range.get_remaining_bytes() / 4) {
  ------------------
  |  Branch (4592:7): [True: 100, False: 1.54k]
  ------------------
 4593|    100|    std::stringstream sstr;
 4594|    100|    size_t maxEntries = range.get_remaining_bytes() / 4;
 4595|    100|    sstr << "entity group box should contain " << nEntities << " entities, but we can only read " << maxEntries << " entities.";
 4596|       |
 4597|    100|    return {heif_error_Invalid_input,
 4598|    100|            heif_suberror_End_of_data,
 4599|    100|            sstr.str()};
 4600|    100|  }
 4601|       |
 4602|  1.54k|  if (limits->max_size_entity_group && nEntities > limits->max_size_entity_group) {
  ------------------
  |  Branch (4602:7): [True: 1.54k, False: 0]
  |  Branch (4602:40): [True: 49, False: 1.49k]
  ------------------
 4603|     49|    std::stringstream sstr;
 4604|     49|    sstr << "entity group box contains " << nEntities << " entities, but the security limit is set to " << limits->max_size_entity_group << " entities.";
 4605|       |
 4606|     49|    return {heif_error_Invalid_input,
 4607|     49|            heif_suberror_Security_limit_exceeded,
 4608|     49|            sstr.str()};
 4609|     49|  }
 4610|       |
 4611|  1.49k|  entity_ids.resize(nEntities);
 4612|  4.45k|  for (uint32_t i = 0; i < nEntities; i++) {
  ------------------
  |  Branch (4612:24): [True: 2.95k, False: 1.49k]
  ------------------
 4613|  2.95k|    entity_ids[i] = range.read32();
 4614|  2.95k|  }
 4615|       |
 4616|  1.49k|  return Error::Ok;
 4617|  1.54k|}
_ZNK17Box_EntityToGroup4dumpER6Indent:
 4646|  1.11k|{
 4647|  1.11k|  std::ostringstream sstr;
 4648|  1.11k|  sstr << Box::dump(indent);
 4649|       |
 4650|  1.11k|  sstr << indent << "group id: " << group_id << "\n"
 4651|  1.11k|       << indent << "entity IDs: ";
 4652|       |
 4653|  1.11k|  bool first = true;
 4654|  2.26k|  for (uint32_t id : entity_ids) {
  ------------------
  |  Branch (4654:20): [True: 2.26k, False: 1.11k]
  ------------------
 4655|  2.26k|    if (first) {
  ------------------
  |  Branch (4655:9): [True: 755, False: 1.50k]
  ------------------
 4656|    755|      first = false;
 4657|    755|    }
 4658|  1.50k|    else {
 4659|  1.50k|      sstr << ' ';
 4660|  1.50k|    }
 4661|       |
 4662|  2.26k|    sstr << id;
 4663|  2.26k|  }
 4664|       |
 4665|  1.11k|  sstr << "\n";
 4666|       |
 4667|  1.11k|  return sstr.str();
 4668|  1.11k|}
_ZN8Box_ster5parseER14BitstreamRangePK20heif_security_limits:
 4672|    308|{
 4673|    308|  Error err = Box_EntityToGroup::parse(range, limits);
 4674|    308|  if (err) {
  ------------------
  |  Branch (4674:7): [True: 11, False: 297]
  ------------------
 4675|     11|    return err;
 4676|     11|  }
 4677|       |
 4678|    297|  if (entity_ids.size() != 2) {
  ------------------
  |  Branch (4678:7): [True: 4, False: 293]
  ------------------
 4679|      4|    return {heif_error_Invalid_input,
 4680|      4|            heif_suberror_Invalid_box_size,
 4681|      4|            "'ster' entity group does not exists of exactly two images"};
 4682|      4|  }
 4683|       |
 4684|    293|  return Error::Ok;
 4685|    297|}
_ZNK8Box_ster4dumpER6Indent:
 4689|    276|{
 4690|    276|  std::ostringstream sstr;
 4691|    276|  sstr << Box::dump(indent);
 4692|       |
 4693|    276|  sstr << indent << "group id: " << group_id << "\n"
 4694|    276|       << indent << "left image ID: " << entity_ids[0] << "\n"
 4695|    276|       << indent << "right image ID: " << entity_ids[1] << "\n";
 4696|       |
 4697|    276|  return sstr.str();
 4698|    276|}
_ZN8Box_pymd5parseER14BitstreamRangePK20heif_security_limits:
 4703|  1.20k|{
 4704|  1.20k|  Error err = Box_EntityToGroup::parse(range, limits);
 4705|  1.20k|  if (err) {
  ------------------
  |  Branch (4705:7): [True: 198, False: 1.00k]
  ------------------
 4706|    198|    return err;
 4707|    198|  }
 4708|       |
 4709|  1.00k|  tile_size_x = range.read16();
 4710|  1.00k|  tile_size_y = range.read16();
 4711|       |
 4712|  3.03k|  for (size_t i = 0; i < entity_ids.size(); i++) {
  ------------------
  |  Branch (4712:22): [True: 2.02k, False: 1.00k]
  ------------------
 4713|  2.02k|    LayerInfo layer{};
 4714|  2.02k|    layer.layer_binning = range.read16();
 4715|  2.02k|    layer.tiles_in_layer_row_minus1 = range.read16();
 4716|  2.02k|    layer.tiles_in_layer_column_minus1 = range.read16();
 4717|       |
 4718|  2.02k|    m_layer_infos.push_back(layer);
 4719|  2.02k|  }
 4720|       |
 4721|  1.00k|  return Error::Ok;
 4722|  1.20k|}
_ZNK8Box_pymd4dumpER6Indent:
 4749|    974|{
 4750|    974|  std::ostringstream sstr;
 4751|    974|  sstr << Box_EntityToGroup::dump(indent);
 4752|       |
 4753|    974|  sstr << indent << "tile size: " << tile_size_x << "x" << tile_size_y << "\n";
 4754|       |
 4755|    974|  int layerNr = 0;
 4756|  2.02k|  for (const auto& layer : m_layer_infos) {
  ------------------
  |  Branch (4756:26): [True: 2.02k, False: 974]
  ------------------
 4757|  2.02k|    sstr << indent << "layer " << layerNr << ":\n"
 4758|  2.02k|         << indent << "| binning: " << layer.layer_binning << "\n"
 4759|  2.02k|         << indent << "| tiles: " << (layer.tiles_in_layer_row_minus1 + 1) << "x" << (layer.tiles_in_layer_column_minus1 + 1) << "\n";
 4760|       |
 4761|  2.02k|    layerNr++;
 4762|  2.02k|  }
 4763|       |
 4764|    974|  return sstr.str();
 4765|    974|}
_ZN8Box_dinf5parseER14BitstreamRangePK20heif_security_limits:
 4769|  5.99k|{
 4770|       |  //parse_full_box_header(range);
 4771|       |
 4772|  5.99k|  return read_children(range, READ_CHILDREN_ALL, limits);
 4773|  5.99k|}
_ZNK8Box_dinf4dumpER6Indent:
 4777|  5.40k|{
 4778|  5.40k|  std::ostringstream sstr;
 4779|  5.40k|  sstr << Box::dump(indent);
 4780|  5.40k|  sstr << dump_children(indent);
 4781|       |
 4782|  5.40k|  return sstr.str();
 4783|  5.40k|}
_ZN8Box_dref5parseER14BitstreamRangePK20heif_security_limits:
 4787|    241|{
 4788|    241|  parse_full_box_header(range);
 4789|       |
 4790|    241|  if (get_version() != 0) {
  ------------------
  |  Branch (4790:7): [True: 9, False: 232]
  ------------------
 4791|      9|    return unsupported_version_error("dref");
 4792|      9|  }
 4793|       |
 4794|    232|  uint32_t nEntities = range.read32();
 4795|       |
 4796|       |  /*
 4797|       |  for (int i=0;i<nEntities;i++) {
 4798|       |    if (range.eof()) {
 4799|       |      break;
 4800|       |    }
 4801|       |  }
 4802|       |  */
 4803|       |
 4804|    232|  if (nEntities > (uint32_t)std::numeric_limits<int>::max()) {
  ------------------
  |  Branch (4804:7): [True: 29, False: 203]
  ------------------
 4805|     29|    return Error(heif_error_Memory_allocation_error,
 4806|     29|                 heif_suberror_Security_limit_exceeded,
 4807|     29|                 "Too many entities in dref box.");
 4808|     29|  }
 4809|       |
 4810|       |  // read_children verifies that exactly nEntities children are present.
 4811|    203|  return read_children(range, (int)nEntities, limits);
 4812|    232|}
_ZNK8Box_dref4dumpER6Indent:
 4836|     87|{
 4837|     87|  std::ostringstream sstr;
 4838|     87|  sstr << Box::dump(indent);
 4839|     87|  sstr << dump_children(indent);
 4840|       |
 4841|     87|  return sstr.str();
 4842|     87|}
_ZN7Box_url5parseER14BitstreamRangePK20heif_security_limits:
 4846|  2.12k|{
 4847|  2.12k|  parse_full_box_header(range);
 4848|       |
 4849|  2.12k|  if (get_version() > 0) {
  ------------------
  |  Branch (4849:7): [True: 6, False: 2.11k]
  ------------------
 4850|      6|    return unsupported_version_error("url");
 4851|      6|  }
 4852|       |
 4853|  2.11k|  if (get_flags() & 1) {
  ------------------
  |  Branch (4853:7): [True: 1.42k, False: 693]
  ------------------
 4854|       |    // data in same file
 4855|  1.42k|    m_location.clear();
 4856|  1.42k|  }
 4857|    693|  else {
 4858|    693|    m_location = range.read_string();
 4859|    693|  }
 4860|       |
 4861|  2.11k|  return range.get_error();
 4862|  2.12k|}
_ZNK7Box_url4dumpER6Indent:
 4883|  1.99k|{
 4884|  1.99k|  std::ostringstream sstr;
 4885|  1.99k|  sstr << Box::dump(indent);
 4886|       |  //sstr << dump_children(indent);
 4887|       |
 4888|  1.99k|  sstr << indent << "location: " << m_location << "\n";
 4889|       |
 4890|  1.99k|  return sstr.str();
 4891|  1.99k|}
_ZN8Box_udes5parseER14BitstreamRangePK20heif_security_limits:
 4895|  1.07k|{
 4896|  1.07k|  parse_full_box_header(range);
 4897|       |
 4898|  1.07k|  if (get_version() > 0) {
  ------------------
  |  Branch (4898:7): [True: 119, False: 955]
  ------------------
 4899|    119|    return unsupported_version_error("udes");
 4900|    119|  }
 4901|       |
 4902|    955|  m_lang = range.read_string();
 4903|    955|  m_name = range.read_string();
 4904|    955|  m_description = range.read_string();
 4905|    955|  m_tags = range.read_string();
 4906|    955|  return range.get_error();
 4907|  1.07k|}
_ZNK8Box_udes4dumpER6Indent:
 4910|    865|{
 4911|    865|  std::ostringstream sstr;
 4912|    865|  sstr << Box::dump(indent);
 4913|    865|  sstr << indent << "lang: " << m_lang << "\n";
 4914|    865|  sstr << indent << "name: " << m_name << "\n";
 4915|    865|  sstr << indent << "description: " << m_description << "\n";
 4916|    865|  sstr << indent << "tags: " << m_tags << "\n";
 4917|    865|  return sstr.str();
 4918|    865|}
_ZNK8Box_cmin4dumpER6Indent:
 4966|  1.32k|{
 4967|  1.32k|  std::ostringstream sstr;
 4968|  1.32k|  sstr << Box::dump(indent);
 4969|  1.32k|  sstr << indent << "principal-point: " << m_matrix.principal_point_x << ", " << m_matrix.principal_point_y << "\n";
 4970|  1.32k|  if (m_matrix.is_anisotropic) {
  ------------------
  |  Branch (4970:7): [True: 553, False: 774]
  ------------------
 4971|    553|    sstr << indent << "focal-length: " << m_matrix.focal_length_x << ", " << m_matrix.focal_length_y << "\n";
 4972|    553|    sstr << indent << "skew: " << m_matrix.skew << "\n";
 4973|    553|  }
 4974|    774|  else {
 4975|    774|    sstr << indent << "focal-length: " << m_matrix.focal_length_x << "\n";
 4976|    774|    sstr << indent << "no skew\n";
 4977|    774|  }
 4978|       |
 4979|  1.32k|  return sstr.str();
 4980|  1.32k|}
_ZN8Box_cmin5parseER14BitstreamRangePK20heif_security_limits:
 4984|  2.63k|{
 4985|  2.63k|  parse_full_box_header(range);
 4986|       |
 4987|  2.63k|  if (get_version() > 0) {
  ------------------
  |  Branch (4987:7): [True: 239, False: 2.39k]
  ------------------
 4988|    239|    return unsupported_version_error("cmin");
 4989|    239|  }
 4990|       |
 4991|  2.39k|  m_denominatorShift = (get_flags() & 0x1F00) >> 8;
 4992|  2.39k|  uint32_t denominator = (1U << m_denominatorShift);
 4993|       |
 4994|  2.39k|  m_matrix.focal_length_x = range.read32s() / (double)denominator;
 4995|  2.39k|  m_matrix.principal_point_x = range.read32s() / (double)denominator;
 4996|  2.39k|  m_matrix.principal_point_y = range.read32s() / (double)denominator;
 4997|       |
 4998|  2.39k|  if (get_flags() & 1) {
  ------------------
  |  Branch (4998:7): [True: 692, False: 1.70k]
  ------------------
 4999|    692|    m_skewDenominatorShift = ((get_flags()) & 0x1F0000) >> 16;
 5000|    692|    uint32_t skewDenominator = (1U << m_skewDenominatorShift);
 5001|       |
 5002|    692|    m_matrix.focal_length_y = range.read32s() / (double)denominator;
 5003|    692|    m_matrix.skew = range.read32s() / (double)skewDenominator;
 5004|       |
 5005|    692|    m_matrix.is_anisotropic = true;
 5006|    692|  }
 5007|  1.70k|  else {
 5008|  1.70k|    m_matrix.is_anisotropic = false;
 5009|  1.70k|    m_matrix.focal_length_y = 0;
 5010|  1.70k|    m_matrix.skew = 0;
 5011|  1.70k|  }
 5012|  2.39k|  return range.get_error();
 5013|  2.63k|}
_ZN8Box_cmex5parseER14BitstreamRangePK20heif_security_limits:
 5171|  3.61k|{
 5172|  3.61k|  parse_full_box_header(range);
 5173|       |
 5174|  3.61k|  if (get_version() > 0) {
  ------------------
  |  Branch (5174:7): [True: 582, False: 3.03k]
  ------------------
 5175|    582|    return unsupported_version_error("cmex");
 5176|    582|  }
 5177|       |
 5178|  3.03k|  m_matrix = ExtrinsicMatrix{};
 5179|       |
 5180|  3.03k|  if (get_flags() & pos_x_present) {
  ------------------
  |  Branch (5180:7): [True: 1.87k, False: 1.15k]
  ------------------
 5181|  1.87k|    m_has_pos_x = true;
 5182|  1.87k|    m_matrix.pos_x = range.read32s();
 5183|  1.87k|  }
 5184|       |
 5185|  3.03k|  if (get_flags() & pos_y_present) {
  ------------------
  |  Branch (5185:7): [True: 2.05k, False: 977]
  ------------------
 5186|  2.05k|    m_has_pos_y = true;
 5187|  2.05k|    m_matrix.pos_y = range.read32s();
 5188|  2.05k|  }
 5189|       |
 5190|  3.03k|  if (get_flags() & pos_z_present) {
  ------------------
  |  Branch (5190:7): [True: 748, False: 2.28k]
  ------------------
 5191|    748|    m_has_pos_z = true;
 5192|    748|    m_matrix.pos_z = range.read32s();
 5193|    748|  }
 5194|       |
 5195|  3.03k|  if (get_flags() & orientation_present) {
  ------------------
  |  Branch (5195:7): [True: 1.17k, False: 1.85k]
  ------------------
 5196|  1.17k|    m_has_orientation = true;
 5197|       |
 5198|  1.17k|    if (get_version() == 0) {
  ------------------
  |  Branch (5198:9): [True: 1.17k, False: 0]
  ------------------
 5199|  1.17k|      bool use32bit = (get_flags() & rot_large_field_size);
 5200|  1.17k|      int32_t quat_x = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (5200:24): [True: 516, False: 660]
  ------------------
 5201|  1.17k|      int32_t quat_y = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (5201:24): [True: 516, False: 660]
  ------------------
 5202|  1.17k|      int32_t quat_z = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (5202:24): [True: 516, False: 660]
  ------------------
 5203|       |
 5204|  1.17k|      uint32_t div = 1U << (14 + (use32bit ? 16 : 0));
  ------------------
  |  Branch (5204:35): [True: 516, False: 660]
  ------------------
 5205|       |
 5206|  1.17k|      m_matrix.rotation_as_quaternions = true;
 5207|  1.17k|      m_matrix.quaternion_x = quat_x / (double)div;
 5208|  1.17k|      m_matrix.quaternion_y = quat_y / (double)div;
 5209|  1.17k|      m_matrix.quaternion_z = quat_z / (double)div;
 5210|       |
 5211|  1.17k|      double q_sum = (m_matrix.quaternion_x * m_matrix.quaternion_x +
 5212|  1.17k|                      m_matrix.quaternion_y * m_matrix.quaternion_y +
 5213|  1.17k|                      m_matrix.quaternion_z * m_matrix.quaternion_z);
 5214|       |
 5215|  1.17k|      if (q_sum > 1.0) {
  ------------------
  |  Branch (5215:11): [True: 316, False: 860]
  ------------------
 5216|    316|        return Error(heif_error_Invalid_input,
 5217|    316|                     heif_suberror_Unspecified,
 5218|    316|                     "Invalid quaternion in extrinsic rotation matrix");
 5219|    316|      }
 5220|       |
 5221|    860|      m_matrix.quaternion_w = sqrt(1 - q_sum);
 5222|       |
 5223|    860|    } else if (get_version() == 1) {
  ------------------
  |  Branch (5223:16): [True: 0, False: 0]
  ------------------
 5224|      0|      uint32_t div = 1<<16;
 5225|      0|      m_matrix.rotation_yaw = range.read32s() / (double)div;
 5226|      0|      m_matrix.rotation_pitch = range.read32s() / (double)div;
 5227|      0|      m_matrix.rotation_roll = range.read32s() / (double)div;
 5228|      0|    }
 5229|  1.17k|  }
 5230|       |
 5231|  2.71k|  if (get_flags() & id_present) {
  ------------------
  |  Branch (5231:7): [True: 1.88k, False: 837]
  ------------------
 5232|  1.88k|    m_has_world_coordinate_system_id = true;
 5233|  1.88k|    m_matrix.world_coordinate_system_id = range.read32();
 5234|  1.88k|  }
 5235|       |
 5236|  2.71k|  return range.get_error();
 5237|  3.03k|}
_ZNK8Box_cmex4dumpER6Indent:
 5241|  1.18k|{
 5242|  1.18k|  std::ostringstream sstr;
 5243|  1.18k|  sstr << Box::dump(indent);
 5244|  1.18k|  sstr << indent << "camera position (um): ";
 5245|  1.18k|  sstr << m_matrix.pos_x << " ; ";
 5246|  1.18k|  sstr << m_matrix.pos_y << " ; ";
 5247|  1.18k|  sstr << m_matrix.pos_z << "\n";
 5248|       |
 5249|  1.18k|  sstr << indent << "orientation ";
 5250|  1.18k|  if (m_matrix.rotation_as_quaternions) {
  ------------------
  |  Branch (5250:7): [True: 1.18k, False: 0]
  ------------------
 5251|  1.18k|    sstr << "(quaterion)\n";
 5252|  1.18k|    sstr << indent << "  q = ["
 5253|  1.18k|         << m_matrix.quaternion_x << ";"
 5254|  1.18k|         << m_matrix.quaternion_y << ";"
 5255|  1.18k|         << m_matrix.quaternion_z << ";"
 5256|  1.18k|         << m_matrix.quaternion_w << "]\n";
 5257|  1.18k|  }
 5258|      0|  else {
 5259|      0|    sstr << "(angles)\n";
 5260|      0|    sstr << indent << "  yaw:   " << m_matrix.rotation_yaw << "\n";
 5261|      0|    sstr << indent << "  pitch: " << m_matrix.rotation_pitch << "\n";
 5262|      0|    sstr << indent << "  roll:  " << m_matrix.rotation_roll << "\n";
 5263|      0|  }
 5264|       |
 5265|  1.18k|  sstr << indent << "world coordinate system id: " << m_matrix.world_coordinate_system_id << "\n";
 5266|       |
 5267|  1.18k|  return sstr.str();
 5268|  1.18k|}
_ZN8Box_taic4dumpERK19heif_tai_clock_infoR6Indent:
 5408|  1.43k|{
 5409|  1.43k|  std::ostringstream sstr;
 5410|  1.43k|  sstr << indent << "time_uncertainty: ";
 5411|  1.43k|  if (info.time_uncertainty == heif_tai_clock_info_time_uncertainty_unknown) {
  ------------------
  |  |   52|  1.43k|#define heif_tai_clock_info_time_uncertainty_unknown UINT64_C(0xFFFFFFFFFFFFFFFF)
  ------------------
  |  Branch (5411:7): [True: 319, False: 1.11k]
  ------------------
 5412|    319|    sstr << "unknown\n";
 5413|    319|  }
 5414|  1.11k|  else {
 5415|  1.11k|    sstr << info.time_uncertainty << "\n";
 5416|  1.11k|  }
 5417|  1.43k|  sstr << indent << "clock_resolution: " << info.clock_resolution << "\n";
 5418|  1.43k|  sstr << indent << "clock_drift_rate: ";
 5419|  1.43k|  if (info.clock_drift_rate == heif_tai_clock_info_clock_drift_rate_unknown) {
  ------------------
  |  |   53|  1.43k|#define heif_tai_clock_info_clock_drift_rate_unknown INT32_C(0x7FFFFFFF)
  ------------------
  |  Branch (5419:7): [True: 145, False: 1.28k]
  ------------------
 5420|    145|    sstr << "undefined\n";
 5421|    145|  }
 5422|  1.28k|  else {
 5423|  1.28k|    sstr << info.clock_drift_rate << "\n";
 5424|  1.28k|  }
 5425|       |
 5426|  1.43k|  sstr << indent << "clock_type: " << int(info.clock_type) << " ";
 5427|  1.43k|  switch (info.clock_type) {
 5428|    644|    case heif_tai_clock_info_clock_type_unknown: sstr << "(unknown)\n"; break;
  ------------------
  |  |   54|    644|#define heif_tai_clock_info_clock_type_unknown 0
  ------------------
  |  Branch (5428:5): [True: 644, False: 788]
  ------------------
 5429|     18|    case heif_tai_clock_info_clock_type_synchronized_to_atomic_source: sstr << "(synchronized to atomic source)\n"; break;
  ------------------
  |  |   56|     18|#define heif_tai_clock_info_clock_type_synchronized_to_atomic_source 2
  ------------------
  |  Branch (5429:5): [True: 18, False: 1.41k]
  ------------------
 5430|     79|    case heif_tai_clock_info_clock_type_not_synchronized_to_atomic_source: sstr << "(not synchronized to atomic source)\n"; break;
  ------------------
  |  |   55|     79|#define heif_tai_clock_info_clock_type_not_synchronized_to_atomic_source 1
  ------------------
  |  Branch (5430:5): [True: 79, False: 1.35k]
  ------------------
 5431|    691|    default: sstr << "(illegal value)\n"; break;;
  ------------------
  |  Branch (5431:5): [True: 691, False: 741]
  ------------------
 5432|  1.43k|  }
 5433|  1.43k|  return sstr.str();
 5434|  1.43k|}
_ZNK8Box_taic4dumpER6Indent:
 5437|  1.43k|std::string Box_taic::dump(Indent& indent) const {
 5438|  1.43k|  std::ostringstream sstr;
 5439|  1.43k|  sstr << Box::dump(indent);
 5440|  1.43k|  sstr << dump(m_info, indent);
 5441|       |
 5442|  1.43k|  return sstr.str();
 5443|  1.43k|}
_ZN8Box_taic5parseER14BitstreamRangePK20heif_security_limits:
 5457|  1.69k|Error Box_taic::parse(BitstreamRange& range, const heif_security_limits*) {
 5458|  1.69k|  parse_full_box_header(range);
 5459|       |
 5460|  1.69k|  m_info.time_uncertainty = range.read64();
 5461|  1.69k|  m_info.clock_resolution = range.read32();
 5462|       |
 5463|  1.69k|  m_info.clock_drift_rate = range.read32s();
 5464|  1.69k|  m_info.clock_type = range.read8() >> 6;
 5465|  1.69k|  return range.get_error();
 5466|  1.69k|}
_ZNK8Box_itai4dumpER6Indent:
 5490|    255|std::string Box_itai::dump(Indent& indent) const {
 5491|    255|  std::ostringstream sstr;
 5492|    255|  sstr << Box::dump(indent);
 5493|    255|  sstr << indent << "tai_timestamp: " << m_timestamp.tai_timestamp << "\n";
 5494|    255|  sstr << indent << "synchronization_state: " << int(m_timestamp.synchronization_state) << "\n";
 5495|    255|  sstr << indent << "timestamp_generation_failure: " << int(m_timestamp.timestamp_generation_failure) << "\n";
 5496|    255|  sstr << indent << "timestamp_is_modified: " << int(m_timestamp.timestamp_is_modified) << "\n";
 5497|    255|  return sstr.str();
 5498|    255|}
_ZN8Box_itai5parseER14BitstreamRangePK20heif_security_limits:
 5585|    297|Error Box_itai::parse(BitstreamRange& range, const heif_security_limits*) {
 5586|    297|  parse_full_box_header(range);
 5587|       |
 5588|    297|  m_timestamp.version = 1;
 5589|    297|  m_timestamp.tai_timestamp = range.read64();
 5590|       |
 5591|    297|  uint8_t status_bits = range.read8();
 5592|       |
 5593|    297|  m_timestamp.synchronization_state = !!(status_bits & 0x80);
 5594|    297|  m_timestamp.timestamp_generation_failure = !!(status_bits & 0x40);
 5595|    297|  m_timestamp.timestamp_is_modified = !!(status_bits & 0x20);
 5596|       |
 5597|    297|  return range.get_error();
 5598|    297|}
_ZN8Box_elng5parseER14BitstreamRangePK20heif_security_limits:
 5601|    630|{
 5602|    630|  parse_full_box_header(range);
 5603|       |
 5604|    630|  if (get_version() > 0) {
  ------------------
  |  Branch (5604:7): [True: 36, False: 594]
  ------------------
 5605|     36|    return unsupported_version_error("elng");
 5606|     36|  }
 5607|       |
 5608|    594|  m_lang = range.read_string();
 5609|    594|  return range.get_error();
 5610|    630|}
_ZNK8Box_elng4dumpER6Indent:
 5613|    548|{
 5614|    548|  std::ostringstream sstr;
 5615|    548|  sstr << Box::dump(indent);
 5616|    548|  sstr << indent << "extended_language: " << m_lang << "\n";
 5617|    548|  return sstr.str();
 5618|    548|}
_ZN19Box_gimi_content_id5parseER14BitstreamRangePK20heif_security_limits:
 5630|  1.06k|{
 5631|  1.06k|  m_content_id = range.read_string_until_eof();
 5632|       |
 5633|  1.06k|  return range.get_error();
 5634|  1.06k|}
_ZNK19Box_gimi_content_id4dumpER6Indent:
 5650|    998|{
 5651|    998|  std::ostringstream sstr;
 5652|    998|  sstr << Box::dump(indent);
 5653|       |
 5654|    998|  sstr << indent << "content ID: " << m_content_id << "\n";
 5655|       |
 5656|    998|  return sstr.str();
 5657|    998|}

_ZNK9BoxHeader12get_box_sizeEv:
  125|  1.62M|  uint64_t get_box_size() const { return m_size; }
_ZNK9BoxHeader18has_fixed_box_sizeEv:
  127|   700k|  bool has_fixed_box_size() const { return m_size != 0; }
_ZNK9BoxHeader15get_header_sizeEv:
  129|  1.30M|  uint32_t get_header_size() const { return m_header_size; }
_ZNK9BoxHeader14get_short_typeEv:
  131|   468k|  uint32_t get_short_type() const { return m_type; }
_ZNK9BoxHeader14debug_box_nameEv:
  137|   119k|  virtual const char* debug_box_name() const { return nullptr; }
_ZN9BoxHeader14set_short_typeEj:
  139|   373k|  void set_short_type(uint32_t type) { m_type = type; }
_ZN3Box16set_short_headerERK9BoxHeader:
  189|   307k|  {
  190|   307k|    *(BoxHeader*) this = hdr;
  191|   307k|  }
_ZN3Box19set_output_positionEm:
  268|  16.2k|  void set_output_position(uint64_t pos) { m_output_position = pos; }
_ZNK3Box24get_parse_error_fatalityEv:
  270|  7.15k|  virtual parse_error_fatality get_parse_error_fatality() const { return parse_error_fatality::fatal; }
_ZNK7FullBox11get_versionEv:
  328|   632k|  uint8_t get_version() const { return m_version; }
_ZNK7FullBox9get_flagsEv:
  332|   473k|  uint32_t get_flags() const { return m_flags; }
_ZN7FullBox9set_flagsEj:
  334|  4.47k|  void set_flags(uint32_t flags) { m_flags = flags; }
_ZN9Box_otherC2Ej:
  356|  78.8k|  {
  357|  78.8k|    set_short_type(short_type);
  358|  78.8k|  }
_ZN9Box_ErrorC2Ej5Error20parse_error_fatality:
  380|  16.0k|  {
  381|  16.0k|    set_short_type(fourcc("ERR "));
  382|       |
  383|  16.0k|    m_box_type_with_parse_error = box4cc;
  384|  16.0k|    m_error = std::move(err);
  385|  16.0k|    m_fatality = fatality;
  386|  16.0k|  }
_ZN8Box_ftypC2Ev:
  411|  38.8k|  {
  412|  38.8k|    set_short_type(fourcc("ftyp"));
  413|  38.8k|  }
_ZNK8Box_ftyp14debug_box_nameEv:
  417|  5.39k|  const char* debug_box_name() const override { return "File Type"; }
_ZN8Box_freeC2Ev:
  451|    613|  {
  452|    613|    set_short_type(fourcc("free"));
  453|    613|  }
_ZNK8Box_free14debug_box_nameEv:
  457|    492|  const char* debug_box_name() const override { return "Free Space"; }
_ZN8Box_metaC2Ev:
  470|  2.97k|  {
  471|  2.97k|    set_short_type(fourcc("meta"));
  472|  2.97k|  }
_ZNK8Box_meta14debug_box_nameEv:
  476|  2.60k|  const char* debug_box_name() const override { return "Metadata"; }
_ZN8Box_hdlrC2Ev:
  487|  2.17k|  {
  488|  2.17k|    set_short_type(fourcc("hdlr"));
  489|  2.17k|  }
_ZNK8Box_hdlr14debug_box_nameEv:
  493|  1.75k|  const char* debug_box_name() const override { return "Handler Reference"; }
_ZN8Box_pitmC2Ev:
  518|  2.17k|  {
  519|  2.17k|    set_short_type(fourcc("pitm"));
  520|  2.17k|  }
_ZNK8Box_pitm14debug_box_nameEv:
  524|  1.94k|  const char* debug_box_name() const override { return "Primary Item"; }
_ZNK8Box_iloc14debug_box_nameEv:
  553|  1.24k|  const char* debug_box_name() const override { return "Item Location"; }
_ZN8Box_infeC2Ev:
  648|  3.17k|  {
  649|  3.17k|    set_short_type(fourcc("infe"));
  650|  3.17k|  }
_ZNK8Box_infe14debug_box_nameEv:
  654|  2.63k|  const char* debug_box_name() const override { return "Item Info Entry"; }
_ZN8Box_iinfC2Ev:
  710|  2.03k|  {
  711|  2.03k|    set_short_type(fourcc("iinf"));
  712|  2.03k|  }
_ZNK8Box_iinf14debug_box_nameEv:
  716|  1.71k|  const char* debug_box_name() const override { return "Item Information"; }
_ZN8Box_iprpC2Ev:
  734|  28.3k|  {
  735|  28.3k|    set_short_type(fourcc("iprp"));
  736|  28.3k|  }
_ZNK8Box_iprp14debug_box_nameEv:
  740|  27.0k|  const char* debug_box_name() const override { return "Item Properties"; }
_ZN8Box_ipcoC2Ev:
  751|  10.9k|  {
  752|  10.9k|    set_short_type(fourcc("ipco"));
  753|  10.9k|  }
_ZNK8Box_ipco14debug_box_nameEv:
  771|  9.82k|  const char* debug_box_name() const override { return "Item Property Container"; }
_ZN8Box_ispeC2Ev:
  782|  1.73k|  {
  783|  1.73k|    set_short_type(fourcc("ispe"));
  784|  1.73k|  }
_ZNK8Box_ispe14debug_box_nameEv:
  798|  1.41k|  const char* debug_box_name() const override { return "Image Spatial Extents"; }
_ZN8Box_ipmaC2Ev:
  820|  2.07k|  {
  821|  2.07k|    set_short_type(fourcc("ipma"));
  822|  2.07k|  }
_ZNK8Box_ipma14debug_box_nameEv:
  826|  1.77k|  const char* debug_box_name() const override { return "Item Property Association"; }
_ZN8Box_auxCC2Ev:
  877|    925|  {
  878|    925|    set_short_type(fourcc("auxC"));
  879|    925|  }
_ZNK8Box_auxC14debug_box_nameEv:
  891|    727|  const char* debug_box_name() const override { return "Image Properties for Auxiliary Images"; }
_ZN8Box_irotC2Ev:
  908|  4.94k|  {
  909|  4.94k|    set_short_type(fourcc("irot"));
  910|  4.94k|  }
_ZNK8Box_irot14debug_box_nameEv:
  918|  4.03k|  const char* debug_box_name() const override { return "Image Rotation"; }
_ZNK8Box_irot24get_parse_error_fatalityEv:
  925|     69|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_imirC2Ev:
  941|  2.07k|  {
  942|  2.07k|    set_short_type(fourcc("imir"));
  943|  2.07k|  }
_ZNK8Box_imir14debug_box_nameEv:
  955|  1.36k|  const char* debug_box_name() const override { return "Image Mirroring"; }
_ZNK8Box_imir24get_parse_error_fatalityEv:
  957|    500|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_isclC2Ev:
  973|    835|  {
  974|    835|    set_short_type(fourcc("iscl"));
  975|    835|  }
_ZNK8Box_iscl14debug_box_nameEv:
  996|    372|  const char* debug_box_name() const override { return "Image Scaling"; }
_ZNK8Box_iscl24get_parse_error_fatalityEv:
  998|    439|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_clapC2Ev:
 1017|  1.79k|  {
 1018|  1.79k|    set_short_type(fourcc("clap"));
 1019|  1.79k|  }
_ZNK8Box_clap14debug_box_nameEv:
 1027|    496|  const char* debug_box_name() const override { return "Clean Aperture"; }
_ZNK8Box_clap24get_parse_error_fatalityEv:
 1055|  1.12k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_irefC2Ev:
 1074|  9.03k|  {
 1075|  9.03k|    set_short_type(fourcc("iref"));
 1076|  9.03k|  }
_ZNK8Box_iref14debug_box_nameEv:
 1089|  7.35k|  const char* debug_box_name() const override { return "Item Reference"; }
_ZN8Box_rrefC2Ev:
 1130|    556|  {
 1131|    556|    set_short_type(fourcc("rref"));
 1132|    556|  }
_ZNK8Box_rref14debug_box_nameEv:
 1138|    482|  const char* debug_box_name() const override { return "Required Reference Types"; }
_ZNK8Box_idat14debug_box_nameEv:
 1163|  2.88k|  const char* debug_box_name() const override { return "Item Data"; }
_ZN8Box_grplC2Ev:
 1196|  2.41k|  {
 1197|  2.41k|    set_short_type(fourcc("grpl"));
 1198|  2.41k|  }
_ZNK8Box_grpl14debug_box_nameEv:
 1202|  1.70k|  const char* debug_box_name() const override { return "Groups List"; }
_ZN8Box_sterC2Ev:
 1238|    310|  {
 1239|    310|    set_short_type(fourcc("ster"));
 1240|    310|  }
_ZNK8Box_ster14debug_box_nameEv:
 1244|    276|  const char* debug_box_name() const override { return "Stereo pair"; }
_ZN8Box_pymdC2Ev:
 1259|  1.20k|  {
 1260|  1.20k|    set_short_type(fourcc("pymd"));
 1261|  1.20k|  }
_ZNK8Box_pymd14debug_box_nameEv:
 1265|    974|  const char* debug_box_name() const override { return "Image pyramid group"; }
_ZNK8Box_pymd24get_parse_error_fatalityEv:
 1288|    198|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_dinfC2Ev:
 1306|  6.00k|  {
 1307|  6.00k|    set_short_type(fourcc("dinf"));
 1308|  6.00k|  }
_ZNK8Box_dinf14debug_box_nameEv:
 1312|  5.40k|  const char* debug_box_name() const override { return "Data Information"; }
_ZN8Box_drefC2Ev:
 1323|    242|  {
 1324|    242|    set_short_type(fourcc("dref"));
 1325|    242|  }
_ZNK8Box_dref14debug_box_nameEv:
 1329|     87|  const char* debug_box_name() const override { return "Data Reference"; }
_ZN7Box_urlC2Ev:
 1342|  2.12k|  {
 1343|  2.12k|    set_short_type(fourcc("url "));
 1344|  2.12k|    set_flags(1);
 1345|  2.12k|  }
_ZNK7Box_url14debug_box_nameEv:
 1349|  1.99k|  const char* debug_box_name() const override { return "Data Entry URL"; }
_ZN8Box_pixiC2Ev:
 1369|  3.67k|  {
 1370|  3.67k|    set_short_type(fourcc("pixi"));
 1371|  3.67k|  }
_ZNK8Box_pixi14debug_box_nameEv:
 1390|  2.13k|  const char* debug_box_name() const override { return "Pixel Information"; }
_ZNK8Box_pixi24get_parse_error_fatalityEv:
 1394|  1.11k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_paspC2Ev:
 1408|  8.86k|  {
 1409|  8.86k|    set_short_type(fourcc("pasp"));
 1410|  8.86k|  }
_ZNK8Box_pasp14debug_box_nameEv:
 1417|  6.70k|  const char* debug_box_name() const override { return "Pixel Aspect Ratio"; }
_ZNK8Box_pasp24get_parse_error_fatalityEv:
 1421|    699|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_lselC2Ev:
 1432|  4.32k|  {
 1433|  4.32k|    set_short_type(fourcc("lsel"));
 1434|  4.32k|  }
_ZNK8Box_lsel14debug_box_nameEv:
 1440|  3.27k|  const char* debug_box_name() const override { return "Layer Selection"; }
_ZNK8Box_lsel24get_parse_error_fatalityEv:
 1444|    513|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_clliC2Ev:
 1455|  6.80k|  {
 1456|  6.80k|    set_short_type(fourcc("clli"));
 1457|       |
 1458|  6.80k|    clli.max_content_light_level = 0;
 1459|  6.80k|    clli.max_pic_average_light_level = 0;
 1460|  6.80k|  }
_ZNK8Box_clli14debug_box_nameEv:
 1466|    197|  const char* debug_box_name() const override { return "Content Light Level Information"; }
_ZNK8Box_clli24get_parse_error_fatalityEv:
 1470|    112|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_mdcv14debug_box_nameEv:
 1486|  1.94k|  const char* debug_box_name() const override { return "Master Display Colour Volume"; }
_ZNK8Box_mdcv24get_parse_error_fatalityEv:
 1490|    572|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_amve14debug_box_nameEv:
 1506|    325|  const char* debug_box_name() const override { return "Ambient Viewing Environment"; }
_ZNK8Box_amve24get_parse_error_fatalityEv:
 1510|    197|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_ndwtC2Ev:
 1521|  5.47k|  {
 1522|  5.47k|    set_short_type(fourcc("ndwt"));
 1523|  5.47k|  }
_ZNK8Box_ndwt27get_diffuse_white_luminanceEv:
 1527|  4.72k|  uint32_t get_diffuse_white_luminance() const { return m_diffuse_white_luminance; }
_ZN8Box_ndwt27set_diffuse_white_luminanceEj:
 1529|  4.94k|  void set_diffuse_white_luminance(uint32_t luminance) { m_diffuse_white_luminance = luminance; }
_ZNK8Box_ndwt14debug_box_nameEv:
 1533|    459|  const char* debug_box_name() const override { return "Nominal Diffuse White"; }
_ZNK8Box_ndwt24get_parse_error_fatalityEv:
 1537|     52|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_cclv23ccv_primaries_are_validEv:
 1552|  11.4k|  bool ccv_primaries_are_valid() const { return m_ccv_primaries_valid; }
_ZNK8Box_cclv18get_ccv_primary_x0Ev:
 1553|    607|  int32_t get_ccv_primary_x0() const { return m_ccv_primaries_x[0]; }
_ZNK8Box_cclv18get_ccv_primary_y0Ev:
 1554|    607|  int32_t get_ccv_primary_y0() const { return m_ccv_primaries_y[0]; }
_ZNK8Box_cclv18get_ccv_primary_x1Ev:
 1555|    607|  int32_t get_ccv_primary_x1() const { return m_ccv_primaries_x[1]; }
_ZNK8Box_cclv18get_ccv_primary_y1Ev:
 1556|    607|  int32_t get_ccv_primary_y1() const { return m_ccv_primaries_y[1]; }
_ZNK8Box_cclv18get_ccv_primary_x2Ev:
 1557|    607|  int32_t get_ccv_primary_x2() const { return m_ccv_primaries_x[2]; }
_ZNK8Box_cclv18get_ccv_primary_y2Ev:
 1558|    607|  int32_t get_ccv_primary_y2() const { return m_ccv_primaries_y[2]; }
_ZNK8Box_cclv22min_luminance_is_validEv:
 1561|  11.4k|  bool min_luminance_is_valid() const { return m_ccv_min_luminance_value.has_value(); }
_ZNK8Box_cclv17get_min_luminanceEv:
 1562|    941|  uint32_t get_min_luminance() const { return *m_ccv_min_luminance_value; }
_ZN8Box_cclv17set_min_luminanceEj:
 1563|  1.10k|  void set_min_luminance(uint32_t luminance) { m_ccv_min_luminance_value = luminance; }
_ZNK8Box_cclv22max_luminance_is_validEv:
 1565|  11.4k|  bool max_luminance_is_valid() const { return m_ccv_max_luminance_value.has_value(); }
_ZNK8Box_cclv17get_max_luminanceEv:
 1566|  2.24k|  uint32_t get_max_luminance() const { return *m_ccv_max_luminance_value; }
_ZN8Box_cclv17set_max_luminanceEj:
 1567|  2.45k|  void set_max_luminance(uint32_t luminance) { m_ccv_max_luminance_value = luminance; }
_ZNK8Box_cclv22avg_luminance_is_validEv:
 1569|  11.4k|  bool avg_luminance_is_valid() const { return m_ccv_avg_luminance_value.has_value(); }
_ZNK8Box_cclv17get_avg_luminanceEv:
 1570|    978|  uint32_t get_avg_luminance() const { return *m_ccv_avg_luminance_value; }
_ZN8Box_cclv17set_avg_luminanceEj:
 1571|  1.16k|  void set_avg_luminance(uint32_t luminance) { m_ccv_avg_luminance_value = luminance; }
_ZN8Box_cminC2Ev:
 1599|  2.64k|  {
 1600|  2.64k|    set_short_type(fourcc("cmin"));
 1601|  2.64k|  }
_ZNK8Box_cmin14debug_box_nameEv:
 1656|  1.32k|  const char* debug_box_name() const override { return "Camera Intrinsic Matrix"; }
_ZNK8Box_cmin24get_parse_error_fatalityEv:
 1662|    900|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_cmexC2Ev:
 1681|  3.62k|  {
 1682|  3.62k|    set_short_type(fourcc("cmex"));
 1683|  3.62k|  }
_ZNK8Box_cmex14debug_box_nameEv:
 1713|  1.18k|  const char* debug_box_name() const override { return "Camera Extrinsic Matrix"; }
_ZNK8Box_cmex24get_parse_error_fatalityEv:
 1719|  1.90k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_udesC2Ev:
 1761|  1.07k|  {
 1762|  1.07k|    set_short_type(fourcc("udes"));
 1763|  1.07k|  }
_ZNK8Box_udes14debug_box_nameEv:
 1767|    865|  const char* debug_box_name() const override { return "User Description"; }
_ZNK8Box_udes24get_parse_error_fatalityEv:
 1833|    154|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_taicC2Ev:
 1854|  1.70k|  {
 1855|  1.70k|    set_short_type(fourcc("taic"));
 1856|  1.70k|    initialize_heif_tai_clock_info(&m_info);
 1857|  1.70k|  }
_ZNK8Box_taic14debug_box_nameEv:
 1863|  1.43k|  const char* debug_box_name() const override { return "TAI Clock Information"; }
_ZN8Box_itaiC2Ev:
 1934|    300|  {
 1935|    300|    set_short_type(fourcc("itai"));
 1936|    300|    initialize_heif_tai_timestamp_packet(&m_timestamp);
 1937|    300|  }
_ZNK8Box_itai14debug_box_nameEv:
 1941|    255|  const char* debug_box_name() const override { return "Item TAI Timestamp"; }
_ZN19Box_gimi_content_idC2Ev:
 1999|  1.06k|  {
 2000|  1.06k|    set_uuid_type(std::vector<uint8_t>{0x26, 0x1e, 0xf3, 0x74, 0x1d, 0x97, 0x5b, 0xba, 0xac, 0xbd, 0x9d, 0x2c, 0x8e, 0xa7, 0x35, 0x22});
 2001|  1.06k|  }
_ZNK19Box_gimi_content_id14debug_box_nameEv:
 2009|    998|  const char* debug_box_name() const override { return "GIMI Content ID"; }
_ZN8Box_elngC2Ev:
 2042|    631|  {
 2043|    631|    set_short_type(fourcc("elng"));
 2044|    631|  }
_ZNK8Box_elng14debug_box_nameEv:
 2048|    548|  const char* debug_box_name() const override { return "Extended language"; }
_ZNK8Box_elng24get_parse_error_fatalityEv:
 2068|     39|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN9BoxHeaderD2Ev:
  121|   735k|  virtual ~BoxHeader() = default;
_ZN3BoxC2Ev:
  186|   380k|  Box() = default;
_ZN8FractionC2Ev:
   67|  7.19k|  Fraction() = default;

_ZN8Box_avcC5parseER14BitstreamRangePK20heif_security_limits:
   35|  3.94k|{
   36|  3.94k|  m_configuration.configuration_version = range.read8();
   37|  3.94k|  m_configuration.AVCProfileIndication = range.read8();
   38|  3.94k|  m_configuration.profile_compatibility = range.read8();
   39|  3.94k|  m_configuration.AVCLevelIndication = range.read8();
   40|  3.94k|  uint8_t lengthSizeMinusOneWithReserved = range.read8();
   41|  3.94k|  m_configuration.lengthSize =
   42|  3.94k|      (lengthSizeMinusOneWithReserved & 0b00000011) + 1;
   43|       |
   44|  3.94k|  uint8_t numOfSequenceParameterSets = (range.read8() & 0b00011111);
   45|  7.10k|  for (int i = 0; i < numOfSequenceParameterSets; i++) {
  ------------------
  |  Branch (45:19): [True: 3.15k, False: 3.94k]
  ------------------
   46|  3.15k|    uint16_t sequenceParameterSetLength = range.read16();
   47|  3.15k|    std::vector<uint8_t> sps(sequenceParameterSetLength);
   48|  3.15k|    range.read(sps.data(), sps.size());
   49|  3.15k|    m_sps.push_back(sps);
   50|  3.15k|  }
   51|       |
   52|  3.94k|  uint8_t numOfPictureParameterSets = range.read8();
   53|  7.93k|  for (int i = 0; i < numOfPictureParameterSets; i++) {
  ------------------
  |  Branch (53:19): [True: 3.98k, False: 3.94k]
  ------------------
   54|  3.98k|    uint16_t pictureParameterSetLength = range.read16();
   55|  3.98k|    std::vector<uint8_t> pps(pictureParameterSetLength);
   56|  3.98k|    range.read(pps.data(), pps.size());
   57|  3.98k|    m_pps.push_back(pps);
   58|  3.98k|  }
   59|       |
   60|       |  // See ISO/IEC 14496-15 2017 Section 5.3.3.1.2
   61|  3.94k|  if (range.get_remaining_bytes() > 0) {
  ------------------
  |  Branch (61:7): [True: 2.26k, False: 1.68k]
  ------------------
   62|  2.26k|    if ((m_configuration.AVCProfileIndication != 66) &&
  ------------------
  |  Branch (62:9): [True: 2.10k, False: 158]
  ------------------
   63|  2.10k|        (m_configuration.AVCProfileIndication != 77) &&
  ------------------
  |  Branch (63:9): [True: 1.92k, False: 183]
  ------------------
   64|  1.92k|        (m_configuration.AVCProfileIndication != 88)) {
  ------------------
  |  Branch (64:9): [True: 1.30k, False: 617]
  ------------------
   65|  1.30k|      m_configuration.chroma_format = (heif_chroma) (range.read8() & 0b00000011);
   66|  1.30k|      m_configuration.bit_depth_luma = 8 + (range.read8() & 0b00000111);
   67|  1.30k|      m_configuration.bit_depth_chroma = 8 + (range.read8() & 0b00000111);
   68|  1.30k|      uint8_t numOfSequenceParameterSetExt = range.read8();
   69|  8.25k|      for (int i = 0; i < numOfSequenceParameterSetExt; i++) {
  ------------------
  |  Branch (69:23): [True: 6.94k, False: 1.30k]
  ------------------
   70|  6.94k|        uint16_t sequenceParameterSetExtLength = range.read16();
   71|  6.94k|        std::vector<uint8_t> sps_ext(sequenceParameterSetExtLength);
   72|  6.94k|        range.read(sps_ext.data(), sps_ext.size());
   73|  6.94k|        m_sps_ext.push_back(sps_ext);
   74|  6.94k|      }
   75|  1.30k|    }
   76|  2.26k|  }
   77|       |
   78|  3.94k|  return range.get_error();
   79|  3.94k|}
_ZNK8Box_avcC4dumpER6Indent:
  170|  3.55k|{
  171|  3.55k|  std::ostringstream sstr;
  172|  3.55k|  sstr << Box::dump(indent);
  173|  3.55k|  sstr << indent << "configuration_version: " << ((int) m_configuration.configuration_version) << "\n"
  174|  3.55k|      << indent << "AVCProfileIndication: " << ((int) m_configuration.AVCProfileIndication) << " (" << profileIndicationAsText() << ")\n"
  175|  3.55k|      << indent << "profile_compatibility: " << ((int) m_configuration.profile_compatibility) << "\n"
  176|  3.55k|      << indent << "AVCLevelIndication: " << ((int) m_configuration.AVCLevelIndication) << "\n"
  177|  3.55k|      << indent << "Chroma format: ";
  178|       |
  179|  3.55k|  switch (m_configuration.chroma_format) {
  180|  1.08k|    case heif_chroma_monochrome:
  ------------------
  |  |   75|  1.08k|#define heif_chroma_monochrome heif_chroma_planar
  ------------------
  |  Branch (180:5): [True: 1.08k, False: 2.46k]
  ------------------
  181|  1.08k|      sstr << "4:0:0\n";
  182|  1.08k|      break;
  183|  2.36k|    case heif_chroma_420:
  ------------------
  |  Branch (183:5): [True: 2.36k, False: 1.18k]
  ------------------
  184|  2.36k|      sstr << "4:2:0\n";
  185|  2.36k|      break;
  186|     55|    case heif_chroma_422:
  ------------------
  |  Branch (186:5): [True: 55, False: 3.49k]
  ------------------
  187|     55|      sstr << "4:2:2\n";
  188|     55|      break;
  189|     46|    case heif_chroma_444:
  ------------------
  |  Branch (189:5): [True: 46, False: 3.50k]
  ------------------
  190|     46|      sstr << "4:4:4\n";
  191|     46|      break;
  192|      0|    default:
  ------------------
  |  Branch (192:5): [True: 0, False: 3.55k]
  ------------------
  193|      0|      sstr << "unsupported\n";
  194|      0|      break;
  195|  3.55k|  }
  196|       |
  197|  3.55k|  sstr << indent << "Bit depth luma: " << ((int) m_configuration.bit_depth_luma) << "\n"
  198|  3.55k|      << indent << "Bit depth chroma: " << ((int) m_configuration.bit_depth_chroma) << "\n";
  199|       |
  200|  3.55k|  for (const auto& sps : m_sps) {
  ------------------
  |  Branch (200:24): [True: 2.50k, False: 3.55k]
  ------------------
  201|  2.50k|    sstr << indent << "SPS: ";
  202|  1.14M|    for (uint8_t b : sps) {
  ------------------
  |  Branch (202:20): [True: 1.14M, False: 2.50k]
  ------------------
  203|  1.14M|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  204|  1.14M|    }
  205|  2.50k|    sstr << "\n";
  206|  2.50k|    sstr << std::dec;
  207|  2.50k|  }
  208|       |
  209|  3.55k|  for (const auto& spsext : m_sps_ext) {
  ------------------
  |  Branch (209:27): [True: 3.46k, False: 3.55k]
  ------------------
  210|  3.46k|    sstr << indent << "SPS-EXT: ";
  211|   182k|    for (uint8_t b : spsext) {
  ------------------
  |  Branch (211:20): [True: 182k, False: 3.46k]
  ------------------
  212|   182k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  213|   182k|    }
  214|  3.46k|    sstr << "\n";
  215|  3.46k|    sstr << std::dec;
  216|  3.46k|  }
  217|       |
  218|  3.55k|  for (const auto& pps : m_pps) {
  ------------------
  |  Branch (218:24): [True: 1.50k, False: 3.55k]
  ------------------
  219|  1.50k|    sstr << indent << "PPS: ";
  220|   586k|    for (uint8_t b : pps) {
  ------------------
  |  Branch (220:20): [True: 586k, False: 1.50k]
  ------------------
  221|   586k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  222|   586k|    }
  223|  1.50k|    sstr << "\n";
  224|  1.50k|    sstr << std::dec;
  225|  1.50k|  }
  226|       |
  227|  3.55k|  return sstr.str();
  228|  3.55k|}
_ZNK8Box_avcC23profileIndicationAsTextEv:
  231|  3.55k|{
  232|       |  // See ISO/IEC 14496-10:2022 Annex A
  233|  3.55k|  switch (m_configuration.AVCProfileIndication) {
  234|    796|    case 44:
  ------------------
  |  Branch (234:5): [True: 796, False: 2.75k]
  ------------------
  235|    796|      return "CALVC 4:4:4";
  236|    400|    case 66:
  ------------------
  |  Branch (236:5): [True: 400, False: 3.15k]
  ------------------
  237|    400|      return "Constrained Baseline";
  238|    742|    case 77:
  ------------------
  |  Branch (238:5): [True: 742, False: 2.81k]
  ------------------
  239|    742|      return "Main";
  240|    943|    case 88:
  ------------------
  |  Branch (240:5): [True: 943, False: 2.60k]
  ------------------
  241|    943|      return "Extended";
  242|    129|    case 100:
  ------------------
  |  Branch (242:5): [True: 129, False: 3.42k]
  ------------------
  243|    129|      return "High variant";
  244|     72|    case 110:
  ------------------
  |  Branch (244:5): [True: 72, False: 3.48k]
  ------------------
  245|     72|      return "High 10";
  246|     71|    case 122:
  ------------------
  |  Branch (246:5): [True: 71, False: 3.48k]
  ------------------
  247|     71|      return "High 4:2:2";
  248|     74|    case 244:
  ------------------
  |  Branch (248:5): [True: 74, False: 3.47k]
  ------------------
  249|     74|      return "High 4:4:4";
  250|    325|    default:
  ------------------
  |  Branch (250:5): [True: 325, False: 3.22k]
  ------------------
  251|    325|      return "Unknown";
  252|  3.55k|  }
  253|  3.55k|}

_ZN8Box_avcCC2Ev:
   36|  3.95k|  Box_avcC() { set_short_type(fourcc("avcC")); }
_ZN8Box_avc1C2Ev:
  111|     59|  {
  112|     59|    set_short_type(fourcc("avc1"));
  113|     59|  }

_ZN8Box_av1C5parseER14BitstreamRangePK20heif_security_limits:
   37|  2.07k|{
   38|       |  //parse_full_box_header(range);
   39|       |
   40|  2.07k|  if (!has_fixed_box_size()) {
  ------------------
  |  Branch (40:7): [True: 1, False: 2.07k]
  ------------------
   41|       |    // Note: in theory, it is allowed to have an av1C box with unspecified size (until the end of the file),
   42|       |    // but that would be very uncommon and give us problems in the calculation of `configOBUs_bytes` below.
   43|       |    // It's better to error on this case than to open a DoS vulnerability.
   44|      1|    return Error{heif_error_Invalid_input, heif_suberror_Unspecified, "av1C with unspecified box size"};
   45|      1|  }
   46|       |
   47|  2.07k|  uint8_t byte;
   48|       |
   49|  2.07k|  auto& c = m_configuration; // abbreviation
   50|       |
   51|  2.07k|  byte = range.read8();
   52|  2.07k|  if ((byte & 0x80) == 0) {
  ------------------
  |  Branch (52:7): [True: 838, False: 1.23k]
  ------------------
   53|       |    // error: marker bit not set
   54|    838|  }
   55|       |
   56|  2.07k|  c.version = byte & 0x7F;
   57|       |
   58|  2.07k|  byte = range.read8();
   59|  2.07k|  c.seq_profile = (byte >> 5) & 0x7;
   60|  2.07k|  c.seq_level_idx_0 = byte & 0x1f;
   61|       |
   62|  2.07k|  byte = range.read8();
   63|  2.07k|  c.seq_tier_0 = (byte >> 7) & 1;
   64|  2.07k|  c.high_bitdepth = (byte >> 6) & 1;
   65|  2.07k|  c.twelve_bit = (byte >> 5) & 1;
   66|  2.07k|  c.monochrome = (byte >> 4) & 1;
   67|  2.07k|  c.chroma_subsampling_x = (byte >> 3) & 1;
   68|  2.07k|  c.chroma_subsampling_y = (byte >> 2) & 1;
   69|  2.07k|  c.chroma_sample_position = byte & 3;
   70|       |
   71|  2.07k|  byte = range.read8();
   72|  2.07k|  c.initial_presentation_delay_present = (byte >> 4) & 1;
   73|  2.07k|  if (c.initial_presentation_delay_present) {
  ------------------
  |  Branch (73:7): [True: 189, False: 1.88k]
  ------------------
   74|    189|    c.initial_presentation_delay_minus_one = byte & 0x0F;
   75|    189|  }
   76|       |
   77|  2.07k|  const size_t configOBUs_bytes = range.get_remaining_bytes();
   78|  2.07k|  m_config_OBUs.resize(configOBUs_bytes);
   79|       |
   80|  2.07k|  if (!range.read(m_config_OBUs.data(), configOBUs_bytes)) {
  ------------------
  |  Branch (80:7): [True: 0, False: 2.07k]
  ------------------
   81|       |    // error
   82|      0|  }
   83|       |
   84|  2.07k|  return range.get_error();
   85|  2.07k|}
_ZNK8Box_av1C4dumpER6Indent:
  116|  1.89k|{
  117|  1.89k|  std::ostringstream sstr;
  118|  1.89k|  sstr << Box::dump(indent);
  119|       |
  120|  1.89k|  const auto& c = m_configuration; // abbreviation
  121|       |
  122|  1.89k|  sstr << indent << "version: " << ((int) c.version) << "\n"
  123|  1.89k|       << indent << "seq_profile: " << ((int) c.seq_profile) << "\n"
  124|  1.89k|       << indent << "seq_level_idx_0: " << ((int) c.seq_level_idx_0) << "\n"
  125|  1.89k|       << indent << "high_bitdepth: " << ((int) c.high_bitdepth) << "\n"
  126|  1.89k|       << indent << "twelve_bit: " << ((int) c.twelve_bit) << "\n"
  127|  1.89k|       << indent << "monochrome: " << ((int) c.monochrome) << "\n"
  128|  1.89k|       << indent << "chroma_subsampling_x: " << ((int) c.chroma_subsampling_x) << "\n"
  129|  1.89k|       << indent << "chroma_subsampling_y: " << ((int) c.chroma_subsampling_y) << "\n"
  130|  1.89k|       << indent << "chroma_sample_position: " << ((int) c.chroma_sample_position) << "\n"
  131|  1.89k|       << indent << "initial_presentation_delay: ";
  132|       |
  133|  1.89k|  if (c.initial_presentation_delay_present) {
  ------------------
  |  Branch (133:7): [True: 189, False: 1.70k]
  ------------------
  134|    189|    sstr << c.initial_presentation_delay_minus_one + 1 << "\n";
  135|    189|  }
  136|  1.70k|  else {
  137|  1.70k|    sstr << "not present\n";
  138|  1.70k|  }
  139|       |
  140|  1.89k|  sstr << indent << "config OBUs:";
  141|   211k|  for (size_t i = 0; i < m_config_OBUs.size(); i++) {
  ------------------
  |  Branch (141:22): [True: 209k, False: 1.89k]
  ------------------
  142|   209k|    sstr << " " << std::hex << std::setfill('0') << std::setw(2)
  143|   209k|         << ((int) m_config_OBUs[i]);
  144|   209k|  }
  145|  1.89k|  sstr << std::dec << "\n";
  146|       |
  147|  1.89k|  return sstr.str();
  148|  1.89k|}
_ZN8Box_a1op5parseER14BitstreamRangePK20heif_security_limits:
  194|  8.22k|{
  195|  8.22k|  op_index = range.read8();
  196|       |
  197|  8.22k|  return range.get_error();
  198|  8.22k|}
_ZNK8Box_a1op4dumpER6Indent:
  202|  6.71k|{
  203|  6.71k|  std::ostringstream sstr;
  204|  6.71k|  sstr << Box::dump(indent);
  205|       |
  206|  6.71k|  sstr << indent << "op-index: " << ((int) op_index) << "\n";
  207|       |
  208|  6.71k|  return sstr.str();
  209|  6.71k|}
_ZN8Box_a1lx5parseER14BitstreamRangePK20heif_security_limits:
  225|  3.15k|{
  226|  3.15k|  uint8_t flags = range.read8();
  227|       |
  228|  12.6k|  for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (228:19): [True: 9.45k, False: 3.15k]
  ------------------
  229|  9.45k|    if (flags & 1) {
  ------------------
  |  Branch (229:9): [True: 1.38k, False: 8.07k]
  ------------------
  230|  1.38k|      layer_size[i] = range.read32();
  231|  1.38k|    }
  232|  8.07k|    else {
  233|  8.07k|      layer_size[i] = range.read16();
  234|  8.07k|    }
  235|  9.45k|  }
  236|       |
  237|  3.15k|  return range.get_error();
  238|  3.15k|}
_ZNK8Box_a1lx4dumpER6Indent:
  242|  2.55k|{
  243|  2.55k|  std::ostringstream sstr;
  244|  2.55k|  sstr << Box::dump(indent);
  245|       |
  246|  2.55k|  sstr << indent << "layer-sizes: [" << layer_size[0] << "," << layer_size[1] << "," << layer_size[2] << "]\n";
  247|       |
  248|  2.55k|  return sstr.str();
  249|  2.55k|}

_ZN8Box_av1CC2Ev:
   45|  2.07k|  {
   46|  2.07k|    set_short_type(fourcc("av1C"));
   47|  2.07k|  }
_ZN8Box_av01C2Ev:
  122|    114|  {
  123|    114|    set_short_type(fourcc("av01"));
  124|    114|  }
_ZN8Box_a1opC2Ev:
  131|  8.22k|  {
  132|  8.22k|    set_short_type(fourcc("a1op"));
  133|  8.22k|  }
_ZN8Box_a1lxC2Ev:
  150|  3.15k|  {
  151|  3.15k|    set_short_type(fourcc("a1lx"));
  152|  3.15k|  }

_ZN30HEVCDecoderConfigurationRecord5parseER14BitstreamRangePK20heif_security_limits:
   38|  3.73k|{
   39|  3.73k|  uint8_t byte;
   40|       |
   41|  3.73k|  configuration_version = range.read8();
   42|  3.73k|  byte = range.read8();
   43|  3.73k|  general_profile_space = (byte >> 6) & 3;
   44|  3.73k|  general_tier_flag = (byte >> 5) & 1;
   45|  3.73k|  general_profile_idc = (byte & 0x1F);
   46|       |
   47|  3.73k|  general_profile_compatibility_flags = range.read32();
   48|       |
   49|  26.1k|  for (int i = 0; i < 6; i++) {
  ------------------
  |  Branch (49:19): [True: 22.3k, False: 3.73k]
  ------------------
   50|  22.3k|    byte = range.read8();
   51|       |
   52|   201k|    for (int b = 0; b < 8; b++) {
  ------------------
  |  Branch (52:21): [True: 179k, False: 22.3k]
  ------------------
   53|   179k|      general_constraint_indicator_flags[i * 8 + b] = (byte >> (7 - b)) & 1;
   54|   179k|    }
   55|  22.3k|  }
   56|       |
   57|  3.73k|  general_level_idc = range.read8();
   58|  3.73k|  min_spatial_segmentation_idc = range.read16() & 0x0FFF;
   59|  3.73k|  parallelism_type = range.read8() & 0x03;
   60|  3.73k|  chroma_format = range.read8() & 0x03;
   61|  3.73k|  bit_depth_luma = static_cast<uint8_t>((range.read8() & 0x07) + 8);
   62|  3.73k|  bit_depth_chroma = static_cast<uint8_t>((range.read8() & 0x07) + 8);
   63|  3.73k|  avg_frame_rate = range.read16();
   64|       |
   65|  3.73k|  byte = range.read8();
   66|  3.73k|  constant_frame_rate = (byte >> 6) & 0x03;
   67|  3.73k|  num_temporal_layers = (byte >> 3) & 0x07;
   68|  3.73k|  temporal_id_nested = (byte >> 2) & 1;
   69|       |
   70|  3.73k|  m_length_size = static_cast<uint8_t>((byte & 0x03) + 1);
   71|       |
   72|  3.73k|  int nArrays = range.read8();
   73|       |
   74|  8.66k|  for (int i = 0; i < nArrays && !range.error(); i++) {
  ------------------
  |  Branch (74:19): [True: 5.00k, False: 3.65k]
  |  Branch (74:34): [True: 4.92k, False: 79]
  ------------------
   75|  4.92k|    byte = range.read8();
   76|       |
   77|  4.92k|    NalArray array;
   78|       |
   79|  4.92k|    array.m_array_completeness = (byte >> 6) & 1;
   80|  4.92k|    array.m_NAL_unit_type = (byte & 0x3F);
   81|       |
   82|  4.92k|    int nUnits = range.read16();
   83|  15.2k|    for (int u = 0; u < nUnits && !range.error(); u++) {
  ------------------
  |  Branch (83:21): [True: 10.3k, False: 4.87k]
  |  Branch (83:35): [True: 10.2k, False: 57]
  ------------------
   84|       |
   85|  10.2k|      std::vector<uint8_t> nal_unit;
   86|  10.2k|      int size = range.read16();
   87|  10.2k|      if (!size) {
  ------------------
  |  Branch (87:11): [True: 1.26k, False: 9.00k]
  ------------------
   88|       |        // Ignore empty NAL units.
   89|  1.26k|        continue;
   90|  1.26k|      }
   91|       |
   92|  9.00k|      if (range.prepare_read(size)) {
  ------------------
  |  Branch (92:11): [True: 8.97k, False: 32]
  ------------------
   93|  8.97k|        nal_unit.resize(size);
   94|  8.97k|        bool success = range.get_istream()->read((char*) nal_unit.data(), size);
   95|  8.97k|        if (!success) {
  ------------------
  |  Branch (95:13): [True: 0, False: 8.97k]
  ------------------
   96|      0|          return Error{heif_error_Invalid_input, heif_suberror_End_of_data, "error while reading hvcC box"};
   97|      0|        }
   98|  8.97k|      }
   99|       |
  100|  9.00k|      array.m_nal_units.push_back(std::move(nal_unit));
  101|  9.00k|    }
  102|       |
  103|  4.92k|    m_nal_array.push_back(std::move(array));
  104|  4.92k|  }
  105|       |
  106|  3.73k|  range.skip_to_end_of_box();
  107|       |
  108|  3.73k|  return range.get_error();
  109|  3.73k|}
_ZN8Box_hvcC5parseER14BitstreamRangePK20heif_security_limits:
  195|  3.73k|{
  196|  3.73k|  return m_configuration.parse(range, limits);
  197|  3.73k|}
_ZNK8Box_hvcC4dumpER6Indent:
  201|  3.46k|{
  202|  3.46k|  std::ostringstream sstr;
  203|  3.46k|  sstr << Box::dump(indent);
  204|       |
  205|  3.46k|  const auto& c = m_configuration; // abbreviation
  206|       |
  207|  3.46k|  sstr << indent << "configuration_version: " << ((int) c.configuration_version) << "\n"
  208|  3.46k|       << indent << "general_profile_space: " << ((int) c.general_profile_space) << "\n"
  209|  3.46k|       << indent << "general_tier_flag: " << c.general_tier_flag << "\n"
  210|  3.46k|       << indent << "general_profile_idc: " << ((int) c.general_profile_idc) << "\n";
  211|       |
  212|  3.46k|  sstr << indent << "general_profile_compatibility_flags: ";
  213|   114k|  for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (213:19): [True: 110k, False: 3.46k]
  ------------------
  214|   110k|    sstr << ((c.general_profile_compatibility_flags >> (31 - i)) & 1);
  215|   110k|    if ((i % 8) == 7) sstr << ' ';
  ------------------
  |  Branch (215:9): [True: 13.8k, False: 96.9k]
  ------------------
  216|  96.9k|    else if ((i % 4) == 3) sstr << '.';
  ------------------
  |  Branch (216:14): [True: 13.8k, False: 83.1k]
  ------------------
  217|   110k|  }
  218|  3.46k|  sstr << "\n";
  219|       |
  220|  3.46k|  sstr << indent << "general_constraint_indicator_flags: ";
  221|  3.46k|  int cnt = 0;
  222|   169k|  for (int i = 0; i < HEVCDecoderConfigurationRecord::NUM_CONSTRAINT_INDICATOR_FLAGS; i++) {
  ------------------
  |  Branch (222:19): [True: 166k, False: 3.46k]
  ------------------
  223|   166k|    bool b = c.general_constraint_indicator_flags[i];
  224|       |
  225|   166k|    sstr << (b ? 1 : 0);
  ------------------
  |  Branch (225:14): [True: 79.5k, False: 86.7k]
  ------------------
  226|   166k|    cnt++;
  227|   166k|    if ((cnt % 8) == 0)
  ------------------
  |  Branch (227:9): [True: 20.7k, False: 145k]
  ------------------
  228|  20.7k|      sstr << ' ';
  229|   166k|  }
  230|  3.46k|  sstr << "\n";
  231|       |
  232|  3.46k|  sstr << indent << "general_level_idc: " << ((int) c.general_level_idc) << "\n"
  233|  3.46k|       << indent << "min_spatial_segmentation_idc: " << c.min_spatial_segmentation_idc << "\n"
  234|  3.46k|       << indent << "parallelism_type: " << ((int) c.parallelism_type) << "\n"
  235|  3.46k|       << indent << "chroma_format: ";
  236|       |
  237|  3.46k|  switch (c.chroma_format) {
  238|  1.40k|    case 0:
  ------------------
  |  Branch (238:5): [True: 1.40k, False: 2.05k]
  ------------------
  239|  1.40k|      sstr << "monochrome";
  240|  1.40k|      break;
  241|     46|    case 1:
  ------------------
  |  Branch (241:5): [True: 46, False: 3.41k]
  ------------------
  242|     46|      sstr << "4:2:0";
  243|     46|      break;
  244|    520|    case 2:
  ------------------
  |  Branch (244:5): [True: 520, False: 2.94k]
  ------------------
  245|    520|      sstr << "4:2:2";
  246|    520|      break;
  247|  1.49k|    case 3:
  ------------------
  |  Branch (247:5): [True: 1.49k, False: 1.97k]
  ------------------
  248|  1.49k|      sstr << "4:4:4";
  249|  1.49k|      break;
  250|      0|    default:
  ------------------
  |  Branch (250:5): [True: 0, False: 3.46k]
  ------------------
  251|      0|      sstr << ((int) c.chroma_format);
  252|      0|      break;
  253|  3.46k|  }
  254|       |
  255|  3.46k|  sstr << "\n"
  256|  3.46k|       << indent << "bit_depth_luma: " << ((int) c.bit_depth_luma) << "\n"
  257|  3.46k|       << indent << "bit_depth_chroma: " << ((int) c.bit_depth_chroma) << "\n"
  258|  3.46k|       << indent << "avg_frame_rate: " << c.avg_frame_rate << "\n"
  259|  3.46k|       << indent << "constant_frame_rate: " << ((int) c.constant_frame_rate) << "\n"
  260|  3.46k|       << indent << "num_temporal_layers: " << ((int) c.num_temporal_layers) << "\n"
  261|  3.46k|       << indent << "temporal_id_nested: " << ((int) c.temporal_id_nested) << "\n"
  262|  3.46k|       << indent << "length_size: " << ((int) c.m_length_size) << "\n";
  263|       |
  264|  3.99k|  for (const auto& array : c.m_nal_array) {
  ------------------
  |  Branch (264:26): [True: 3.99k, False: 3.46k]
  ------------------
  265|  3.99k|    sstr << indent << "<array>\n";
  266|       |
  267|  3.99k|    indent++;
  268|  3.99k|    sstr << indent << "array_completeness: " << ((int) array.m_array_completeness) << "\n"
  269|  3.99k|         << indent << "NAL_unit_type: " << ((int) array.m_NAL_unit_type) << "\n";
  270|       |
  271|  3.99k|    for (const auto& unit : array.m_nal_units) {
  ------------------
  |  Branch (271:27): [True: 637, False: 3.99k]
  ------------------
  272|       |      //sstr << "  unit with " << unit.size() << " bytes of data\n";
  273|    637|      sstr << indent;
  274|   446k|      for (uint8_t b : unit) {
  ------------------
  |  Branch (274:22): [True: 446k, False: 637]
  ------------------
  275|   446k|        sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  276|   446k|      }
  277|    637|      sstr << "\n";
  278|    637|      sstr << std::dec;
  279|    637|    }
  280|       |
  281|  3.99k|    indent--;
  282|  3.99k|  }
  283|       |
  284|  3.46k|  return sstr.str();
  285|  3.46k|}

_ZN8Box_hvcCC2Ev:
   97|  3.74k|  {
   98|  3.74k|    set_short_type(fourcc("hvcC"));
   99|  3.74k|  }
_ZN8Box_hvc1C2Ev:
  138|    206|  {
  139|    206|    set_short_type(fourcc("hvc1"));
  140|    206|  }
_ZNK8Box_hvcC14debug_box_nameEv:
  106|  3.46k|  const char* debug_box_name() const override { return "HEVC Configuration Item"; }

_ZN8Box_cdef5parseER14BitstreamRangePK20heif_security_limits:
   33|  5.48k|{
   34|  5.48k|  uint16_t channel_count = range.read16();
   35|       |
   36|  5.48k|  if (limits->max_components && channel_count > limits->max_components) {
  ------------------
  |  Branch (36:7): [True: 5.48k, False: 0]
  |  Branch (36:33): [True: 11, False: 5.47k]
  ------------------
   37|     11|    std::stringstream sstr;
   38|     11|    sstr << "cdef box wants to define " << channel_count << " JPEG-2000 channels, but the security limit is set to "
   39|     11|         << limits->max_components << " components";
   40|     11|    return {heif_error_Invalid_input,
   41|     11|            heif_suberror_Security_limit_exceeded,
   42|     11|            sstr.str()};
   43|     11|  }
   44|       |
   45|  5.47k|  if (channel_count > range.get_remaining_bytes() / 6) {
  ------------------
  |  Branch (45:7): [True: 11, False: 5.46k]
  ------------------
   46|     11|    std::stringstream sstr;
   47|     11|    sstr << "cdef box wants to define " << channel_count << " JPEG-2000 channels, but file only contains "
   48|     11|         << range.get_remaining_bytes() / 6 << " components";
   49|     11|    return {heif_error_Invalid_input,
   50|     11|            heif_suberror_End_of_data,
   51|     11|            sstr.str()};
   52|     11|  }
   53|       |
   54|  5.46k|  m_channels.resize(channel_count);
   55|       |
   56|  14.4k|  for (uint16_t i = 0; i < channel_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (56:24): [True: 9.02k, False: 5.46k]
  |  Branch (56:45): [True: 9.02k, False: 0]
  |  Branch (56:63): [True: 9.02k, False: 0]
  ------------------
   57|  9.02k|    Channel channel;
   58|  9.02k|    channel.channel_index = range.read16();
   59|  9.02k|    channel.channel_type = range.read16();
   60|  9.02k|    channel.channel_association = range.read16();
   61|  9.02k|    m_channels[i] = channel;
   62|  9.02k|  }
   63|       |
   64|  5.46k|  return range.get_error();
   65|  5.47k|}
_ZNK8Box_cdef4dumpER6Indent:
   68|  4.49k|{
   69|  4.49k|  std::ostringstream sstr;
   70|  4.49k|  sstr << Box::dump(indent);
   71|       |
   72|  8.56k|  for (const auto& channel : m_channels) {
  ------------------
  |  Branch (72:28): [True: 8.56k, False: 4.49k]
  ------------------
   73|  8.56k|    sstr << indent << "channel_index: " << channel.channel_index
   74|  8.56k|         << ", channel_type: " << channel.channel_type
   75|  8.56k|         << ", channel_association: " << channel.channel_association << "\n";
   76|  8.56k|  }
   77|       |
   78|  4.49k|  return sstr.str();
   79|  4.49k|}
_ZN8Box_cmap5parseER14BitstreamRangePK20heif_security_limits:
  136|  1.15k|{
  137|  5.07M|  while (!range.eof() && !range.error()) {
  ------------------
  |  Branch (137:10): [True: 5.07M, False: 1.15k]
  |  Branch (137:26): [True: 5.07M, False: 0]
  ------------------
  138|  5.07M|    Component component;
  139|  5.07M|    component.component_index = range.read16();
  140|  5.07M|    component.mapping_type = range.read8();
  141|  5.07M|    component.palette_colour = range.read8();
  142|  5.07M|    m_components.push_back(component);
  143|  5.07M|  }
  144|       |
  145|  1.15k|  return range.get_error();
  146|  1.15k|}
_ZNK8Box_cmap4dumpER6Indent:
  150|    813|{
  151|    813|  std::ostringstream sstr;
  152|    813|  sstr << Box::dump(indent);
  153|       |
  154|  4.94M|  for (const auto& component : m_components) {
  ------------------
  |  Branch (154:30): [True: 4.94M, False: 813]
  ------------------
  155|  4.94M|    sstr << indent << "component_index: " << component.component_index
  156|  4.94M|         << ", mapping_type: " << (int) (component.mapping_type)
  157|  4.94M|         << ", palette_colour: " << (int) (component.palette_colour) << "\n";
  158|  4.94M|  }
  159|       |
  160|    813|  return sstr.str();
  161|    813|}
_ZN8Box_pclr5parseER14BitstreamRangePK20heif_security_limits:
  181|  1.10k|{
  182|  1.10k|  uint16_t num_entries = range.read16();
  183|  1.10k|  uint8_t num_palette_columns = range.read8();
  184|  3.79k|  for (uint8_t i = 0; i < num_palette_columns; i++) {
  ------------------
  |  Branch (184:23): [True: 2.69k, False: 1.09k]
  ------------------
  185|  2.69k|    uint8_t bit_depth = range.read8();
  186|  2.69k|    if (bit_depth & 0x80) {
  ------------------
  |  Branch (186:9): [True: 7, False: 2.69k]
  ------------------
  187|      7|      return Error(heif_error_Unsupported_feature,
  188|      7|                   heif_suberror_Unsupported_data_version,
  189|      7|                   "pclr with signed data is not supported");
  190|      7|    }
  191|  2.69k|    if (bit_depth > 16) {
  ------------------
  |  Branch (191:9): [True: 4, False: 2.68k]
  ------------------
  192|      4|      return Error(heif_error_Unsupported_feature,
  193|      4|                   heif_suberror_Unsupported_data_version,
  194|      4|                   "pclr more than 16 bits per channel is not supported");
  195|      4|    }
  196|  2.68k|    m_bitDepths.push_back(bit_depth);
  197|  2.68k|  }
  198|       |  // Number of bytes each palette entry occupies in the box. Used to bound
  199|       |  // num_entries by the data actually present, so a small header cannot force
  200|       |  // a large allocation (analogous to the 'cdef'/'j2kL' checks).
  201|  1.09k|  size_t bytes_per_entry = 0;
  202|  2.68k|  for (uint8_t bd : m_bitDepths) {
  ------------------
  |  Branch (202:19): [True: 2.68k, False: 1.09k]
  ------------------
  203|  2.68k|    bytes_per_entry += (bd <= 8) ? 1 : 2;
  ------------------
  |  Branch (203:24): [True: 2.34k, False: 340]
  ------------------
  204|  2.68k|  }
  205|       |
  206|  1.09k|  if (bytes_per_entry != 0 &&
  ------------------
  |  Branch (206:7): [True: 222, False: 871]
  ------------------
  207|    222|      num_entries > range.get_remaining_bytes() / bytes_per_entry) {
  ------------------
  |  Branch (207:7): [True: 23, False: 199]
  ------------------
  208|     23|    return Error(heif_error_Invalid_input,
  209|     23|                 heif_suberror_End_of_data,
  210|     23|                 "pclr box declares more entries than the box contains");
  211|     23|  }
  212|       |
  213|  1.73M|  for (uint16_t j = 0; j < num_entries; j++) {
  ------------------
  |  Branch (213:24): [True: 1.73M, False: 1.07k]
  ------------------
  214|  1.73M|    PaletteEntry entry;
  215|  1.73M|    for (size_t i = 0; i < m_bitDepths.size(); i++) {
  ------------------
  |  Branch (215:24): [True: 1.75k, False: 1.73M]
  ------------------
  216|  1.75k|      if (m_bitDepths[i] <= 8) {
  ------------------
  |  Branch (216:11): [True: 1.26k, False: 489]
  ------------------
  217|  1.26k|        entry.columns.push_back(range.read8());
  218|  1.26k|      }
  219|    489|      else {
  220|    489|        entry.columns.push_back(range.read16());
  221|    489|      }
  222|  1.75k|    }
  223|  1.73M|    m_entries.push_back(std::move(entry));
  224|  1.73M|  }
  225|       |
  226|  1.07k|  return range.get_error();
  227|  1.09k|}
_ZNK8Box_pclr4dumpER6Indent:
  231|    979|{
  232|    979|  std::ostringstream sstr;
  233|    979|  sstr << Box::dump(indent);
  234|       |
  235|    979|  sstr << indent << "NE: " << m_entries.size();
  236|    979|  sstr << ", NPC: " << (int) get_num_columns();
  237|    979|  sstr << ", B: ";
  238|  1.28k|  for (uint8_t b : m_bitDepths) {
  ------------------
  |  Branch (238:18): [True: 1.28k, False: 979]
  ------------------
  239|  1.28k|    sstr << (int) b << ", ";
  240|  1.28k|  }
  241|       |  // TODO: maybe dump entries too?
  242|    979|  sstr << "\n";
  243|       |
  244|    979|  return sstr.str();
  245|    979|}
_ZN8Box_j2kL5parseER14BitstreamRangePK20heif_security_limits:
  288|    801|{
  289|    801|  uint16_t layer_count = range.read16();
  290|       |
  291|    801|  if (layer_count > range.get_remaining_bytes() / (2+1+2)) {
  ------------------
  |  Branch (291:7): [True: 10, False: 791]
  ------------------
  292|     10|    std::stringstream sstr;
  293|     10|    sstr << "j2kL box wants to define " << layer_count << "JPEG-2000 layers, but the box only contains "
  294|     10|         << range.get_remaining_bytes() / (2 + 1 + 2) << " layers entries";
  295|     10|    return {heif_error_Invalid_input,
  296|     10|            heif_suberror_End_of_data,
  297|     10|            sstr.str()};
  298|     10|  }
  299|       |
  300|    791|  m_layers.resize(layer_count);
  301|       |
  302|   651k|  for (int i = 0; i < layer_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (302:19): [True: 650k, False: 791]
  |  Branch (302:38): [True: 650k, False: 0]
  |  Branch (302:56): [True: 650k, False: 0]
  ------------------
  303|   650k|    Layer layer;
  304|   650k|    layer.layer_id = range.read16();
  305|   650k|    layer.discard_levels = range.read8();
  306|   650k|    layer.decode_layers = range.read16();
  307|   650k|    m_layers[i] = layer;
  308|   650k|  }
  309|       |
  310|    791|  if (range.get_error()) {
  ------------------
  |  Branch (310:7): [True: 2, False: 789]
  ------------------
  311|      2|    m_layers.clear();
  312|      2|  }
  313|       |
  314|    791|  return range.get_error();
  315|    801|}
_ZNK8Box_j2kL4dumpER6Indent:
  318|    680|{
  319|    680|  std::ostringstream sstr;
  320|    680|  sstr << Box::dump(indent);
  321|       |
  322|   650k|  for (const auto& layer : m_layers) {
  ------------------
  |  Branch (322:26): [True: 650k, False: 680]
  ------------------
  323|   650k|    sstr << indent << "layer_id: " << layer.layer_id
  324|   650k|         << ", discard_levels: " << (int) (layer.discard_levels)
  325|   650k|         << ", decode_layers: " << layer.decode_layers << "\n";
  326|   650k|  }
  327|       |
  328|    680|  return sstr.str();
  329|    680|}
_ZN8Box_j2kH5parseER14BitstreamRangePK20heif_security_limits:
  350|  6.21k|{
  351|  6.21k|  return read_children(range, READ_CHILDREN_ALL, limits);
  352|  6.21k|}
_ZNK8Box_j2kH4dumpER6Indent:
  355|  5.53k|{
  356|  5.53k|  std::ostringstream sstr;
  357|  5.53k|  sstr << Box::dump(indent);
  358|       |
  359|  5.53k|  sstr << dump_children(indent);
  360|       |
  361|  5.53k|  return sstr.str();
  362|  5.53k|}

_ZN8Box_j2kHC2Ev:
  314|  6.21k|    Box_j2kH() { set_short_type(fourcc("j2kH")); }
_ZN8Box_cdefC2Ev:
   57|  5.48k|    Box_cdef() { set_short_type(fourcc("cdef")); }
_ZN8Box_cmapC2Ev:
  141|  1.16k|    Box_cmap() { set_short_type(fourcc("cmap")); }
_ZN8Box_pclrC2Ev:
  186|  1.10k|    {
  187|  1.10k|        set_short_type(fourcc("pclr"));
  188|  1.10k|    }
_ZN8Box_j2kLC2Ev:
  269|    803|    Box_j2kL() { set_short_type(fourcc("j2kL")); }
_ZN8Box_j2kiC2Ev:
  527|    131|  {
  528|    131|    set_short_type(fourcc("j2ki"));
  529|    131|  }
_ZNK8Box_pclr15get_num_columnsEv:
  227|    979|    {
  228|    979|        return (uint8_t)(m_bitDepths.size());
  229|    979|    }

_ZNK8Box_jpgC4dumpER6Indent:
   42|  5.42k|{
   43|  5.42k|  std::ostringstream sstr;
   44|  5.42k|  sstr << Box::dump(indent);
   45|       |
   46|  5.42k|  sstr << indent << "num bytes: " << m_data.size() << "\n";
   47|       |
   48|  5.42k|  return sstr.str();
   49|  5.42k|}
_ZN8Box_jpgC5parseER14BitstreamRangePK20heif_security_limits:
   65|  5.62k|{
   66|  5.62k|  if (!has_fixed_box_size()) {
  ------------------
  |  Branch (66:7): [True: 2, False: 5.62k]
  ------------------
   67|      2|    return Error{heif_error_Unsupported_feature, heif_suberror_Unspecified, "jpgC with unspecified size are not supported"};
   68|      2|  }
   69|       |
   70|  5.62k|  size_t nBytes = range.get_remaining_bytes();
   71|  5.62k|  if (limits->max_memory_block_size && nBytes > limits->max_memory_block_size) {
  ------------------
  |  Branch (71:7): [True: 5.62k, False: 0]
  |  Branch (71:40): [True: 0, False: 5.62k]
  ------------------
   72|      0|    return Error{heif_error_Invalid_input, heif_suberror_Unspecified, "jpgC block exceeds maximum size"};
   73|      0|  }
   74|       |
   75|  5.62k|  m_data.resize(nBytes);
   76|  5.62k|  range.read(m_data.data(), nBytes);
   77|  5.62k|  return range.get_error();
   78|  5.62k|}

_ZN8Box_jpgCC2Ev:
   36|  5.62k|  {
   37|  5.62k|    set_short_type(fourcc("jpgC"));
   38|  5.62k|  }
_ZN8Box_mjpgC2Ev:
   60|    115|  {
   61|    115|    set_short_type(fourcc("mjpg"));
   62|    115|  }

_Z25is_valid_component_formath:
   43|  2.54k|{
   44|  2.54k|  return format <= component_format_max_valid;
   45|  2.54k|}
_Z24is_valid_interleave_modeh:
   62|    622|{
   63|    622|  return interleave <= interleave_mode_max_valid;
   64|    622|}
_Z22is_valid_sampling_modeh:
   83|    624|{
   84|    624|  return sampling <= sampling_mode_max_valid;
   85|    624|}
_Z28is_predefined_component_typet:
   96|  7.80k|{
   97|       |  // check whether the component type can be mapped to heif_uncompressed_component_type and we have a name defined for
   98|       |  // it in sNames_uncompressed_component_type.
   99|  7.80k|  return type <= heif_cmpd_component_type_max_valid;
  ------------------
  |  |   29|  7.80k|#define heif_cmpd_component_type_max_valid heif_cmpd_component_type_key_black
  ------------------
  100|  7.80k|}
_ZN8Box_cmpd5parseER14BitstreamRangePK20heif_security_limits:
  144|    988|{
  145|    988|  uint32_t component_count = range.read32();
  146|       |
  147|    988|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (147:7): [True: 988, False: 0]
  |  Branch (147:33): [True: 46, False: 942]
  ------------------
  148|     46|    std::stringstream sstr;
  149|     46|    sstr << "cmpd box should contain " << component_count << " components, but security limit is set to "
  150|     46|         << limits->max_components << " components";
  151|       |
  152|     46|    return {heif_error_Invalid_input,
  153|     46|            heif_suberror_Security_limit_exceeded,
  154|     46|            sstr.str()
  155|     46|    };
  156|     46|  }
  157|       |
  158|  10.9k|  for (unsigned int i = 0; i < component_count ; i++) {
  ------------------
  |  Branch (158:28): [True: 10.1k, False: 880]
  ------------------
  159|  10.1k|    if (range.eof()) {
  ------------------
  |  Branch (159:9): [True: 62, False: 10.0k]
  ------------------
  160|     62|      std::stringstream sstr;
  161|     62|      sstr << "cmpd box should contain " << component_count << " components, but box only contained "
  162|     62|           << i << " components";
  163|       |
  164|     62|      return {heif_error_Invalid_input,
  165|     62|              heif_suberror_End_of_data,
  166|     62|              sstr.str()
  167|     62|      };
  168|     62|    }
  169|       |
  170|  10.0k|    Component component;
  171|  10.0k|    component.component_type = range.read16();
  172|  10.0k|    if (component.component_type >= 0x8000) {
  ------------------
  |  Branch (172:9): [True: 2.16k, False: 7.88k]
  ------------------
  173|  2.16k|      component.component_type_uri = range.read_string();
  174|  2.16k|    }
  175|  7.88k|    else {
  176|  7.88k|      component.component_type_uri = std::string();
  177|  7.88k|    }
  178|  10.0k|    m_components.push_back(component);
  179|  10.0k|  }
  180|       |
  181|    880|  return range.get_error();
  182|    942|}
_ZN8Box_cmpd9Component23get_component_type_nameEt:
  185|  7.80k|{
  186|  7.80k|  std::stringstream sstr;
  187|       |
  188|  7.80k|  if (is_predefined_component_type(component_type)) {
  ------------------
  |  Branch (188:7): [True: 3.51k, False: 4.28k]
  ------------------
  189|  3.51k|    sstr << get_name(heif_cmpd_component_type(component_type), sNames_uncompressed_component_type) << "\n";
  190|  3.51k|  }
  191|  4.28k|  else {
  192|  4.28k|    sstr << "0x" << std::hex << component_type << std::dec << "\n";
  193|  4.28k|  }
  194|       |
  195|  7.80k|  return sstr.str();
  196|  7.80k|}
_ZNK8Box_cmpd4dumpER6Indent:
  207|    810|{
  208|    810|  std::ostringstream sstr;
  209|    810|  sstr << Box::dump(indent);
  210|       |
  211|  7.80k|  for (const auto& component : m_components) {
  ------------------
  |  Branch (211:30): [True: 7.80k, False: 810]
  ------------------
  212|  7.80k|    sstr << indent << "component_type: " << component.get_component_type_name();
  213|       |
  214|  7.80k|    if (component.component_type >= 0x8000) {
  ------------------
  |  Branch (214:9): [True: 1.33k, False: 6.46k]
  ------------------
  215|  1.33k|      sstr << indent << "| component_type_uri: " << component.component_type_uri << "\n";
  216|  1.33k|    }
  217|  7.80k|  }
  218|       |
  219|    810|  return sstr.str();
  220|    810|}
_ZN8Box_uncC5parseER14BitstreamRangePK20heif_security_limits:
  240|  3.30k|{
  241|  3.30k|  parse_full_box_header(range);
  242|       |
  243|  3.30k|  m_profile = range.read32();
  244|       |
  245|  3.30k|  if (get_version() == 1) {
  ------------------
  |  Branch (245:7): [True: 2.39k, False: 910]
  ------------------
  246|  2.39k|    switch (m_profile) {
  247|    101|      case fourcc("rgb3"):
  ------------------
  |  Branch (247:7): [True: 101, False: 2.29k]
  ------------------
  248|    170|      case fourcc("rgba"):
  ------------------
  |  Branch (248:7): [True: 69, False: 2.32k]
  ------------------
  249|    293|      case fourcc("abgr"):
  ------------------
  |  Branch (249:7): [True: 123, False: 2.27k]
  ------------------
  250|    359|      case fourcc("2vuy"):
  ------------------
  |  Branch (250:7): [True: 66, False: 2.33k]
  ------------------
  251|  1.01k|      case fourcc("yuv2"):
  ------------------
  |  Branch (251:7): [True: 654, False: 1.74k]
  ------------------
  252|  1.06k|      case fourcc("yvyu"):
  ------------------
  |  Branch (252:7): [True: 49, False: 2.34k]
  ------------------
  253|  1.18k|      case fourcc("vyuy"):
  ------------------
  |  Branch (253:7): [True: 123, False: 2.27k]
  ------------------
  254|  1.29k|      case fourcc("yuv1"):
  ------------------
  |  Branch (254:7): [True: 114, False: 2.28k]
  ------------------
  255|  1.49k|      case fourcc("v308"):
  ------------------
  |  Branch (255:7): [True: 198, False: 2.19k]
  ------------------
  256|  1.56k|      case fourcc("v408"):
  ------------------
  |  Branch (256:7): [True: 66, False: 2.33k]
  ------------------
  257|  1.63k|      case fourcc("y210"):
  ------------------
  |  Branch (257:7): [True: 71, False: 2.32k]
  ------------------
  258|  1.64k|      case fourcc("v410"):
  ------------------
  |  Branch (258:7): [True: 10, False: 2.38k]
  ------------------
  259|  1.66k|      case fourcc("v210"):
  ------------------
  |  Branch (259:7): [True: 18, False: 2.37k]
  ------------------
  260|  1.73k|      case fourcc("i420"):
  ------------------
  |  Branch (260:7): [True: 71, False: 2.32k]
  ------------------
  261|  1.80k|      case fourcc("nv12"):
  ------------------
  |  Branch (261:7): [True: 67, False: 2.32k]
  ------------------
  262|  1.86k|      case fourcc("nv21"):
  ------------------
  |  Branch (262:7): [True: 66, False: 2.33k]
  ------------------
  263|  1.90k|      case fourcc("yu22"):
  ------------------
  |  Branch (263:7): [True: 34, False: 2.36k]
  ------------------
  264|  1.96k|      case fourcc("yv22"):
  ------------------
  |  Branch (264:7): [True: 68, False: 2.32k]
  ------------------
  265|  2.00k|      case fourcc("yv20"):
  ------------------
  |  Branch (265:7): [True: 34, False: 2.36k]
  ------------------
  266|  2.00k|        break;
  267|    394|      default:
  ------------------
  |  Branch (267:7): [True: 394, False: 2.00k]
  ------------------
  268|    394|        return Error{heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Unknown uncC v1 profile"};
  269|  2.39k|    }
  270|  2.39k|  } else if (get_version() == 0) {
  ------------------
  |  Branch (270:14): [True: 658, False: 252]
  ------------------
  271|       |
  272|    658|    uint32_t component_count = range.read32();
  273|       |
  274|    658|    if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (274:9): [True: 658, False: 0]
  |  Branch (274:35): [True: 20, False: 638]
  ------------------
  275|     20|      std::stringstream sstr;
  276|     20|      sstr << "Number of image components (" << component_count << ") exceeds security limit ("
  277|     20|           << limits->max_components << ")";
  278|       |
  279|     20|      return {heif_error_Invalid_input,
  280|     20|              heif_suberror_Security_limit_exceeded,
  281|     20|              sstr.str()};
  282|     20|    }
  283|       |
  284|  3.17k|    for (uint32_t i = 0; i < component_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (284:26): [True: 2.58k, False: 590]
  |  Branch (284:49): [True: 2.56k, False: 20]
  |  Branch (284:67): [True: 2.54k, False: 14]
  ------------------
  285|  2.54k|      Component component;
  286|  2.54k|      component.component_index = range.read16();
  287|  2.54k|      component.component_bit_depth = uint16_t(range.read8() + 1);
  288|  2.54k|      component.component_format = range.read8();
  289|  2.54k|      component.component_align_size = range.read8();
  290|  2.54k|      m_components.push_back(component);
  291|       |
  292|  2.54k|      if (!is_valid_component_format(component.component_format)) {
  ------------------
  |  Branch (292:11): [True: 12, False: 2.53k]
  ------------------
  293|     12|        return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid component format"};
  294|     12|      }
  295|       |
  296|       |      // When component_align_size != 0, the component is padded up to that many bytes.
  297|       |      // It therefore must be large enough to hold the component's bit depth; otherwise
  298|       |      // the decoder computes a negative pad-bits count and shifts by a negative amount.
  299|  2.53k|      if (component.component_align_size != 0 &&
  ------------------
  |  Branch (299:11): [True: 639, False: 1.89k]
  ------------------
  300|    639|          uint32_t(component.component_align_size) * 8 < component.component_bit_depth) {
  ------------------
  |  Branch (300:11): [True: 2, False: 637]
  ------------------
  301|      2|        std::stringstream sstr;
  302|      2|        sstr << "Component alignment (" << int(component.component_align_size)
  303|      2|             << " bytes) is too small for component bit depth (" << component.component_bit_depth << " bits)";
  304|      2|        return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, sstr.str()};
  305|      2|      }
  306|  2.53k|    }
  307|       |
  308|    624|    m_sampling_type = range.read8();
  309|    624|    if (!is_valid_sampling_mode(m_sampling_type)) {
  ------------------
  |  Branch (309:9): [True: 2, False: 622]
  ------------------
  310|      2|      return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid sampling mode"};
  311|      2|    }
  312|       |
  313|    622|    m_interleave_type = range.read8();
  314|    622|    if (!is_valid_interleave_mode(m_interleave_type)) {
  ------------------
  |  Branch (314:9): [True: 5, False: 617]
  ------------------
  315|      5|      return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid interleave mode"};
  316|      5|    }
  317|       |
  318|    617|    m_block_size = range.read8();
  319|       |
  320|    617|    uint8_t flags = range.read8();
  321|    617|    m_components_little_endian = !!(flags & 0x80);
  322|    617|    m_block_pad_lsb = !!(flags & 0x40);
  323|    617|    m_block_little_endian = !!(flags & 0x20);
  324|    617|    m_block_reversed = !!(flags & 0x10);
  325|    617|    m_pad_unknown = !!(flags & 0x08);
  326|       |
  327|    617|    m_pixel_size = range.read32();
  328|       |
  329|    617|    if (limits->version >= 4 &&
  ------------------
  |  Branch (329:9): [True: 617, False: 0]
  ------------------
  330|    617|        limits->max_iso23001_17_pixel_size_bytes != 0 &&
  ------------------
  |  Branch (330:9): [True: 617, False: 0]
  ------------------
  331|    617|        m_pixel_size > limits->max_iso23001_17_pixel_size_bytes) {
  ------------------
  |  Branch (331:9): [True: 47, False: 570]
  ------------------
  332|     47|      std::stringstream sstr;
  333|     47|      sstr << "uncC pixel_size (" << m_pixel_size << " bytes) exceeds security limit of "
  334|     47|           << limits->max_iso23001_17_pixel_size_bytes << " bytes";
  335|     47|      return {heif_error_Memory_allocation_error,
  336|     47|              heif_suberror_Security_limit_exceeded,
  337|     47|              sstr.str()};
  338|     47|    }
  339|       |
  340|    570|    m_row_align_size = range.read32();
  341|       |
  342|    570|    m_tile_align_size = range.read32();
  343|       |
  344|    570|    uint32_t num_tile_cols_minus_one = range.read32();
  345|    570|    uint32_t num_tile_rows_minus_one = range.read32();
  346|       |
  347|       |    // The field is stored as `count - 1`, so 0xFFFFFFFF would mean 2^32 tiles,
  348|       |    // which we cannot represent in our uint32 m_num_tile_cols/rows. Reject this
  349|       |    // before the security-limit check so that disabling the security limit does
  350|       |    // not silently turn this into a divide-by-zero in get_heif_image_tiling().
  351|    570|    if (num_tile_cols_minus_one == 0xFFFFFFFF || num_tile_rows_minus_one == 0xFFFFFFFF) {
  ------------------
  |  Branch (351:9): [True: 1, False: 569]
  |  Branch (351:50): [True: 1, False: 568]
  ------------------
  352|      2|      return {heif_error_Unsupported_feature,
  353|      2|              heif_suberror_Invalid_parameter_value,
  354|      2|              "uncC num_tile_cols/rows_minus_one of 0xFFFFFFFF (2^32 tiles) exceeds the supported range"};
  355|      2|    }
  356|       |
  357|    568|    if (limits->max_number_of_tiles &&
  ------------------
  |  Branch (357:9): [True: 568, False: 0]
  ------------------
  358|    568|        static_cast<uint64_t>(num_tile_cols_minus_one) + 1 > limits->max_number_of_tiles / (static_cast<uint64_t>(num_tile_rows_minus_one) + 1)) {
  ------------------
  |  Branch (358:9): [True: 31, False: 537]
  ------------------
  359|     31|      std::stringstream sstr;
  360|     31|      sstr << "Tiling size "
  361|     31|           << ((uint64_t)num_tile_cols_minus_one + 1) << " x " << ((uint64_t)num_tile_rows_minus_one + 1)
  362|     31|           << " exceeds the maximum allowed number " << limits->max_number_of_tiles << " set as security limit";
  363|     31|      return {heif_error_Memory_allocation_error,
  364|     31|              heif_suberror_Security_limit_exceeded,
  365|     31|              sstr.str()};
  366|     31|    }
  367|       |
  368|    537|    m_num_tile_cols = num_tile_cols_minus_one + 1;
  369|    537|    m_num_tile_rows = num_tile_rows_minus_one + 1;
  370|    537|  }
  371|       |
  372|  2.79k|  return range.get_error();
  373|  3.30k|}
_ZNK8Box_uncC4dumpER6Indent:
  378|  2.49k|{
  379|  2.49k|  std::ostringstream sstr;
  380|  2.49k|  sstr << Box::dump(indent);
  381|       |
  382|  2.49k|  sstr << indent << "profile: " << m_profile;
  383|  2.49k|  if (m_profile != 0) {
  ------------------
  |  Branch (383:7): [True: 2.27k, False: 221]
  ------------------
  384|  2.27k|    sstr << " (" << fourcc_to_string(m_profile) << ")";
  385|  2.27k|  }
  386|  2.49k|  sstr << "\n";
  387|  2.49k|  if (get_version() == 0) {
  ------------------
  |  Branch (387:7): [True: 489, False: 2.00k]
  ------------------
  388|  1.62k|    for (const auto& component : m_components) {
  ------------------
  |  Branch (388:32): [True: 1.62k, False: 489]
  ------------------
  389|  1.62k|      sstr << indent << "component_index: " << component.component_index << "\n";
  390|  1.62k|      indent++;
  391|  1.62k|      sstr << indent << "component_bit_depth: " << (int) component.component_bit_depth << "\n";
  392|  1.62k|      sstr << indent << "component_format: " << get_name(heif_uncompressed_component_format(component.component_format), sNames_uncompressed_component_format) << "\n";
  393|  1.62k|      sstr << indent << "component_align_size: " << (int) component.component_align_size << "\n";
  394|  1.62k|      indent--;
  395|  1.62k|    }
  396|       |
  397|    489|    sstr << indent << "sampling_type: " << get_name(heif_uncompressed_sampling_mode(m_sampling_type), sNames_uncompressed_sampling_mode) << "\n";
  398|       |
  399|    489|    sstr << indent << "interleave_type: " << get_name(heif_uncompressed_interleave_mode(m_interleave_type), sNames_uncompressed_interleave_mode) << "\n";
  400|       |
  401|    489|    sstr << indent << "block_size: " << (int) m_block_size << "\n";
  402|       |
  403|    489|    sstr << indent << "components_little_endian: " << m_components_little_endian << "\n";
  404|    489|    sstr << indent << "block_pad_lsb: " << m_block_pad_lsb << "\n";
  405|    489|    sstr << indent << "block_little_endian: " << m_block_little_endian << "\n";
  406|    489|    sstr << indent << "block_reversed: " << m_block_reversed << "\n";
  407|    489|    sstr << indent << "pad_unknown: " << m_pad_unknown << "\n";
  408|       |
  409|    489|    sstr << indent << "pixel_size: " << m_pixel_size << "\n";
  410|       |
  411|    489|    sstr << indent << "row_align_size: " << m_row_align_size << "\n";
  412|       |
  413|    489|    sstr << indent << "tile_align_size: " << m_tile_align_size << "\n";
  414|       |
  415|    489|    sstr << indent << "num_tile_cols: " << m_num_tile_cols << "\n";
  416|       |
  417|    489|    sstr << indent << "num_tile_rows: " << m_num_tile_rows << "\n";
  418|    489|  }
  419|  2.49k|  return sstr.str();
  420|  2.49k|}
_ZN8Box_cmpC5parseER14BitstreamRangePK20heif_security_limits:
  750|    624|{
  751|    624|  parse_full_box_header(range);
  752|       |
  753|    624|  if (get_version() != 0) {
  ------------------
  |  Branch (753:7): [True: 7, False: 617]
  ------------------
  754|      7|    return unsupported_version_error("cmpC");
  755|      7|  }
  756|       |
  757|    617|  m_compression_type = range.read32();
  758|       |
  759|    617|  uint8_t unit_type = range.read8();
  760|    617|  if (unit_type > heif_cmpC_compressed_unit_type_image_pixel) {
  ------------------
  |  Branch (760:7): [True: 5, False: 612]
  ------------------
  761|      5|    return {heif_error_Invalid_input,
  762|      5|            heif_suberror_Unsupported_parameter,
  763|      5|            "Unsupported cmpC compressed unit type"};
  764|    612|  };
  765|       |
  766|    612|  m_compressed_unit_type = static_cast<heif_cmpC_compressed_unit_type>(unit_type);
  767|       |
  768|    612|  return range.get_error();
  769|    617|}
_ZNK8Box_cmpC4dumpER6Indent:
  773|    468|{
  774|    468|  std::ostringstream sstr;
  775|    468|  sstr << Box::dump(indent);
  776|    468|  sstr << indent << "compression_type: " << fourcc_to_string(m_compression_type) << "\n";
  777|    468|  sstr << indent << "compressed_entity_type: " << (int)m_compressed_unit_type << "\n";
  778|    468|  return sstr.str();
  779|    468|}
_ZN8Box_icef5parseER14BitstreamRangePK20heif_security_limits:
  798|    690|{
  799|    690|  parse_full_box_header(range);
  800|       |
  801|    690|  if (get_version() != 0) {
  ------------------
  |  Branch (801:7): [True: 1, False: 689]
  ------------------
  802|      1|    return unsupported_version_error("icef");
  803|      1|  }
  804|    689|  uint8_t codes = range.read8();
  805|    689|  uint8_t unit_offset_code = (codes & 0b11100000) >> 5;
  806|    689|  uint8_t unit_size_code = (codes & 0b00011100) >> 2;
  807|    689|  uint32_t num_compressed_units = range.read32();
  808|    689|  uint64_t implied_offset = 0;
  809|       |
  810|    689|  if (unit_offset_code > 4) {
  ------------------
  |  Branch (810:7): [True: 3, False: 686]
  ------------------
  811|      3|    return {heif_error_Usage_error, heif_suberror_Unsupported_parameter, "Unsupported icef unit offset code"};
  812|      3|  }
  813|       |
  814|    686|  if (unit_size_code > 4) {
  ------------------
  |  Branch (814:7): [True: 1, False: 685]
  ------------------
  815|      1|    return {heif_error_Usage_error, heif_suberror_Unsupported_parameter, "Unsupported icef unit size code"};
  816|      1|  }
  817|       |
  818|       |  // --- precompute fields lengths
  819|       |
  820|    685|  uint8_t unit_offset_bits = unit_offset_bits_table[unit_offset_code];
  821|    685|  uint8_t unit_size_bits = unit_size_bits_table[unit_size_code];
  822|       |
  823|       |  // --- check if box is large enough for all the data
  824|       |
  825|       |  // range.get_remaining_bytes() is bounded by the real file size: Box::read() rejects any box whose
  826|       |  // declared size exceeds either the bytes actually available in the file (wait_for_available_bytes())
  827|       |  // or the parent box's remaining bytes. So this check already prevents an unbounded allocation:
  828|       |  // num_compressed_units cannot exceed the bytes present in the file.
  829|       |  // It is, however, not sufficient on its own. With unit_offset_code==0 and unit_size_code==0 a unit
  830|       |  // occupies only 1 byte in the file but allocates a 16-byte CompressedUnitInfo, a ~16x amplification
  831|       |  // that bypasses the configured memory budget. The alloc() below therefore additionally enforces the
  832|       |  // security limits (mirroring Box_snuc).
  833|       |
  834|    685|  uint64_t data_size_bytes = static_cast<uint64_t>(num_compressed_units) * (unit_offset_bits + unit_size_bits) / 8;
  835|    685|  if (data_size_bytes > range.get_remaining_bytes()) {
  ------------------
  |  Branch (835:7): [True: 44, False: 641]
  ------------------
  836|     44|    uint64_t contained_units = range.get_remaining_bytes() / ((unit_offset_bits + unit_size_bits) * 8);
  837|     44|    std::stringstream sstr;
  838|     44|    sstr << "icef box declares " << num_compressed_units << " units, but only " << contained_units
  839|     44|         << " were contained in the file";
  840|     44|    return {heif_error_Invalid_input,
  841|     44|            heif_suberror_End_of_data,
  842|     44|            sstr.str()};
  843|     44|  }
  844|       |
  845|       |  // --- read box content
  846|       |
  847|    641|  if (auto err = m_memory_handle.alloc(num_compressed_units, sizeof(CompressedUnitInfo),
  ------------------
  |  Branch (847:12): [True: 0, False: 641]
  ------------------
  848|    641|                                       limits, "icef box compressed unit infos")) {
  849|      0|    return err;
  850|      0|  }
  851|       |
  852|    641|  m_unit_infos.resize(num_compressed_units);
  853|       |
  854|   434k|  for (uint32_t r = 0; r < num_compressed_units; r++) {
  ------------------
  |  Branch (854:24): [True: 433k, False: 629]
  ------------------
  855|   433k|    CompressedUnitInfo unitInfo;
  856|   433k|    if (unit_offset_code == 0) {
  ------------------
  |  Branch (856:9): [True: 433k, False: 442]
  ------------------
  857|   433k|      unitInfo.unit_offset = implied_offset;
  858|   433k|    } else {
  859|    442|      unitInfo.unit_offset = range.read_uint(unit_offset_bits);
  860|    442|    }
  861|       |
  862|   433k|    unitInfo.unit_size = range.read_uint(unit_size_bits);
  863|       |
  864|       |    // Reject unit_offset + unit_size wrapping past the 64 bit range.
  865|   433k|    if (unitInfo.unit_size >= UINT64_MAX - unitInfo.unit_offset) {
  ------------------
  |  Branch (865:9): [True: 12, False: 433k]
  ------------------
  866|     12|      return {heif_error_Invalid_input,
  867|     12|              heif_suberror_Invalid_parameter_value,
  868|     12|              "icef unit offset + size exceeds 64 bit range"};
  869|     12|    }
  870|       |
  871|       |    // implied_offset is only used as unit_offset when unit_offset_code==0.
  872|       |    // Accumulating it for other offset codes would be unused and could overflow, so only do it if needed.
  873|   433k|    if (unit_offset_code == 0) {
  ------------------
  |  Branch (873:9): [True: 433k, False: 441]
  ------------------
  874|   433k|      implied_offset += unitInfo.unit_size;
  875|   433k|    }
  876|       |
  877|   433k|    if (range.get_error() != Error::Ok) {
  ------------------
  |  Branch (877:9): [True: 0, False: 433k]
  ------------------
  878|      0|      return range.get_error();
  879|      0|    }
  880|       |
  881|   433k|    m_unit_infos[r] = unitInfo;
  882|   433k|  }
  883|       |
  884|    629|  return range.get_error();
  885|    641|}
_ZNK8Box_icef4dumpER6Indent:
  889|    576|{
  890|    576|  std::ostringstream sstr;
  891|    576|  sstr << Box::dump(indent);
  892|    576|  sstr << indent << "num_compressed_units: " << m_unit_infos.size() << "\n";
  893|   433k|  for (CompressedUnitInfo unit_info: m_unit_infos) {
  ------------------
  |  Branch (893:36): [True: 433k, False: 576]
  ------------------
  894|   433k|    sstr << indent << "unit_offset: " << unit_info.unit_offset << ", unit_size: " << unit_info.unit_size << "\n";
  895|   433k|  }
  896|    576|  return sstr.str();
  897|    576|}
_ZN8Box_cpat5parseER14BitstreamRangePK20heif_security_limits:
 1014|    623|{
 1015|    623|  parse_full_box_header(range);
 1016|       |
 1017|    623|  if (get_version() != 0) {
  ------------------
  |  Branch (1017:7): [True: 9, False: 614]
  ------------------
 1018|      9|    return unsupported_version_error("cpat");
 1019|      9|  }
 1020|       |
 1021|    614|  m_pattern.pattern_width = range.read16();
 1022|    614|  m_pattern.pattern_height = range.read16();
 1023|       |
 1024|    614|  if (m_pattern.pattern_width == 0 || m_pattern.pattern_height == 0) {
  ------------------
  |  Branch (1024:7): [True: 3, False: 611]
  |  Branch (1024:39): [True: 9, False: 602]
  ------------------
 1025|     12|    return {heif_error_Invalid_input,
 1026|     12|            heif_suberror_Invalid_parameter_value,
 1027|     12|            "Zero Bayer pattern size."};
 1028|     12|  }
 1029|       |
 1030|    602|  auto max_bayer_pattern_size = limits->max_bayer_pattern_pixels;
 1031|    602|  if (max_bayer_pattern_size && m_pattern.pattern_height > max_bayer_pattern_size / m_pattern.pattern_width) {
  ------------------
  |  Branch (1031:7): [True: 602, False: 0]
  |  Branch (1031:33): [True: 18, False: 584]
  ------------------
 1032|     18|    return {heif_error_Invalid_input,
 1033|     18|            heif_suberror_Security_limit_exceeded,
 1034|     18|            "Maximum Bayer pattern size exceeded."};
 1035|     18|  }
 1036|       |
 1037|    584|  size_t num_pixels = size_t{m_pattern.pattern_width} * m_pattern.pattern_height;
 1038|    584|  m_pattern.pixels.resize(num_pixels);
 1039|       |
 1040|  5.29k|  for (size_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1040:22): [True: 4.71k, False: 584]
  ------------------
 1041|  4.71k|    BayerPatternPixelCmpd pixel{};
 1042|  4.71k|    pixel.cmpd_index = range.read32();
 1043|  4.71k|    pixel.component_gain = range.read_float32();
 1044|  4.71k|    m_pattern.pixels[i] = pixel;
 1045|  4.71k|  }
 1046|       |
 1047|    584|  return range.get_error();
 1048|    602|}
_ZNK8Box_cpat4dumpER6Indent:
 1052|    564|{
 1053|    564|  std::ostringstream sstr;
 1054|       |
 1055|    564|  sstr << FullBox::dump(indent);
 1056|    564|  sstr << indent << "pattern_width: " << get_pattern_width() << "\n";
 1057|    564|  sstr << indent << "pattern_height: " << get_pattern_height() << "\n";
 1058|       |
 1059|  2.85k|  for (const auto& pixel : m_pattern.pixels) {
  ------------------
  |  Branch (1059:26): [True: 2.85k, False: 564]
  ------------------
 1060|  2.85k|    sstr << indent << "component index: " << pixel.cmpd_index << ", gain: " << pixel.component_gain << "\n";
 1061|  2.85k|  }
 1062|    564|  return sstr.str();
 1063|    564|}
_ZN8Box_splz5parseER14BitstreamRangePK20heif_security_limits:
 1091|    637|{
 1092|    637|  parse_full_box_header(range);
 1093|       |
 1094|    637|  if (get_version() != 0) {
  ------------------
  |  Branch (1094:7): [True: 3, False: 634]
  ------------------
 1095|      3|    return unsupported_version_error("splz");
 1096|      3|  }
 1097|       |
 1098|    634|  uint32_t component_count = range.read32();
 1099|    634|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1099:7): [True: 634, False: 0]
  |  Branch (1099:33): [True: 50, False: 584]
  ------------------
 1100|     50|    return {heif_error_Invalid_input,
 1101|     50|            heif_suberror_Security_limit_exceeded,
 1102|     50|            "Number of components in splz box exceeds the security limits."};
 1103|     50|  }
 1104|       |
 1105|    584|  m_pattern.component_ids.resize(component_count);
 1106|  3.47k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1106:24): [True: 2.89k, False: 584]
  ------------------
 1107|  2.89k|    m_pattern.component_ids[i] = range.read32();
 1108|  2.89k|  }
 1109|       |
 1110|    584|  m_pattern.pattern_width = range.read16();
 1111|    584|  m_pattern.pattern_height = range.read16();
 1112|       |
 1113|    584|  if (m_pattern.pattern_width == 0 || m_pattern.pattern_height == 0) {
  ------------------
  |  Branch (1113:7): [True: 17, False: 567]
  |  Branch (1113:39): [True: 1, False: 566]
  ------------------
 1114|     18|    return {heif_error_Invalid_input,
 1115|     18|            heif_suberror_Invalid_parameter_value,
 1116|     18|            "Zero polarization pattern size."};
 1117|     18|  }
 1118|       |
 1119|    566|  auto max_pattern_size = limits->max_bayer_pattern_pixels;
 1120|    566|  if (max_pattern_size && m_pattern.pattern_height > max_pattern_size / m_pattern.pattern_width) {
  ------------------
  |  Branch (1120:7): [True: 566, False: 0]
  |  Branch (1120:27): [True: 10, False: 556]
  ------------------
 1121|     10|    return {heif_error_Invalid_input,
 1122|     10|            heif_suberror_Security_limit_exceeded,
 1123|     10|            "Maximum polarization pattern size exceeded."};
 1124|     10|  }
 1125|       |
 1126|    556|  size_t num_pixels = size_t{m_pattern.pattern_width} * m_pattern.pattern_height;
 1127|    556|  m_pattern.polarization_angles.resize(num_pixels);
 1128|       |
 1129|  36.6k|  for (size_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1129:22): [True: 36.0k, False: 556]
  ------------------
 1130|  36.0k|    m_pattern.polarization_angles[i] = range.read_float32();
 1131|  36.0k|  }
 1132|       |
 1133|    556|  return range.get_error();
 1134|    566|}
_ZNK8Box_splz4dumpER6Indent:
 1138|    506|{
 1139|    506|  std::ostringstream sstr;
 1140|       |
 1141|    506|  sstr << FullBox::dump(indent);
 1142|       |
 1143|    506|  sstr << indent << "component_count: " << m_pattern.component_ids.size() << "\n";
 1144|  1.99k|  for (size_t i = 0; i < m_pattern.component_ids.size(); i++) {
  ------------------
  |  Branch (1144:22): [True: 1.48k, False: 506]
  ------------------
 1145|  1.48k|    sstr << indent << "  component_index[" << i << "]: " << m_pattern.component_ids[i] << "\n";
 1146|  1.48k|  }
 1147|       |
 1148|    506|  sstr << indent << "pattern_width: " << m_pattern.pattern_width << "\n";
 1149|    506|  sstr << indent << "pattern_height: " << m_pattern.pattern_height << "\n";
 1150|       |
 1151|  8.88k|  for (uint16_t y = 0; y < m_pattern.pattern_height; y++) {
  ------------------
  |  Branch (1151:24): [True: 8.37k, False: 506]
  ------------------
 1152|  38.4k|    for (uint16_t x = 0; x < m_pattern.pattern_width; x++) {
  ------------------
  |  Branch (1152:26): [True: 30.1k, False: 8.37k]
  ------------------
 1153|  30.1k|      float angle = m_pattern.polarization_angles[y * m_pattern.pattern_width + x];
 1154|  30.1k|      if (heif_polarization_angle_is_no_filter(angle)) {
  ------------------
  |  Branch (1154:11): [True: 936, False: 29.1k]
  ------------------
 1155|    936|        sstr << indent << "  [" << x << "," << y << "]: no filter\n";
 1156|    936|      }
 1157|  29.1k|      else {
 1158|  29.1k|        sstr << indent << "  [" << x << "," << y << "]: " << angle << " degrees\n";
 1159|  29.1k|      }
 1160|  30.1k|    }
 1161|  8.37k|  }
 1162|       |
 1163|    506|  return sstr.str();
 1164|    506|}
_ZN8Box_sbpm5parseER14BitstreamRangePK20heif_security_limits:
 1196|    527|{
 1197|    527|  parse_full_box_header(range);
 1198|       |
 1199|    527|  if (get_version() != 0) {
  ------------------
  |  Branch (1199:7): [True: 1, False: 526]
  ------------------
 1200|      1|    return unsupported_version_error("sbpm");
 1201|      1|  }
 1202|       |
 1203|    526|  uint32_t component_count = range.read32();
 1204|       |
 1205|    526|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1205:7): [True: 526, False: 0]
  |  Branch (1205:33): [True: 41, False: 485]
  ------------------
 1206|     41|    return {heif_error_Invalid_input,
 1207|     41|            heif_suberror_Security_limit_exceeded,
 1208|     41|            "sbpm component_count exceeds security limit."};
 1209|     41|  }
 1210|       |
 1211|    485|  m_map.component_ids.resize(component_count);
 1212|  2.46k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1212:24): [True: 1.98k, False: 485]
  ------------------
 1213|  1.98k|    m_map.component_ids[i] = range.read32();
 1214|  1.98k|  }
 1215|       |
 1216|    485|  uint8_t flags = range.read8();
 1217|    485|  m_map.correction_applied = !!(flags & 0x80);
 1218|       |
 1219|    485|  uint32_t num_bad_rows = range.read32();
 1220|    485|  uint32_t num_bad_cols = range.read32();
 1221|    485|  uint32_t num_bad_pixels = range.read32();
 1222|       |
 1223|       |  // Security check: limit total number of entries
 1224|    485|  uint64_t total_entries = static_cast<uint64_t>(num_bad_rows) + num_bad_cols + num_bad_pixels;
 1225|    485|  if (limits->max_bad_pixels && total_entries > limits->max_bad_pixels) {
  ------------------
  |  Branch (1225:7): [True: 485, False: 0]
  |  Branch (1225:33): [True: 26, False: 459]
  ------------------
 1226|     26|    return {heif_error_Invalid_input,
 1227|     26|            heif_suberror_Security_limit_exceeded,
 1228|     26|            "sbpm total bad pixel entries exceed security limit."};
 1229|     26|  }
 1230|       |
 1231|    459|  m_map.bad_rows.resize(num_bad_rows);
 1232|  4.87k|  for (uint32_t i = 0; i < num_bad_rows; i++) {
  ------------------
  |  Branch (1232:24): [True: 4.41k, False: 459]
  ------------------
 1233|  4.41k|    m_map.bad_rows[i] = range.read32();
 1234|  4.41k|  }
 1235|       |
 1236|    459|  m_map.bad_columns.resize(num_bad_cols);
 1237|  5.89k|  for (uint32_t i = 0; i < num_bad_cols; i++) {
  ------------------
  |  Branch (1237:24): [True: 5.43k, False: 459]
  ------------------
 1238|  5.43k|    m_map.bad_columns[i] = range.read32();
 1239|  5.43k|  }
 1240|       |
 1241|    459|  m_map.bad_pixels.resize(num_bad_pixels);
 1242|  4.71k|  for (uint32_t i = 0; i < num_bad_pixels; i++) {
  ------------------
  |  Branch (1242:24): [True: 4.25k, False: 459]
  ------------------
 1243|  4.25k|    m_map.bad_pixels[i].row = range.read32();
 1244|  4.25k|    m_map.bad_pixels[i].column = range.read32();
 1245|  4.25k|  }
 1246|       |
 1247|    459|  return range.get_error();
 1248|    485|}
_ZNK8Box_sbpm4dumpER6Indent:
 1252|    354|{
 1253|    354|  std::ostringstream sstr;
 1254|       |
 1255|    354|  sstr << FullBox::dump(indent);
 1256|       |
 1257|    354|  sstr << indent << "component_count: " << m_map.component_ids.size() << "\n";
 1258|  1.04k|  for (size_t i = 0; i < m_map.component_ids.size(); i++) {
  ------------------
  |  Branch (1258:22): [True: 691, False: 354]
  ------------------
 1259|    691|    sstr << indent << "  component_index[" << i << "]: " << m_map.component_ids[i] << "\n";
 1260|    691|  }
 1261|       |
 1262|    354|  sstr << indent << "correction_applied: " << m_map.correction_applied << "\n";
 1263|       |
 1264|    354|  sstr << indent << "num_bad_rows: " << m_map.bad_rows.size() << "\n";
 1265|  1.13k|  for (size_t i = 0; i < m_map.bad_rows.size(); i++) {
  ------------------
  |  Branch (1265:22): [True: 776, False: 354]
  ------------------
 1266|    776|    sstr << indent << "  bad_row[" << i << "]: " << m_map.bad_rows[i] << "\n";
 1267|    776|  }
 1268|       |
 1269|    354|  sstr << indent << "num_bad_columns: " << m_map.bad_columns.size() << "\n";
 1270|  1.37k|  for (size_t i = 0; i < m_map.bad_columns.size(); i++) {
  ------------------
  |  Branch (1270:22): [True: 1.01k, False: 354]
  ------------------
 1271|  1.01k|    sstr << indent << "  bad_column[" << i << "]: " << m_map.bad_columns[i] << "\n";
 1272|  1.01k|  }
 1273|       |
 1274|    354|  sstr << indent << "num_bad_pixels: " << m_map.bad_pixels.size() << "\n";
 1275|  1.59k|  for (size_t i = 0; i < m_map.bad_pixels.size(); i++) {
  ------------------
  |  Branch (1275:22): [True: 1.24k, False: 354]
  ------------------
 1276|  1.24k|    sstr << indent << "  bad_pixel[" << i << "]: row=" << m_map.bad_pixels[i].row
 1277|  1.24k|         << ", column=" << m_map.bad_pixels[i].column << "\n";
 1278|  1.24k|  }
 1279|       |
 1280|    354|  return sstr.str();
 1281|    354|}
_ZN8Box_snuc5parseER14BitstreamRangePK20heif_security_limits:
 1320|    430|{
 1321|    430|  parse_full_box_header(range);
 1322|       |
 1323|    430|  if (get_version() != 0) {
  ------------------
  |  Branch (1323:7): [True: 1, False: 429]
  ------------------
 1324|      1|    return unsupported_version_error("snuc");
 1325|      1|  }
 1326|       |
 1327|    429|  uint32_t component_count = range.read32();
 1328|       |
 1329|    429|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1329:7): [True: 429, False: 0]
  |  Branch (1329:33): [True: 44, False: 385]
  ------------------
 1330|     44|    return {heif_error_Invalid_input,
 1331|     44|            heif_suberror_Security_limit_exceeded,
 1332|     44|            "snuc component_count exceeds security limit."};
 1333|     44|  }
 1334|       |
 1335|    385|  m_nuc.component_ids.resize(component_count);
 1336|  3.20k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1336:24): [True: 2.82k, False: 385]
  ------------------
 1337|  2.82k|    m_nuc.component_ids[i] = range.read32();
 1338|  2.82k|  }
 1339|       |
 1340|    385|  uint8_t flags = range.read8();
 1341|    385|  m_nuc.nuc_is_applied = !!(flags & 0x80);
 1342|       |
 1343|    385|  m_nuc.image_width = range.read32();
 1344|    385|  m_nuc.image_height = range.read32();
 1345|       |
 1346|    385|  if (m_nuc.image_width == 0 || m_nuc.image_height == 0) {
  ------------------
  |  Branch (1346:7): [True: 16, False: 369]
  |  Branch (1346:33): [True: 22, False: 347]
  ------------------
 1347|     38|    return {heif_error_Invalid_input,
 1348|     38|            heif_suberror_Invalid_parameter_value,
 1349|     38|            "snuc image width and height must be non-zero."};
 1350|     38|  }
 1351|       |
 1352|    347|  uint64_t num_pixels = static_cast<uint64_t>(m_nuc.image_width) * m_nuc.image_height;
 1353|       |
 1354|    347|  if (limits->max_image_size_pixels && num_pixels > limits->max_image_size_pixels) {
  ------------------
  |  Branch (1354:7): [True: 347, False: 0]
  |  Branch (1354:40): [True: 81, False: 266]
  ------------------
 1355|     81|    return {heif_error_Invalid_input,
 1356|     81|            heif_suberror_Security_limit_exceeded,
 1357|     81|            "snuc image dimensions exceed security limit."};
 1358|     81|  }
 1359|       |
 1360|    266|  Error err = m_memory_handle.alloc(num_pixels, 2 * sizeof(float), limits, "snuc box");
 1361|    266|  if (err) {
  ------------------
  |  Branch (1361:7): [True: 5, False: 261]
  ------------------
 1362|      5|    return err;
 1363|      5|  }
 1364|       |
 1365|    261|  m_nuc.nuc_gains.resize(num_pixels);
 1366|   444M|  for (uint64_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1366:24): [True: 444M, False: 261]
  ------------------
 1367|   444M|    m_nuc.nuc_gains[i] = range.read_float32();
 1368|   444M|  }
 1369|       |
 1370|    261|  m_nuc.nuc_offsets.resize(num_pixels);
 1371|   444M|  for (uint64_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1371:24): [True: 444M, False: 261]
  ------------------
 1372|   444M|    m_nuc.nuc_offsets[i] = range.read_float32();
 1373|   444M|  }
 1374|       |
 1375|    261|  return range.get_error();
 1376|    266|}
_ZNK8Box_snuc4dumpER6Indent:
 1380|    206|{
 1381|    206|  std::ostringstream sstr;
 1382|       |
 1383|    206|  sstr << FullBox::dump(indent);
 1384|       |
 1385|    206|  sstr << indent << "component_count: " << m_nuc.component_ids.size() << "\n";
 1386|  1.72k|  for (size_t i = 0; i < m_nuc.component_ids.size(); i++) {
  ------------------
  |  Branch (1386:22): [True: 1.52k, False: 206]
  ------------------
 1387|  1.52k|    sstr << indent << "  component_index[" << i << "]: " << m_nuc.component_ids[i] << "\n";
 1388|  1.52k|  }
 1389|       |
 1390|    206|  sstr << indent << "nuc_is_applied: " << m_nuc.nuc_is_applied << "\n";
 1391|    206|  sstr << indent << "image_width: " << m_nuc.image_width << "\n";
 1392|    206|  sstr << indent << "image_height: " << m_nuc.image_height << "\n";
 1393|       |
 1394|    206|  uint64_t num_pixels = static_cast<uint64_t>(m_nuc.image_width) * m_nuc.image_height;
 1395|    206|  sstr << indent << "nuc_gains: " << num_pixels << " values\n";
 1396|    206|  sstr << indent << "nuc_offsets: " << num_pixels << " values\n";
 1397|       |
 1398|    206|  return sstr.str();
 1399|    206|}
_ZN8Box_cloc5parseER14BitstreamRangePK20heif_security_limits:
 1432|    215|{
 1433|    215|  parse_full_box_header(range);
 1434|       |
 1435|    215|  if (get_version() != 0) {
  ------------------
  |  Branch (1435:7): [True: 7, False: 208]
  ------------------
 1436|      7|    return unsupported_version_error("cloc");
 1437|      7|  }
 1438|       |
 1439|    208|  m_chroma_location = range.read8();
 1440|       |
 1441|    208|  if (m_chroma_location > 6) {
  ------------------
  |  Branch (1441:7): [True: 1, False: 207]
  ------------------
 1442|      1|    return {heif_error_Invalid_input,
 1443|      1|            heif_suberror_Invalid_parameter_value,
 1444|      1|            "cloc chroma_location value out of range (must be 0-6)."};
 1445|      1|  }
 1446|       |
 1447|    207|  return range.get_error();
 1448|    208|}
_ZNK8Box_cloc4dumpER6Indent:
 1452|    206|{
 1453|    206|  std::ostringstream sstr;
 1454|       |
 1455|    206|  sstr << FullBox::dump(indent);
 1456|       |
 1457|    206|  static const char* location_names[] = {
 1458|    206|    "h=0,   v=0.5",   // 0
 1459|    206|    "h=0.5, v=0.5",   // 1
 1460|    206|    "h=0,   v=0",     // 2
 1461|    206|    "h=0.5, v=0",     // 3
 1462|    206|    "h=0,   v=1",     // 4
 1463|    206|    "h=0.5, v=1",     // 5
 1464|    206|    "Cr:0,0 / Cb:1,0" // 6
 1465|    206|  };
 1466|       |
 1467|    206|  sstr << indent << "chroma_location: " << static_cast<int>(m_chroma_location);
 1468|    206|  if (m_chroma_location <= 6) {
  ------------------
  |  Branch (1468:7): [True: 206, False: 0]
  ------------------
 1469|    206|    sstr << " (" << location_names[m_chroma_location] << ")";
 1470|    206|  }
 1471|    206|  sstr << "\n";
 1472|       |
 1473|    206|  return sstr.str();
 1474|    206|}
_ZN30Box_gimi_component_content_ids5parseER14BitstreamRangePK20heif_security_limits:
 1490|  1.21k|{
 1491|  1.21k|  uint32_t number_of_components = range.read32();
 1492|       |
 1493|  1.21k|  if (limits->max_components && number_of_components > limits->max_components) {
  ------------------
  |  Branch (1493:7): [True: 1.21k, False: 0]
  |  Branch (1493:33): [True: 64, False: 1.14k]
  ------------------
 1494|     64|    std::stringstream sstr;
 1495|     64|    sstr << "GIMI component content IDs box contains " << number_of_components
 1496|     64|         << " components, but security limit is set to " << limits->max_components << " components";
 1497|     64|    return {heif_error_Invalid_input,
 1498|     64|            heif_suberror_Security_limit_exceeded,
 1499|     64|            sstr.str()};
 1500|     64|  }
 1501|       |
 1502|  7.71k|  for (uint32_t i = 0; i < number_of_components; i++) {
  ------------------
  |  Branch (1502:24): [True: 6.68k, False: 1.02k]
  ------------------
 1503|  6.68k|    if (range.eof()) {
  ------------------
  |  Branch (1503:9): [True: 123, False: 6.56k]
  ------------------
 1504|    123|      return {heif_error_Invalid_input,
 1505|    123|              heif_suberror_End_of_data,
 1506|    123|              "Not enough data for all component content IDs"};
 1507|    123|    }
 1508|  6.56k|    m_content_ids.push_back(range.read_string());
 1509|  6.56k|  }
 1510|       |
 1511|  1.02k|  return range.get_error();
 1512|  1.14k|}
_ZNK30Box_gimi_component_content_ids4dumpER6Indent:
 1532|    944|{
 1533|    944|  std::ostringstream sstr;
 1534|    944|  sstr << Box::dump(indent);
 1535|       |
 1536|  5.70k|  for (size_t i = 0; i < m_content_ids.size(); i++) {
  ------------------
  |  Branch (1536:22): [True: 4.76k, False: 944]
  ------------------
 1537|  4.76k|    sstr << indent << "[" << i << "] content ID: " << m_content_ids[i] << "\n";
 1538|  4.76k|  }
 1539|       |
 1540|    944|  return sstr.str();
 1541|    944|}
_Z8get_nameI24heif_cmpd_component_typeEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|  3.51k|{
  124|  3.51k|  auto iter = table.find(val);
  125|  3.51k|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 3.51k]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|  3.51k|  else {
  129|  3.51k|    return iter->second;
  130|  3.51k|  }
  131|  3.51k|}
_Z8get_nameI34heif_uncompressed_component_formatEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|  1.62k|{
  124|  1.62k|  auto iter = table.find(val);
  125|  1.62k|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 1.62k]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|  1.62k|  else {
  129|  1.62k|    return iter->second;
  130|  1.62k|  }
  131|  1.62k|}
_Z8get_nameI31heif_uncompressed_sampling_modeEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|    489|{
  124|    489|  auto iter = table.find(val);
  125|    489|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 489]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|    489|  else {
  129|    489|    return iter->second;
  130|    489|  }
  131|    489|}
_Z8get_nameI33heif_uncompressed_interleave_modeEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|    489|{
  124|    489|  auto iter = table.find(val);
  125|    489|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 489]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|    489|  else {
  129|    489|    return iter->second;
  130|    489|  }
  131|    489|}

_ZN8Box_cmpdC2Ev:
   45|    990|  {
   46|    990|    set_short_type(fourcc("cmpd"));
   47|    990|  }
_ZN8Box_uncCC2Ev:
   90|  3.31k|  Box_uncC() {
   91|  3.31k|    set_short_type(fourcc("uncC"));
   92|  3.31k|  }
_ZN8Box_cmpCC2Ev:
  270|    626|  {
  271|    626|    set_short_type(fourcc("cmpC"));
  272|    626|  }
_ZN8Box_icefC2Ev:
  304|    695|  {
  305|    695|    set_short_type(fourcc("icef"));
  306|    695|  }
_ZN8Box_cpatC2Ev:
  359|    628|  {
  360|    628|    set_short_type(fourcc("cpat"));
  361|    628|  }
_ZN8Box_splzC2Ev:
  394|    642|  Box_splz() { set_short_type(fourcc("splz")); }
_ZN8Box_sbpmC2Ev:
  423|    533|  Box_sbpm() { set_short_type(fourcc("sbpm")); }
_ZN8Box_snucC2Ev:
  449|    432|  Box_snuc() { set_short_type(fourcc("snuc")); }
_ZN8Box_clocC2Ev:
  475|    216|  Box_cloc() { set_short_type(fourcc("cloc")); }
_ZN8Box_uncvC2Ev:
  498|    324|  {
  499|    324|    set_short_type(fourcc("uncv"));
  500|    324|  }
_ZN30Box_gimi_component_content_idsC2Ev:
  516|  1.21k|  {
  517|  1.21k|    set_uuid_type(std::vector<uint8_t>{0x9d, 0xb9, 0xdd, 0x6e, 0x37, 0x3c, 0x5a, 0x4e,
  518|  1.21k|                                       0x81, 0x10, 0x21, 0xfc, 0x83, 0xa9, 0x11, 0xfd});
  519|  1.21k|  }
_ZNK8Box_cmpd9Component23get_component_type_nameEv:
   60|  7.80k|    std::string get_component_type_name() const { return get_component_type_name(component_type); }
_ZNK8Box_cpat17get_pattern_widthEv:
  363|    564|  uint16_t get_pattern_width() const { return m_pattern.pattern_width; }
_ZNK8Box_cpat18get_pattern_heightEv:
  365|    564|  uint16_t get_pattern_height() const { return m_pattern.pattern_height; }
_ZNK30Box_gimi_component_content_ids14debug_box_nameEv:
  527|    944|  const char* debug_box_name() const override { return "GIMI Component Content IDs"; }
_ZNK30Box_gimi_component_content_ids24get_parse_error_fatalityEv:
  533|    188|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }

_ZN8Box_vvcC5parseER14BitstreamRangePK20heif_security_limits:
   34|  1.57k|{
   35|  1.57k|  parse_full_box_header(range);
   36|       |
   37|  1.57k|  uint8_t byte;
   38|       |
   39|  1.57k|  auto& c = m_configuration; // abbreviation
   40|       |
   41|  1.57k|  byte = range.read8();
   42|       |
   43|  1.57k|  c.LengthSizeMinusOne = (byte >> 1) & 3;
   44|  1.57k|  c.ptl_present_flag = !!(byte & 1);
   45|       |
   46|  1.57k|  if (c.ptl_present_flag) {
  ------------------
  |  Branch (46:7): [True: 1.56k, False: 2]
  ------------------
   47|  1.56k|    uint16_t word = range.read16();
   48|  1.56k|    c.ols_idx = (word >> 7) & 0x1FF;
   49|  1.56k|    c.num_sublayers = (word >> 4) & 0x07;
   50|  1.56k|    c.constant_frame_rate = (word >> 2) & 0x03;
   51|  1.56k|    c.chroma_format_idc = word & 0x03;
   52|       |
   53|  1.56k|    byte = range.read8();
   54|  1.56k|    c.bit_depth_minus8 = (byte >> 5) & 0x07;
   55|       |
   56|       |    // VvcPTLRecord
   57|       |
   58|  1.56k|    auto& ptl = c.native_ptl; // abbreviation
   59|       |
   60|  1.56k|    byte = range.read8();
   61|  1.56k|    ptl.num_bytes_constraint_info = byte & 0x3f;
   62|       |
   63|  1.56k|    if (ptl.num_bytes_constraint_info == 0) {
  ------------------
  |  Branch (63:9): [True: 1, False: 1.56k]
  ------------------
   64|      1|      return {heif_error_Invalid_input,
   65|      1|              heif_suberror_Invalid_parameter_value,
   66|      1|              "vvcC with num_bytes_constraint_info==0 is not allowed."};
   67|      1|    }
   68|       |
   69|  1.56k|    byte = range.read8();
   70|  1.56k|    ptl.general_profile_idc = (byte >> 1) & 0x7f;
   71|  1.56k|    ptl.general_tier_flag = (byte & 1);
   72|       |
   73|  1.56k|    ptl.general_level_idc = range.read8();
   74|       |
   75|  10.1k|    for (int i = 0; i < ptl.num_bytes_constraint_info; i++) {
  ------------------
  |  Branch (75:21): [True: 8.55k, False: 1.56k]
  ------------------
   76|  8.55k|      byte = range.read8();
   77|  8.55k|      if (i == 0) {
  ------------------
  |  Branch (77:11): [True: 1.56k, False: 6.98k]
  ------------------
   78|  1.56k|        ptl.ptl_frame_only_constraint_flag = (byte >> 7) & 1;
   79|  1.56k|        ptl.ptl_multi_layer_enabled_flag = (byte >> 6) & 1;
   80|  1.56k|        byte &= 0x3f;
   81|  1.56k|      }
   82|       |
   83|  8.55k|      ptl.general_constraint_info.push_back(byte);
   84|  8.55k|    }
   85|       |
   86|  1.56k|    if (c.num_sublayers > 1) {
  ------------------
  |  Branch (86:9): [True: 572, False: 995]
  ------------------
   87|    572|      ptl.ptl_sublayer_level_present_flag.resize(c.num_sublayers - 1);
   88|       |
   89|    572|      byte = range.read8();
   90|    572|      uint8_t mask = 0x80;
   91|       |
   92|  3.65k|      for (int i = c.num_sublayers - 2; i >= 0; i--) {
  ------------------
  |  Branch (92:41): [True: 3.08k, False: 572]
  ------------------
   93|  3.08k|        ptl.ptl_sublayer_level_present_flag[i] = !!(byte & mask);
   94|  3.08k|        mask >>= 1;
   95|  3.08k|      }
   96|    572|    }
   97|       |
   98|  1.56k|    ptl.sublayer_level_idc.resize(c.num_sublayers);
   99|  1.56k|    if (c.num_sublayers > 0) {
  ------------------
  |  Branch (99:9): [True: 685, False: 882]
  ------------------
  100|    685|      ptl.sublayer_level_idc[c.num_sublayers - 1] = ptl.general_level_idc;
  101|       |
  102|  3.77k|      for (int i = c.num_sublayers - 2; i >= 0; i--) {
  ------------------
  |  Branch (102:41): [True: 3.08k, False: 685]
  ------------------
  103|  3.08k|        if (ptl.ptl_sublayer_level_present_flag[i]) {
  ------------------
  |  Branch (103:13): [True: 724, False: 2.36k]
  ------------------
  104|    724|          ptl.sublayer_level_idc[i] = range.read8();
  105|    724|        }
  106|  2.36k|        else {
  107|  2.36k|          ptl.sublayer_level_idc[i] = ptl.sublayer_level_idc[i + 1];
  108|  2.36k|        }
  109|  3.08k|      }
  110|    685|    }
  111|       |
  112|  1.56k|    uint8_t ptl_num_sub_profiles = range.read8();
  113|  4.67k|    for (int j=0; j < ptl_num_sub_profiles; j++) {
  ------------------
  |  Branch (113:19): [True: 3.10k, False: 1.56k]
  ------------------
  114|  3.10k|      ptl.general_sub_profile_idc.push_back(range.read32());
  115|  3.10k|    }
  116|       |
  117|       |
  118|       |    // remaining fields
  119|       |
  120|  1.56k|    c.max_picture_width = range.read16();
  121|  1.56k|    c.max_picture_height = range.read16();
  122|  1.56k|    c.avg_frame_rate = range.read16();
  123|  1.56k|  }
  124|      2|  else {
  125|      2|    return Error{
  126|      2|      heif_error_Unsupported_feature,
  127|      2|      heif_suberror_Unspecified,
  128|      2|      "Reading vvcC configuration with ptl_present_flag=0 is not supported."
  129|      2|    };
  130|      2|  }
  131|       |
  132|       |  // read NAL arrays
  133|       |
  134|  1.56k|  int nArrays = range.read8();
  135|       |
  136|  5.91k|  for (int i = 0; i < nArrays && !range.error(); i++) {
  ------------------
  |  Branch (136:19): [True: 4.41k, False: 1.49k]
  |  Branch (136:34): [True: 4.34k, False: 71]
  ------------------
  137|  4.34k|    byte = range.read8();
  138|       |
  139|  4.34k|    NalArray array;
  140|       |
  141|  4.34k|    array.m_array_completeness = (byte >> 7) & 1;
  142|  4.34k|    array.m_NAL_unit_type = (byte & 0x3F);
  143|       |
  144|  4.34k|    int nUnits = range.read16();
  145|   271k|    for (int u = 0; u < nUnits && !range.error(); u++) {
  ------------------
  |  Branch (145:21): [True: 267k, False: 4.28k]
  |  Branch (145:35): [True: 267k, False: 62]
  ------------------
  146|       |
  147|   267k|      std::vector<uint8_t> nal_unit;
  148|   267k|      int size = range.read16();
  149|   267k|      if (!size) {
  ------------------
  |  Branch (149:11): [True: 242k, False: 24.5k]
  ------------------
  150|       |        // Ignore empty NAL units.
  151|   242k|        continue;
  152|   242k|      }
  153|       |
  154|  24.5k|      if (range.prepare_read(size)) {
  ------------------
  |  Branch (154:11): [True: 24.4k, False: 40]
  ------------------
  155|  24.4k|        nal_unit.resize(size);
  156|  24.4k|        bool success = range.get_istream()->read((char*) nal_unit.data(), size);
  157|  24.4k|        if (!success) {
  ------------------
  |  Branch (157:13): [True: 0, False: 24.4k]
  ------------------
  158|      0|          return Error{heif_error_Invalid_input, heif_suberror_End_of_data, "error while reading hvcC box"};
  159|      0|        }
  160|  24.4k|      }
  161|       |
  162|  24.5k|      array.m_nal_units.push_back(std::move(nal_unit));
  163|  24.5k|    }
  164|       |
  165|  4.34k|    m_nal_array.push_back(std::move(array));
  166|  4.34k|  }
  167|       |
  168|  1.56k|  return range.get_error();
  169|  1.56k|}
_Z8NAL_nameh:
  354|  3.69k|{
  355|  3.69k|  switch (nal_type) {
  356|    247|    case 12: return "OPI";
  ------------------
  |  Branch (356:5): [True: 247, False: 3.44k]
  ------------------
  357|     10|    case 13: return "DCI";
  ------------------
  |  Branch (357:5): [True: 10, False: 3.68k]
  ------------------
  358|      5|    case 14: return "VPS";
  ------------------
  |  Branch (358:5): [True: 5, False: 3.68k]
  ------------------
  359|    237|    case 15: return "SPS";
  ------------------
  |  Branch (359:5): [True: 237, False: 3.45k]
  ------------------
  360|     19|    case 16: return "PPS";
  ------------------
  |  Branch (360:5): [True: 19, False: 3.67k]
  ------------------
  361|     29|    case 17: return "PREFIX_APS";
  ------------------
  |  Branch (361:5): [True: 29, False: 3.66k]
  ------------------
  362|    426|    case 18: return "SUFFIX_APS";
  ------------------
  |  Branch (362:5): [True: 426, False: 3.26k]
  ------------------
  363|     10|    case 19: return "PH";
  ------------------
  |  Branch (363:5): [True: 10, False: 3.68k]
  ------------------
  364|  2.70k|    default: return "?";
  ------------------
  |  Branch (364:5): [True: 2.70k, False: 983]
  ------------------
  365|  3.69k|  }
  366|  3.69k|}
_ZNK8Box_vvcC4dumpER6Indent:
  370|  1.30k|{
  371|  1.30k|  std::ostringstream sstr;
  372|  1.30k|  sstr << FullBox::dump(indent);
  373|       |
  374|  1.30k|  const auto& c = m_configuration; // abbreviation
  375|       |
  376|  1.30k|  sstr << indent << "NAL length size: " << ((int) c.LengthSizeMinusOne + 1) << "\n";
  377|  1.30k|  if (c.ptl_present_flag) {
  ------------------
  |  Branch (377:7): [True: 1.30k, False: 0]
  ------------------
  378|  1.30k|    const auto& ptl = c.native_ptl;
  379|  1.30k|    sstr << indent << "ols-index: " << c.ols_idx << "\n"
  380|  1.30k|         << indent << "num sublayers: " << ((int) c.num_sublayers) << "\n"
  381|  1.30k|         << indent << "constant frame rate: " << (c.constant_frame_rate == 1 ? "constant" : (c.constant_frame_rate == 2 ? "multi-layer" : "unknown")) << "\n"
  ------------------
  |  Branch (381:51): [True: 688, False: 621]
  |  Branch (381:94): [True: 41, False: 580]
  ------------------
  382|  1.30k|         << indent << "chroma-format: " << vvc_chroma_names[c.chroma_format_idc] << "\n"
  383|  1.30k|         << indent << "bit-depth: " << ((int) c.bit_depth_minus8 + 8) << "\n"
  384|  1.30k|         << indent << "max picture width:  " << c.max_picture_width << "\n"
  385|  1.30k|         << indent << "max picture height: " << c.max_picture_height << "\n";
  386|       |
  387|  1.30k|    sstr << indent << "general profile: " << ((int)ptl.general_profile_idc) << "\n"
  388|  1.30k|         << indent << "tier flag: " << ((int)ptl.general_tier_flag) << "\n"
  389|  1.30k|         << indent << "general level:" << ((int)ptl.general_level_idc) << "\n"
  390|  1.30k|         << indent << "ptl frame only constraint flag: " << ((int)ptl.ptl_frame_only_constraint_flag) << "\n"
  391|  1.30k|         << indent << "ptl multi layer enabled flag: " << ((int)ptl.ptl_multi_layer_enabled_flag) << "\n";
  392|  1.30k|  }
  393|       |
  394|       |
  395|  1.30k|  sstr << indent << "num of arrays: " << m_nal_array.size() << "\n";
  396|       |
  397|  1.30k|  sstr << indent << "config NALs:\n";
  398|  3.69k|  for (const auto& nal_array : m_nal_array) {
  ------------------
  |  Branch (398:30): [True: 3.69k, False: 1.30k]
  ------------------
  399|  3.69k|    indent++;
  400|  3.69k|    sstr << indent << "NAL type: " << ((int)nal_array.m_NAL_unit_type) << " (" << NAL_name(nal_array.m_NAL_unit_type) << ")\n";
  401|  3.69k|    sstr << indent << "array completeness: " << ((int)nal_array.m_array_completeness) << "\n";
  402|       |
  403|  3.98k|    for (const auto& nal : nal_array.m_nal_units) {
  ------------------
  |  Branch (403:26): [True: 3.98k, False: 3.69k]
  ------------------
  404|  3.98k|      indent++;
  405|  3.98k|      std::string ind = indent.get_string();
  406|  3.98k|      sstr << write_raw_data_as_hex(nal.data(), nal.size(), ind, ind);
  407|  3.98k|      indent--;
  408|  3.98k|    }
  409|  3.69k|    indent--;
  410|  3.69k|  }
  411|       |
  412|  1.30k|  return sstr.str();
  413|  1.30k|}

_ZN8Box_vvcCC2Ev:
   36|  1.57k|  {
   37|  1.57k|    set_short_type(fourcc("vvcC"));
   38|  1.57k|  }
_ZN8Box_vvc1C2Ev:
  115|     57|  {
  116|     57|    set_short_type(fourcc("vvc1"));
  117|     57|  }

_Z16fourcc_to_stringj:
  159|   766k|{
  160|   766k|  std::string str("    ");
  161|   766k|  str[0] = static_cast<char>((code >> 24) & 0xFF);
  162|   766k|  str[1] = static_cast<char>((code >> 16) & 0xFF);
  163|   766k|  str[2] = static_cast<char>((code >> 8) & 0xFF);
  164|   766k|  str[3] = static_cast<char>((code >> 0) & 0xFF);
  165|       |
  166|   766k|  return str;
  167|   766k|}

_Z20four_bytes_to_uint32hhhh:
   39|  7.09M|{
   40|  7.09M|  return (static_cast<uint32_t>(msb << 24) |
   41|  7.09M|          static_cast<uint32_t>(b << 16) |
   42|  7.09M|          static_cast<uint32_t>(c << 8) |
   43|  7.09M|          static_cast<uint32_t>(lsb));
   44|  7.09M|}
_Z6fourccPKc:
   53|  1.62M|{
   54|  1.62M|  return four_bytes_to_uint32(static_cast<uint8_t>(id[0]),
   55|  1.62M|                              static_cast<uint8_t>(id[1]),
   56|  1.62M|                              static_cast<uint8_t>(id[2]),
   57|  1.62M|                              static_cast<uint8_t>(id[3]));
   58|  1.62M|}

_ZN11HeifContextC2Ev:
  164|  16.2k|    : m_limits(initial_security_limits()),
  165|  16.2k|      m_memory_tracker(&m_limits)
  166|  16.2k|{
  167|       |  // m_limits must be fully initialized above before its address is passed to the memory tracker.
  168|       |  // (m_limits is declared before m_memory_tracker in context.h, so it is constructed first.)
  169|       |
  170|  16.2k|  reset_to_empty_heif();
  171|  16.2k|}
_ZN11HeifContextD2Ev:
  175|  16.2k|{
  176|       |  // Break circular references between Images (when a faulty input image has circular image references)
  177|  16.2k|  for (auto& it : m_all_images) {
  ------------------
  |  Branch (177:17): [True: 0, False: 16.2k]
  ------------------
  178|      0|    std::shared_ptr<ImageItem> image = it.second;
  179|      0|    image->clear();
  180|      0|  }
  181|  16.2k|}
_ZN11HeifContext19reset_to_empty_heifEv:
  290|  16.2k|{
  291|  16.2k|  m_heif_file = std::make_shared<HeifFile>();
  292|  16.2k|  m_heif_file->set_security_limits(&m_limits);
  293|  16.2k|  m_heif_file->new_empty_file();
  294|       |
  295|  16.2k|  m_all_images.clear();
  296|  16.2k|  m_top_level_images.clear();
  297|  16.2k|  m_primary_image.reset();
  298|  16.2k|}
context.cc:_ZL23initial_security_limitsv:
  150|  16.2k|{
  151|  16.2k|  const char* security_limits_variable = getenv("LIBHEIF_SECURITY_LIMITS");
  152|       |
  153|  16.2k|  if (security_limits_variable && (strcmp(security_limits_variable, "off") == 0 ||
  ------------------
  |  Branch (153:7): [True: 0, False: 16.2k]
  |  Branch (153:36): [True: 0, False: 0]
  ------------------
  154|      0|                                   strcmp(security_limits_variable, "OFF") == 0)) {
  ------------------
  |  Branch (154:36): [True: 0, False: 0]
  ------------------
  155|      0|    return disabled_security_limits;
  156|      0|  }
  157|  16.2k|  else {
  158|  16.2k|    return global_security_limits;
  159|  16.2k|  }
  160|  16.2k|}

_ZN11HeifContext19get_security_limitsEv:
   81|   186k|  [[nodiscard]] heif_security_limits* get_security_limits() { return &m_limits; }

_ZN5ErrorC2Ev:
   58|  32.3k|Error::Error() = default;
_ZN5ErrorC2E15heif_error_code18heif_suberror_codeRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   64|  29.8k|    : error_code(c),
   65|  29.8k|      sub_error_code(sc),
   66|  29.8k|      message(msg)
   67|  29.8k|{
   68|  29.8k|}

_ZNK5ErrorneERKS_:
  103|   763k|  bool operator!=(const Error& other) const { return !(*this == other); }
_ZNK5ErroreqERKS_:
  101|  1.06M|  bool operator==(const Error& other) const { return error_code == other.error_code; }
_ZNK5ErrorcvbEv:
  117|   517k|  explicit operator bool() const { return error_code != heif_error_Ok; }
_ZN6ResultI8FractionEC2ERK5Error:
  141|  3.49k|  Result(const Error& e) : m_data(e) {}
_ZN6ResultI8FractionEC2ES0_:
  139|  3.69k|  Result(T v) : m_data(std::move(v)) {}
_ZNK6ResultI8FractionEcvbEv:
  147|  8.33k|  explicit operator bool() const { return std::holds_alternative<T>(m_data); }
_ZNK6ResultI8FractionE5errorEv:
  171|  1.12k|  {
  172|  1.12k|    if (*this) {
  ------------------
  |  Branch (172:9): [True: 0, False: 1.12k]
  ------------------
  173|      0|      return Error::Ok;
  174|      0|    }
  175|       |
  176|  1.12k|    return std::get<Error>(m_data);
  177|  1.12k|  }
_ZN6ResultI8FractionEdeEv:
  160|  2.67k|  {
  161|  2.67k|    assert(*this);
  ------------------
  |  Branch (161:5): [True: 2.67k, False: 0]
  ------------------
  162|  2.67k|    return std::get<T>(m_data);
  163|  2.67k|  }
_ZN11ErrorBufferC2Ev:
   52|  16.2k|  ErrorBuffer() = default;

_ZN8HeifFileC2Ev:
   68|  16.2k|{
   69|  16.2k|  m_file_layout = std::make_shared<FileLayout>();
   70|  16.2k|}
_ZN8HeifFileD2Ev:
   72|  16.2k|HeifFile::~HeifFile() = default;
_ZN8HeifFile14new_empty_fileEv:
  169|  16.2k|{
  170|       |  //m_input_stream.reset();
  171|  16.2k|  m_top_level_boxes.clear();
  172|       |
  173|  16.2k|  m_ftyp_box = std::make_shared<Box_ftyp>();
  174|  16.2k|  m_top_level_boxes.push_back(m_ftyp_box);
  175|  16.2k|}

_ZN8HeifFile19set_security_limitsEPK20heif_security_limits:
   69|  16.2k|  void set_security_limits(const heif_security_limits* limits) { m_limits = limits; }

_ZN10FileLayoutC2Ev:
   27|  16.2k|{
   28|  16.2k|  auto ftyp = std::make_shared<Box_ftyp>();
   29|  16.2k|  ftyp->set_output_position(0);
   30|  16.2k|  m_boxes.push_back(ftyp);
   31|       |
   32|       |  // TODO: these variables are not used yet
   33|  16.2k|  (void)m_writeMode;
   34|  16.2k|  (void)m_file_size;
   35|  16.2k|}

_ZN8Box_mskC5parseER14BitstreamRangePK20heif_security_limits:
   37|    655|{
   38|    655|  parse_full_box_header(range);
   39|    655|  m_bits_per_pixel = range.read8();
   40|    655|  return range.get_error();
   41|    655|}
_ZNK8Box_mskC4dumpER6Indent:
   44|    475|{
   45|    475|  std::ostringstream sstr;
   46|    475|  sstr << Box::dump(indent);
   47|    475|  sstr << indent << "bits_per_pixel: " << ((int)m_bits_per_pixel) << "\n";
   48|    475|  return sstr.str();
   49|    475|}

_ZN8Box_mskCC2Ev:
   50|    657|  {
   51|    657|    set_short_type(fourcc("mskC"));
   52|    657|  }

_ZN8Box_tilC32init_heif_tiled_image_parametersER27heif_tiled_image_parameters:
  115|    663|{
  116|    663|  params.version = 1;
  117|       |
  118|    663|  params.image_width = 0;
  119|    663|  params.image_height = 0;
  120|    663|  params.tile_width = 0;
  121|    663|  params.tile_height = 0;
  122|    663|  params.compression_format_fourcc = 0;
  123|    663|  params.offset_field_length = 40;
  124|    663|  params.size_field_length = 24;
  125|    663|  params.number_of_extra_dimensions = 0;
  126|       |
  127|  5.30k|  for (uint32_t& dim : params.extra_dimensions) {
  ------------------
  |  Branch (127:22): [True: 5.30k, False: 663]
  ------------------
  128|  5.30k|    dim = 0;
  129|  5.30k|  }
  130|       |
  131|    663|  params.tiles_are_sequential = false;
  132|    663|}
_ZNK8Box_tilC4dumpER6Indent:
  222|    414|{
  223|    414|  std::ostringstream sstr;
  224|       |
  225|    414|  sstr << BoxHeader::dump(indent);
  226|       |
  227|    414|  sstr << indent << "version: " << ((int) get_version()) << "\n"
  228|       |       //<< indent << "image size: " << m_parameters.image_width << "x" << m_parameters.image_height << "\n"
  229|    414|       << indent << "tile size: " << m_parameters.tile_width << "x" << m_parameters.tile_height << "\n"
  230|    414|       << indent << "compression: " << fourcc_to_string(m_parameters.compression_format_fourcc) << "\n"
  231|    414|       << indent << "tiles are sequential: " << (m_parameters.tiles_are_sequential ? "yes" : "no") << "\n"
  ------------------
  |  Branch (231:50): [True: 80, False: 334]
  ------------------
  232|    414|       << indent << "offset field length: " << ((int) m_parameters.offset_field_length) << " bits\n"
  233|    414|       << indent << "size field length: " << ((int) m_parameters.size_field_length) << " bits\n"
  234|    414|       << indent << "number of extra dimensions: " << ((int) m_parameters.number_of_extra_dimensions) << "\n";
  235|       |
  236|    414|  sstr << indent << "tile properties:\n"
  237|    414|       << dump_children(indent, true);
  238|       |
  239|    414|  return sstr.str();
  240|       |
  241|    414|}
_ZN8Box_tilC5parseER14BitstreamRangePK20heif_security_limits:
  245|    662|{
  246|    662|  parse_full_box_header(range);
  247|       |
  248|       |  // Note: actually, we should allow 0 only, but there are a few images around that use version 1.
  249|    662|  if (get_version() > 1) {
  ------------------
  |  Branch (249:7): [True: 7, False: 655]
  ------------------
  250|      7|    std::stringstream sstr;
  251|      7|    sstr << "'tili' image version " << ((int) get_version()) << " is not implemented yet";
  252|       |
  253|      7|    return {heif_error_Unsupported_feature,
  254|      7|            heif_suberror_Unsupported_data_version,
  255|      7|            sstr.str()};
  256|      7|  }
  257|       |
  258|    655|  m_parameters.version = get_version();
  259|       |
  260|    655|  uint32_t flags = get_flags();
  261|       |
  262|    655|  switch (flags & 0x03) {
  ------------------
  |  Branch (262:11): [True: 655, False: 0]
  ------------------
  263|    405|    case 0:
  ------------------
  |  Branch (263:5): [True: 405, False: 250]
  ------------------
  264|    405|      m_parameters.offset_field_length = 32;
  265|    405|      break;
  266|     48|    case 1:
  ------------------
  |  Branch (266:5): [True: 48, False: 607]
  ------------------
  267|     48|      m_parameters.offset_field_length = 40;
  268|     48|      break;
  269|    118|    case 2:
  ------------------
  |  Branch (269:5): [True: 118, False: 537]
  ------------------
  270|    118|      m_parameters.offset_field_length = 48;
  271|    118|      break;
  272|     84|    case 3:
  ------------------
  |  Branch (272:5): [True: 84, False: 571]
  ------------------
  273|     84|      m_parameters.offset_field_length = 64;
  274|     84|      break;
  275|    655|  }
  276|       |
  277|    655|  switch (flags & 0x0c) {
  ------------------
  |  Branch (277:11): [True: 655, False: 0]
  ------------------
  278|    405|    case 0x00:
  ------------------
  |  Branch (278:5): [True: 405, False: 250]
  ------------------
  279|    405|      m_parameters.size_field_length = 0;
  280|    405|      break;
  281|     89|    case 0x04:
  ------------------
  |  Branch (281:5): [True: 89, False: 566]
  ------------------
  282|     89|      m_parameters.size_field_length = 24;
  283|     89|      break;
  284|     68|    case 0x08:
  ------------------
  |  Branch (284:5): [True: 68, False: 587]
  ------------------
  285|     68|      m_parameters.size_field_length = 32;
  286|     68|      break;
  287|     93|    case 0x0c:
  ------------------
  |  Branch (287:5): [True: 93, False: 562]
  ------------------
  288|     93|      m_parameters.size_field_length = 64;
  289|     93|      break;
  290|    655|  }
  291|       |
  292|    655|  m_parameters.tiles_are_sequential = !!(flags & 0x10);
  293|       |
  294|       |
  295|    655|  m_parameters.tile_width = range.read32();
  296|    655|  m_parameters.tile_height = range.read32();
  297|    655|  m_parameters.compression_format_fourcc = range.read32();
  298|       |
  299|    655|  if (m_parameters.tile_width == 0 || m_parameters.tile_height == 0) {
  ------------------
  |  Branch (299:7): [True: 6, False: 649]
  |  Branch (299:39): [True: 38, False: 611]
  ------------------
  300|     44|    return {heif_error_Invalid_input,
  301|     44|            heif_suberror_Unspecified,
  302|     44|            "Tile with zero width or height."};
  303|     44|  }
  304|       |
  305|       |
  306|       |  // --- extra dimensions
  307|       |
  308|    611|  m_parameters.number_of_extra_dimensions = range.read8();
  309|       |
  310|  1.64k|  for (int i = 0; i < m_parameters.number_of_extra_dimensions; i++) {
  ------------------
  |  Branch (310:19): [True: 1.08k, False: 567]
  ------------------
  311|  1.08k|    uint32_t size = range.read32();
  312|       |
  313|  1.08k|    if (size == 0) {
  ------------------
  |  Branch (313:9): [True: 44, False: 1.03k]
  ------------------
  314|     44|      return {heif_error_Invalid_input,
  315|     44|              heif_suberror_Unspecified,
  316|     44|              "'tili' extra dimension may not be zero."};
  317|     44|    }
  318|       |
  319|  1.03k|    if (i < 8) {
  ------------------
  |  Branch (319:9): [True: 533, False: 504]
  ------------------
  320|    533|      m_parameters.extra_dimensions[i] = size;
  321|    533|    }
  322|    504|    else {
  323|       |      // TODO: error: too many dimensions (not supported)
  324|    504|    }
  325|  1.03k|  }
  326|       |
  327|       |  // --- read tile properties
  328|       |
  329|       |  // Check version for backwards compatibility with old format.
  330|       |  // TODO: remove when spec is final and old test images have been converted
  331|    567|  if (get_version() == 0) {
  ------------------
  |  Branch (331:7): [True: 180, False: 387]
  ------------------
  332|    180|    uint8_t num_properties = range.read8();
  333|       |
  334|    180|    Error error = read_children(range, num_properties, limits);
  335|    180|    if (error) {
  ------------------
  |  Branch (335:9): [True: 103, False: 77]
  ------------------
  336|    103|      return error;
  337|    103|    }
  338|    180|  }
  339|       |
  340|    464|  return range.get_error();
  341|    567|}

_ZN8Box_tilCC2Ev:
   54|    663|  {
   55|    663|    set_short_type(fourcc("tilC"));
   56|       |
   57|    663|    init_heif_tiled_image_parameters(m_parameters);
   58|    663|  }

_ZNK6Indent10get_stringEv:
   27|  44.1M|{
   28|  44.1M|  std::stringstream sstr;
   29|       |
   30|   270M|  for (int i = 0; i < get_indent(); i++) {
  ------------------
  |  Branch (30:19): [True: 226M, False: 44.1M]
  ------------------
   31|   226M|    sstr << "| ";
   32|   226M|  }
   33|       |
   34|  44.1M|  return sstr.str();
   35|  44.1M|}
_Z21write_raw_data_as_hexPKhmRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
   41|  64.2k|{
   42|  64.2k|  std::stringstream sstr;
   43|       |
   44|  64.2k|  sstr << std::hex << std::setfill('0');
   45|       |
   46|  11.6M|  for (size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (46:22): [True: 11.6M, False: 64.2k]
  ------------------
   47|  11.6M|    if (i % 16 == 0) {
  ------------------
  |  Branch (47:9): [True: 749k, False: 10.8M]
  ------------------
   48|       |      // start of line
   49|       |
   50|   749k|      if (i == 0) {
  ------------------
  |  Branch (50:11): [True: 42.5k, False: 706k]
  ------------------
   51|  42.5k|        sstr << firstLineIndent;
   52|  42.5k|      }
   53|   706k|      else {
   54|   706k|        sstr << remainingLinesIndent;
   55|   706k|      }
   56|   749k|      sstr << std::setw(4) << i << ": "; // address
   57|   749k|    }
   58|  10.8M|    else if (i % 16 == 8) {
  ------------------
  |  Branch (58:14): [True: 718k, False: 10.1M]
  ------------------
   59|       |      // space in middle
   60|   718k|      sstr << "  ";
   61|   718k|    }
   62|  10.1M|    else {
   63|       |      // space between bytes
   64|  10.1M|      sstr << " ";
   65|  10.1M|    }
   66|       |
   67|  11.6M|    sstr << std::setw(2) << ((int) data[i]);
   68|       |
   69|  11.6M|    if (i % 16 == 15 || i == len - 1) {
  ------------------
  |  Branch (69:9): [True: 709k, False: 10.8M]
  |  Branch (69:25): [True: 39.2k, False: 10.8M]
  ------------------
   70|   749k|      sstr << "\n";
   71|   749k|    }
   72|  11.6M|  }
   73|       |
   74|  64.2k|  return sstr.str();
   75|  64.2k|}

_ZN6IndentC2Ev:
   37|   154k|  Indent() = default;
_ZNK6Indent10get_indentEv:
   39|   270M|  int get_indent() const { return m_indent; }
_ZN6IndentppEi:
   41|  84.0k|  void operator++(int) { m_indent++; }
_ZN6IndentmmEi:
   44|  84.0k|  {
   45|  84.0k|    m_indent--;
   46|  84.0k|    if (m_indent < 0) m_indent = 0;
  ------------------
  |  Branch (46:9): [True: 0, False: 84.0k]
  ------------------
   47|  84.0k|  }
_ZlsRNSt3__113basic_ostreamIcNS_11char_traitsIcEEEERK6Indent:
   57|  44.0M|{
   58|  44.0M|  ostr << indent.get_string();
   59|  44.0M|  return ostr;
   60|  44.0M|}

_ZN8Box_mini5parseER14BitstreamRangePK20heif_security_limits:
   42|  9.36k|{
   43|  9.36k|  uint64_t start_offset = range.get_istream()->get_position();
   44|  9.36k|  std::size_t length = range.get_remaining_bytes();
   45|       |
   46|       |  // Register the payload allocation with the total-memory tracker (also
   47|       |  // checks against max_memory_block_size). The buffer is local to parse(),
   48|       |  // so use a scoped handle that releases the budget when parse() returns.
   49|  9.36k|  MemoryHandle mini_data_handle;
   50|  9.36k|  if (auto err = mini_data_handle.alloc(length, limits, "MinimizedImageBox payload")) {
  ------------------
  |  Branch (50:12): [True: 0, False: 9.36k]
  ------------------
   51|      0|    return err;
   52|      0|  }
   53|       |
   54|  9.36k|  std::vector<uint8_t> mini_data(length);
   55|  9.36k|  if (!range.read(mini_data.data(), mini_data.size())) {
  ------------------
  |  Branch (55:7): [True: 0, False: 9.36k]
  ------------------
   56|      0|    return range.get_error();
   57|      0|  }
   58|       |
   59|  9.36k|  BitReader bits(mini_data.data(), mini_data.size());
   60|       |
   61|  9.36k|  m_version = bits.get_bits8(2);
   62|  9.36k|  m_explicit_codec_types_flag = bits.get_flag();
   63|  9.36k|  m_float_flag = bits.get_flag();
   64|  9.36k|  m_full_range_flag = bits.get_flag();
   65|  9.36k|  m_alpha_flag = bits.get_flag();
   66|  9.36k|  m_explicit_cicp_flag = bits.get_flag();
   67|  9.36k|  m_hdr_flag = bits.get_flag();
   68|  9.36k|  m_icc_flag = bits.get_flag();
   69|  9.36k|  m_exif_flag = bits.get_flag();
   70|  9.36k|  m_xmp_flag = bits.get_flag();
   71|  9.36k|  m_chroma_subsampling = bits.get_bits8(2);
   72|  9.36k|  m_orientation = bits.get_bits8(3) + 1;
   73|       |
   74|  9.36k|  bool large_dimensions_flag = bits.get_flag();
   75|       |  // large_dimensions_flag = !large_dimensions_flag;  // HACK to get old behavior
   76|  9.36k|  m_width = 1 + bits.get_bits32(large_dimensions_flag ? 15 : 7);
  ------------------
  |  Branch (76:33): [True: 3.88k, False: 5.48k]
  ------------------
   77|  9.36k|  m_height = 1 + bits.get_bits32(large_dimensions_flag ? 15 : 7);
  ------------------
  |  Branch (77:34): [True: 3.88k, False: 5.48k]
  ------------------
   78|       |
   79|  9.36k|  if ((m_chroma_subsampling == 1) || (m_chroma_subsampling == 2))
  ------------------
  |  Branch (79:7): [True: 315, False: 9.04k]
  |  Branch (79:38): [True: 4.36k, False: 4.68k]
  ------------------
   80|  4.67k|  {
   81|  4.67k|    m_chroma_is_horizontally_centered = bits.get_flag();
   82|  4.67k|  }
   83|  9.36k|  if (m_chroma_subsampling == 1)
  ------------------
  |  Branch (83:7): [True: 315, False: 9.04k]
  ------------------
   84|    315|  {
   85|    315|    m_chroma_is_vertically_centered = bits.get_flag();
   86|    315|  }
   87|       |
   88|  9.36k|  bool high_bit_depth_flag = false;
   89|  9.36k|  if (m_float_flag)
  ------------------
  |  Branch (89:7): [True: 1.43k, False: 7.92k]
  ------------------
   90|  1.43k|  {
   91|  1.43k|    uint8_t bit_depth_log2 = bits.get_bits8(2) + 4; // [4;6] (7 is reserved)
   92|  1.43k|    if (bit_depth_log2 > 6) {
  ------------------
  |  Branch (92:9): [True: 3, False: 1.43k]
  ------------------
   93|      3|      return {heif_error_Invalid_input,
   94|      3|              heif_suberror_Invalid_mini_box,
   95|      3|              "Reserved float bit_depth_log2 value 7 in MinimizedImageBox"};
   96|      3|    }
   97|  1.43k|    m_bit_depth = (uint8_t)powl(2, (bit_depth_log2)); // [16,32,64]
   98|  1.43k|  }
   99|  7.92k|  else
  100|  7.92k|  {
  101|  7.92k|    high_bit_depth_flag = bits.get_flag();
  102|  7.92k|    if (high_bit_depth_flag)
  ------------------
  |  Branch (102:9): [True: 3.94k, False: 3.97k]
  ------------------
  103|  3.94k|    {
  104|  3.94k|      m_bit_depth = bits.get_bits8(3) + 9; // [9;16]
  105|  3.94k|    }
  106|  7.92k|  }
  107|       |
  108|  9.35k|  if (m_alpha_flag)
  ------------------
  |  Branch (108:7): [True: 3.58k, False: 5.76k]
  ------------------
  109|  3.58k|  {
  110|  3.58k|    m_alpha_is_premultiplied = bits.get_flag();
  111|  3.58k|  }
  112|       |
  113|  9.35k|  if (m_explicit_cicp_flag)
  ------------------
  |  Branch (113:7): [True: 4.06k, False: 5.29k]
  ------------------
  114|  4.06k|  {
  115|       |    // Per ISO/IEC 23008-12 Annex O.3.2, matrix_coefficients is always
  116|       |    // present (8 bits) when explicit_cicp_flag is set, irrespective of
  117|       |    // chroma_subsampling. The chroma_subsampling==0 ⇒ MC=2 default is
  118|       |    // only used in the non-explicit branch (Table O.3, row 1).
  119|  4.06k|    m_colour_primaries = bits.get_bits8(8);
  120|  4.06k|    m_transfer_characteristics = bits.get_bits8(8);
  121|  4.06k|    m_matrix_coefficients = bits.get_bits8(8);
  122|  4.06k|  }
  123|  5.29k|  else
  124|  5.29k|  {
  125|  5.29k|    m_colour_primaries = m_icc_flag ? 2 : 1;
  ------------------
  |  Branch (125:26): [True: 865, False: 4.43k]
  ------------------
  126|  5.29k|    m_transfer_characteristics = m_icc_flag ? 2 : 13;
  ------------------
  |  Branch (126:34): [True: 865, False: 4.43k]
  ------------------
  127|  5.29k|    m_matrix_coefficients = (m_chroma_subsampling == 0) ? 2 : 6;
  ------------------
  |  Branch (127:29): [True: 1.42k, False: 3.87k]
  ------------------
  128|  5.29k|  }
  129|       |
  130|  9.35k|  if (m_explicit_codec_types_flag)
  ------------------
  |  Branch (130:7): [True: 4.41k, False: 4.94k]
  ------------------
  131|  4.41k|  {
  132|  4.41k|    m_infe_type = bits.get_bits32(32);
  133|  4.41k|    m_codec_config_type = bits.get_bits32(32);
  134|  4.41k|  }
  135|       |
  136|  9.35k|  if (m_hdr_flag)
  ------------------
  |  Branch (136:7): [True: 8.86k, False: 490]
  ------------------
  137|  8.86k|  {
  138|  8.86k|    m_gainmap_flag = bits.get_flag();
  139|  8.86k|    if (m_gainmap_flag)
  ------------------
  |  Branch (139:9): [True: 7.52k, False: 1.33k]
  ------------------
  140|  7.52k|    {
  141|  7.52k|      bool gainmap_dimension_same_as_main_item_flag = bits.get_flag();
  142|  7.52k|      if (gainmap_dimension_same_as_main_item_flag) {
  ------------------
  |  Branch (142:11): [True: 3.82k, False: 3.70k]
  ------------------
  143|  3.82k|        m_gainmap_width = m_width;
  144|  3.82k|        m_gainmap_height = m_height;
  145|  3.82k|      }
  146|  3.70k|      else {
  147|  3.70k|        m_gainmap_width = bits.get_bits32(large_dimensions_flag ? 15 : 7) + 1;
  ------------------
  |  Branch (147:43): [True: 1.22k, False: 2.47k]
  ------------------
  148|  3.70k|        m_gainmap_height = bits.get_bits32(large_dimensions_flag ? 15 : 7) + 1;
  ------------------
  |  Branch (148:44): [True: 1.22k, False: 2.47k]
  ------------------
  149|  3.70k|      }
  150|       |
  151|  7.52k|      m_gainmap_matrix_coefficients = bits.get_bits8(8);
  152|  7.52k|      m_gainmap_full_range_flag = bits.get_flag();
  153|  7.52k|      m_gainmap_chroma_subsampling = bits.get_bits8(2);
  154|  7.52k|      if ((m_gainmap_chroma_subsampling == 1) || (m_gainmap_chroma_subsampling == 2))
  ------------------
  |  Branch (154:11): [True: 4.32k, False: 3.20k]
  |  Branch (154:50): [True: 2.32k, False: 882]
  ------------------
  155|  6.64k|      {
  156|  6.64k|        m_gainmap_chroma_is_horizontally_centred = bits.get_flag();
  157|  6.64k|      }
  158|  7.52k|      if (m_gainmap_chroma_subsampling == 1)
  ------------------
  |  Branch (158:11): [True: 4.32k, False: 3.20k]
  ------------------
  159|  4.32k|      {
  160|  4.32k|        m_gainmap_chroma_is_vertically_centred = bits.get_flag();
  161|  4.32k|      }
  162|       |
  163|  7.52k|      m_gainmap_float_flag = bits.get_flag();
  164|       |
  165|  7.52k|      bool gainmap_high_bit_depth_flag = false;
  166|  7.52k|      if (m_gainmap_float_flag)
  ------------------
  |  Branch (166:11): [True: 1.32k, False: 6.19k]
  ------------------
  167|  1.32k|      {
  168|  1.32k|        uint8_t bit_depth_log2 = bits.get_bits8(2) + 4;
  169|  1.32k|        if (bit_depth_log2 > 6) {
  ------------------
  |  Branch (169:13): [True: 7, False: 1.32k]
  ------------------
  170|      7|          return {heif_error_Invalid_input,
  171|      7|                  heif_suberror_Invalid_mini_box,
  172|      7|                  "Reserved float gainmap bit_depth_log2 value 7 in MinimizedImageBox"};
  173|      7|        }
  174|  1.32k|        m_gainmap_bit_depth = (uint8_t)powl(2, (bit_depth_log2));
  175|  1.32k|      }
  176|  6.19k|      else
  177|  6.19k|      {
  178|  6.19k|        gainmap_high_bit_depth_flag = bits.get_flag();
  179|  6.19k|        if (gainmap_high_bit_depth_flag)
  ------------------
  |  Branch (179:13): [True: 964, False: 5.23k]
  ------------------
  180|    964|        {
  181|    964|          m_gainmap_bit_depth = 9 + bits.get_bits8(3);
  182|    964|        }
  183|  6.19k|      }
  184|       |
  185|  7.52k|      m_tmap_icc_flag = bits.get_flag();
  186|  7.52k|      m_tmap_explicit_cicp_flag = bits.get_flag();
  187|  7.52k|      if (m_tmap_explicit_cicp_flag)
  ------------------
  |  Branch (187:11): [True: 2.32k, False: 5.19k]
  ------------------
  188|  2.32k|      {
  189|  2.32k|        m_tmap_colour_primaries = bits.get_bits8(8);
  190|  2.32k|        m_tmap_transfer_characteristics = bits.get_bits8(8);
  191|  2.32k|        m_tmap_matrix_coefficients = bits.get_bits8(8);
  192|  2.32k|        m_tmap_full_range_flag = bits.get_flag();
  193|  2.32k|      }
  194|  5.19k|      else
  195|  5.19k|      {
  196|  5.19k|        m_tmap_colour_primaries = 1;
  197|  5.19k|        m_tmap_transfer_characteristics = 13;
  198|  5.19k|        m_tmap_matrix_coefficients = 6;
  199|  5.19k|        m_tmap_full_range_flag = true;
  200|  5.19k|      }
  201|  7.52k|    }
  202|       |
  203|  8.86k|    bool clli_flag = bits.get_flag();
  204|  8.86k|    bool mdcv_flag = bits.get_flag();
  205|  8.86k|    bool cclv_flag = bits.get_flag();
  206|  8.86k|    bool amve_flag = bits.get_flag();
  207|  8.86k|    m_reve_flag = bits.get_flag();
  208|  8.86k|    bool ndwt_flag = bits.get_flag();
  209|       |
  210|  8.86k|    if (clli_flag)
  ------------------
  |  Branch (210:9): [True: 2.99k, False: 5.86k]
  ------------------
  211|  2.99k|    {
  212|  2.99k|      m_clli = std::make_shared<Box_clli>();
  213|  2.99k|      m_clli->clli.max_content_light_level = bits.get_bits16(16);
  214|  2.99k|      m_clli->clli.max_pic_average_light_level = bits.get_bits16(16);
  215|  2.99k|    }
  216|       |
  217|  8.86k|    if (mdcv_flag)
  ------------------
  |  Branch (217:9): [True: 783, False: 8.07k]
  ------------------
  218|    783|    {
  219|    783|      m_mdcv = std::make_shared<Box_mdcv>();
  220|  3.13k|      for (int c = 0; c < 3; c++)
  ------------------
  |  Branch (220:23): [True: 2.34k, False: 783]
  ------------------
  221|  2.34k|      {
  222|  2.34k|        m_mdcv->mdcv.display_primaries_x[c] = bits.get_bits16(16);
  223|  2.34k|        m_mdcv->mdcv.display_primaries_y[c] = bits.get_bits16(16);
  224|  2.34k|      }
  225|       |
  226|    783|      m_mdcv->mdcv.white_point_x = bits.get_bits16(16);
  227|    783|      m_mdcv->mdcv.white_point_y = bits.get_bits16(16);
  228|    783|      m_mdcv->mdcv.max_display_mastering_luminance = bits.get_bits32(32);
  229|    783|      m_mdcv->mdcv.min_display_mastering_luminance = bits.get_bits32(32);
  230|    783|    }
  231|       |
  232|  8.86k|    if (cclv_flag)
  ------------------
  |  Branch (232:9): [True: 2.27k, False: 6.58k]
  ------------------
  233|  2.27k|    {
  234|  2.27k|      m_cclv = std::make_shared<Box_cclv>();
  235|  2.27k|      bits.skip_bits(2);
  236|  2.27k|      bool ccv_primaries_present_flag = bits.get_flag();
  237|  2.27k|      bool ccv_min_luminance_value_present_flag = bits.get_flag();
  238|  2.27k|      bool ccv_max_luminance_value_present_flag = bits.get_flag();
  239|  2.27k|      bool ccv_avg_luminance_value_present_flag = bits.get_flag();
  240|  2.27k|      bits.skip_bits(2);
  241|  2.27k|      if (ccv_primaries_present_flag)
  ------------------
  |  Branch (241:11): [True: 369, False: 1.90k]
  ------------------
  242|    369|      {
  243|    369|        int32_t x0 = bits.get_bits32s();
  244|    369|        int32_t y0 = bits.get_bits32s();
  245|    369|        int32_t x1 = bits.get_bits32s();
  246|    369|        int32_t y1 = bits.get_bits32s();
  247|    369|        int32_t x2 = bits.get_bits32s();
  248|    369|        int32_t y2 = bits.get_bits32s();
  249|    369|        m_cclv->set_primaries(x0, y0, x1, y1, x2, y2);
  250|    369|      }
  251|  2.27k|      if (ccv_min_luminance_value_present_flag)
  ------------------
  |  Branch (251:11): [True: 396, False: 1.87k]
  ------------------
  252|    396|      {
  253|    396|        m_cclv->set_min_luminance(bits.get_bits32(32));
  254|    396|      }
  255|  2.27k|      if (ccv_max_luminance_value_present_flag)
  ------------------
  |  Branch (255:11): [True: 1.72k, False: 545]
  ------------------
  256|  1.72k|      {
  257|  1.72k|        m_cclv->set_max_luminance(bits.get_bits32(32));
  258|  1.72k|      }
  259|  2.27k|      if (ccv_avg_luminance_value_present_flag)
  ------------------
  |  Branch (259:11): [True: 451, False: 1.82k]
  ------------------
  260|    451|      {
  261|    451|        m_cclv->set_avg_luminance(bits.get_bits32(32));
  262|    451|      }
  263|  2.27k|    }
  264|       |
  265|  8.86k|    if (amve_flag)
  ------------------
  |  Branch (265:9): [True: 554, False: 8.30k]
  ------------------
  266|    554|    {
  267|    554|      m_amve = std::make_shared<Box_amve>();
  268|    554|      m_amve->amve.ambient_illumination = bits.get_bits32(32);
  269|    554|      m_amve->amve.ambient_light_x = bits.get_bits16(16);
  270|    554|      m_amve->amve.ambient_light_y = bits.get_bits16(16);
  271|    554|    }
  272|       |
  273|  8.86k|    if (m_reve_flag)
  ------------------
  |  Branch (273:9): [True: 2.04k, False: 6.81k]
  ------------------
  274|  2.04k|    {
  275|       |      // TODO: ReferenceViewingEnvironment isn't published yet
  276|  2.04k|      bits.skip_bits(32);
  277|  2.04k|      bits.skip_bits(16);
  278|  2.04k|      bits.skip_bits(16);
  279|  2.04k|      bits.skip_bits(32);
  280|  2.04k|      bits.skip_bits(16);
  281|  2.04k|      bits.skip_bits(16);
  282|  2.04k|    }
  283|       |
  284|  8.86k|    if (ndwt_flag)
  ------------------
  |  Branch (284:9): [True: 3.35k, False: 5.50k]
  ------------------
  285|  3.35k|    {
  286|  3.35k|      m_ndwt = std::make_shared<Box_ndwt>();
  287|  3.35k|      m_ndwt->set_diffuse_white_luminance(bits.get_bits32(32));
  288|  3.35k|    }
  289|       |
  290|  8.86k|    if (m_gainmap_flag)
  ------------------
  |  Branch (290:9): [True: 7.52k, False: 1.33k]
  ------------------
  291|  7.52k|    {
  292|  7.52k|      bool tmap_clli_flag = bits.get_flag();
  293|  7.52k|      bool tmap_mdcv_flag = bits.get_flag();
  294|  7.52k|      bool tmap_cclv_flag = bits.get_flag();
  295|  7.52k|      bool tmap_amve_flag = bits.get_flag();
  296|  7.52k|      m_tmap_reve_flag = bits.get_flag();
  297|  7.52k|      bool tmap_ndwt_flag = bits.get_flag();
  298|       |
  299|  7.52k|      if (tmap_clli_flag)
  ------------------
  |  Branch (299:11): [True: 3.45k, False: 4.06k]
  ------------------
  300|  3.45k|      {
  301|  3.45k|        m_tmap_clli = std::make_shared<Box_clli>();
  302|  3.45k|        m_tmap_clli->clli.max_content_light_level = (uint16_t)bits.get_bits32(16);
  303|  3.45k|        m_tmap_clli->clli.max_pic_average_light_level = (uint16_t)bits.get_bits32(16);
  304|  3.45k|      }
  305|       |
  306|  7.52k|      if (tmap_mdcv_flag)
  ------------------
  |  Branch (306:11): [True: 2.14k, False: 5.37k]
  ------------------
  307|  2.14k|      {
  308|  2.14k|        m_tmap_mdcv = std::make_shared<Box_mdcv>();
  309|  8.58k|        for (int c = 0; c < 3; c++)
  ------------------
  |  Branch (309:25): [True: 6.44k, False: 2.14k]
  ------------------
  310|  6.44k|        {
  311|  6.44k|          m_tmap_mdcv->mdcv.display_primaries_x[c] = bits.get_bits16(16);
  312|  6.44k|          m_tmap_mdcv->mdcv.display_primaries_y[c] = bits.get_bits16(16);
  313|  6.44k|        }
  314|       |
  315|  2.14k|        m_tmap_mdcv->mdcv.white_point_x = bits.get_bits16(16);
  316|  2.14k|        m_tmap_mdcv->mdcv.white_point_y = bits.get_bits16(16);
  317|  2.14k|        m_tmap_mdcv->mdcv.max_display_mastering_luminance = bits.get_bits32(32);
  318|  2.14k|        m_tmap_mdcv->mdcv.min_display_mastering_luminance = bits.get_bits32(32);
  319|  2.14k|      }
  320|       |
  321|  7.52k|      if (tmap_cclv_flag)
  ------------------
  |  Branch (321:11): [True: 3.85k, False: 3.66k]
  ------------------
  322|  3.85k|      {
  323|  3.85k|        m_tmap_cclv = std::make_shared<Box_cclv>();
  324|  3.85k|        bits.skip_bits(2); // skip ccv_cancel_flag and ccv_persistence_flag
  325|  3.85k|        bool ccv_primaries_present_flag = bits.get_flag();
  326|  3.85k|        bool ccv_min_luminance_value_present_flag = bits.get_flag();
  327|  3.85k|        bool ccv_max_luminance_value_present_flag = bits.get_flag();
  328|  3.85k|        bool ccv_avg_luminance_value_present_flag = bits.get_flag();
  329|  3.85k|        bits.skip_bits(2);
  330|  3.85k|        if (ccv_primaries_present_flag)
  ------------------
  |  Branch (330:13): [True: 396, False: 3.46k]
  ------------------
  331|    396|        {
  332|    396|          int32_t x0 = bits.get_bits32s();
  333|    396|          int32_t y0 = bits.get_bits32s();
  334|    396|          int32_t x1 = bits.get_bits32s();
  335|    396|          int32_t y1 = bits.get_bits32s();
  336|    396|          int32_t x2 = bits.get_bits32s();
  337|    396|          int32_t y2 = bits.get_bits32s();
  338|    396|          m_tmap_cclv->set_primaries(x0, y0, x1, y1, x2, y2);
  339|    396|        }
  340|  3.85k|        if (ccv_min_luminance_value_present_flag)
  ------------------
  |  Branch (340:13): [True: 710, False: 3.14k]
  ------------------
  341|    710|        {
  342|    710|          m_tmap_cclv->set_min_luminance(bits.get_bits32(32));
  343|    710|        }
  344|  3.85k|        if (ccv_max_luminance_value_present_flag)
  ------------------
  |  Branch (344:13): [True: 724, False: 3.13k]
  ------------------
  345|    724|        {
  346|    724|          m_tmap_cclv->set_max_luminance(bits.get_bits32(32));
  347|    724|        }
  348|  3.85k|        if (ccv_avg_luminance_value_present_flag)
  ------------------
  |  Branch (348:13): [True: 709, False: 3.15k]
  ------------------
  349|    709|        {
  350|    709|          m_tmap_cclv->set_avg_luminance(bits.get_bits32(32));
  351|    709|        }
  352|  3.85k|      }
  353|       |
  354|  7.52k|      if (tmap_amve_flag)
  ------------------
  |  Branch (354:11): [True: 3.13k, False: 4.39k]
  ------------------
  355|  3.13k|      {
  356|  3.13k|        m_tmap_amve = std::make_shared<Box_amve>();
  357|  3.13k|        m_tmap_amve->amve.ambient_illumination = bits.get_bits32(32);
  358|  3.13k|        m_tmap_amve->amve.ambient_light_x = bits.get_bits16(16);
  359|  3.13k|        m_tmap_amve->amve.ambient_light_y = bits.get_bits16(16);
  360|  3.13k|      }
  361|       |
  362|  7.52k|      if (m_tmap_reve_flag)
  ------------------
  |  Branch (362:11): [True: 844, False: 6.67k]
  ------------------
  363|    844|      {
  364|       |        // TODO: ReferenceViewingEnvironment isn't published yet
  365|    844|        bits.skip_bits(32);
  366|    844|        bits.skip_bits(16);
  367|    844|        bits.skip_bits(16);
  368|    844|        bits.skip_bits(32);
  369|    844|        bits.skip_bits(16);
  370|    844|        bits.skip_bits(16);
  371|    844|      }
  372|       |
  373|  7.52k|      if (tmap_ndwt_flag)
  ------------------
  |  Branch (373:11): [True: 1.59k, False: 5.92k]
  ------------------
  374|  1.59k|      {
  375|  1.59k|        m_tmap_ndwt = std::make_shared<Box_ndwt>();
  376|  1.59k|        m_tmap_ndwt->set_diffuse_white_luminance(bits.get_bits32(32));
  377|  1.59k|      }
  378|  7.52k|    }
  379|  8.86k|  }
  380|       |
  381|       |  // Chunk sizes
  382|  9.35k|  bool large_metadata_flag = false;
  383|  9.35k|  if (m_icc_flag || m_exif_flag || m_xmp_flag || (m_hdr_flag && m_gainmap_flag))
  ------------------
  |  Branch (383:7): [True: 3.29k, False: 6.06k]
  |  Branch (383:21): [True: 826, False: 5.23k]
  |  Branch (383:36): [True: 1.83k, False: 3.40k]
  |  Branch (383:51): [True: 3.13k, False: 271]
  |  Branch (383:65): [True: 2.30k, False: 824]
  ------------------
  384|  8.25k|  {
  385|  8.25k|    large_metadata_flag = bits.get_flag();
  386|  8.25k|  }
  387|       |
  388|  9.35k|  bool large_codec_config_flag = bits.get_flag();
  389|  9.35k|  bool large_item_data_flag = bits.get_flag();
  390|       |
  391|  9.35k|  uint32_t icc_data_size = 0;
  392|  9.35k|  if (m_icc_flag)
  ------------------
  |  Branch (392:7): [True: 3.29k, False: 6.06k]
  ------------------
  393|  3.29k|  {
  394|  3.29k|    icc_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (394:37): [True: 16, False: 3.27k]
  ------------------
  395|  3.29k|  }
  396|       |
  397|  9.35k|  uint32_t tmap_icc_data_size = 0;
  398|  9.35k|  if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag)
  ------------------
  |  Branch (398:7): [True: 8.86k, False: 490]
  |  Branch (398:21): [True: 7.52k, False: 1.33k]
  |  Branch (398:39): [True: 1.03k, False: 6.48k]
  ------------------
  399|  1.03k|  {
  400|  1.03k|    tmap_icc_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (400:42): [True: 254, False: 780]
  ------------------
  401|  1.03k|  }
  402|       |
  403|  9.35k|  uint32_t gainmap_metadata_size = 0;
  404|  9.35k|  if (m_hdr_flag && m_gainmap_flag)
  ------------------
  |  Branch (404:7): [True: 8.86k, False: 490]
  |  Branch (404:21): [True: 7.52k, False: 1.33k]
  ------------------
  405|  7.52k|  {
  406|  7.52k|    gainmap_metadata_size = bits.get_bits32(large_metadata_flag ? 20 : 10);
  ------------------
  |  Branch (406:45): [True: 274, False: 7.24k]
  ------------------
  407|  7.52k|  }
  408|       |
  409|  9.35k|  if (m_hdr_flag && m_gainmap_flag)
  ------------------
  |  Branch (409:7): [True: 8.86k, False: 490]
  |  Branch (409:21): [True: 7.52k, False: 1.33k]
  ------------------
  410|  7.52k|  {
  411|  7.52k|    m_gainmap_item_data_size = bits.get_bits32(large_item_data_flag ? 28 : 15);
  ------------------
  |  Branch (411:48): [True: 51, False: 7.47k]
  ------------------
  412|  7.52k|  }
  413|       |
  414|  9.35k|  uint32_t gainmap_item_codec_config_size = 0;
  415|  9.35k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0)
  ------------------
  |  Branch (415:7): [True: 8.86k, False: 490]
  |  Branch (415:21): [True: 7.52k, False: 1.33k]
  |  Branch (415:39): [True: 727, False: 6.79k]
  ------------------
  416|    727|  {
  417|    727|    gainmap_item_codec_config_size = bits.get_bits32(large_codec_config_flag ? 12 : 3);
  ------------------
  |  Branch (417:54): [True: 42, False: 685]
  ------------------
  418|    727|  }
  419|       |
  420|  9.35k|  uint32_t main_item_codec_config_size = bits.get_bits32(large_codec_config_flag ? 12 : 3);
  ------------------
  |  Branch (420:58): [True: 485, False: 8.86k]
  ------------------
  421|  9.35k|  m_main_item_data_size = bits.get_bits32(large_item_data_flag ? 28 : 15) + 1;
  ------------------
  |  Branch (421:43): [True: 145, False: 9.20k]
  ------------------
  422|       |
  423|  9.35k|  if (m_alpha_flag)
  ------------------
  |  Branch (423:7): [True: 3.58k, False: 5.76k]
  ------------------
  424|  3.58k|  {
  425|  3.58k|    m_alpha_item_data_size = bits.get_bits32(large_item_data_flag ? 28 : 15);
  ------------------
  |  Branch (425:46): [True: 52, False: 3.53k]
  ------------------
  426|  3.58k|  }
  427|       |
  428|  9.35k|  uint32_t alpha_item_codec_config_size = 0;
  429|  9.35k|  if (m_alpha_flag && m_alpha_item_data_size > 0)
  ------------------
  |  Branch (429:7): [True: 3.58k, False: 5.76k]
  |  Branch (429:23): [True: 226, False: 3.36k]
  ------------------
  430|    226|  {
  431|    226|    alpha_item_codec_config_size = bits.get_bits32(large_codec_config_flag ? 12 : 3);
  ------------------
  |  Branch (431:52): [True: 24, False: 202]
  ------------------
  432|    226|  }
  433|       |
  434|  9.35k|  if (m_exif_flag || m_xmp_flag)
  ------------------
  |  Branch (434:7): [True: 3.10k, False: 6.24k]
  |  Branch (434:22): [True: 2.53k, False: 3.70k]
  ------------------
  435|  5.64k|  {
  436|  5.64k|    m_exif_xmp_compressed_flag = bits.get_flag();
  437|  5.64k|  }
  438|       |
  439|  9.35k|  if (m_exif_flag)
  ------------------
  |  Branch (439:7): [True: 3.10k, False: 6.24k]
  ------------------
  440|  3.10k|  {
  441|  3.10k|    m_exif_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (441:40): [True: 23, False: 3.08k]
  ------------------
  442|  3.10k|  }
  443|  9.35k|  if (m_xmp_flag)
  ------------------
  |  Branch (443:7): [True: 5.33k, False: 4.02k]
  ------------------
  444|  5.33k|  {
  445|  5.33k|    m_xmp_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (445:39): [True: 271, False: 5.05k]
  ------------------
  446|  5.33k|  }
  447|       |
  448|  9.35k|  bits.skip_to_byte_boundary();
  449|       |
  450|       |  // Validate that the declared chunk sizes don't exceed the remaining payload.
  451|       |  // Without this, a malformed mini box with 28-bit *_item_data_size fields set
  452|       |  // near 2^28 makes skip_bytes/read_bytes loop hundreds of millions of times
  453|       |  // past EOF, eventually triggering signed-int overflow in BitReader::refill().
  454|  9.35k|  {
  455|  9.35k|    uint64_t required_bytes = (uint64_t) main_item_codec_config_size + m_main_item_data_size;
  456|  9.35k|    if (m_alpha_flag && m_alpha_item_data_size > 0) {
  ------------------
  |  Branch (456:9): [True: 3.58k, False: 5.76k]
  |  Branch (456:25): [True: 226, False: 3.36k]
  ------------------
  457|    226|      required_bytes += alpha_item_codec_config_size;
  458|    226|      required_bytes += m_alpha_item_data_size;
  459|    226|    }
  460|  9.35k|    if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0) {
  ------------------
  |  Branch (460:9): [True: 8.86k, False: 490]
  |  Branch (460:23): [True: 7.52k, False: 1.33k]
  |  Branch (460:41): [True: 727, False: 6.79k]
  ------------------
  461|    727|      required_bytes += gainmap_item_codec_config_size;
  462|    727|      required_bytes += m_gainmap_item_data_size;
  463|    727|    }
  464|  9.35k|    if (m_icc_flag) required_bytes += icc_data_size;
  ------------------
  |  Branch (464:9): [True: 3.29k, False: 6.06k]
  ------------------
  465|  9.35k|    if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag) required_bytes += tmap_icc_data_size;
  ------------------
  |  Branch (465:9): [True: 8.86k, False: 490]
  |  Branch (465:23): [True: 7.52k, False: 1.33k]
  |  Branch (465:41): [True: 1.03k, False: 6.48k]
  ------------------
  466|  9.35k|    if (m_hdr_flag && m_gainmap_flag) required_bytes += gainmap_metadata_size;
  ------------------
  |  Branch (466:9): [True: 8.86k, False: 490]
  |  Branch (466:23): [True: 7.52k, False: 1.33k]
  ------------------
  467|  9.35k|    if (m_exif_flag) required_bytes += m_exif_data_size;
  ------------------
  |  Branch (467:9): [True: 3.10k, False: 6.24k]
  ------------------
  468|  9.35k|    if (m_xmp_flag) required_bytes += m_xmp_data_size;
  ------------------
  |  Branch (468:9): [True: 5.33k, False: 4.02k]
  ------------------
  469|       |
  470|  9.35k|    int64_t remaining_bits = bits.get_bits_remaining();
  471|  9.35k|    if (remaining_bits < 0 || required_bytes > (uint64_t) remaining_bits / 8) {
  ------------------
  |  Branch (471:9): [True: 278, False: 9.07k]
  |  Branch (471:31): [True: 136, False: 8.93k]
  ------------------
  472|    414|      return {heif_error_Invalid_input,
  473|    414|              heif_suberror_Invalid_mini_box,
  474|    414|              "Declared chunk sizes in MinimizedImageBox exceed available payload."};
  475|    414|    }
  476|  9.35k|  }
  477|       |
  478|       |  // Enforce the color-profile size limit on embedded ICC blobs, matching
  479|       |  // the check applied to regular 'colr' boxes in nclx.cc.
  480|  8.93k|  if (limits && limits->max_color_profile_size) {
  ------------------
  |  Branch (480:7): [True: 8.93k, False: 0]
  |  Branch (480:17): [True: 8.93k, False: 0]
  ------------------
  481|  8.93k|    if (m_icc_flag && icc_data_size > limits->max_color_profile_size) {
  ------------------
  |  Branch (481:9): [True: 3.20k, False: 5.73k]
  |  Branch (481:23): [True: 0, False: 3.20k]
  ------------------
  482|      0|      return {heif_error_Invalid_input,
  483|      0|              heif_suberror_Security_limit_exceeded,
  484|      0|              "ICC color profile in MinimizedImageBox exceeds maximum supported size"};
  485|      0|    }
  486|  8.93k|    if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag &&
  ------------------
  |  Branch (486:9): [True: 8.54k, False: 392]
  |  Branch (486:23): [True: 7.34k, False: 1.19k]
  |  Branch (486:41): [True: 960, False: 6.38k]
  ------------------
  487|    960|        tmap_icc_data_size > limits->max_color_profile_size) {
  ------------------
  |  Branch (487:9): [True: 0, False: 960]
  ------------------
  488|      0|      return {heif_error_Invalid_input,
  489|      0|              heif_suberror_Security_limit_exceeded,
  490|      0|              "Tone-map ICC color profile in MinimizedImageBox exceeds maximum supported size"};
  491|      0|    }
  492|  8.93k|  }
  493|       |
  494|  8.93k|  if (main_item_codec_config_size > 0)
  ------------------
  |  Branch (494:7): [True: 193, False: 8.74k]
  ------------------
  495|    193|  {
  496|    193|    m_main_item_codec_config = bits.read_bytes(main_item_codec_config_size);
  497|    193|  }
  498|       |
  499|       |  // Chunks
  500|  8.93k|  if (m_alpha_flag && m_alpha_item_data_size > 0) {
  ------------------
  |  Branch (500:7): [True: 3.45k, False: 5.48k]
  |  Branch (500:23): [True: 164, False: 3.28k]
  ------------------
  501|    164|    if (alpha_item_codec_config_size == 0) {
  ------------------
  |  Branch (501:9): [True: 79, False: 85]
  ------------------
  502|     79|      m_alpha_item_codec_config = m_main_item_codec_config;
  503|     79|    }
  504|     85|    else {
  505|       |      // TODO: should we have a flag indicating that we have explicit config for alpha?
  506|     85|      m_alpha_item_codec_config = bits.read_bytes(alpha_item_codec_config_size);
  507|     85|    }
  508|    164|  }
  509|       |
  510|  8.93k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0)
  ------------------
  |  Branch (510:7): [True: 8.54k, False: 392]
  |  Branch (510:21): [True: 7.34k, False: 1.19k]
  |  Branch (510:39): [True: 661, False: 6.68k]
  ------------------
  511|    661|  {
  512|    661|    if (gainmap_item_codec_config_size == 0) {
  ------------------
  |  Branch (512:9): [True: 80, False: 581]
  ------------------
  513|     80|      m_gainmap_item_codec_config = m_main_item_codec_config;
  514|     80|    }
  515|    581|    else {
  516|       |      // TODO: should we have a flag indicating that we have explicit config for the gain map?
  517|    581|      m_gainmap_item_codec_config = bits.read_bytes(gainmap_item_codec_config_size);
  518|    581|    }
  519|    661|  }
  520|       |
  521|  8.93k|  if (m_icc_flag)
  ------------------
  |  Branch (521:7): [True: 3.20k, False: 5.73k]
  ------------------
  522|  3.20k|  {
  523|  3.20k|    m_icc_data = bits.read_bytes(icc_data_size);
  524|  3.20k|  }
  525|       |
  526|  8.93k|  if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag)
  ------------------
  |  Branch (526:7): [True: 8.54k, False: 392]
  |  Branch (526:21): [True: 7.34k, False: 1.19k]
  |  Branch (526:39): [True: 960, False: 6.38k]
  ------------------
  527|    960|  {
  528|    960|    m_tmap_icc_data = bits.read_bytes(tmap_icc_data_size);
  529|    960|  }
  530|       |
  531|  8.93k|  if (m_hdr_flag && m_gainmap_flag && gainmap_metadata_size > 0)
  ------------------
  |  Branch (531:7): [True: 8.54k, False: 392]
  |  Branch (531:21): [True: 7.34k, False: 1.19k]
  |  Branch (531:39): [True: 157, False: 7.19k]
  ------------------
  532|    157|  {
  533|    157|    m_gainmap_metadata = bits.read_bytes(gainmap_metadata_size);
  534|    157|  }
  535|       |
  536|  8.93k|  if (m_alpha_flag && m_alpha_item_data_size > 0)
  ------------------
  |  Branch (536:7): [True: 3.45k, False: 5.48k]
  |  Branch (536:23): [True: 164, False: 3.28k]
  ------------------
  537|    164|  {
  538|    164|    m_alpha_item_data_offset = bits.get_current_byte_index() + start_offset;
  539|    164|    bits.skip_bytes(m_alpha_item_data_size);
  540|    164|  }
  541|  8.93k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0)
  ------------------
  |  Branch (541:7): [True: 8.54k, False: 392]
  |  Branch (541:21): [True: 7.34k, False: 1.19k]
  |  Branch (541:39): [True: 661, False: 6.68k]
  ------------------
  542|    661|  {
  543|    661|    m_gainmap_item_data_offset = bits.get_current_byte_index() + start_offset;
  544|    661|    bits.skip_bytes(m_gainmap_item_data_size);
  545|    661|  }
  546|       |
  547|  8.93k|  m_main_item_data_offset = bits.get_current_byte_index() + start_offset;
  548|  8.93k|  bits.skip_bytes(m_main_item_data_size);
  549|       |
  550|  8.93k|  if (m_exif_flag)
  ------------------
  |  Branch (550:7): [True: 2.99k, False: 5.93k]
  ------------------
  551|  2.99k|  {
  552|  2.99k|    m_exif_item_data_offset = bits.get_current_byte_index() + start_offset;
  553|  2.99k|    bits.skip_bytes(m_exif_data_size);
  554|  2.99k|  }
  555|  8.93k|  if (m_xmp_flag)
  ------------------
  |  Branch (555:7): [True: 5.17k, False: 3.75k]
  ------------------
  556|  5.17k|  {
  557|  5.17k|    m_xmp_item_data_offset = bits.get_current_byte_index() + start_offset;
  558|  5.17k|    bits.skip_bytes(m_xmp_data_size);
  559|  5.17k|  }
  560|       |
  561|  8.93k|  return range.get_error();
  562|  8.93k|}
_ZNK8Box_mini4dumpER6Indent:
  565|  8.39k|{
  566|  8.39k|  std::ostringstream sstr;
  567|  8.39k|  sstr << Box::dump(indent);
  568|  8.39k|  sstr << indent << "version: " << (int)m_version << "\n";
  569|       |
  570|  8.39k|  sstr << indent << "explicit_codec_types_flag: " << m_explicit_codec_types_flag << "\n";
  571|  8.39k|  sstr << indent << "float_flag: " << m_float_flag << "\n";
  572|  8.39k|  sstr << indent << "full_range_flag: " << m_full_range_flag << "\n";
  573|  8.39k|  sstr << indent << "alpha_flag: " << m_alpha_flag << "\n";
  574|  8.39k|  sstr << indent << "explicit_cicp_flag: " << m_explicit_cicp_flag << "\n";
  575|  8.39k|  sstr << indent << "hdr_flag: " << m_hdr_flag << "\n";
  576|  8.39k|  sstr << indent << "icc_flag: " << m_icc_flag << "\n";
  577|  8.39k|  sstr << indent << "exif_flag: " << m_exif_flag << "\n";
  578|  8.39k|  sstr << indent << "xmp_flag: " << m_xmp_flag << "\n";
  579|       |
  580|  8.39k|  sstr << indent << "chroma_subsampling: " << (int)m_chroma_subsampling << "\n";
  581|  8.39k|  sstr << indent << "orientation: " << (int)m_orientation << "\n";
  582|       |
  583|  8.39k|  sstr << indent << "width: " << m_width << "\n";
  584|  8.39k|  sstr << indent << "height: " << m_height << "\n";
  585|       |
  586|  8.39k|  if ((m_chroma_subsampling == 1) || (m_chroma_subsampling == 2))
  ------------------
  |  Branch (586:7): [True: 250, False: 8.14k]
  |  Branch (586:38): [True: 4.09k, False: 4.04k]
  ------------------
  587|  4.34k|  {
  588|  4.34k|    sstr << indent << "chroma_is_horizontally_centered: " << m_chroma_is_horizontally_centered << "\n";
  589|  4.34k|  }
  590|  8.39k|  if (m_chroma_subsampling == 1)
  ------------------
  |  Branch (590:7): [True: 250, False: 8.14k]
  ------------------
  591|    250|  {
  592|    250|    sstr << indent << "chroma_is_vertically_centered: " << m_chroma_is_vertically_centered << "\n";
  593|    250|  }
  594|       |
  595|  8.39k|  sstr << "bit_depth: " << (int)m_bit_depth << "\n";
  596|       |
  597|  8.39k|  if (m_alpha_flag)
  ------------------
  |  Branch (597:7): [True: 3.11k, False: 5.28k]
  ------------------
  598|  3.11k|  {
  599|  3.11k|    sstr << "alpha_is_premultiplied: " << m_alpha_is_premultiplied << "\n";
  600|  3.11k|  }
  601|       |
  602|  8.39k|  sstr << "colour_primaries: " << (int)m_colour_primaries << "\n";
  603|  8.39k|  sstr << "transfer_characteristics: " << (int)m_transfer_characteristics << "\n";
  604|  8.39k|  sstr << "matrix_coefficients: " << (int)m_matrix_coefficients << "\n";
  605|       |
  606|  8.39k|  if (m_explicit_codec_types_flag)
  ------------------
  |  Branch (606:7): [True: 4.13k, False: 4.26k]
  ------------------
  607|  4.13k|  {
  608|  4.13k|    sstr << "infe_type: " << fourcc_to_string(m_infe_type) << " (" << m_infe_type << ")" << "\n";
  609|  4.13k|    sstr << "codec_config_type: " << fourcc_to_string(m_codec_config_type) << " (" << m_codec_config_type << ")" << "\n";
  610|  4.13k|  }
  611|       |
  612|  8.39k|  if (m_hdr_flag)
  ------------------
  |  Branch (612:7): [True: 8.03k, False: 361]
  ------------------
  613|  8.03k|  {
  614|  8.03k|    sstr << indent << "gainmap_flag: " << m_gainmap_flag << "\n";
  615|  8.03k|    if (m_gainmap_flag)
  ------------------
  |  Branch (615:9): [True: 7.02k, False: 1.00k]
  ------------------
  616|  7.02k|    {
  617|  7.02k|      sstr << indent << "gainmap_width: " << m_gainmap_width << "\n";
  618|  7.02k|      sstr << indent << "gainmap_height: " << m_gainmap_height << "\n";
  619|  7.02k|      sstr << indent << "gainmap_matrix_coefficients: " << (int)m_gainmap_matrix_coefficients << "\n";
  620|  7.02k|      sstr << indent << "gainmap_full_range_flag: " << m_gainmap_full_range_flag << "\n";
  621|  7.02k|      sstr << indent << "gainmap_chroma_subsampling: " << (int)m_gainmap_chroma_subsampling << "\n";
  622|  7.02k|      if ((m_gainmap_chroma_subsampling == 1) || (m_gainmap_chroma_subsampling == 2))
  ------------------
  |  Branch (622:11): [True: 4.10k, False: 2.92k]
  |  Branch (622:50): [True: 2.22k, False: 700]
  ------------------
  623|  6.32k|      {
  624|  6.32k|        sstr << indent << "gainmap_chroma_is_horizontally_centred: " << m_gainmap_chroma_is_horizontally_centred << "\n";
  625|  6.32k|      }
  626|  7.02k|      if (m_gainmap_chroma_subsampling == 1)
  ------------------
  |  Branch (626:11): [True: 4.10k, False: 2.92k]
  ------------------
  627|  4.10k|      {
  628|  4.10k|        sstr << indent << "gainmap_chroma_is_vertically_centred: " << m_gainmap_chroma_is_vertically_centred << "\n";
  629|  4.10k|      }
  630|  7.02k|      sstr << indent << "gainmap_float_flag: " << m_gainmap_float_flag << "\n";
  631|  7.02k|      sstr << "gainmap_bit_depth: " << (int)m_gainmap_bit_depth << "\n";
  632|  7.02k|      sstr << indent << "tmap_icc_flag: " << m_tmap_icc_flag << "\n";
  633|  7.02k|      sstr << indent << "tmap_explicit_cicp_flag: " << m_tmap_explicit_cicp_flag << "\n";
  634|  7.02k|      if (m_tmap_explicit_cicp_flag)
  ------------------
  |  Branch (634:11): [True: 2.13k, False: 4.88k]
  ------------------
  635|  2.13k|      {
  636|  2.13k|        sstr << "tmap_colour_primaries: " << (int)m_tmap_colour_primaries << "\n";
  637|  2.13k|        sstr << "tmap_transfer_characteristics: " << (int)m_tmap_transfer_characteristics << "\n";
  638|  2.13k|        sstr << "tmap_matrix_coefficients: " << (int)m_tmap_matrix_coefficients << "\n";
  639|  2.13k|        sstr << "tmap_full_range_flag: " << m_tmap_full_range_flag << "\n";
  640|  2.13k|      }
  641|  7.02k|    }
  642|       |
  643|  8.03k|    if (m_clli)
  ------------------
  |  Branch (643:9): [True: 2.81k, False: 5.22k]
  ------------------
  644|  2.81k|    {
  645|  2.81k|      sstr << indent << "ccli.max_content_light_level: " << m_clli->clli.max_content_light_level << "\n";
  646|  2.81k|      sstr << indent << "ccli.max_pic_average_light_level: " << m_clli->clli.max_pic_average_light_level << "\n";
  647|  2.81k|    }
  648|  5.22k|    else {
  649|  5.22k|      sstr << indent << "clli: ---\n";
  650|  5.22k|    }
  651|       |
  652|  8.03k|    if (m_mdcv)
  ------------------
  |  Branch (652:9): [True: 668, False: 7.36k]
  ------------------
  653|    668|    {
  654|    668|      sstr << indent << "mdcv.display_primaries (x,y): ";
  655|    668|      sstr << "(" << m_mdcv->mdcv.display_primaries_x[0] << ";" << m_mdcv->mdcv.display_primaries_y[0] << "), ";
  656|    668|      sstr << "(" << m_mdcv->mdcv.display_primaries_x[1] << ";" << m_mdcv->mdcv.display_primaries_y[1] << "), ";
  657|    668|      sstr << "(" << m_mdcv->mdcv.display_primaries_x[2] << ";" << m_mdcv->mdcv.display_primaries_y[2] << ")\n";
  658|       |
  659|    668|      sstr << indent << "mdcv.white point (x,y): (" << m_mdcv->mdcv.white_point_x << ";" << m_mdcv->mdcv.white_point_y << ")\n";
  660|    668|      sstr << indent << "mdcv.max display mastering luminance: " << m_mdcv->mdcv.max_display_mastering_luminance << "\n";
  661|    668|      sstr << indent << "mdcv.min display mastering luminance: " << m_mdcv->mdcv.min_display_mastering_luminance << "\n";
  662|    668|    }
  663|  7.36k|    else {
  664|  7.36k|      sstr << indent << "mdcv: ---\n";
  665|  7.36k|    }
  666|       |
  667|  8.03k|    if (m_cclv)
  ------------------
  |  Branch (667:9): [True: 2.01k, False: 6.01k]
  ------------------
  668|  2.01k|    {
  669|  2.01k|      sstr << indent << "cclv.ccv_primaries_present_flag: " << m_cclv->ccv_primaries_are_valid() << "\n";
  670|  2.01k|      sstr << indent << "cclv.ccv_min_luminance_value_present_flag: " << m_cclv->min_luminance_is_valid() << "\n";
  671|  2.01k|      sstr << indent << "cclv.ccv_max_luminance_value_present_flag: " << m_cclv->max_luminance_is_valid() << "\n";
  672|  2.01k|      sstr << indent << "cclv.ccv_avg_luminance_value_present_flag: " << m_cclv->avg_luminance_is_valid() << "\n";
  673|  2.01k|      if (m_cclv->ccv_primaries_are_valid())
  ------------------
  |  Branch (673:11): [True: 271, False: 1.74k]
  ------------------
  674|    271|      {
  675|    271|        sstr << indent << "cclv.ccv_primaries (x,y): ";
  676|    271|        sstr << "(" << m_cclv->get_ccv_primary_x0() << ";" << m_cclv->get_ccv_primary_y0() << "), ";
  677|    271|        sstr << "(" << m_cclv->get_ccv_primary_x1() << ";" << m_cclv->get_ccv_primary_y1() << "), ";
  678|    271|        sstr << "(" << m_cclv->get_ccv_primary_x2() << ";" << m_cclv->get_ccv_primary_y2() << ")\n";
  679|    271|      }
  680|  2.01k|      if (m_cclv->min_luminance_is_valid())
  ------------------
  |  Branch (680:11): [True: 314, False: 1.70k]
  ------------------
  681|    314|      {
  682|    314|        sstr << indent << "cclv.ccv_min_luminance_value: " << m_cclv->get_min_luminance() << "\n";
  683|    314|      }
  684|  2.01k|      if (m_cclv->max_luminance_is_valid())
  ------------------
  |  Branch (684:11): [True: 1.61k, False: 402]
  ------------------
  685|  1.61k|      {
  686|  1.61k|        sstr << indent << "cclv.ccv_max_luminance_value: " << m_cclv->get_max_luminance() << "\n";
  687|  1.61k|      }
  688|  2.01k|      if (m_cclv->avg_luminance_is_valid())
  ------------------
  |  Branch (688:11): [True: 354, False: 1.66k]
  ------------------
  689|    354|      {
  690|    354|        sstr << indent << "cclv.ccv_avg_luminance_value: " << m_cclv->get_avg_luminance() << "\n";
  691|    354|      }
  692|  2.01k|    }
  693|  6.01k|    else {
  694|  6.01k|      sstr << indent << "cclv: ---\n";
  695|  6.01k|    }
  696|       |
  697|  8.03k|    if (m_amve)
  ------------------
  |  Branch (697:9): [True: 368, False: 7.66k]
  ------------------
  698|    368|    {
  699|    368|      sstr << indent << "amve.ambient_illumination: " << m_amve->amve.ambient_illumination << "\n";
  700|    368|      sstr << indent << "amve.ambient_light_x: " << m_amve->amve.ambient_light_x << "\n";
  701|    368|      sstr << indent << "amve.ambient_light_y: " << m_amve->amve.ambient_light_y << "\n";
  702|    368|    }
  703|  7.66k|    else {
  704|  7.66k|      sstr << indent << "amve: ---\n";
  705|  7.66k|    }
  706|       |
  707|  8.03k|    sstr << indent << "reve_flag: " << m_reve_flag << "\n";
  708|       |
  709|  8.03k|    if (m_reve_flag)
  ------------------
  |  Branch (709:9): [True: 1.84k, False: 6.18k]
  ------------------
  710|  1.84k|    {
  711|       |      // TODO - this isn't published yet
  712|  1.84k|    }
  713|  8.03k|    if (m_ndwt)
  ------------------
  |  Branch (713:9): [True: 3.20k, False: 4.82k]
  ------------------
  714|  3.20k|    {
  715|  3.20k|      sstr << indent << "ndwt.diffuse_white_luminance: " << m_ndwt->get_diffuse_white_luminance() << "\n";
  716|  3.20k|    }
  717|  4.82k|    else {
  718|  4.82k|      sstr << indent << "ndwt: ---\n";
  719|  4.82k|    }
  720|       |
  721|  8.03k|    if (m_gainmap_flag)
  ------------------
  |  Branch (721:9): [True: 7.02k, False: 1.00k]
  ------------------
  722|  7.02k|    {
  723|  7.02k|      if (m_tmap_clli)
  ------------------
  |  Branch (723:11): [True: 3.38k, False: 3.63k]
  ------------------
  724|  3.38k|      {
  725|  3.38k|        sstr << indent << "tmap_clli.max_content_light_level: " << m_tmap_clli->clli.max_content_light_level << "\n";
  726|  3.38k|        sstr << indent << "tmap_clli.max_pic_average_light_level: " << m_tmap_clli->clli.max_pic_average_light_level << "\n";
  727|  3.38k|      }
  728|  3.63k|      else {
  729|  3.63k|        sstr << indent << "tmap_clli: ---\n";
  730|  3.63k|      }
  731|       |
  732|  7.02k|      if (m_tmap_mdcv)
  ------------------
  |  Branch (732:11): [True: 2.04k, False: 4.98k]
  ------------------
  733|  2.04k|      {
  734|  2.04k|        sstr << indent << "tmap_mdcv.display_primaries (x,y): ";
  735|  2.04k|        sstr << "(" << m_tmap_mdcv->mdcv.display_primaries_x[0] << ";" << m_tmap_mdcv->mdcv.display_primaries_y[0] << "), ";
  736|  2.04k|        sstr << "(" << m_tmap_mdcv->mdcv.display_primaries_x[1] << ";" << m_tmap_mdcv->mdcv.display_primaries_y[1] << "), ";
  737|  2.04k|        sstr << "(" << m_tmap_mdcv->mdcv.display_primaries_x[2] << ";" << m_tmap_mdcv->mdcv.display_primaries_y[2] << ")\n";
  738|       |
  739|  2.04k|        sstr << indent << "tmap_mdcv.white point (x,y): (" << m_tmap_mdcv->mdcv.white_point_x << ";" << m_tmap_mdcv->mdcv.white_point_y << ")\n";
  740|  2.04k|        sstr << indent << "tmap_mdcv.max display mastering luminance: " << m_tmap_mdcv->mdcv.max_display_mastering_luminance << "\n";
  741|  2.04k|        sstr << indent << "tmap_mdcv.min display mastering luminance: " << m_tmap_mdcv->mdcv.min_display_mastering_luminance << "\n";
  742|  2.04k|      }
  743|  4.98k|      else {
  744|  4.98k|        sstr << indent << "tmap_mdcv: ---\n";
  745|  4.98k|      }
  746|       |
  747|  7.02k|      if (m_tmap_cclv)
  ------------------
  |  Branch (747:11): [True: 3.70k, False: 3.32k]
  ------------------
  748|  3.70k|      {
  749|  3.70k|        sstr << indent << "tmap_cclv.ccv_primaries_present_flag: " << m_tmap_cclv->ccv_primaries_are_valid() << "\n";
  750|  3.70k|        sstr << indent << "tmap_cclv.ccv_min_luminance_value_present_flag: " << m_tmap_cclv->min_luminance_is_valid() << "\n";
  751|  3.70k|        sstr << indent << "tmap_cclv.ccv_max_luminance_value_present_flag: " << m_tmap_cclv->max_luminance_is_valid() << "\n";
  752|  3.70k|        sstr << indent << "tmap_cclv.ccv_avg_luminance_value_present_flag: " << m_tmap_cclv->avg_luminance_is_valid() << "\n";
  753|  3.70k|        if (m_tmap_cclv->ccv_primaries_are_valid())
  ------------------
  |  Branch (753:13): [True: 336, False: 3.37k]
  ------------------
  754|    336|        {
  755|    336|          sstr << indent << "tmap_cclv.ccv_primaries (x,y): ";
  756|    336|          sstr << "(" << m_tmap_cclv->get_ccv_primary_x0() << ";" << m_tmap_cclv->get_ccv_primary_y0() << "), ";
  757|    336|          sstr << "(" << m_tmap_cclv->get_ccv_primary_x1() << ";" << m_tmap_cclv->get_ccv_primary_y1() << "), ";
  758|    336|          sstr << "(" << m_tmap_cclv->get_ccv_primary_x2() << ";" << m_tmap_cclv->get_ccv_primary_y2() << ")\n";
  759|    336|        }
  760|  3.70k|        if (m_tmap_cclv->min_luminance_is_valid())
  ------------------
  |  Branch (760:13): [True: 627, False: 3.08k]
  ------------------
  761|    627|        {
  762|    627|          sstr << indent << "tmap_cclv.ccv_min_luminance_value: " << m_tmap_cclv->get_min_luminance() << "\n";
  763|    627|        }
  764|  3.70k|        if (m_tmap_cclv->max_luminance_is_valid())
  ------------------
  |  Branch (764:13): [True: 633, False: 3.07k]
  ------------------
  765|    633|        {
  766|    633|          sstr << indent << "tmap_cclv.ccv_max_luminance_value: " << m_tmap_cclv->get_max_luminance() << "\n";
  767|    633|        }
  768|  3.70k|        if (m_tmap_cclv->avg_luminance_is_valid())
  ------------------
  |  Branch (768:13): [True: 624, False: 3.08k]
  ------------------
  769|    624|        {
  770|    624|          sstr << indent << "tmap_cclv.ccv_avg_luminance_value: " << m_tmap_cclv->get_avg_luminance() << "\n";
  771|    624|        }
  772|  3.70k|      }
  773|  3.32k|      else {
  774|  3.32k|        sstr << indent << "tmap_cclv: ---\n";
  775|  3.32k|      }
  776|       |
  777|  7.02k|      if (m_tmap_amve)
  ------------------
  |  Branch (777:11): [True: 3.03k, False: 3.99k]
  ------------------
  778|  3.03k|      {
  779|  3.03k|        sstr << indent << "tmap_amve.ambient_illumination: " << m_tmap_amve->amve.ambient_illumination << "\n";
  780|  3.03k|        sstr << indent << "tmap_amve.ambient_light_x: " << m_tmap_amve->amve.ambient_light_x << "\n";
  781|  3.03k|        sstr << indent << "tmap_amve.ambient_light_y: " << m_tmap_amve->amve.ambient_light_y << "\n";
  782|  3.03k|      }
  783|  3.99k|      else {
  784|  3.99k|        sstr << indent << "tmap_amve: ---\n";
  785|  3.99k|      }
  786|       |
  787|  7.02k|      sstr << indent << "tmap_reve_flag: " << m_tmap_reve_flag << "\n";
  788|       |
  789|  7.02k|      if (m_tmap_reve_flag)
  ------------------
  |  Branch (789:11): [True: 753, False: 6.27k]
  ------------------
  790|    753|      {
  791|       |        // TODO - this isn't published yet
  792|    753|      }
  793|  7.02k|      if (m_tmap_ndwt)
  ------------------
  |  Branch (793:11): [True: 1.51k, False: 5.51k]
  ------------------
  794|  1.51k|      {
  795|  1.51k|        sstr << indent << "tmap_ndwt.diffuse_white_luminance: " << m_tmap_ndwt->get_diffuse_white_luminance() << "\n";
  796|  1.51k|      }
  797|  5.51k|      else {
  798|  5.51k|        sstr << indent << "tmap_ndwt: ---\n";
  799|  5.51k|      }
  800|  7.02k|    }
  801|  8.03k|  }
  802|       |
  803|  8.39k|  if (m_alpha_flag && (m_alpha_item_data_size > 0) && (m_alpha_item_codec_config.size() > 0))
  ------------------
  |  Branch (803:7): [True: 3.11k, False: 5.28k]
  |  Branch (803:23): [True: 139, False: 2.97k]
  |  Branch (803:55): [True: 91, False: 48]
  ------------------
  804|     91|  {
  805|     91|    sstr << "alpha_item_code_config size: " << m_alpha_item_codec_config.size() << "\n";
  806|     91|  }
  807|  8.39k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_codec_config.size() > 0)
  ------------------
  |  Branch (807:7): [True: 8.03k, False: 361]
  |  Branch (807:21): [True: 7.02k, False: 1.00k]
  |  Branch (807:39): [True: 542, False: 6.48k]
  ------------------
  808|    542|  {
  809|    542|    sstr << "gainmap_item_codec_config size: " << m_gainmap_item_codec_config.size() << "\n";
  810|    542|  }
  811|  8.39k|  if (m_main_item_codec_config.size() > 0)
  ------------------
  |  Branch (811:7): [True: 173, False: 8.22k]
  ------------------
  812|    173|  {
  813|    173|    sstr << "main_item_code_config size: " << m_main_item_codec_config.size() << "\n";
  814|    173|  }
  815|       |
  816|  8.39k|  if (m_icc_flag)
  ------------------
  |  Branch (816:7): [True: 3.02k, False: 5.37k]
  ------------------
  817|  3.02k|  {
  818|  3.02k|    sstr << "icc_data size: " << m_icc_data.size() << "\n";
  819|  3.02k|  }
  820|  8.39k|  if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag)
  ------------------
  |  Branch (820:7): [True: 8.03k, False: 361]
  |  Branch (820:21): [True: 7.02k, False: 1.00k]
  |  Branch (820:39): [True: 934, False: 6.09k]
  ------------------
  821|    934|  {
  822|    934|    sstr << "tmap_icc_data size: " << m_tmap_icc_data.size() << "\n";
  823|    934|  }
  824|  8.39k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_metadata.size() > 0)
  ------------------
  |  Branch (824:7): [True: 8.03k, False: 361]
  |  Branch (824:21): [True: 7.02k, False: 1.00k]
  |  Branch (824:39): [True: 151, False: 6.87k]
  ------------------
  825|    151|  {
  826|    151|    sstr << "gainmap_metadata size: " << m_gainmap_metadata.size() << "\n";
  827|    151|  }
  828|       |
  829|  8.39k|  if (m_alpha_flag && (m_alpha_item_data_size > 0))
  ------------------
  |  Branch (829:7): [True: 3.11k, False: 5.28k]
  |  Branch (829:23): [True: 139, False: 2.97k]
  ------------------
  830|    139|  {
  831|    139|    sstr << "alpha_item_data offset: " << m_alpha_item_data_offset << ", size: " << m_alpha_item_data_size << "\n";
  832|    139|  }
  833|  8.39k|  if (m_hdr_flag && m_gainmap_flag && (m_gainmap_item_data_size > 0))
  ------------------
  |  Branch (833:7): [True: 8.03k, False: 361]
  |  Branch (833:21): [True: 7.02k, False: 1.00k]
  |  Branch (833:39): [True: 619, False: 6.40k]
  ------------------
  834|    619|  {
  835|    619|    sstr << "gainmap_item_data offset: " << m_gainmap_item_data_offset << ", size: " << m_gainmap_item_data_size << "\n";
  836|    619|  }
  837|       |
  838|  8.39k|  sstr << "main_item_data offset: " << m_main_item_data_offset << ", size: " << m_main_item_data_size << "\n";
  839|       |
  840|  8.39k|  if (m_exif_flag)
  ------------------
  |  Branch (840:7): [True: 2.85k, False: 5.54k]
  ------------------
  841|  2.85k|  {
  842|  2.85k|    sstr << "exif_data offset: " << m_exif_item_data_offset << ", size: " << m_exif_data_size << "\n";
  843|  2.85k|  }
  844|  8.39k|  if (m_xmp_flag)
  ------------------
  |  Branch (844:7): [True: 4.93k, False: 3.46k]
  ------------------
  845|  4.93k|  {
  846|  4.93k|    sstr << "xmp_data offset: " << m_xmp_item_data_offset << ", size: " << m_xmp_data_size << "\n";
  847|  4.93k|  }
  848|  8.39k|  return sstr.str();
  849|  8.39k|}

_ZN8Box_miniC2Ev:
   36|  9.37k|  {
   37|  9.37k|    set_short_type(fourcc("mini"));
   38|  9.37k|  }

_ZN18color_profile_nclx5parseER14BitstreamRange:
  223|    174|{
  224|    174|  StreamReader::grow_status status;
  225|    174|  status = range.wait_for_available_bytes(7);
  226|    174|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (226:7): [True: 3, False: 171]
  ------------------
  227|       |    // TODO: return recoverable error at timeout
  228|      3|    return Error(heif_error_Invalid_input,
  229|      3|                 heif_suberror_End_of_data);
  230|      3|  }
  231|       |
  232|    171|  m_profile.m_colour_primaries = range.read16();
  233|    171|  m_profile.m_transfer_characteristics = range.read16();
  234|    171|  m_profile.m_matrix_coefficients = range.read16();
  235|    171|  m_profile.m_full_range_flag = (range.read8() & 0x80 ? true : false);
  ------------------
  |  Branch (235:34): [True: 7, False: 164]
  ------------------
  236|       |
  237|    171|  return Error::Ok;
  238|    174|}
_ZN18color_profile_nclx10parse_nclcER14BitstreamRange:
  241|    349|{
  242|    349|  StreamReader::grow_status status;
  243|    349|  status = range.wait_for_available_bytes(6);
  244|    349|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (244:7): [True: 1, False: 348]
  ------------------
  245|       |    // TODO: return recoverable error at timeout
  246|      1|    return Error(heif_error_Invalid_input,
  247|      1|                 heif_suberror_End_of_data);
  248|      1|  }
  249|       |
  250|    348|  m_profile.m_colour_primaries = range.read16();
  251|    348|  m_profile.m_transfer_characteristics = range.read16();
  252|    348|  m_profile.m_matrix_coefficients = range.read16();
  253|       |
  254|       |  // use full range for RGB, limited range otherwise
  255|    348|  m_profile.m_full_range_flag = (m_profile.m_matrix_coefficients == 0);
  256|       |
  257|    348|  return Error::Ok;
  258|    349|}
_ZN12nclx_profile17set_sRGB_defaultsEv:
  315|    523|{
  316|       |  // sRGB defaults
  317|    523|  m_colour_primaries = 1;
  318|    523|  m_transfer_characteristics = 13;
  319|    523|  m_matrix_coefficients = 6;
  320|    523|  m_full_range_flag = true;
  321|    523|}
_ZN8Box_colr5parseER14BitstreamRangePK20heif_security_limits:
  385|  5.39k|{
  386|  5.39k|  StreamReader::grow_status status;
  387|  5.39k|  uint32_t colour_type = range.read32();
  388|       |
  389|  5.39k|  if (colour_type == fourcc("nclx")) {
  ------------------
  |  Branch (389:7): [True: 174, False: 5.21k]
  ------------------
  390|    174|    auto color_profile = std::make_shared<color_profile_nclx>();
  391|    174|    m_color_profile = color_profile;
  392|    174|    Error err = color_profile->parse(range);
  393|    174|    if (err) {
  ------------------
  |  Branch (393:9): [True: 3, False: 171]
  ------------------
  394|      3|      return err;
  395|      3|    }
  396|    174|  }
  397|  5.21k|  else if (colour_type == fourcc("nclc")) {
  ------------------
  |  Branch (397:12): [True: 349, False: 4.86k]
  ------------------
  398|    349|    auto color_profile = std::make_shared<color_profile_nclx>();
  399|    349|    m_color_profile = color_profile;
  400|    349|    Error err = color_profile->parse_nclc(range);
  401|    349|    if (err) {
  ------------------
  |  Branch (401:9): [True: 1, False: 348]
  ------------------
  402|      1|      return err;
  403|      1|    }
  404|    349|  }
  405|  4.86k|  else if (colour_type == fourcc("prof") ||
  ------------------
  |  Branch (405:12): [True: 1.48k, False: 3.37k]
  ------------------
  406|  4.76k|           colour_type == fourcc("rICC")) {
  ------------------
  |  Branch (406:12): [True: 3.28k, False: 98]
  ------------------
  407|  4.76k|    if (!has_fixed_box_size()) {
  ------------------
  |  Branch (407:9): [True: 2, False: 4.76k]
  ------------------
  408|      2|      return Error(heif_error_Unsupported_feature, heif_suberror_Unspecified, "colr boxes with undefined box size are not supported");
  409|      2|    }
  410|       |
  411|  4.76k|    uint64_t profile_size_64 = get_box_size() - get_header_size() - 4;
  412|  4.76k|    if (limits->max_color_profile_size && profile_size_64 > limits->max_color_profile_size) {
  ------------------
  |  Branch (412:9): [True: 4.76k, False: 0]
  |  Branch (412:43): [True: 0, False: 4.76k]
  ------------------
  413|      0|      return Error(heif_error_Invalid_input, heif_suberror_Security_limit_exceeded, "Color profile exceeds maximum supported size");
  414|      0|    }
  415|       |
  416|  4.76k|    size_t profile_size = static_cast<size_t>(profile_size_64);
  417|       |
  418|  4.76k|    status = range.wait_for_available_bytes(profile_size);
  419|  4.76k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (419:9): [True: 0, False: 4.76k]
  ------------------
  420|       |      // TODO: return recoverable error at timeout
  421|      0|      return Error(heif_error_Invalid_input,
  422|      0|                   heif_suberror_End_of_data);
  423|      0|    }
  424|       |
  425|  4.76k|    std::vector<uint8_t> rawData(profile_size);
  426|  20.8k|    for (size_t i = 0; i < profile_size; i++) {
  ------------------
  |  Branch (426:24): [True: 16.1k, False: 4.76k]
  ------------------
  427|  16.1k|      rawData[i] = range.read8();
  428|  16.1k|    }
  429|       |
  430|  4.76k|    m_color_profile = std::make_shared<color_profile_raw>(colour_type, rawData);
  431|  4.76k|  }
  432|     98|  else {
  433|     98|    return Error(heif_error_Invalid_input,
  434|     98|                 heif_suberror_Unknown_color_profile_type);
  435|     98|  }
  436|       |
  437|  5.28k|  return range.get_error();
  438|  5.39k|}
_ZNK8Box_colr4dumpER6Indent:
  442|  4.36k|{
  443|  4.36k|  std::ostringstream sstr;
  444|  4.36k|  sstr << Box::dump(indent);
  445|       |
  446|  4.36k|  if (m_color_profile) {
  ------------------
  |  Branch (446:7): [True: 4.36k, False: 0]
  ------------------
  447|  4.36k|    sstr << indent << "colour_type: " << fourcc_to_string(get_color_profile_type()) << "\n";
  448|  4.36k|    sstr << m_color_profile->dump(indent);
  449|  4.36k|  }
  450|      0|  else {
  451|      0|    sstr << indent << "colour_type: ---\n";
  452|      0|    sstr << "no color profile\n";
  453|      0|  }
  454|       |
  455|  4.36k|  return sstr.str();
  456|  4.36k|}
_ZNK17color_profile_raw4dumpER6Indent:
  460|  3.93k|{
  461|  3.93k|  std::ostringstream sstr;
  462|  3.93k|  sstr << indent << "profile size: " << m_data.size() << "\n";
  463|  3.93k|  return sstr.str();
  464|  3.93k|}
_ZNK18color_profile_nclx4dumpER6Indent:
  468|    425|{
  469|    425|  std::ostringstream sstr;
  470|    425|  sstr << indent << "colour_primaries: " << m_profile.m_colour_primaries << "\n"
  471|    425|       << indent << "transfer_characteristics: " << m_profile.m_transfer_characteristics << "\n"
  472|    425|       << indent << "matrix_coefficients: " << m_profile.m_matrix_coefficients << "\n"
  473|    425|       << indent << "full_range_flag: " << m_profile.m_full_range_flag << "\n";
  474|    425|  return sstr.str();
  475|    425|}

_ZN17color_profile_rawC2EjRKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  105|  4.76k|      : m_type(type), m_data(data) {}
_ZNK17color_profile_raw8get_typeEv:
  107|  3.93k|  uint32_t get_type() const override { return m_type; }
_ZN18color_profile_nclxC2Ev:
  175|    523|  color_profile_nclx() { m_profile.set_sRGB_defaults(); }
_ZNK18color_profile_nclx8get_typeEv:
  184|    425|  uint32_t get_type() const override { return fourcc("nclx"); }
_ZN8Box_colrC2Ev:
  205|  5.39k|  {
  206|  5.39k|    set_short_type(fourcc("colr"));
  207|  5.39k|  }
_ZNK8Box_colr22get_color_profile_typeEv:
  211|  4.36k|  uint32_t get_color_profile_type() const { return m_color_profile->get_type(); }
_ZN13color_profileD2Ev:
   92|  5.29k|  virtual ~color_profile() = default;

_ZN8Box_prfr5parseER14BitstreamRangePK20heif_security_limits:
   29|    808|{
   30|    808|  parse_full_box_header(range);
   31|       |
   32|    808|  if (get_version() > 0) {
  ------------------
  |  Branch (32:7): [True: 73, False: 735]
  ------------------
   33|     73|    return unsupported_version_error("prfr");
   34|     73|  }
   35|       |
   36|    735|  uint8_t projection_type = (range.read8() & 0x1F);
   37|    735|  m_projection = static_cast<heif_omaf_image_projection>(projection_type);
   38|    735|  return range.get_error();
   39|    808|}
_ZNK8Box_prfr4dumpER6Indent:
   42|    711|{
   43|    711|  std::ostringstream sstr;
   44|    711|  sstr << Box::dump(indent);
   45|    711|  sstr << indent << "projection_type: ";
   46|    711|  switch (m_projection) {
   47|     75|    case heif_omaf_image_projection_equirectangular:
  ------------------
  |  Branch (47:5): [True: 75, False: 636]
  ------------------
   48|     75|      sstr << "equirectangular\n";
   49|     75|      break;
   50|    283|    case heif_omaf_image_projection_cube_map:
  ------------------
  |  Branch (50:5): [True: 283, False: 428]
  ------------------
   51|    283|      sstr << "cube-map\n";
   52|    283|      break;
   53|    353|    default:
  ------------------
  |  Branch (53:5): [True: 353, False: 358]
  ------------------
   54|    353|      sstr << "unknown (" << m_projection << ")\n";
   55|    353|      break;
   56|    711|  }
   57|    711|  return sstr.str();
   58|    711|}

_ZN8Box_prfrC2Ev:
   37|    809|  {
   38|    809|    set_short_type(fourcc("prfr"));
   39|    809|  }
_ZNK8Box_prfr14debug_box_nameEv:
   47|    711|  const char* debug_box_name() const override { return "Projection Format"; }
_ZNK8Box_prfr24get_parse_error_fatalityEv:
   49|     75|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }

_Z24register_default_pluginsv:
  149|      2|{
  150|       |#if HAVE_WEBCODECS
  151|       |  register_decoder(get_decoder_plugin_webcodecs());
  152|       |#endif
  153|       |
  154|      2|#if HAVE_LIBDE265
  155|      2|  register_decoder(get_decoder_plugin_libde265());
  156|      2|#endif
  157|       |
  158|      2|#if HAVE_X265
  159|      2|  register_encoder(get_encoder_plugin_x265());
  160|      2|#endif
  161|       |
  162|       |#if HAVE_KVAZAAR
  163|       |  register_encoder(get_encoder_plugin_kvazaar());
  164|       |#endif
  165|       |
  166|       |#if HAVE_UVG266
  167|       |  register_encoder(get_encoder_plugin_uvg266());
  168|       |#endif
  169|       |
  170|      2|#if HAVE_VVENC
  171|      2|  register_encoder(get_encoder_plugin_vvenc());
  172|      2|#endif
  173|       |
  174|      2|#if HAVE_VVDEC
  175|      2|  register_decoder(get_decoder_plugin_vvdec());
  176|      2|#endif
  177|       |
  178|      2|#if HAVE_AOM_ENCODER
  179|      2|  register_encoder(get_encoder_plugin_aom());
  180|      2|#endif
  181|       |
  182|      2|#if HAVE_AOM_DECODER
  183|      2|  register_decoder(get_decoder_plugin_aom());
  184|      2|#endif
  185|       |
  186|       |#if HAVE_RAV1E
  187|       |  register_encoder(get_encoder_plugin_rav1e());
  188|       |#endif
  189|       |
  190|      2|#if HAVE_DAV1D
  191|      2|  register_decoder(get_decoder_plugin_dav1d());
  192|      2|#endif
  193|       |
  194|      2|#if HAVE_SvtEnc
  195|      2|  register_encoder(get_encoder_plugin_svt());
  196|      2|#endif
  197|       |
  198|       |#if HAVE_FFMPEG_DECODER
  199|       |  register_decoder(get_decoder_plugin_ffmpeg());
  200|       |#endif
  201|       |
  202|      2|#if HAVE_JPEG_DECODER
  203|      2|  register_decoder(get_decoder_plugin_jpeg());
  204|      2|#endif
  205|       |
  206|      2|#if HAVE_JPEG_ENCODER
  207|      2|  register_encoder(get_encoder_plugin_jpeg());
  208|      2|#endif
  209|       |
  210|      2|#if HAVE_OPENJPEG_ENCODER
  211|      2|  register_encoder(get_encoder_plugin_openjpeg());
  212|      2|#endif
  213|       |
  214|      2|#if HAVE_OPENJPEG_DECODER
  215|      2|  register_decoder(get_decoder_plugin_openjpeg());
  216|      2|#endif
  217|       |
  218|      2|#if HAVE_OPENJPH_ENCODER
  219|      2|  register_encoder(get_encoder_plugin_openjph());
  220|      2|#endif
  221|       |
  222|      2|#if HAVE_OpenH264_DECODER
  223|      2|  register_decoder(get_decoder_plugin_openh264());
  224|      2|#endif
  225|       |
  226|      2|#if HAVE_X264
  227|      2|  register_encoder(get_encoder_plugin_x264());
  228|      2|#endif
  229|       |
  230|      2|#if WITH_UNCOMPRESSED_CODEC
  231|      2|  register_encoder(get_encoder_plugin_uncompressed());
  232|      2|  register_decoder(get_decoder_plugin_uncompressed());
  233|      2|#endif
  234|       |
  235|      2|  register_encoder(get_encoder_plugin_mask());
  236|      2|}
_Z16register_decoderPK19heif_decoder_plugin:
  240|     16|{
  241|     16|  if (decoder_plugin->init_plugin) {
  ------------------
  |  Branch (241:7): [True: 14, False: 2]
  ------------------
  242|     14|    (*decoder_plugin->init_plugin)();
  243|     14|  }
  244|       |
  245|     16|  s_decoder_plugins.insert(decoder_plugin);
  246|     16|}
_Z16register_encoderPK19heif_encoder_plugin:
  292|     20|{
  293|     20|  if (encoder_plugin->init_plugin) {
  ------------------
  |  Branch (293:7): [True: 20, False: 0]
  ------------------
  294|     20|    (*encoder_plugin->init_plugin)();
  295|     20|  }
  296|       |
  297|     20|  auto descriptor = std::unique_ptr<heif_encoder_descriptor>(new heif_encoder_descriptor);
  298|     20|  descriptor->plugin = encoder_plugin;
  299|       |
  300|     20|  s_encoder_descriptors.insert(std::move(descriptor));
  301|     20|}
_ZN24Register_Default_PluginsC2Ev:
  142|      2|  {
  143|      2|    register_default_plugins();
  144|      2|  }

_ZNK33encoder_descriptor_priority_orderclERKNSt3__110unique_ptrI23heif_encoder_descriptorNS0_14default_deleteIS2_EEEES7_:
   50|     50|  {
   51|     50|    return a->plugin->priority > b->plugin->priority;  // highest priority first
   52|     50|  }

_Z22get_decoder_plugin_aomv:
  436|      2|{
  437|      2|  return &decoder_aom;
  438|      2|}
decoder_aom.cc:_ZL15aom_init_pluginv:
   88|      2|{
   89|      2|}

_Z24get_decoder_plugin_dav1dv:
  447|      2|{
  448|      2|  return &decoder_dav1d;
  449|      2|}
decoder_dav1d.cc:_ZL17dav1d_init_pluginv:
   71|      2|{
   72|      2|}

_Z23get_decoder_plugin_jpegv:
  495|      2|{
  496|      2|  return &decoder_jpeg;
  497|      2|}
decoder_jpeg.cc:_ZL16jpeg_init_pluginv:
   70|      2|{
   71|      2|}

_Z27get_decoder_plugin_libde265v:
  523|      2|{
  524|      2|  return &decoder_libde265;
  525|      2|}
decoder_libde265.cc:_ZL20libde265_init_pluginv:
   67|      2|{
   68|      2|  de265_init();
   69|      2|}

_Z27get_decoder_plugin_openh264v:
  471|      2|{
  472|      2|  return &decoder_openh264;
  473|      2|}
decoder_openh264.cc:_ZL20openh264_init_pluginv:
   95|      2|{
   96|      2|}

_Z27get_decoder_plugin_openjpegv:
  550|      2|{
  551|      2|  return &decoder_openjpeg;
  552|      2|}
decoder_openjpeg.cc:_ZL20openjpeg_init_pluginv:
   60|      2|{
   61|      2|}

_Z31get_decoder_plugin_uncompressedv:
   71|      2|{
   72|      2|  return &decoder_uncompressed;
   73|      2|}

_Z24get_decoder_plugin_vvdecv:
  438|      2|{
  439|      2|  return &decoder_vvdec;
  440|      2|}
decoder_vvdec.cc:_ZL17vvdec_init_pluginv:
   84|      2|{
   85|      2|}

_Z22get_encoder_plugin_aomv:
 1562|      2|{
 1563|      2|  return &encoder_plugin_aom;
 1564|      2|}
encoder_aom.cc:_ZL15aom_init_pluginv:
  466|      2|{
  467|      2|  aom_init_parameters();
  468|      2|}
encoder_aom.cc:_ZL19aom_init_parametersv:
  280|      2|{
  281|      2|  heif_encoder_parameter* p = aom_encoder_params;
  282|      2|  const heif_encoder_parameter** d = aom_encoder_parameter_ptrs;
  283|      2|  int i = 0;
  284|       |
  285|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (285:3): [True: 2, False: 0]
  ------------------
  286|      2|  p->version = 2;
  287|      2|  p->name = kParam_realtime;
  288|      2|  p->type = heif_encoder_parameter_type_boolean;
  289|      2|  p->boolean.default_value = false;
  290|      2|  p->has_default = true;
  291|      2|  d[i++] = p++;
  292|       |
  293|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (293:3): [True: 2, False: 0]
  ------------------
  294|      2|  p->version = 2;
  295|      2|  p->name = kParam_speed;
  296|      2|  p->type = heif_encoder_parameter_type_integer;
  297|      2|  p->integer.default_value = 6;
  298|      2|  p->has_default = true;
  299|      2|  p->integer.have_minimum_maximum = true;
  300|      2|  p->integer.minimum = 0;
  301|      2|  if (aom_codec_version_major() >= 3) {
  ------------------
  |  Branch (301:7): [True: 2, False: 0]
  ------------------
  302|      2|    p->integer.maximum = 9;
  303|      2|  }
  304|      0|  else {
  305|      0|    p->integer.maximum = 8;
  306|      0|  }
  307|      2|  p->integer.valid_values = NULL;
  308|      2|  p->integer.num_valid_values = 0;
  309|      2|  d[i++] = p++;
  310|       |
  311|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (311:3): [True: 2, False: 0]
  ------------------
  312|      2|  p->version = 2;
  313|      2|  p->name = kParam_threads;
  314|      2|  p->type = heif_encoder_parameter_type_integer;
  315|      2|  p->has_default = true;
  316|      2|  p->integer.have_minimum_maximum = true;
  317|      2|  p->integer.minimum = 1;
  318|      2|  p->integer.maximum = 64;
  319|      2|  int threads = static_cast<int>(std::thread::hardware_concurrency());
  320|      2|  if (threads == 0) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2]
  ------------------
  321|       |    // Could not autodetect, use previous default value.
  322|      0|    threads = 4;
  323|      0|  }
  324|      2|  threads = std::min(threads, p->integer.maximum);
  325|      2|  p->integer.default_value = threads;
  326|      2|  p->integer.valid_values = NULL;
  327|      2|  p->integer.num_valid_values = 0;
  328|      2|  d[i++] = p++;
  329|       |
  330|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (330:3): [True: 2, False: 0]
  ------------------
  331|      2|  p->version = 2;
  332|      2|  p->name = heif_encoder_parameter_name_quality;
  ------------------
  |  |  317|      2|#define heif_encoder_parameter_name_quality  "quality"
  ------------------
  333|      2|  p->type = heif_encoder_parameter_type_integer;
  334|      2|  p->integer.default_value = 50;
  335|      2|  p->has_default = true;
  336|      2|  p->integer.have_minimum_maximum = true;
  337|      2|  p->integer.minimum = 0;
  338|      2|  p->integer.maximum = 100;
  339|      2|  p->integer.valid_values = NULL;
  340|      2|  p->integer.num_valid_values = 0;
  341|      2|  d[i++] = p++;
  342|       |
  343|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (343:3): [True: 2, False: 0]
  ------------------
  344|      2|  p->version = 2;
  345|      2|  p->name = heif_encoder_parameter_name_lossless;
  ------------------
  |  |  318|      2|#define heif_encoder_parameter_name_lossless "lossless"
  ------------------
  346|      2|  p->type = heif_encoder_parameter_type_boolean;
  347|      2|  p->boolean.default_value = false;
  348|      2|  p->has_default = true;
  349|      2|  d[i++] = p++;
  350|       |
  351|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (351:3): [True: 2, False: 0]
  ------------------
  352|      2|  p->version = 2;
  353|      2|  p->name = kParam_chroma;
  354|      2|  p->type = heif_encoder_parameter_type_string;
  355|      2|  p->string.default_value = "420";
  356|      2|  p->has_default = true;
  357|      2|  p->string.valid_values = kParam_chroma_valid_values;
  358|      2|  d[i++] = p++;
  359|       |
  360|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (360:3): [True: 2, False: 0]
  ------------------
  361|      2|  p->version = 2;
  362|      2|  p->name = kParam_tune;
  363|      2|  p->type = heif_encoder_parameter_type_string;
  364|      2|  p->string.default_value = "auto";
  365|      2|  p->has_default = true;
  366|      2|  p->string.valid_values = kParam_tune_valid_values;
  367|      2|  d[i++] = p++;
  368|       |
  369|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (369:3): [True: 2, False: 0]
  ------------------
  370|      2|  p->version = 2;
  371|      2|  p->name = kParam_min_q;
  372|      2|  p->type = heif_encoder_parameter_type_integer;
  373|      2|  p->integer.default_value = 0;
  374|      2|  p->has_default = true;
  375|      2|  p->integer.have_minimum_maximum = true;
  376|      2|  p->integer.minimum = 0;
  377|      2|  p->integer.maximum = 63;
  378|      2|  p->integer.valid_values = NULL;
  379|      2|  p->integer.num_valid_values = 0;
  380|      2|  d[i++] = p++;
  381|       |
  382|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (382:3): [True: 2, False: 0]
  ------------------
  383|      2|  p->version = 2;
  384|      2|  p->name = kParam_max_q;
  385|      2|  p->type = heif_encoder_parameter_type_integer;
  386|      2|  p->integer.default_value = 63;
  387|      2|  p->has_default = true;
  388|      2|  p->integer.have_minimum_maximum = true;
  389|      2|  p->integer.minimum = 0;
  390|      2|  p->integer.maximum = 63;
  391|      2|  p->integer.valid_values = NULL;
  392|      2|  p->integer.num_valid_values = 0;
  393|      2|  d[i++] = p++;
  394|       |
  395|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (395:3): [True: 2, False: 0]
  ------------------
  396|      2|  p->version = 2;
  397|      2|  p->name = kParam_alpha_quality;
  398|      2|  p->type = heif_encoder_parameter_type_integer;
  399|      2|  p->has_default = false;
  400|      2|  p->integer.have_minimum_maximum = true;
  401|      2|  p->integer.minimum = 0;
  402|      2|  p->integer.maximum = 100;
  403|      2|  p->integer.valid_values = NULL;
  404|      2|  p->integer.num_valid_values = 0;
  405|      2|  d[i++] = p++;
  406|       |
  407|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (407:3): [True: 2, False: 0]
  ------------------
  408|      2|  p->version = 2;
  409|      2|  p->name = kParam_alpha_min_q;
  410|      2|  p->type = heif_encoder_parameter_type_integer;
  411|      2|  p->has_default = false;
  412|      2|  p->integer.have_minimum_maximum = true;
  413|      2|  p->integer.minimum = 0;
  414|      2|  p->integer.maximum = 63;
  415|      2|  p->integer.valid_values = NULL;
  416|      2|  p->integer.num_valid_values = 0;
  417|      2|  d[i++] = p++;
  418|       |
  419|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (419:3): [True: 2, False: 0]
  ------------------
  420|      2|  p->version = 2;
  421|      2|  p->name = kParam_alpha_max_q;
  422|      2|  p->type = heif_encoder_parameter_type_integer;
  423|      2|  p->has_default = false;
  424|      2|  p->integer.have_minimum_maximum = true;
  425|      2|  p->integer.minimum = 0;
  426|      2|  p->integer.maximum = 63;
  427|      2|  p->integer.valid_values = NULL;
  428|      2|  p->integer.num_valid_values = 0;
  429|      2|  d[i++] = p++;
  430|       |
  431|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (431:3): [True: 2, False: 0]
  ------------------
  432|      2|  p->version = 2;
  433|      2|  p->name = kParam_lossless_alpha;
  434|      2|  p->type = heif_encoder_parameter_type_boolean;
  435|      2|  p->boolean.default_value = false;
  436|      2|  p->has_default = true;
  437|      2|  d[i++] = p++;
  438|       |
  439|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (439:3): [True: 2, False: 0]
  ------------------
  440|      2|  p->version = 2;
  441|      2|  p->name = kParam_auto_tiles;
  442|      2|  p->type = heif_encoder_parameter_type_boolean;
  443|      2|  p->boolean.default_value = false;
  444|      2|  p->has_default = true;
  445|      2|  d[i++] = p++;
  446|       |
  447|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (447:3): [True: 2, False: 0]
  ------------------
  448|      2|  p->version = 2;
  449|      2|  p->name = kParam_enable_intra_block_copy;
  450|      2|  p->type = heif_encoder_parameter_type_boolean;
  451|      2|  p->boolean.default_value = true;
  452|      2|  p->has_default = true;
  453|      2|  d[i++] = p++;
  454|       |
  455|      2|  assert(i < MAX_NPARAMETERS + 1);
  ------------------
  |  Branch (455:3): [True: 2, False: 0]
  ------------------
  456|      2|  d[i++] = nullptr;
  457|      2|}

_Z23get_encoder_plugin_jpegv:
  548|      2|{
  549|      2|  return &encoder_plugin_jpeg;
  550|      2|}
encoder_jpeg.cc:_ZL16jpeg_init_pluginv:
  118|      2|{
  119|      2|  jpeg_init_parameters();
  120|      2|}
encoder_jpeg.cc:_ZL20jpeg_init_parametersv:
   80|      2|{
   81|      2|  heif_encoder_parameter* p = jpeg_encoder_params;
   82|      2|  const heif_encoder_parameter** d = jpeg_encoder_parameter_ptrs;
   83|      2|  int i = 0;
   84|       |
   85|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (85:3): [True: 2, False: 0]
  ------------------
   86|      2|  p->version = 2;
   87|      2|  p->name = heif_encoder_parameter_name_quality;
  ------------------
  |  |  317|      2|#define heif_encoder_parameter_name_quality  "quality"
  ------------------
   88|      2|  p->type = heif_encoder_parameter_type_integer;
   89|      2|  p->integer.default_value = 50;
   90|      2|  p->has_default = true;
   91|      2|  p->integer.have_minimum_maximum = true;
   92|      2|  p->integer.minimum = 0;
   93|      2|  p->integer.maximum = 100;
   94|      2|  p->integer.valid_values = NULL;
   95|      2|  p->integer.num_valid_values = 0;
   96|      2|  d[i++] = p++;
   97|       |
   98|       |  /*
   99|       |  assert(i < MAX_NPARAMETERS);
  100|       |  p->version = 2;
  101|       |  p->name = heif_encoder_parameter_name_lossless;
  102|       |  p->type = heif_encoder_parameter_type_boolean;
  103|       |  p->boolean.default_value = false;
  104|       |  p->has_default = true;
  105|       |  d[i++] = p++;
  106|       |*/
  107|       |
  108|      2|  d[i++] = nullptr;
  109|      2|}

_Z23get_encoder_plugin_maskv:
  293|      2|{
  294|      2|  return &encoder_plugin_mask;
  295|      2|}
encoder_mask.cc:_ZL16mask_init_pluginv:
   80|      2|{
   81|      2|  mask_init_parameters();
   82|      2|}
encoder_mask.cc:_ZL20mask_init_parametersv:
   56|      2|{
   57|      2|  heif_encoder_parameter* p = mask_encoder_params;
   58|      2|  const heif_encoder_parameter** d = mask_encoder_parameter_ptrs;
   59|      2|  int i = 0;
   60|       |
   61|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (61:3): [True: 2, False: 0]
  ------------------
   62|      2|  p->version = 2;
   63|      2|  p->name = kParam_interleave;
   64|      2|  p->type = heif_encoder_parameter_type_string;
   65|      2|  p->string.default_value = "planar";
   66|      2|  p->has_default = true;
   67|      2|  d[i++] = p++;
   68|       |
   69|      2|  assert(i < MAX_NPARAMETERS + 1);
  ------------------
  |  Branch (69:3): [True: 2, False: 0]
  ------------------
   70|      2|  d[i++] = nullptr;
   71|      2|}

_Z15opj_init_pluginv:
  112|      2|{
  113|      2|  opj_init_parameters();
  114|      2|}
_Z27get_encoder_plugin_openjpegv:
  680|      2|{
  681|      2|  return &encoder_plugin_openjpeg;
  682|      2|}
encoder_openjpeg.cc:_ZL19opj_init_parametersv:
   94|      2|{
   95|      2|  heif_encoder_parameter* p = opj_encoder_params;
   96|      2|  const heif_encoder_parameter** d = opj_encoder_parameter_ptrs;
   97|      2|  int i = 0;
   98|       |
   99|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (99:3): [True: 2, False: 0]
  ------------------
  100|      2|  p->version = 2;
  101|      2|  p->name = kParam_chroma;
  102|      2|  p->type = heif_encoder_parameter_type_string;
  103|       |  //p->string.default_value = "420";
  104|      2|  p->has_default = false;
  105|      2|  p->string.valid_values = kParam_chroma_valid_values;
  106|      2|  d[i++] = p++;
  107|       |
  108|      2|  d[i++] = nullptr;
  109|      2|}

_Z16ojph_init_pluginv:
  231|      2|{
  232|      2|  ojph_init_encoder_parameters();
  233|      2|}
_Z26get_encoder_plugin_openjphv:
  944|      2|{
  945|      2|  return &encoder_plugin_openjph;
  946|      2|}
encoder_openjph.cc:_ZL28ojph_init_encoder_parametersv:
  134|      2|{
  135|      2|  heif_encoder_parameter* p = ojph_encoder_params;
  136|      2|  const heif_encoder_parameter** d = ojph_encoder_parameter_ptrs;
  137|      2|  int i = 0;
  138|       |
  139|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (139:3): [True: 2, False: 0]
  ------------------
  140|      2|  p->version = 2;
  141|      2|  p->name = heif_encoder_parameter_name_lossless;
  ------------------
  |  |  318|      2|#define heif_encoder_parameter_name_lossless "lossless"
  ------------------
  142|      2|  p->type = heif_encoder_parameter_type_boolean;
  143|      2|  p->boolean.default_value = false;
  144|      2|  p->has_default = true;
  145|      2|  d[i++] = p++;
  146|       |
  147|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (147:3): [True: 2, False: 0]
  ------------------
  148|      2|  p->version = 2;
  149|      2|  p->name = kParam_chroma;
  150|      2|  p->type = heif_encoder_parameter_type_string;
  151|      2|  p->string.default_value = "444";
  152|      2|  p->has_default = true;
  153|      2|  p->string.valid_values = kParam_chroma_valid_values;
  154|      2|  d[i++] = p++;
  155|       |
  156|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (156:3): [True: 2, False: 0]
  ------------------
  157|      2|  p->version = 2;
  158|      2|  p->name = kParam_num_decompositions;
  159|      2|  p->type = heif_encoder_parameter_type_integer;
  160|      2|  p->integer.default_value = 5;
  161|      2|  p->integer.have_minimum_maximum = true;
  162|      2|  p->integer.minimum = NUM_DECOMPOSITIONS_MIN;
  163|      2|  p->integer.maximum = NUM_DECOMPOSITIONS_MAX;
  164|      2|  p->integer.valid_values = NULL;
  165|      2|  p->integer.num_valid_values = 0;
  166|      2|  p->has_default = true;
  167|      2|  d[i++] = p++;
  168|       |
  169|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (169:3): [True: 2, False: 0]
  ------------------
  170|      2|  p->version = 2;
  171|      2|  p->name = kParam_progression_order;
  172|      2|  p->type = heif_encoder_parameter_type_string;
  173|      2|  p->string.default_value = "RPCL";
  174|      2|  p->has_default = true;
  175|      2|  p->string.valid_values = kParam_progression_order_valid_values;
  176|      2|  d[i++] = p++;
  177|       |
  178|       |#if OPENJPH_MAJOR_VERSION > 1 || OPENJPH_MINOR_VERSION > 10
  179|       |  assert(i < MAX_NPARAMETERS);
  180|       |  p->version = 2;
  181|       |  p->name = kParam_tlm_marker;
  182|       |  p->type = heif_encoder_parameter_type_boolean;
  183|       |  p->boolean.default_value = false;
  184|       |  p->has_default = true;
  185|       |  d[i++] = p++;
  186|       |#endif
  187|       |
  188|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (188:3): [True: 2, False: 0]
  ------------------
  189|      2|  p->version = 2;
  190|      2|  p->name = kParam_codestream_comment;
  191|      2|  p->type = heif_encoder_parameter_type_string;
  192|      2|  p->string.default_value = nullptr;
  193|      2|  p->has_default = false;
  194|      2|  p->string.valid_values = nullptr;
  195|      2|  d[i++] = p++;
  196|       |
  197|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (197:3): [True: 2, False: 0]
  ------------------
  198|      2|  p->version = 2;
  199|      2|  p->name = kParam_tile_size;
  200|      2|  p->type = heif_encoder_parameter_type_string;
  201|      2|  p->string.default_value = "0,0";
  202|      2|  p->has_default = true;
  203|      2|  p->string.valid_values = nullptr;
  204|      2|  d[i++] = p++;
  205|       |
  206|       |#if OPENJPH_MAJOR_VERSION > 1 || OPENJPH_MINOR_VERSION > 11
  207|       |  assert(i < MAX_NPARAMETERS);
  208|       |  p->version = 2;
  209|       |  p->name = kParam_tilepart_division;
  210|       |  p->type = heif_encoder_parameter_type_string;
  211|       |  p->string.default_value = "none";
  212|       |  p->has_default = true;
  213|       |  p->string.valid_values = kParam_tilepart_division_valid_values;
  214|       |  d[i++] = p++;
  215|       |#endif
  216|       |
  217|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (217:3): [True: 2, False: 0]
  ------------------
  218|      2|  p->version = 2;
  219|      2|  p->name = kParam_block_dimensions;
  220|      2|  p->type = heif_encoder_parameter_type_string;
  221|      2|  p->string.default_value = "64,64";
  222|      2|  p->has_default = true;
  223|      2|  p->string.valid_values = nullptr;
  224|      2|  d[i++] = p++;
  225|       |
  226|      2|  d[i++] = nullptr;
  227|      2|}

_Z22get_encoder_plugin_svtv:
 1346|      2|{
 1347|      2|  return &encoder_plugin_svt;
 1348|      2|}
encoder_svt.cc:_ZL15svt_init_pluginv:
  335|      2|{
  336|      2|  svt_init_parameters();
  337|      2|}
encoder_svt.cc:_ZL19svt_init_parametersv:
  187|      2|{
  188|      2|  heif_encoder_parameter* p = svt_encoder_params;
  189|      2|  const heif_encoder_parameter** d = svt_encoder_parameter_ptrs;
  190|      2|  int i = 0;
  191|       |
  192|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (192:3): [True: 2, False: 0]
  ------------------
  193|      2|  p->version = 2;
  194|      2|  p->name = kParam_speed;
  195|      2|  p->type = heif_encoder_parameter_type_integer;
  196|      2|  p->integer.default_value = 12;
  197|      2|  p->has_default = true;
  198|      2|  p->integer.have_minimum_maximum = true;
  199|      2|  p->integer.minimum = 0;
  200|      2|  p->integer.maximum = 13;
  201|      2|  p->integer.valid_values = nullptr;
  202|      2|  p->integer.num_valid_values = 0;
  203|      2|  d[i++] = p++;
  204|       |
  205|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (205:3): [True: 2, False: 0]
  ------------------
  206|      2|  p->version = 2;
  207|      2|  p->name = kParam_threads;
  208|      2|  p->type = heif_encoder_parameter_type_integer;
  209|      2|  p->integer.default_value = 4;
  210|      2|  p->has_default = true;
  211|      2|  p->integer.have_minimum_maximum = true;
  212|      2|  p->integer.minimum = 1;
  213|      2|  p->integer.maximum = 16;
  214|      2|  p->integer.valid_values = nullptr;
  215|      2|  p->integer.num_valid_values = 0;
  216|      2|  d[i++] = p++;
  217|       |
  218|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (218:3): [True: 2, False: 0]
  ------------------
  219|      2|  p->version = 2;
  220|      2|  p->name = "tile-rows";
  221|      2|  p->type = heif_encoder_parameter_type_integer;
  222|      2|  p->integer.default_value = 4;
  223|      2|  p->has_default = true;
  224|      2|  p->integer.have_minimum_maximum = false;
  225|      2|  p->integer.valid_values = valid_tile_num_values;
  226|      2|  p->integer.num_valid_values = 7;
  227|      2|  d[i++] = p++;
  228|       |
  229|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (229:3): [True: 2, False: 0]
  ------------------
  230|      2|  p->version = 2;
  231|      2|  p->name = "tile-cols";
  232|      2|  p->type = heif_encoder_parameter_type_integer;
  233|      2|  p->integer.default_value = 4;
  234|      2|  p->has_default = true;
  235|      2|  p->integer.have_minimum_maximum = false;
  236|      2|  p->integer.valid_values = valid_tile_num_values;
  237|      2|  p->integer.num_valid_values = 7;
  238|      2|  d[i++] = p++;
  239|       |
  240|       |
  241|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (241:3): [True: 2, False: 0]
  ------------------
  242|      2|  p->version = 2;
  243|      2|  p->name = heif_encoder_parameter_name_quality;
  ------------------
  |  |  317|      2|#define heif_encoder_parameter_name_quality  "quality"
  ------------------
  244|      2|  p->type = heif_encoder_parameter_type_integer;
  245|      2|  p->integer.default_value = 50;
  246|      2|  p->has_default = true;
  247|      2|  p->integer.have_minimum_maximum = true;
  248|      2|  p->integer.minimum = 0;
  249|      2|  p->integer.maximum = 100;
  250|      2|  p->integer.valid_values = NULL;
  251|      2|  p->integer.num_valid_values = 0;
  252|      2|  d[i++] = p++;
  253|       |
  254|      2|#if SVT_AV1_CHECK_VERSION(3, 0, 0)
  255|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (255:3): [True: 2, False: 0]
  ------------------
  256|      2|  p->version = 2;
  257|      2|  p->name = heif_encoder_parameter_name_lossless;
  ------------------
  |  |  318|      2|#define heif_encoder_parameter_name_lossless "lossless"
  ------------------
  258|      2|  p->type = heif_encoder_parameter_type_boolean;
  259|      2|  p->boolean.default_value = false;
  260|      2|  p->has_default = true;
  261|      2|  d[i++] = p++;
  262|      2|#endif
  263|       |
  264|       |#if 0
  265|       |  assert(i < MAX_NPARAMETERS);
  266|       |  p->version = 2;
  267|       |  p->name = kParam_chroma;
  268|       |  p->type = heif_encoder_parameter_type_string;
  269|       |  p->string.default_value = "420";
  270|       |  p->has_default = true;
  271|       |  p->string.valid_values = kParam_chroma_valid_values;
  272|       |  d[i++] = p++;
  273|       |#endif
  274|       |
  275|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (275:3): [True: 2, False: 0]
  ------------------
  276|      2|  p->version = 2;
  277|      2|  p->name = kParam_qp;
  278|      2|  p->type = heif_encoder_parameter_type_integer;
  279|      2|  p->integer.default_value = 50;
  280|      2|  p->has_default = false;
  281|      2|  p->integer.have_minimum_maximum = true;
  282|      2|  p->integer.minimum = 0;
  283|      2|  p->integer.maximum = 63;
  284|      2|  p->integer.valid_values = nullptr;
  285|      2|  p->integer.num_valid_values = 0;
  286|      2|  d[i++] = p++;
  287|       |
  288|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (288:3): [True: 2, False: 0]
  ------------------
  289|      2|  p->version = 2;
  290|      2|  p->name = kParam_min_q;
  291|      2|  p->type = heif_encoder_parameter_type_integer;
  292|      2|  p->integer.default_value = 0;
  293|      2|  p->has_default = true;
  294|      2|  p->integer.have_minimum_maximum = true;
  295|      2|  p->integer.minimum = 0;
  296|      2|  p->integer.maximum = 63;
  297|      2|  p->integer.valid_values = nullptr;
  298|      2|  p->integer.num_valid_values = 0;
  299|      2|  d[i++] = p++;
  300|       |
  301|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (301:3): [True: 2, False: 0]
  ------------------
  302|      2|  p->version = 2;
  303|      2|  p->name = kParam_max_q;
  304|      2|  p->type = heif_encoder_parameter_type_integer;
  305|      2|  p->integer.default_value = 63;
  306|      2|  p->has_default = true;
  307|      2|  p->integer.have_minimum_maximum = true;
  308|      2|  p->integer.minimum = 0;
  309|      2|  p->integer.maximum = 63;
  310|      2|  p->integer.valid_values = nullptr;
  311|      2|  p->integer.num_valid_values = 0;
  312|      2|  d[i++] = p++;
  313|       |
  314|      2|#if SVT_AV1_CHECK_VERSION(0, 9, 1)
  315|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (315:3): [True: 2, False: 0]
  ------------------
  316|      2|  p->version = 2;
  317|      2|  p->name = kParam_tune;
  318|      2|  p->type = heif_encoder_parameter_type_string;
  319|      2|  p->string.default_value = "psnr";
  320|      2|  p->has_default = true;
  321|      2|  p->string.valid_values = kParam_tune_valid_values;
  322|      2|  d[i++] = p++;
  323|      2|#endif
  324|       |
  325|      2|  d[i++] = nullptr;
  326|      2|}

_Z31get_encoder_plugin_uncompressedv:
  359|      2|{
  360|      2|  return &encoder_plugin_uncompressed;
  361|      2|}
encoder_uncompressed.cc:_ZL24uncompressed_init_pluginv:
   80|      2|{
   81|      2|  uncompressed_init_parameters();
   82|      2|}
encoder_uncompressed.cc:_ZL28uncompressed_init_parametersv:
   56|      2|{
   57|      2|  heif_encoder_parameter* p = uncompressed_encoder_params;
   58|      2|  const heif_encoder_parameter** d = uncompressed_encoder_parameter_ptrs;
   59|      2|  int i = 0;
   60|       |
   61|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (61:3): [True: 2, False: 0]
  ------------------
   62|      2|  p->version = 2;
   63|      2|  p->name = kParam_interleave;
   64|      2|  p->type = heif_encoder_parameter_type_string;
   65|      2|  p->string.default_value = "planar";
   66|      2|  p->has_default = true;
   67|      2|  d[i++] = p++;
   68|       |
   69|      2|  assert(i < MAX_NPARAMETERS + 1);
  ------------------
  |  Branch (69:3): [True: 2, False: 0]
  ------------------
   70|      2|  d[i++] = nullptr;
   71|      2|}

_Z24get_encoder_plugin_vvencv:
  909|      2|{
  910|      2|  return &encoder_plugin_vvenc;
  911|      2|}
encoder_vvenc.cc:_ZL17vvenc_init_pluginv:
  139|      2|{
  140|      2|  vvenc_init_parameters();
  141|      2|}
encoder_vvenc.cc:_ZL21vvenc_init_parametersv:
  102|      2|{
  103|      2|  heif_encoder_parameter* p = vvenc_encoder_params;
  104|      2|  const heif_encoder_parameter** d = vvenc_encoder_parameter_ptrs;
  105|      2|  int i = 0;
  106|       |
  107|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (107:3): [True: 2, False: 0]
  ------------------
  108|      2|  p->version = 2;
  109|      2|  p->name = heif_encoder_parameter_name_quality;
  ------------------
  |  |  317|      2|#define heif_encoder_parameter_name_quality  "quality"
  ------------------
  110|      2|  p->type = heif_encoder_parameter_type_integer;
  111|      2|  p->integer.default_value = 50;
  112|      2|  p->has_default = true;
  113|      2|  p->integer.have_minimum_maximum = true;
  114|      2|  p->integer.minimum = 0;
  115|      2|  p->integer.maximum = 100;
  116|      2|  p->integer.valid_values = NULL;
  117|      2|  p->integer.num_valid_values = 0;
  118|      2|  d[i++] = p++;
  119|       |
  120|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (120:3): [True: 2, False: 0]
  ------------------
  121|      2|  p->version = 2;
  122|      2|  p->name = heif_encoder_parameter_name_lossless;
  ------------------
  |  |  318|      2|#define heif_encoder_parameter_name_lossless "lossless"
  ------------------
  123|      2|  p->type = heif_encoder_parameter_type_boolean;
  124|      2|  p->boolean.default_value = false;
  125|      2|  p->has_default = true;
  126|      2|  d[i++] = p++;
  127|       |
  128|      2|  d[i++] = nullptr;
  129|      2|}

_Z23get_encoder_plugin_x264v:
 1277|      2|{
 1278|      2|  return &encoder_plugin_x264;
 1279|      2|}
encoder_x264.cc:_ZL16x264_init_pluginv:
  370|      2|{
  371|      2|  x264_init_parameters();
  372|      2|}
encoder_x264.cc:_ZL20x264_init_parametersv:
  280|      2|{
  281|      2|  heif_encoder_parameter* p = x264_encoder_params;
  282|      2|  const heif_encoder_parameter** d = x264_encoder_parameter_ptrs;
  283|      2|  int i = 0;
  284|       |
  285|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (285:3): [True: 2, False: 0]
  ------------------
  286|      2|  p->version = 2;
  287|      2|  p->name = heif_encoder_parameter_name_quality;
  ------------------
  |  |  317|      2|#define heif_encoder_parameter_name_quality  "quality"
  ------------------
  288|      2|  p->type = heif_encoder_parameter_type_integer;
  289|      2|  p->integer.default_value = 50;
  290|      2|  p->has_default = true;
  291|      2|  p->integer.have_minimum_maximum = true;
  292|      2|  p->integer.minimum = 0;
  293|      2|  p->integer.maximum = 100;
  294|      2|  p->integer.valid_values = NULL;
  295|      2|  p->integer.num_valid_values = 0;
  296|      2|  d[i++] = p++;
  297|       |
  298|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (298:3): [True: 2, False: 0]
  ------------------
  299|      2|  p->version = 2;
  300|      2|  p->name = heif_encoder_parameter_name_lossless;
  ------------------
  |  |  318|      2|#define heif_encoder_parameter_name_lossless "lossless"
  ------------------
  301|      2|  p->type = heif_encoder_parameter_type_boolean;
  302|      2|  p->boolean.default_value = false;
  303|      2|  p->has_default = true;
  304|      2|  d[i++] = p++;
  305|       |
  306|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (306:3): [True: 2, False: 0]
  ------------------
  307|      2|  p->version = 2;
  308|      2|  p->name = kParam_preset;
  309|      2|  p->type = heif_encoder_parameter_type_string;
  310|      2|  p->string.default_value = "slow";  // increases computation time
  311|      2|  p->has_default = true;
  312|      2|  p->string.valid_values = kParam_preset_valid_values;
  313|      2|  d[i++] = p++;
  314|       |
  315|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (315:3): [True: 2, False: 0]
  ------------------
  316|      2|  p->version = 2;
  317|      2|  p->name = kParam_tune;
  318|      2|  p->type = heif_encoder_parameter_type_string;
  319|      2|  p->string.default_value = "ssim";
  320|      2|  p->has_default = true;
  321|      2|  p->string.valid_values = kParam_tune_valid_values;
  322|      2|  d[i++] = p++;
  323|       |
  324|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (324:3): [True: 2, False: 0]
  ------------------
  325|      2|  p->version = 2;
  326|      2|  p->name = kParam_TU_intra_depth;
  327|      2|  p->type = heif_encoder_parameter_type_integer;
  328|      2|  p->integer.default_value = 2;  // increases computation time
  329|      2|  p->has_default = true;
  330|      2|  p->integer.have_minimum_maximum = true;
  331|      2|  p->integer.minimum = 1;
  332|      2|  p->integer.maximum = 4;
  333|      2|  p->integer.valid_values = NULL;
  334|      2|  p->integer.num_valid_values = 0;
  335|      2|  d[i++] = p++;
  336|       |
  337|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (337:3): [True: 2, False: 0]
  ------------------
  338|      2|  p->version = 2;
  339|      2|  p->name = kParam_complexity;
  340|      2|  p->type = heif_encoder_parameter_type_integer;
  341|      2|  p->integer.default_value = 50;
  342|      2|  p->has_default = false;
  343|      2|  p->integer.have_minimum_maximum = true;
  344|      2|  p->integer.minimum = 0;
  345|      2|  p->integer.maximum = 100;
  346|      2|  p->integer.valid_values = NULL;
  347|      2|  p->integer.num_valid_values = 0;
  348|      2|  d[i++] = p++;
  349|       |
  350|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (350:3): [True: 2, False: 0]
  ------------------
  351|      2|  p->version = 2;
  352|      2|  p->name = kParam_chroma;
  353|      2|  p->type = heif_encoder_parameter_type_string;
  354|      2|  p->string.default_value = "420";
  355|      2|  p->has_default = true;
  356|      2|  p->string.valid_values = kParam_chroma_valid_values;
  357|      2|  d[i++] = p++;
  358|       |
  359|      2|  d[i++] = nullptr;
  360|      2|}

_Z23get_encoder_plugin_x265v:
 1344|      2|{
 1345|      2|  return &encoder_plugin_x265;
 1346|      2|}
encoder_x265.cc:_ZL16x265_init_pluginv:
  311|      2|{
  312|      2|  x265_init_parameters();
  313|      2|}
encoder_x265.cc:_ZL20x265_init_parametersv:
  221|      2|{
  222|      2|  heif_encoder_parameter* p = x265_encoder_params;
  223|      2|  const heif_encoder_parameter** d = x265_encoder_parameter_ptrs;
  224|      2|  int i = 0;
  225|       |
  226|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (226:3): [True: 2, False: 0]
  ------------------
  227|      2|  p->version = 2;
  228|      2|  p->name = heif_encoder_parameter_name_quality;
  ------------------
  |  |  317|      2|#define heif_encoder_parameter_name_quality  "quality"
  ------------------
  229|      2|  p->type = heif_encoder_parameter_type_integer;
  230|      2|  p->integer.default_value = 50;
  231|      2|  p->has_default = true;
  232|      2|  p->integer.have_minimum_maximum = true;
  233|      2|  p->integer.minimum = 0;
  234|      2|  p->integer.maximum = 100;
  235|      2|  p->integer.valid_values = NULL;
  236|      2|  p->integer.num_valid_values = 0;
  237|      2|  d[i++] = p++;
  238|       |
  239|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (239:3): [True: 2, False: 0]
  ------------------
  240|      2|  p->version = 2;
  241|      2|  p->name = heif_encoder_parameter_name_lossless;
  ------------------
  |  |  318|      2|#define heif_encoder_parameter_name_lossless "lossless"
  ------------------
  242|      2|  p->type = heif_encoder_parameter_type_boolean;
  243|      2|  p->boolean.default_value = false;
  244|      2|  p->has_default = true;
  245|      2|  d[i++] = p++;
  246|       |
  247|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (247:3): [True: 2, False: 0]
  ------------------
  248|      2|  p->version = 2;
  249|      2|  p->name = kParam_preset;
  250|      2|  p->type = heif_encoder_parameter_type_string;
  251|      2|  p->string.default_value = "slow";  // increases computation time
  252|      2|  p->has_default = true;
  253|      2|  p->string.valid_values = kParam_preset_valid_values;
  254|      2|  d[i++] = p++;
  255|       |
  256|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (256:3): [True: 2, False: 0]
  ------------------
  257|      2|  p->version = 2;
  258|      2|  p->name = kParam_tune;
  259|      2|  p->type = heif_encoder_parameter_type_string;
  260|      2|  p->string.default_value = "ssim";
  261|      2|  p->has_default = true;
  262|      2|  p->string.valid_values = kParam_tune_valid_values;
  263|      2|  d[i++] = p++;
  264|       |
  265|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (265:3): [True: 2, False: 0]
  ------------------
  266|      2|  p->version = 2;
  267|      2|  p->name = kParam_TU_intra_depth;
  268|      2|  p->type = heif_encoder_parameter_type_integer;
  269|      2|  p->integer.default_value = 2;  // increases computation time
  270|      2|  p->has_default = true;
  271|      2|  p->integer.have_minimum_maximum = true;
  272|      2|  p->integer.minimum = 1;
  273|      2|  p->integer.maximum = 4;
  274|      2|  p->integer.valid_values = NULL;
  275|      2|  p->integer.num_valid_values = 0;
  276|      2|  d[i++] = p++;
  277|       |
  278|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (278:3): [True: 2, False: 0]
  ------------------
  279|      2|  p->version = 2;
  280|      2|  p->name = kParam_complexity;
  281|      2|  p->type = heif_encoder_parameter_type_integer;
  282|      2|  p->integer.default_value = 50;
  283|      2|  p->has_default = false;
  284|      2|  p->integer.have_minimum_maximum = true;
  285|      2|  p->integer.minimum = 0;
  286|      2|  p->integer.maximum = 100;
  287|      2|  p->integer.valid_values = NULL;
  288|      2|  p->integer.num_valid_values = 0;
  289|      2|  d[i++] = p++;
  290|       |
  291|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (291:3): [True: 2, False: 0]
  ------------------
  292|      2|  p->version = 2;
  293|      2|  p->name = kParam_chroma;
  294|      2|  p->type = heif_encoder_parameter_type_string;
  295|      2|  p->string.default_value = "420";
  296|      2|  p->has_default = true;
  297|      2|  p->string.valid_values = kParam_chroma_valid_values;
  298|      2|  d[i++] = p++;
  299|       |
  300|      2|  d[i++] = nullptr;
  301|      2|}

_Z22get_memory_usage_mutexv:
  163|  67.2k|{
  164|  67.2k|  static std::mutex sMutex;
  165|  67.2k|  return sMutex;
  166|  67.2k|}
_ZN18TotalMemoryTrackerC2EPK20heif_security_limits:
  171|  16.2k|{
  172|  16.2k|  std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  173|       |
  174|  16.2k|  sMemoryUsage[limits] = {};
  175|  16.2k|  m_limits_context = limits;
  176|  16.2k|}
_ZN18TotalMemoryTrackerD2Ev:
  179|  16.2k|{
  180|  16.2k|  std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  181|  16.2k|  sMemoryUsage.erase(m_limits_context);
  182|  16.2k|}
_ZN12MemoryHandle5allocEmmPK20heif_security_limitsPKc:
  203|  6.76k|{
  204|  6.76k|  if (element_size != 0 && count > SIZE_MAX / element_size) {
  ------------------
  |  Branch (204:7): [True: 6.76k, False: 0]
  |  Branch (204:28): [True: 0, False: 6.76k]
  ------------------
  205|      0|    std::stringstream sstr;
  206|      0|    if (reason_description) {
  ------------------
  |  Branch (206:9): [True: 0, False: 0]
  ------------------
  207|      0|      sstr << "Allocation size overflow computing " << count << " * " << element_size
  208|      0|           << " for " << reason_description;
  209|      0|    }
  210|      0|    else {
  211|      0|      sstr << "Allocation size overflow computing " << count << " * " << element_size;
  212|      0|    }
  213|      0|    return {heif_error_Memory_allocation_error,
  214|      0|            heif_suberror_Security_limit_exceeded,
  215|      0|            sstr.str()};
  216|      0|  }
  217|  6.76k|  return alloc(count * element_size, limits_context, reason_description);
  218|  6.76k|}
_ZN12MemoryHandle5allocEmPK20heif_security_limitsPKc:
  223|  17.3k|{
  224|       |  // --- check whether limits are exceeded
  225|       |
  226|  17.3k|  if (!limits_context) {
  ------------------
  |  Branch (226:7): [True: 0, False: 17.3k]
  ------------------
  227|      0|    return Error::Ok;
  228|      0|  }
  229|       |
  230|       |  // check against maximum memory block size
  231|       |
  232|  17.3k|  if (limits_context->max_memory_block_size != 0 &&
  ------------------
  |  Branch (232:7): [True: 17.3k, False: 0]
  ------------------
  233|  17.3k|      memory_amount > limits_context->max_memory_block_size) {
  ------------------
  |  Branch (233:7): [True: 21, False: 17.3k]
  ------------------
  234|     21|    std::stringstream sstr;
  235|       |
  236|     21|    if (reason_description) {
  ------------------
  |  Branch (236:9): [True: 21, False: 0]
  ------------------
  237|     21|      sstr << "Allocating " << memory_amount << " bytes for " << reason_description <<" exceeds the security limit of "
  238|     21|           << limits_context->max_memory_block_size << " bytes";
  239|     21|    }
  240|      0|    else {
  241|      0|      sstr << "Allocating " << memory_amount << " bytes exceeds the security limit of "
  242|      0|           << limits_context->max_memory_block_size << " bytes";
  243|      0|    }
  244|       |
  245|     21|    return {heif_error_Memory_allocation_error,
  246|     21|            heif_suberror_Security_limit_exceeded,
  247|     21|            sstr.str()};
  248|     21|  }
  249|       |
  250|       |  // Resolve to the registered (root) context for total-memory accounting.
  251|       |  // The passed-in limits may be a stack-local derived copy (e.g. tightened for
  252|       |  // ispe) whose `parent` points back to the registered context.
  253|  17.3k|  const heif_security_limits* root_limits = limits_context;
  254|  17.3k|  while (root_limits->version >= 4 && root_limits->parent) {
  ------------------
  |  Branch (254:10): [True: 17.3k, False: 0]
  |  Branch (254:39): [True: 0, False: 17.3k]
  ------------------
  255|      0|    root_limits = root_limits->parent;
  256|      0|  }
  257|       |
  258|       |  // we allow several allocations on the same handle, but they have to be for the same registered context
  259|  17.3k|  if (m_limits_context) {
  ------------------
  |  Branch (259:7): [True: 0, False: 17.3k]
  ------------------
  260|      0|    assert(m_limits_context == root_limits);
  ------------------
  |  Branch (260:5): [True: 0, False: 0]
  ------------------
  261|      0|  }
  262|       |
  263|  17.3k|  if (root_limits == &global_security_limits ||
  ------------------
  |  Branch (263:7): [True: 0, False: 17.3k]
  ------------------
  264|  17.3k|      root_limits == &disabled_security_limits) {
  ------------------
  |  Branch (264:7): [True: 0, False: 17.3k]
  ------------------
  265|      0|    return Error::Ok;
  266|      0|  }
  267|       |
  268|  17.3k|  std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  269|  17.3k|  auto it = sMemoryUsage.find(root_limits);
  270|  17.3k|  if (it == sMemoryUsage.end()) {
  ------------------
  |  Branch (270:7): [True: 0, False: 17.3k]
  ------------------
  271|       |    // Unregistered limits context with no resolvable parent — total-memory
  272|       |    // tracking is not available, but the per-block check above still applies.
  273|      0|    return Error::Ok;
  274|      0|  }
  275|       |
  276|       |  // check against maximum total memory usage
  277|       |
  278|  17.3k|  if (limits_context->max_total_memory != 0 &&
  ------------------
  |  Branch (278:7): [True: 17.3k, False: 0]
  ------------------
  279|  17.3k|      it->second.total_memory_usage + memory_amount > limits_context->max_total_memory) {
  ------------------
  |  Branch (279:7): [True: 31, False: 17.3k]
  ------------------
  280|     31|    std::stringstream sstr;
  281|       |
  282|     31|    if (reason_description) {
  ------------------
  |  Branch (282:9): [True: 31, False: 0]
  ------------------
  283|     31|      sstr << "Memory usage of " << it->second.total_memory_usage + memory_amount
  284|     31|           << " bytes for " << reason_description << " exceeds the security limit of "
  285|     31|           << limits_context->max_total_memory << " bytes of total memory usage";
  286|     31|    }
  287|      0|    else {
  288|      0|      sstr << "Memory usage of " << it->second.total_memory_usage + memory_amount
  289|      0|           << " bytes exceeds the security limit of "
  290|      0|           << limits_context->max_total_memory << " bytes of total memory usage";
  291|      0|    }
  292|       |
  293|     31|    return {heif_error_Memory_allocation_error,
  294|     31|            heif_suberror_Security_limit_exceeded,
  295|     31|            sstr.str()};
  296|     31|  }
  297|       |
  298|       |
  299|       |  // --- register memory usage
  300|       |
  301|  17.3k|  m_limits_context = root_limits;
  302|  17.3k|  m_memory_amount += memory_amount;
  303|       |
  304|  17.3k|  it->second.total_memory_usage += memory_amount;
  305|       |
  306|       |  // remember maximum memory usage (for informational purpose)
  307|  17.3k|  if (it->second.total_memory_usage > it->second.max_memory_usage) {
  ------------------
  |  Branch (307:7): [True: 3.22k, False: 14.0k]
  ------------------
  308|  3.22k|    it->second.max_memory_usage = it->second.total_memory_usage;
  309|  3.22k|  }
  310|       |
  311|  17.3k|  return Error::Ok;
  312|  17.3k|}
_ZN12MemoryHandle4freeEv:
  316|  19.2k|{
  317|  19.2k|  if (m_limits_context) {
  ------------------
  |  Branch (317:7): [True: 17.3k, False: 1.98k]
  ------------------
  318|  17.3k|    std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  319|       |
  320|  17.3k|    auto it = sMemoryUsage.find(m_limits_context);
  321|  17.3k|    if (it != sMemoryUsage.end()) {
  ------------------
  |  Branch (321:9): [True: 17.3k, False: 0]
  ------------------
  322|  17.3k|      it->second.total_memory_usage -= m_memory_amount;
  323|  17.3k|    }
  324|       |
  325|  17.3k|    m_limits_context = nullptr;
  326|  17.3k|    m_memory_amount = 0;
  327|  17.3k|  }
  328|  19.2k|}

_ZN12MemoryHandleD2Ev:
  157|  19.2k|  ~MemoryHandle() { free(); }
_ZN12MemoryHandleC2Ev:
  156|  19.2k|  MemoryHandle() = default;

_ZN13Box_container5parseER14BitstreamRangePK20heif_security_limits:
   30|  2.58k|{
   31|  2.58k|  return read_children(range, READ_CHILDREN_ALL, limits);
   32|  2.58k|}
_ZNK13Box_container4dumpER6Indent:
   36|  2.34k|{
   37|  2.34k|  std::ostringstream sstr;
   38|  2.34k|  sstr << Box::dump(indent);
   39|  2.34k|  sstr << dump_children(indent);
   40|       |
   41|  2.34k|  return sstr.str();
   42|  2.34k|}
_ZNK8Box_mvhd18get_matrix_elementEi:
   46|  16.5k|{
   47|  16.5k|  if (idx == 8) {
  ------------------
  |  Branch (47:7): [True: 1.83k, False: 14.6k]
  ------------------
   48|  1.83k|    return 1.0;
   49|  1.83k|  }
   50|       |
   51|  14.6k|  return m_matrix[idx] / double(0x10000);
   52|  16.5k|}
_ZN8Box_mvhd5parseER14BitstreamRangePK20heif_security_limits:
   56|  2.26k|{
   57|  2.26k|  parse_full_box_header(range);
   58|       |
   59|  2.26k|  if (get_version() > 1) {
  ------------------
  |  Branch (59:7): [True: 2, False: 2.26k]
  ------------------
   60|      2|    return unsupported_version_error("mvhd");
   61|      2|  }
   62|       |
   63|  2.26k|  if (get_version() == 1) {
  ------------------
  |  Branch (63:7): [True: 107, False: 2.15k]
  ------------------
   64|    107|    m_creation_time = range.read64();
   65|    107|    m_modification_time = range.read64();
   66|    107|    m_timescale = range.read32();
   67|    107|    m_duration = range.read64();
   68|    107|  }
   69|  2.15k|  else {
   70|       |    // version==0
   71|  2.15k|    m_creation_time = range.read32();
   72|  2.15k|    m_modification_time = range.read32();
   73|  2.15k|    m_timescale = range.read32();
   74|  2.15k|    m_duration = range.read32();
   75|  2.15k|  }
   76|       |
   77|  2.26k|  m_rate = range.read32();
   78|  2.26k|  m_volume = range.read16();
   79|  2.26k|  range.skip(2);
   80|  2.26k|  range.skip(8);
   81|  20.3k|  for (uint32_t& m : m_matrix) {
  ------------------
  |  Branch (81:20): [True: 20.3k, False: 2.26k]
  ------------------
   82|  20.3k|    m = range.read32();
   83|  20.3k|  }
   84|  15.8k|  for (int i = 0; i < 6; i++) {
  ------------------
  |  Branch (84:19): [True: 13.5k, False: 2.26k]
  ------------------
   85|  13.5k|    range.skip(4);
   86|  13.5k|  }
   87|       |
   88|  2.26k|  m_next_track_ID = range.read32();
   89|       |
   90|  2.26k|  return range.get_error();
   91|  2.26k|}
_ZNK8Box_mvhd4dumpER6Indent:
   95|  1.83k|{
   96|  1.83k|  std::ostringstream sstr;
   97|  1.83k|  sstr << FullBox::dump(indent);
   98|  1.83k|  sstr << indent << "creation time:     " << m_creation_time << "\n"
   99|  1.83k|      << indent << "modification time: " << m_modification_time << "\n"
  100|  1.83k|      << indent << "timescale: " << m_timescale << "\n"
  101|  1.83k|      << indent << "duration: " << m_duration << "\n";
  102|  1.83k|  sstr << indent << "rate: " << get_rate() << "\n"
  103|  1.83k|      << indent << "volume: " << get_volume() << "\n"
  104|  1.83k|      << indent << "matrix:\n";
  105|  7.34k|  for (int y = 0; y < 3; y++) {
  ------------------
  |  Branch (105:19): [True: 5.50k, False: 1.83k]
  ------------------
  106|  5.50k|    sstr << indent << "  ";
  107|  22.0k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (107:21): [True: 16.5k, False: 5.50k]
  ------------------
  108|  16.5k|      sstr << get_matrix_element(i + 3 * y) << " ";
  109|  16.5k|    }
  110|  5.50k|    sstr << "\n";
  111|  5.50k|  }
  112|  1.83k|  sstr << indent << "next_track_ID: " << m_next_track_ID << "\n";
  113|       |
  114|  1.83k|  return sstr.str();
  115|  1.83k|}
_ZNK8Box_tkhd18get_matrix_elementEi:
  170|  11.3k|{
  171|  11.3k|  if (idx == 8) {
  ------------------
  |  Branch (171:7): [True: 1.26k, False: 10.0k]
  ------------------
  172|  1.26k|    return 1.0;
  173|  1.26k|  }
  174|       |
  175|  10.0k|  return m_matrix[idx] / double(0x10000);
  176|  11.3k|}
_ZN8Box_tkhd5parseER14BitstreamRangePK20heif_security_limits:
  180|  1.37k|{
  181|  1.37k|  parse_full_box_header(range);
  182|       |
  183|  1.37k|  if (get_version() > 1) {
  ------------------
  |  Branch (183:7): [True: 6, False: 1.36k]
  ------------------
  184|      6|    return unsupported_version_error("tkhd");
  185|      6|  }
  186|       |
  187|  1.36k|  if (get_version() == 1) {
  ------------------
  |  Branch (187:7): [True: 58, False: 1.31k]
  ------------------
  188|     58|    m_creation_time = range.read64();
  189|     58|    m_modification_time = range.read64();
  190|     58|    m_track_id = range.read32();
  191|     58|    range.skip(4);
  192|     58|    m_duration = range.read64();
  193|     58|  }
  194|  1.31k|  else {
  195|       |    // version==0
  196|  1.31k|    m_creation_time = range.read32();
  197|  1.31k|    m_modification_time = range.read32();
  198|  1.31k|    m_track_id = range.read32();
  199|  1.31k|    range.skip(4);
  200|  1.31k|    m_duration = range.read32();
  201|  1.31k|  }
  202|       |
  203|  1.36k|  range.skip(8);
  204|  1.36k|  m_layer = range.read16();
  205|  1.36k|  m_alternate_group = range.read16();
  206|  1.36k|  m_volume = range.read16();
  207|  1.36k|  range.skip(2);
  208|  12.3k|  for (uint32_t& m : m_matrix) {
  ------------------
  |  Branch (208:20): [True: 12.3k, False: 1.36k]
  ------------------
  209|  12.3k|    m = range.read32();
  210|  12.3k|  }
  211|       |
  212|  1.36k|  m_width = range.read32();
  213|  1.36k|  m_height = range.read32();
  214|       |
  215|  1.36k|  return range.get_error();
  216|  1.37k|}
_ZNK8Box_tkhd4dumpER6Indent:
  220|  1.26k|{
  221|  1.26k|  std::ostringstream sstr;
  222|  1.26k|  sstr << FullBox::dump(indent);
  223|  1.26k|  sstr << indent << "track enabled: " << ((get_flags() & Track_enabled) ? "yes" : "no") << "\n"
  ------------------
  |  Branch (223:43): [True: 309, False: 951]
  ------------------
  224|  1.26k|       << indent << "track in movie: " << ((get_flags() & Track_in_movie) ? "yes" : "no") << "\n"
  ------------------
  |  Branch (224:44): [True: 309, False: 951]
  ------------------
  225|  1.26k|       << indent << "track in preview: " << ((get_flags() & Track_in_preview) ? "yes" : "no") << "\n"
  ------------------
  |  Branch (225:46): [True: 324, False: 936]
  ------------------
  226|  1.26k|       << indent << "track size is aspect ratio: " << ((get_flags() & Track_size_is_aspect_ratio) ? "yes" : "no") << "\n";
  ------------------
  |  Branch (226:56): [True: 288, False: 972]
  ------------------
  227|  1.26k|  sstr << indent << "creation time:     " << m_creation_time << "\n"
  228|  1.26k|      << indent << "modification time: " << m_modification_time << "\n"
  229|  1.26k|      << indent << "track ID: " << m_track_id << "\n"
  230|  1.26k|      << indent << "duration: " << m_duration << "\n";
  231|  1.26k|  sstr << indent << "layer: " << m_layer << "\n"
  232|  1.26k|      << indent << "alternate_group: " << m_alternate_group << "\n"
  233|  1.26k|      << indent << "volume: " << get_volume() << "\n"
  234|  1.26k|      << indent << "matrix:\n";
  235|  5.04k|  for (int y = 0; y < 3; y++) {
  ------------------
  |  Branch (235:19): [True: 3.78k, False: 1.26k]
  ------------------
  236|  3.78k|    sstr << indent << "  ";
  237|  15.1k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (237:21): [True: 11.3k, False: 3.78k]
  ------------------
  238|  11.3k|      sstr << get_matrix_element(i + 3 * y) << " ";
  239|  11.3k|    }
  240|  3.78k|    sstr << "\n";
  241|  3.78k|  }
  242|       |
  243|  1.26k|  sstr << indent << "width: " << get_width() << "\n"
  244|  1.26k|      << indent << "height: " << get_height() << "\n";
  245|       |
  246|  1.26k|  return sstr.str();
  247|  1.26k|}
_ZN8Box_mdhd5parseER14BitstreamRangePK20heif_security_limits:
  302|    594|{
  303|    594|  parse_full_box_header(range);
  304|       |
  305|    594|  if (get_version() > 1) {
  ------------------
  |  Branch (305:7): [True: 3, False: 591]
  ------------------
  306|      3|    return unsupported_version_error("mdhd");
  307|      3|  }
  308|       |
  309|    591|  if (get_version() == 1) {
  ------------------
  |  Branch (309:7): [True: 72, False: 519]
  ------------------
  310|     72|    m_creation_time = range.read64();
  311|     72|    m_modification_time = range.read64();
  312|     72|    m_timescale = range.read32();
  313|     72|    m_duration = range.read64();
  314|     72|  }
  315|    519|  else {
  316|       |    // version==0
  317|    519|    m_creation_time = range.read32();
  318|    519|    m_modification_time = range.read32();
  319|    519|    m_timescale = range.read32();
  320|    519|    m_duration = range.read32();
  321|    519|  }
  322|       |
  323|    591|  uint16_t language_packed = range.read16();
  324|    591|  m_language[0] = ((language_packed >> 10) & 0x1F) + 0x60;
  325|    591|  m_language[1] = ((language_packed >> 5) & 0x1F) + 0x60;
  326|    591|  m_language[2] = ((language_packed >> 0) & 0x1F) + 0x60;
  327|    591|  m_language[3] = 0;
  328|       |
  329|    591|  range.skip(2);
  330|       |
  331|    591|  return range.get_error();
  332|    594|}
_ZNK8Box_mdhd4dumpER6Indent:
  336|    528|{
  337|    528|  std::ostringstream sstr;
  338|    528|  sstr << FullBox::dump(indent);
  339|    528|  sstr << indent << "creation time:     " << m_creation_time << "\n"
  340|    528|      << indent << "modification time: " << m_modification_time << "\n"
  341|    528|      << indent << "timescale: " << m_timescale << "\n"
  342|    528|      << indent << "duration: " << m_duration << "\n";
  343|    528|  sstr << indent << "language: " << m_language << "\n";
  344|       |
  345|    528|  return sstr.str();
  346|    528|}
_ZN8Box_vmhd5parseER14BitstreamRangePK20heif_security_limits:
  394|    463|{
  395|    463|  parse_full_box_header(range);
  396|       |
  397|    463|  if (get_version() > 0) {
  ------------------
  |  Branch (397:7): [True: 1, False: 462]
  ------------------
  398|      1|    return unsupported_version_error("vmhd");
  399|      1|  }
  400|       |
  401|    462|  m_graphics_mode = range.read16();
  402|  1.38k|  for (uint16_t& c : m_op_color) {
  ------------------
  |  Branch (402:20): [True: 1.38k, False: 462]
  ------------------
  403|  1.38k|    c = range.read16();
  404|  1.38k|  }
  405|       |
  406|    462|  return range.get_error();
  407|    463|}
_ZNK8Box_vmhd4dumpER6Indent:
  411|    393|{
  412|    393|  std::ostringstream sstr;
  413|    393|  sstr << FullBox::dump(indent);
  414|    393|  sstr << indent << "graphics mode: " << m_graphics_mode;
  415|    393|  if (m_graphics_mode == 0) {
  ------------------
  |  Branch (415:7): [True: 285, False: 108]
  ------------------
  416|    285|    sstr << " (copy)";
  417|    285|  }
  418|    393|  sstr << "\n"
  419|    393|       << indent << "op color: " << m_op_color[0] << "; " << m_op_color[1] << "; " << m_op_color[2] << "\n";
  420|       |
  421|    393|  return sstr.str();
  422|    393|}
_ZN8Box_nmhd5parseER14BitstreamRangePK20heif_security_limits:
  441|    500|{
  442|    500|  parse_full_box_header(range);
  443|       |
  444|    500|  if (get_version() > 0) {
  ------------------
  |  Branch (444:7): [True: 1, False: 499]
  ------------------
  445|      1|    return unsupported_version_error("nmhd");
  446|      1|  }
  447|       |
  448|    499|  return range.get_error();
  449|    500|}
_ZNK8Box_nmhd4dumpER6Indent:
  453|    496|{
  454|    496|  std::ostringstream sstr;
  455|    496|  sstr << FullBox::dump(indent);
  456|       |
  457|    496|  return sstr.str();
  458|    496|}
_ZN8Box_stsd5parseER14BitstreamRangePK20heif_security_limits:
  472|  1.40k|{
  473|  1.40k|  parse_full_box_header(range);
  474|       |
  475|  1.40k|  if (get_version() > 0) {
  ------------------
  |  Branch (475:7): [True: 1, False: 1.40k]
  ------------------
  476|      1|    return unsupported_version_error("stsd");
  477|      1|  }
  478|       |
  479|  1.40k|  uint32_t entry_count = range.read32();
  480|       |
  481|  1.40k|  if (limits->max_sample_description_box_entries &&
  ------------------
  |  Branch (481:7): [True: 1.40k, False: 0]
  ------------------
  482|  1.40k|      entry_count > limits->max_sample_description_box_entries) {
  ------------------
  |  Branch (482:7): [True: 42, False: 1.36k]
  ------------------
  483|     42|    std::stringstream sstr;
  484|     42|    sstr << "Allocating " << static_cast<uint64_t>(entry_count) << " sample description items exceeds the security limit of "
  485|     42|         << limits->max_sample_description_box_entries << " items";
  486|       |
  487|     42|    return {heif_error_Memory_allocation_error,
  488|     42|            heif_suberror_Security_limit_exceeded,
  489|     42|            sstr.str()};
  490|       |
  491|     42|  }
  492|       |
  493|  6.03k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (493:24): [True: 4.81k, False: 1.22k]
  ------------------
  494|  4.81k|    std::shared_ptr<Box> entrybox;
  495|  4.81k|    Error err = Box::read(range, &entrybox, limits);
  496|  4.81k|    if (err) {
  ------------------
  |  Branch (496:9): [True: 142, False: 4.66k]
  ------------------
  497|    142|      return err;
  498|    142|    }
  499|       |
  500|       |#if 0
  501|       |    auto visualSampleEntry_box = std::dynamic_pointer_cast<Box_VisualSampleEntry>(entrybox);
  502|       |    if (!visualSampleEntry_box) {
  503|       |      return Error{heif_error_Invalid_input,
  504|       |                   heif_suberror_Unspecified,
  505|       |                   "Invalid or unknown VisualSampleEntry in stsd box."};
  506|       |    }
  507|       |#endif
  508|       |
  509|  4.66k|    m_sample_entries.push_back(entrybox);
  510|  4.66k|  }
  511|       |
  512|  1.22k|  return range.get_error();
  513|  1.36k|}
_ZNK8Box_stsd4dumpER6Indent:
  517|    963|{
  518|    963|  std::ostringstream sstr;
  519|    963|  sstr << FullBox::dump(indent);
  520|  3.31k|  for (size_t i = 0; i < m_sample_entries.size(); i++) {
  ------------------
  |  Branch (520:22): [True: 2.34k, False: 963]
  ------------------
  521|  2.34k|    sstr << indent << "[" << i << "]\n";
  522|  2.34k|    indent++;
  523|  2.34k|    sstr << m_sample_entries[i]->dump(indent);
  524|  2.34k|    indent--;
  525|  2.34k|  }
  526|       |
  527|    963|  return sstr.str();
  528|    963|}
_ZN8Box_stts5parseER14BitstreamRangePK20heif_security_limits:
  547|    316|{
  548|    316|  parse_full_box_header(range);
  549|       |
  550|    316|  if (get_version() > 0) {
  ------------------
  |  Branch (550:7): [True: 6, False: 310]
  ------------------
  551|      6|    return unsupported_version_error("stts");
  552|      6|  }
  553|       |
  554|    310|  uint32_t entry_count = range.read32();
  555|       |
  556|    310|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (556:7): [True: 310, False: 0]
  |  Branch (556:42): [True: 11, False: 299]
  ------------------
  557|     11|    return {
  558|     11|      heif_error_Memory_allocation_error,
  559|     11|      heif_suberror_Security_limit_exceeded,
  560|     11|      "Security limit for maximum number of sequence frames exceeded"
  561|     11|    };
  562|     11|  }
  563|       |
  564|    299|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(TimeToSample),
  ------------------
  |  Branch (564:12): [True: 0, False: 299]
  ------------------
  565|    299|                                       limits, "the 'stts' table")) {
  566|      0|    return err;
  567|      0|  }
  568|       |
  569|    299|  m_entries.resize(entry_count);
  570|       |
  571|   369k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (571:24): [True: 369k, False: 246]
  ------------------
  572|   369k|    if (range.eof()) {
  ------------------
  |  Branch (572:9): [True: 53, False: 369k]
  ------------------
  573|     53|      std::stringstream sstr;
  574|     53|      sstr << "stts box should contain " << entry_count << " entries, but box only contained "
  575|     53|          << i << " entries";
  576|       |
  577|     53|      return {
  578|     53|        heif_error_Invalid_input,
  579|     53|        heif_suberror_End_of_data,
  580|     53|        sstr.str()
  581|     53|      };
  582|     53|    }
  583|       |
  584|   369k|    TimeToSample entry{};
  585|   369k|    entry.sample_count = range.read32();
  586|   369k|    entry.sample_delta = range.read32();
  587|   369k|    m_entries[i] = entry;
  588|   369k|  }
  589|       |
  590|       |  // The run-lengths describe the samples of the track, so their sum is the track's
  591|       |  // sample count: a 32-bit quantity that 'stsz' caps at max_sequence_frames. Nothing
  592|       |  // above bounds the sum, so an oversized table would wrap get_number_of_samples()
  593|       |  // and could thereby slip past the consistency check against 'stsz'.
  594|    246|  {
  595|    246|    uint64_t total_samples = 0;
  596|   260k|    for (const auto& entry : m_entries) {
  ------------------
  |  Branch (596:28): [True: 260k, False: 246]
  ------------------
  597|   260k|      total_samples += entry.sample_count;
  598|   260k|    }
  599|       |
  600|    246|    uint64_t max_samples = (limits->max_sequence_frames > 0
  ------------------
  |  Branch (600:29): [True: 246, False: 0]
  ------------------
  601|    246|                            ? limits->max_sequence_frames
  602|    246|                            : uint64_t{0xFFFFFFFF});
  603|       |
  604|    246|    if (total_samples > max_samples) {
  ------------------
  |  Branch (604:9): [True: 24, False: 222]
  ------------------
  605|     24|      return {
  606|     24|        heif_error_Memory_allocation_error,
  607|     24|        heif_suberror_Security_limit_exceeded,
  608|     24|        "Security limit for maximum number of sequence frames exceeded"
  609|     24|      };
  610|     24|    }
  611|    246|  }
  612|       |
  613|       |  // Precompute the prefix sum of sample_count for O(log entries) lookups in
  614|       |  // get_sample_duration(). Safe as uint32 because the total was just checked to
  615|       |  // be <= max_samples <= 0xFFFFFFFF.
  616|    222|  {
  617|    222|    uint32_t running = 0;
  618|   165k|    for (auto& entry : m_entries) {
  ------------------
  |  Branch (618:22): [True: 165k, False: 222]
  ------------------
  619|   165k|      running += entry.sample_count;
  620|   165k|      entry.cumulative_sample_count = running;
  621|   165k|    }
  622|    222|  }
  623|       |
  624|    222|  return range.get_error();
  625|    246|}
_ZNK8Box_stts4dumpER6Indent:
  629|    212|{
  630|    212|  std::ostringstream sstr;
  631|    212|  sstr << FullBox::dump(indent);
  632|   165k|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (632:22): [True: 165k, False: 212]
  ------------------
  633|   165k|    sstr << indent << "[" << i << "] : cnt=" << m_entries[i].sample_count << ", delta=" << m_entries[i].sample_delta << "\n";
  634|   165k|  }
  635|       |
  636|    212|  return sstr.str();
  637|    212|}
_ZN8Box_ctts5parseER14BitstreamRangePK20heif_security_limits:
  726|  1.16k|{
  727|  1.16k|  parse_full_box_header(range);
  728|       |
  729|  1.16k|  uint8_t version = get_version();
  730|       |
  731|  1.16k|  if (version > 1) {
  ------------------
  |  Branch (731:7): [True: 5, False: 1.16k]
  ------------------
  732|      5|    return unsupported_version_error("ctts");
  733|      5|  }
  734|       |
  735|  1.16k|  uint32_t entry_count = range.read32();
  736|       |
  737|  1.16k|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (737:7): [True: 1.16k, False: 0]
  |  Branch (737:42): [True: 29, False: 1.13k]
  ------------------
  738|     29|    return {
  739|     29|      heif_error_Memory_allocation_error,
  740|     29|      heif_suberror_Security_limit_exceeded,
  741|     29|      "Security limit for maximum number of sequence frames exceeded"
  742|     29|    };
  743|     29|  }
  744|       |
  745|  1.13k|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(OffsetToSample),
  ------------------
  |  Branch (745:12): [True: 0, False: 1.13k]
  ------------------
  746|  1.13k|                                       limits, "the 'ctts' table")) {
  747|      0|    return err;
  748|      0|  }
  749|       |
  750|  1.13k|  m_entries.resize(entry_count);
  751|       |
  752|   617k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (752:24): [True: 616k, False: 1.08k]
  ------------------
  753|   616k|    if (range.eof()) {
  ------------------
  |  Branch (753:9): [True: 49, False: 616k]
  ------------------
  754|     49|      std::stringstream sstr;
  755|     49|      sstr << "ctts box should contain " << entry_count << " entries, but box only contained "
  756|     49|          << i << " entries";
  757|       |
  758|     49|      return {
  759|     49|        heif_error_Invalid_input,
  760|     49|        heif_suberror_End_of_data,
  761|     49|        sstr.str()
  762|     49|      };
  763|     49|    }
  764|       |
  765|   616k|    OffsetToSample entry{};
  766|   616k|    entry.sample_count = range.read32();
  767|   616k|    if (version == 0) {
  ------------------
  |  Branch (767:9): [True: 610k, False: 5.57k]
  ------------------
  768|   610k|      uint32_t offset = range.read32();
  769|       |#if 0
  770|       |      // TODO: I disabled this because I found several files that seem to
  771|       |      //       have wrong data. Since we are not using the 'ctts' data anyway,
  772|       |      //       let's not care about it now.
  773|       |
  774|       |      if (offset > INT32_MAX) {
  775|       |        return {
  776|       |          heif_error_Unsupported_feature,
  777|       |          heif_suberror_Unsupported_parameter,
  778|       |          "We don't support offsets > 0x7fff in 'ctts' box."
  779|       |        };
  780|       |      }
  781|       |#endif
  782|       |
  783|   610k|      entry.sample_offset = static_cast<int32_t>(offset);
  784|   610k|    }
  785|  5.57k|    else if (version == 1) {
  ------------------
  |  Branch (785:14): [True: 5.57k, False: 0]
  ------------------
  786|  5.57k|      entry.sample_offset = range.read32s();
  787|  5.57k|    }
  788|      0|    else {
  789|      0|      assert(false);
  ------------------
  |  Branch (789:7): [Folded, False: 0]
  ------------------
  790|      0|    }
  791|       |
  792|   616k|    m_entries[i] = entry;
  793|   616k|  }
  794|       |
  795|       |  // The run-lengths describe the samples of the track, so their sum is the track's
  796|       |  // sample count: a 32-bit quantity that 'stsz' caps at max_sequence_frames. Nothing
  797|       |  // above bounds the sum, so an oversized table would wrap get_number_of_samples()
  798|       |  // and could thereby slip past the consistency check against 'stsz'.
  799|  1.08k|  {
  800|  1.08k|    uint64_t total_samples = 0;
  801|   603k|    for (const auto& entry : m_entries) {
  ------------------
  |  Branch (801:28): [True: 603k, False: 1.08k]
  ------------------
  802|   603k|      total_samples += entry.sample_count;
  803|   603k|    }
  804|       |
  805|  1.08k|    uint64_t max_samples = (limits->max_sequence_frames > 0
  ------------------
  |  Branch (805:29): [True: 1.08k, False: 0]
  ------------------
  806|  1.08k|                            ? limits->max_sequence_frames
  807|  1.08k|                            : uint64_t{0xFFFFFFFF});
  808|       |
  809|  1.08k|    if (total_samples > max_samples) {
  ------------------
  |  Branch (809:9): [True: 42, False: 1.04k]
  ------------------
  810|     42|      return {
  811|     42|        heif_error_Memory_allocation_error,
  812|     42|        heif_suberror_Security_limit_exceeded,
  813|     42|        "Security limit for maximum number of sequence frames exceeded"
  814|     42|      };
  815|     42|    }
  816|  1.08k|  }
  817|       |
  818|  1.04k|  return range.get_error();
  819|  1.08k|}
_ZNK8Box_ctts4dumpER6Indent:
  823|    874|{
  824|    874|  std::ostringstream sstr;
  825|    874|  sstr << FullBox::dump(indent);
  826|   396k|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (826:22): [True: 395k, False: 874]
  ------------------
  827|   395k|    sstr << indent << "[" << i << "] : cnt=" << m_entries[i].sample_count << ", offset=" << m_entries[i].sample_offset << "\n";
  828|   395k|  }
  829|       |
  830|    874|  return sstr.str();
  831|    874|}
_ZN8Box_stsc5parseER14BitstreamRangePK20heif_security_limits:
  927|    310|{
  928|    310|  parse_full_box_header(range);
  929|       |
  930|    310|  if (get_version() > 0) {
  ------------------
  |  Branch (930:7): [True: 5, False: 305]
  ------------------
  931|      5|    return unsupported_version_error("stsc");
  932|      5|  }
  933|       |
  934|    305|  uint32_t entry_count = range.read32();
  935|    305|  if (entry_count == 0) {
  ------------------
  |  Branch (935:7): [True: 2, False: 303]
  ------------------
  936|      2|    return {
  937|      2|      heif_error_Invalid_input,
  938|      2|      heif_suberror_Unspecified,
  939|      2|      "'stsc' box with zero entries."};
  940|      2|  }
  941|       |
  942|       |  // Note: test against maximum number of frames (upper limit) since we have no limit on maximum number of chunks
  943|    303|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (943:7): [True: 303, False: 0]
  |  Branch (943:42): [True: 52, False: 251]
  ------------------
  944|     52|    return {
  945|     52|      heif_error_Invalid_input,
  946|     52|      heif_suberror_Unspecified,
  947|     52|      "Number of chunks in `stsc` box exceeds security limits of maximum number of frames."};
  948|     52|  }
  949|       |
  950|       |
  951|    251|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(SampleToChunk),
  ------------------
  |  Branch (951:12): [True: 0, False: 251]
  ------------------
  952|    251|                                       limits, "the 'stsc' table")) {
  953|      0|    return err;
  954|      0|  }
  955|       |
  956|    251|  m_entries.resize(entry_count);
  957|       |
  958|  1.03k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (958:24): [True: 917, False: 119]
  ------------------
  959|    917|    SampleToChunk entry{};
  960|    917|    entry.first_chunk = range.read32();
  961|    917|    entry.samples_per_chunk = range.read32();
  962|    917|    entry.sample_description_index = range.read32();
  963|       |
  964|    917|    if (entry.samples_per_chunk == 0) {
  ------------------
  |  Branch (964:9): [True: 46, False: 871]
  ------------------
  965|     46|      return {
  966|     46|        heif_error_Invalid_input,
  967|     46|        heif_suberror_Unspecified,
  968|     46|        "'stsc' box with zero samples per chunk entry."};
  969|     46|    }
  970|       |
  971|    871|    if (entry.sample_description_index == 0) {
  ------------------
  |  Branch (971:9): [True: 40, False: 831]
  ------------------
  972|     40|      return {
  973|     40|      heif_error_Invalid_input,
  974|     40|      heif_suberror_Unspecified,
  975|     40|      "'sample_description_index' in 'stsc' must not be 0."};
  976|     40|    }
  977|       |
  978|    831|    if (limits->max_sequence_frames > 0 && entry.samples_per_chunk > limits->max_sequence_frames) {
  ------------------
  |  Branch (978:9): [True: 831, False: 0]
  |  Branch (978:44): [True: 46, False: 785]
  ------------------
  979|     46|      return {
  980|     46|        heif_error_Invalid_input,
  981|     46|        heif_suberror_Unspecified,
  982|     46|        "Number of chunk samples in `stsc` box exceeds security limits of maximum number of frames."};
  983|     46|    }
  984|       |
  985|    785|    m_entries[i] = entry;
  986|    785|  }
  987|       |
  988|    119|  return range.get_error();
  989|    251|}
_ZNK8Box_stsc4dumpER6Indent:
  993|    119|{
  994|    119|  std::ostringstream sstr;
  995|    119|  sstr << FullBox::dump(indent);
  996|    707|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (996:22): [True: 588, False: 119]
  ------------------
  997|    588|    sstr << indent << "[" << i << "]\n"
  998|    588|        << indent << "  first chunk: " << m_entries[i].first_chunk << "\n"
  999|    588|        << indent << "  samples per chunk: " << m_entries[i].samples_per_chunk << "\n"
 1000|    588|        << indent << "  sample description index: " << m_entries[i].sample_description_index << "\n";
 1001|    588|  }
 1002|       |
 1003|    119|  return sstr.str();
 1004|    119|}
_ZN8Box_stco5parseER14BitstreamRangePK20heif_security_limits:
 1056|    528|{
 1057|    528|  parse_full_box_header(range);
 1058|       |
 1059|    528|  if (get_version() > 0) {
  ------------------
  |  Branch (1059:7): [True: 1, False: 527]
  ------------------
 1060|      1|    return unsupported_version_error("stco");
 1061|      1|  }
 1062|       |
 1063|    527|  uint32_t entry_count = range.read32();
 1064|       |
 1065|       |  // Note: test against maximum number of frames (upper limit) since we have no limit on maximum number of chunks
 1066|    527|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (1066:7): [True: 527, False: 0]
  |  Branch (1066:42): [True: 6, False: 521]
  ------------------
 1067|      6|    return {
 1068|      6|      heif_error_Invalid_input,
 1069|      6|      heif_suberror_Unspecified,
 1070|      6|      "Number of chunks in 'stco' box exceeds security limits of maximum number of frames."
 1071|      6|    };
 1072|      6|  }
 1073|       |
 1074|       |  // check required memory
 1075|       |
 1076|    521|  uint64_t mem_size = static_cast<uint64_t>(entry_count) * sizeof(uint32_t);
 1077|    521|  if (auto err = m_memory_handle.alloc(mem_size,
  ------------------
  |  Branch (1077:12): [True: 0, False: 521]
  ------------------
 1078|    521|                                       limits, "the 'stco' table")) {
 1079|      0|    return err;
 1080|      0|  }
 1081|       |
 1082|   112k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (1082:24): [True: 111k, False: 501]
  ------------------
 1083|   111k|    m_offsets.push_back(range.read32());
 1084|       |
 1085|   111k|    if (range.error()) {
  ------------------
  |  Branch (1085:9): [True: 20, False: 111k]
  ------------------
 1086|     20|      return range.get_error();
 1087|     20|    }
 1088|   111k|  }
 1089|       |
 1090|    501|  return range.get_error();
 1091|    521|}
_ZNK8Box_stco4dumpER6Indent:
 1095|    498|{
 1096|    498|  std::ostringstream sstr;
 1097|    498|  sstr << FullBox::dump(indent);
 1098|   111k|  for (size_t i = 0; i < m_offsets.size(); i++) {
  ------------------
  |  Branch (1098:22): [True: 111k, False: 498]
  ------------------
 1099|   111k|    sstr << indent << "[" << i << "] : 0x" << std::hex << m_offsets[i] << std::dec << "\n";
 1100|   111k|  }
 1101|       |
 1102|    498|  return sstr.str();
 1103|    498|}
_ZN8Box_stsz5parseER14BitstreamRangePK20heif_security_limits:
 1145|  1.02k|{
 1146|  1.02k|  parse_full_box_header(range);
 1147|       |
 1148|  1.02k|  if (get_version() > 0) {
  ------------------
  |  Branch (1148:7): [True: 1, False: 1.02k]
  ------------------
 1149|      1|    return unsupported_version_error("stsz");
 1150|      1|  }
 1151|       |
 1152|  1.02k|  m_fixed_sample_size = range.read32();
 1153|  1.02k|  m_sample_count = range.read32();
 1154|       |
 1155|  1.02k|  if (limits->max_sequence_frames > 0 && m_sample_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (1155:7): [True: 1.02k, False: 0]
  |  Branch (1155:42): [True: 30, False: 998]
  ------------------
 1156|     30|    return {
 1157|     30|      heif_error_Memory_allocation_error,
 1158|     30|      heif_suberror_Security_limit_exceeded,
 1159|     30|      "Security limit for maximum number of sequence frames exceeded"
 1160|     30|    };
 1161|     30|  }
 1162|       |
 1163|    998|  if (m_fixed_sample_size == 0) {
  ------------------
  |  Branch (1163:7): [True: 637, False: 361]
  ------------------
 1164|       |    // check required memory
 1165|       |
 1166|    637|    if (auto err = m_memory_handle.alloc(m_sample_count, sizeof(uint32_t),
  ------------------
  |  Branch (1166:14): [True: 0, False: 637]
  ------------------
 1167|    637|                                         limits, "the 'stsz' table")) {
 1168|      0|      return err;
 1169|      0|    }
 1170|       |
 1171|   165k|    for (uint32_t i = 0; i < m_sample_count; i++) {
  ------------------
  |  Branch (1171:26): [True: 164k, False: 598]
  ------------------
 1172|   164k|      if (range.eof()) {
  ------------------
  |  Branch (1172:11): [True: 18, False: 164k]
  ------------------
 1173|     18|        std::stringstream sstr;
 1174|     18|        sstr << "stsz box should contain " << m_sample_count << " entries, but box only contained "
 1175|     18|            << i << " entries";
 1176|       |
 1177|     18|        return {
 1178|     18|          heif_error_Invalid_input,
 1179|     18|          heif_suberror_End_of_data,
 1180|     18|          sstr.str()
 1181|     18|        };
 1182|     18|      }
 1183|       |
 1184|   164k|      m_sample_sizes.push_back(range.read32());
 1185|       |
 1186|   164k|      if (range.error()) {
  ------------------
  |  Branch (1186:11): [True: 21, False: 164k]
  ------------------
 1187|     21|        return range.get_error();
 1188|     21|      }
 1189|   164k|    }
 1190|    637|  }
 1191|       |
 1192|    959|  return range.get_error();
 1193|    998|}
_ZNK8Box_stsz4dumpER6Indent:
 1197|    927|{
 1198|    927|  std::ostringstream sstr;
 1199|    927|  sstr << FullBox::dump(indent);
 1200|    927|  sstr << indent << "sample count: " << m_sample_count << "\n";
 1201|    927|  if (m_fixed_sample_size == 0) {
  ------------------
  |  Branch (1201:7): [True: 591, False: 336]
  ------------------
 1202|   164k|    for (size_t i = 0; i < m_sample_sizes.size(); i++) {
  ------------------
  |  Branch (1202:24): [True: 164k, False: 591]
  ------------------
 1203|   164k|      sstr << indent << "[" << i << "] : " << m_sample_sizes[i] << "\n";
 1204|   164k|    }
 1205|    591|  }
 1206|    336|  else {
 1207|    336|    sstr << indent << "fixed sample size: " << m_fixed_sample_size << "\n";
 1208|    336|  }
 1209|       |
 1210|    927|  return sstr.str();
 1211|    927|}
_ZN8Box_stss5parseER14BitstreamRangePK20heif_security_limits:
 1263|    464|{
 1264|    464|  parse_full_box_header(range);
 1265|       |
 1266|    464|  if (get_version() > 0) {
  ------------------
  |  Branch (1266:7): [True: 7, False: 457]
  ------------------
 1267|      7|    return unsupported_version_error("stss");
 1268|      7|  }
 1269|       |
 1270|    457|  uint32_t sample_count = range.read32();
 1271|       |
 1272|       |  // check required memory
 1273|       |
 1274|    457|  if (auto err = m_memory_handle.alloc(sample_count, sizeof(uint32_t),
  ------------------
  |  Branch (1274:12): [True: 39, False: 418]
  ------------------
 1275|    457|                                       limits, "the 'stss' table")) {
 1276|     39|    return err;
 1277|     39|  }
 1278|       |
 1279|   267k|  for (uint32_t i = 0; i < sample_count; i++) {
  ------------------
  |  Branch (1279:24): [True: 266k, False: 384]
  ------------------
 1280|   266k|    m_sync_samples.push_back(range.read32());
 1281|       |
 1282|   266k|    if (range.error()) {
  ------------------
  |  Branch (1282:9): [True: 34, False: 266k]
  ------------------
 1283|     34|      return range.get_error();
 1284|     34|    }
 1285|   266k|  }
 1286|       |
 1287|    384|  return range.get_error();
 1288|    418|}
_ZNK8Box_stss4dumpER6Indent:
 1292|    329|{
 1293|    329|  std::ostringstream sstr;
 1294|    329|  sstr << FullBox::dump(indent);
 1295|   266k|  for (size_t i = 0; i < m_sync_samples.size(); i++) {
  ------------------
  |  Branch (1295:22): [True: 266k, False: 329]
  ------------------
 1296|   266k|    sstr << indent << "[" << i << "] : " << m_sync_samples[i] << "\n";
 1297|   266k|  }
 1298|       |
 1299|    329|  return sstr.str();
 1300|    329|}
_ZN17VisualSampleEntry5parseER14BitstreamRangePK20heif_security_limits:
 1330|    994|{
 1331|    994|  (void)limits;
 1332|       |
 1333|    994|  range.skip(6);
 1334|    994|  data_reference_index = range.read16();
 1335|       |
 1336|    994|  pre_defined = range.read16();
 1337|    994|  range.skip(2);
 1338|  2.98k|  for (uint32_t& p : pre_defined2) {
  ------------------
  |  Branch (1338:20): [True: 2.98k, False: 994]
  ------------------
 1339|  2.98k|    p = range.read32();
 1340|  2.98k|  }
 1341|    994|  width = range.read16();
 1342|    994|  height = range.read16();
 1343|    994|  horizresolution = range.read32();
 1344|    994|  vertresolution = range.read32();
 1345|    994|  range.skip(4);
 1346|    994|  frame_count = range.read16();
 1347|    994|  compressorname = range.read_fixed_string(32);
 1348|    994|  depth = range.read16();
 1349|    994|  pre_defined3 = range.read16s();
 1350|       |
 1351|       |  // other boxes from derived specifications
 1352|       |  //std::shared_ptr<Box_clap> clap; // optional // TODO
 1353|       |  //std::shared_ptr<Box_pixi> pixi; // optional // TODO
 1354|       |
 1355|    994|  return Error::Ok;
 1356|    994|}
_ZNK17VisualSampleEntry4dumpER6Indent:
 1386|    511|{
 1387|    511|  std::stringstream sstr;
 1388|    511|  sstr << indent << "data reference index: " << data_reference_index << "\n"
 1389|    511|       << indent << "width: " << width << "\n"
 1390|    511|       << indent << "height: " << height << "\n"
 1391|    511|       << indent << "horiz. resolution: " << get_horizontal_resolution() << "\n"
 1392|    511|       << indent << "vert. resolution: " << get_vertical_resolution() << "\n"
 1393|    511|       << indent << "frame count: " << frame_count << "\n"
 1394|    511|       << indent << "compressorname: " << compressorname << "\n"
 1395|    511|       << indent << "depth: " << depth << "\n";
 1396|       |
 1397|    511|  return sstr.str();
 1398|    511|}
_ZNK22Box_URIMetaSampleEntry4dumpER6Indent:
 1418|    656|{
 1419|    656|  std::stringstream sstr;
 1420|    656|  sstr << Box::dump(indent);
 1421|    656|  sstr << indent << "data reference index: " << data_reference_index << "\n";
 1422|    656|  sstr << dump_children(indent);
 1423|    656|  return sstr.str();
 1424|    656|}
_ZN22Box_URIMetaSampleEntry5parseER14BitstreamRangePK20heif_security_limits:
 1428|    850|{
 1429|    850|  range.skip(6);
 1430|    850|  data_reference_index = range.read16();
 1431|       |
 1432|    850|  Error err = read_children(range, READ_CHILDREN_ALL, limits);
 1433|    850|  if (err) {
  ------------------
  |  Branch (1433:7): [True: 96, False: 754]
  ------------------
 1434|     96|    return err;
 1435|     96|  }
 1436|       |
 1437|    754|  return Error::Ok;
 1438|    850|}
_ZN7Box_uri5parseER14BitstreamRangePK20heif_security_limits:
 1442|    737|{
 1443|    737|  parse_full_box_header(range);
 1444|       |
 1445|    737|  if (get_version() > 0) {
  ------------------
  |  Branch (1445:7): [True: 1, False: 736]
  ------------------
 1446|      1|    return unsupported_version_error("uri ");
 1447|      1|  }
 1448|       |
 1449|    736|  m_uri = range.read_string();
 1450|       |
 1451|    736|  return range.get_error();
 1452|    737|}
_ZNK7Box_uri4dumpER6Indent:
 1456|    579|{
 1457|    579|  std::ostringstream sstr;
 1458|    579|  sstr << FullBox::dump(indent);
 1459|    579|  sstr << indent << "uri: " << m_uri << "\n";
 1460|       |
 1461|    579|  return sstr.str();
 1462|    579|}
_ZN8Box_ccst5parseER14BitstreamRangePK20heif_security_limits:
 1479|    690|{
 1480|    690|  parse_full_box_header(range);
 1481|       |
 1482|    690|  if (get_version() > 0) {
  ------------------
  |  Branch (1482:7): [True: 2, False: 688]
  ------------------
 1483|      2|    return unsupported_version_error("ccst");
 1484|      2|  }
 1485|       |
 1486|    688|  uint32_t bits = range.read32();
 1487|       |
 1488|    688|  auto& constraints = m_codingConstraints;
 1489|       |
 1490|    688|  constraints.all_ref_pics_intra = (bits & 0x80000000) != 0;
 1491|    688|  constraints.intra_pred_used = (bits & 0x40000000) != 0;
 1492|    688|  constraints.max_ref_per_pic = (bits >> 26) & 0x0F;
 1493|       |
 1494|    688|  return range.get_error();
 1495|    690|}
_ZNK8Box_ccst4dumpER6Indent:
 1499|    687|{
 1500|    687|  const auto& constraints = m_codingConstraints;
 1501|       |
 1502|    687|  std::ostringstream sstr;
 1503|    687|  sstr << FullBox::dump(indent);
 1504|    687|  sstr << indent << "all ref pics intra: " << std::boolalpha <<constraints.all_ref_pics_intra << "\n"
 1505|    687|       << indent << "intra pred used: " << constraints.intra_pred_used << "\n"
 1506|    687|       << indent << "max ref per pic: " << ((int) constraints.max_ref_per_pic) << "\n";
 1507|       |
 1508|    687|  return sstr.str();
 1509|    687|}
_ZN8Box_auxi5parseER14BitstreamRangePK20heif_security_limits:
 1539|  1.34k|{
 1540|  1.34k|  parse_full_box_header(range);
 1541|       |
 1542|  1.34k|  if (get_version() > 0) {
  ------------------
  |  Branch (1542:7): [True: 1, False: 1.34k]
  ------------------
 1543|      1|    return unsupported_version_error("auxi");
 1544|      1|  }
 1545|       |
 1546|  1.34k|  m_aux_track_type = range.read_string();
 1547|       |
 1548|  1.34k|  return range.get_error();
 1549|  1.34k|}
_ZNK8Box_auxi4dumpER6Indent:
 1553|  1.18k|{
 1554|  1.18k|  std::ostringstream sstr;
 1555|  1.18k|  sstr << FullBox::dump(indent);
 1556|  1.18k|  sstr << indent << "aux track info type: " << m_aux_track_type << "\n";
 1557|       |
 1558|  1.18k|  return sstr.str();
 1559|  1.18k|}
_ZNK21Box_VisualSampleEntry4dumpER6Indent:
 1592|    511|{
 1593|    511|  std::stringstream sstr;
 1594|    511|  sstr << Box::dump(indent);
 1595|    511|  sstr << m_visualSampleEntry.dump(indent);
 1596|    511|  sstr << dump_children(indent);
 1597|    511|  return sstr.str();
 1598|    511|}
_ZN21Box_VisualSampleEntry5parseER14BitstreamRangePK20heif_security_limits:
 1602|    994|{
 1603|    994|  auto err = m_visualSampleEntry.parse(range, limits);
 1604|    994|  if (err) {
  ------------------
  |  Branch (1604:7): [True: 0, False: 994]
  ------------------
 1605|      0|    return err;
 1606|      0|  }
 1607|       |
 1608|    994|  err = read_children(range, READ_CHILDREN_ALL, limits);
 1609|    994|  if (err) {
  ------------------
  |  Branch (1609:7): [True: 450, False: 544]
  ------------------
 1610|    450|    return err;
 1611|    450|  }
 1612|       |
 1613|    544|  return Error::Ok;
 1614|    994|}
_ZNK8Box_sbgp4dumpER6Indent:
 1618|    681|{
 1619|    681|  std::stringstream sstr;
 1620|    681|  sstr << FullBox::dump(indent);
 1621|    681|  sstr << indent << "grouping_type: " << fourcc_to_string(m_grouping_type) << "\n";
 1622|       |
 1623|    681|  if (m_grouping_type_parameter) {
  ------------------
  |  Branch (1623:7): [True: 553, False: 128]
  ------------------
 1624|    553|    sstr << indent << "grouping_type_parameter: " << *m_grouping_type_parameter << "\n";
 1625|    553|  }
 1626|       |
 1627|    681|  uint32_t total_samples = 0;
 1628|   510k|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (1628:22): [True: 509k, False: 681]
  ------------------
 1629|   509k|    sstr << indent << "[" << std::setw(2) << (i + 1) << "] : " << std::setw(3) << m_entries[i].sample_count << "x " << m_entries[i].group_description_index << "\n";
 1630|   509k|    total_samples += m_entries[i].sample_count;
 1631|   509k|  }
 1632|    681|  sstr << indent << "total samples: " << total_samples << "\n";
 1633|       |
 1634|    681|  return sstr.str();
 1635|    681|}
_ZN8Box_sbgp5parseER14BitstreamRangePK20heif_security_limits:
 1677|    742|{
 1678|    742|  parse_full_box_header(range);
 1679|       |
 1680|    742|  if (get_version() > 1) {
  ------------------
  |  Branch (1680:7): [True: 8, False: 734]
  ------------------
 1681|      8|    return unsupported_version_error("sbgp");
 1682|      8|  }
 1683|       |
 1684|    734|  m_grouping_type = range.read32();
 1685|       |
 1686|    734|  if (get_version() == 1) {
  ------------------
  |  Branch (1686:7): [True: 554, False: 180]
  ------------------
 1687|    554|    m_grouping_type_parameter = range.read32();
 1688|    554|  }
 1689|       |
 1690|    734|  uint32_t count = range.read32();
 1691|    734|  if (auto err = m_memory_handle.alloc(count, sizeof(Entry),
  ------------------
  |  Branch (1691:12): [True: 8, False: 726]
  ------------------
 1692|    734|                                       limits, "the 'sample to group' table")) {
 1693|      8|    return err;
 1694|      8|  }
 1695|       |
 1696|   644k|  for (uint32_t i = 0; i < count; i++) {
  ------------------
  |  Branch (1696:24): [True: 643k, False: 686]
  ------------------
 1697|   643k|    Entry e{};
 1698|   643k|    e.sample_count = range.read32();
 1699|   643k|    e.group_description_index = range.read32();
 1700|   643k|    m_entries.push_back(e);
 1701|   643k|    if (range.error()) {
  ------------------
  |  Branch (1701:9): [True: 40, False: 643k]
  ------------------
 1702|     40|      return range.get_error();
 1703|     40|    }
 1704|   643k|  }
 1705|       |
 1706|    686|  return range.get_error();
 1707|    726|}
_ZNK21SampleGroupEntry_refs4dumpEv:
 1711|   164k|{
 1712|   164k|  std::stringstream sstr;
 1713|   164k|  if (m_sample_id==0) {
  ------------------
  |  Branch (1713:7): [True: 160k, False: 3.93k]
  ------------------
 1714|   160k|    sstr << "0 (non-ref) refs =";
 1715|   160k|  }
 1716|  3.93k|  else {
 1717|  3.93k|    sstr << m_sample_id << " refs =";
 1718|  3.93k|  }
 1719|   260k|  for (uint32_t ref : m_direct_reference_sample_id) {
  ------------------
  |  Branch (1719:21): [True: 260k, False: 164k]
  ------------------
 1720|   260k|    sstr << ' ' << ref;
 1721|   260k|  }
 1722|       |
 1723|   164k|  return sstr.str();
 1724|   164k|}
_ZN21SampleGroupEntry_refs5parseER14BitstreamRangePK20heif_security_limits:
 1732|   164k|{
 1733|   164k|  m_sample_id = range.read32();
 1734|   164k|  uint8_t cnt = range.read8();
 1735|   425k|  for (uint8_t i = 0; i < cnt; i++) {
  ------------------
  |  Branch (1735:23): [True: 260k, False: 164k]
  ------------------
 1736|   260k|    m_direct_reference_sample_id.push_back(range.read32());
 1737|   260k|  }
 1738|       |
 1739|   164k|  return Error::Ok;
 1740|   164k|}
_ZNK8Box_sgpd4dumpER6Indent:
 1761|  1.48k|{
 1762|  1.48k|  std::stringstream sstr;
 1763|  1.48k|  sstr << FullBox::dump(indent);
 1764|       |
 1765|  1.48k|  sstr << indent << "grouping_type: " << fourcc_to_string(m_grouping_type) << "\n";
 1766|  1.48k|  if (m_default_length) {
  ------------------
  |  Branch (1766:7): [True: 338, False: 1.14k]
  ------------------
 1767|    338|    sstr << indent << "default_length: " << *m_default_length << "\n";
 1768|    338|  }
 1769|  1.48k|  if (m_default_sample_description_index) {
  ------------------
  |  Branch (1769:7): [True: 482, False: 1.00k]
  ------------------
 1770|    482|    sstr << indent << "default_sample_description_index: " << *m_default_sample_description_index << "\n";
 1771|    482|  }
 1772|       |
 1773|   165k|  for (size_t i=0; i<m_entries.size(); i++) {
  ------------------
  |  Branch (1773:20): [True: 164k, False: 1.48k]
  ------------------
 1774|   164k|    sstr << indent << "[" << (i+1) << "] : ";
 1775|   164k|    if (m_entries[i].sample_group_entry) {
  ------------------
  |  Branch (1775:9): [True: 164k, False: 0]
  ------------------
 1776|   164k|      sstr << m_entries[i].sample_group_entry->dump() << "\n";
 1777|   164k|    }
 1778|      0|    else {
 1779|      0|      sstr << "empty (description_length=" << m_entries[i].description_length << ")\n";
 1780|      0|    }
 1781|   164k|  }
 1782|       |
 1783|  1.48k|  return sstr.str();
 1784|  1.48k|}
_ZN8Box_sgpd5parseER14BitstreamRangePK20heif_security_limits:
 1794|  1.66k|{
 1795|  1.66k|  parse_full_box_header(range);
 1796|       |
 1797|  1.66k|  m_grouping_type = range.read32();
 1798|       |
 1799|       |  // Readers are expected to ignore sgpd boxes with grouping_types they don't
 1800|       |  // understand. Skip parsing of unknown types to avoid allocating Entry objects
 1801|       |  // for entries whose payload we wouldn't read anyway (and which, with
 1802|       |  // version==1 + default_length!=0 or version>=2, would consume zero bytes per
 1803|       |  // iteration and allow unbounded allocation from a tiny box).
 1804|  1.66k|  if (m_grouping_type != fourcc("refs")) {
  ------------------
  |  Branch (1804:7): [True: 718, False: 951]
  ------------------
 1805|    718|    return Error::Ok;
 1806|    718|  }
 1807|       |
 1808|    951|  if (get_version() == 1) {
  ------------------
  |  Branch (1808:7): [True: 351, False: 600]
  ------------------
 1809|    351|    m_default_length = range.read32();
 1810|    351|  }
 1811|       |
 1812|    951|  if (get_version() >= 2) {
  ------------------
  |  Branch (1812:7): [True: 488, False: 463]
  ------------------
 1813|    488|    m_default_sample_description_index = range.read32();
 1814|    488|  }
 1815|       |
 1816|    951|  uint32_t entry_count = range.read32();
 1817|       |
 1818|    951|  if (limits->max_sample_group_description_box_entries &&
  ------------------
  |  Branch (1818:7): [True: 951, False: 0]
  ------------------
 1819|    951|      entry_count > limits->max_sample_group_description_box_entries) {
  ------------------
  |  Branch (1819:7): [True: 50, False: 901]
  ------------------
 1820|     50|    std::stringstream sstr;
 1821|     50|    sstr << "Allocating " << static_cast<uint64_t>(entry_count) << " sample group description items exceeds the security limit of "
 1822|     50|         << limits->max_sample_group_description_box_entries << " items";
 1823|       |
 1824|     50|    return {heif_error_Memory_allocation_error,
 1825|     50|            heif_suberror_Security_limit_exceeded,
 1826|     50|            sstr.str()};
 1827|       |
 1828|     50|  }
 1829|       |
 1830|    901|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(Entry),
  ------------------
  |  Branch (1830:12): [True: 0, False: 901]
  ------------------
 1831|    901|                                       limits, "the 'sgpd' table")) {
 1832|      0|    return err;
 1833|      0|  }
 1834|       |
 1835|   164k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (1835:24): [True: 164k, False: 901]
  ------------------
 1836|   164k|    Entry entry;
 1837|       |
 1838|   164k|    if (get_version() == 1) {
  ------------------
  |  Branch (1838:9): [True: 46.8k, False: 117k]
  ------------------
 1839|  46.8k|      if (*m_default_length == 0) {
  ------------------
  |  Branch (1839:11): [True: 648, False: 46.2k]
  ------------------
 1840|    648|        entry.description_length = range.read32();
 1841|    648|      }
 1842|  46.8k|    }
 1843|       |
 1844|   164k|    switch (m_grouping_type) {
 1845|   164k|      case fourcc("refs"): {
  ------------------
  |  Branch (1845:7): [True: 164k, False: 0]
  ------------------
 1846|   164k|        entry.sample_group_entry = std::make_shared<SampleGroupEntry_refs>();
 1847|   164k|        Error err = entry.sample_group_entry->parse(range, limits);
 1848|   164k|        if (err) {
  ------------------
  |  Branch (1848:13): [True: 0, False: 164k]
  ------------------
 1849|      0|          return err;
 1850|      0|        }
 1851|       |
 1852|   164k|        break;
 1853|   164k|      }
 1854|       |
 1855|   164k|      default:
  ------------------
  |  Branch (1855:7): [True: 0, False: 164k]
  ------------------
 1856|      0|        break;
 1857|   164k|    }
 1858|       |
 1859|   164k|    m_entries.emplace_back(std::move(entry));
 1860|   164k|  }
 1861|       |
 1862|    901|  return Error::Ok;
 1863|    901|}
_ZNK8Box_btrt4dumpER6Indent:
 1867|    585|{
 1868|    585|  std::stringstream sstr;
 1869|    585|  sstr << FullBox::dump(indent);
 1870|       |
 1871|    585|  sstr << indent << "bufferSizeDB: " << m_bufferSizeDB << " bytes\n";
 1872|    585|  sstr << indent << "max bitrate: " << m_maxBitrate << " bits/sec\n";
 1873|    585|  sstr << indent << "avg bitrate: " << m_avgBitrate << " bits/sec\n";
 1874|       |
 1875|    585|  return sstr.str();
 1876|    585|}
_ZN8Box_btrt5parseER14BitstreamRangePK20heif_security_limits:
 1894|    695|{
 1895|    695|  m_bufferSizeDB = range.read32();
 1896|    695|  m_maxBitrate = range.read32();
 1897|    695|  m_avgBitrate = range.read32();
 1898|       |
 1899|    695|  return Error::Ok;
 1900|    695|}
_ZNK8Box_saiz4dumpER6Indent:
 1965|    923|{
 1966|    923|  std::stringstream sstr;
 1967|    923|  sstr << FullBox::dump(indent);
 1968|       |
 1969|    923|  sstr << indent << "aux_info_type: ";
 1970|    923|  if (m_aux_info_type == 0) {
  ------------------
  |  Branch (1970:7): [True: 281, False: 642]
  ------------------
 1971|    281|    sstr << "0\n";
 1972|    281|  }
 1973|    642|  else {
 1974|    642|    sstr << fourcc_to_string(m_aux_info_type) << "\n";
 1975|    642|  }
 1976|       |
 1977|    923|  sstr << indent << "aux_info_type_parameter: ";
 1978|    923|  if (m_aux_info_type_parameter == 0) {
  ------------------
  |  Branch (1978:7): [True: 283, False: 640]
  ------------------
 1979|    283|    sstr << "0\n";
 1980|    283|  }
 1981|    640|  else {
 1982|    640|    sstr << fourcc_to_string(m_aux_info_type_parameter) << "\n";
 1983|    640|  }
 1984|       |
 1985|    923|  sstr << indent << "default sample size: ";
 1986|    923|  if (m_default_sample_info_size == 0) {
  ------------------
  |  Branch (1986:7): [True: 628, False: 295]
  ------------------
 1987|    628|    sstr << "0 (variable)\n";
 1988|    628|  }
 1989|    295|  else {
 1990|    295|    sstr << ((int)m_default_sample_info_size) << "\n";
 1991|    295|  }
 1992|       |
 1993|    923|  if (m_default_sample_info_size == 0) {
  ------------------
  |  Branch (1993:7): [True: 628, False: 295]
  ------------------
 1994|   332k|    for (size_t i = 0; i < m_sample_sizes.size(); i++) {
  ------------------
  |  Branch (1994:24): [True: 331k, False: 628]
  ------------------
 1995|   331k|      sstr << indent << "[" << i << "] : " << ((int) m_sample_sizes[i]) << "\n";
 1996|   331k|    }
 1997|    628|  }
 1998|       |
 1999|    923|  return sstr.str();
 2000|    923|}
_ZN8Box_saiz5parseER14BitstreamRangePK20heif_security_limits:
 2039|  1.05k|{
 2040|  1.05k|  parse_full_box_header(range);
 2041|       |
 2042|  1.05k|  if (get_flags() & 1) {
  ------------------
  |  Branch (2042:7): [True: 652, False: 401]
  ------------------
 2043|    652|    m_aux_info_type = range.read32();
 2044|    652|    m_aux_info_type_parameter = range.read32();
 2045|    652|  }
 2046|       |
 2047|  1.05k|  m_default_sample_info_size = range.read8();
 2048|  1.05k|  m_num_samples = range.read32();
 2049|       |
 2050|  1.05k|  if (limits && limits->max_sequence_frames > 0 && m_num_samples > limits->max_sequence_frames) {
  ------------------
  |  Branch (2050:7): [True: 1.05k, False: 0]
  |  Branch (2050:17): [True: 1.05k, False: 0]
  |  Branch (2050:52): [True: 39, False: 1.01k]
  ------------------
 2051|     39|    return {
 2052|     39|      heif_error_Memory_allocation_error,
 2053|     39|      heif_suberror_Security_limit_exceeded,
 2054|     39|      "Number of 'saiz' samples exceeds the maximum number of sequence frames."
 2055|     39|    };
 2056|     39|  }
 2057|       |
 2058|  1.01k|  if (m_default_sample_info_size == 0) {
  ------------------
  |  Branch (2058:7): [True: 711, False: 303]
  ------------------
 2059|       |    // check required memory
 2060|       |
 2061|    711|    uint64_t mem_size = m_num_samples;
 2062|    711|    if (auto err = m_memory_handle.alloc(mem_size, limits, "the 'sample aux info sizes' (saiz) table")) {
  ------------------
  |  Branch (2062:14): [True: 0, False: 711]
  ------------------
 2063|      0|      return err;
 2064|      0|    }
 2065|       |
 2066|       |    // read whole table at once
 2067|       |
 2068|    711|    m_sample_sizes.resize(m_num_samples);
 2069|    711|    range.read(m_sample_sizes.data(), m_num_samples);
 2070|    711|  }
 2071|       |
 2072|  1.01k|  return range.get_error();
 2073|  1.01k|}
_ZNK8Box_saio4dumpER6Indent:
 2110|  1.39k|{
 2111|  1.39k|  std::stringstream sstr;
 2112|  1.39k|  sstr << FullBox::dump(indent);
 2113|       |
 2114|  1.39k|  sstr << indent << "aux_info_type: ";
 2115|  1.39k|  if (m_aux_info_type == 0) {
  ------------------
  |  Branch (2115:7): [True: 838, False: 558]
  ------------------
 2116|    838|    sstr << "0\n";
 2117|    838|  }
 2118|    558|  else {
 2119|    558|    sstr << fourcc_to_string(m_aux_info_type) << "\n";
 2120|    558|  }
 2121|       |
 2122|  1.39k|  sstr << indent << "aux_info_type_parameter: ";
 2123|  1.39k|  if (m_aux_info_type_parameter == 0) {
  ------------------
  |  Branch (2123:7): [True: 751, False: 645]
  ------------------
 2124|    751|    sstr << "0\n";
 2125|    751|  }
 2126|    645|  else {
 2127|    645|    sstr << fourcc_to_string(m_aux_info_type_parameter) << "\n";
 2128|    645|  }
 2129|       |
 2130|   280k|  for (size_t i = 0; i < m_chunk_offset.size(); i++) {
  ------------------
  |  Branch (2130:22): [True: 279k, False: 1.39k]
  ------------------
 2131|   279k|    sstr << indent << "[" << i << "] : 0x" << std::hex << m_chunk_offset[i] << "\n";
 2132|   279k|  }
 2133|       |
 2134|  1.39k|  return sstr.str();
 2135|  1.39k|}
_ZN8Box_saio5parseER14BitstreamRangePK20heif_security_limits:
 2191|  1.48k|{
 2192|  1.48k|  parse_full_box_header(range);
 2193|       |
 2194|  1.48k|  if (get_flags() & 1) {
  ------------------
  |  Branch (2194:7): [True: 759, False: 725]
  ------------------
 2195|    759|    m_aux_info_type = range.read32();
 2196|    759|    m_aux_info_type_parameter = range.read32();
 2197|    759|  }
 2198|       |
 2199|  1.48k|  uint32_t num_chunks = range.read32();
 2200|       |
 2201|       |  // We have no explicit maximum on the number of chunks.
 2202|       |  // Use the maximum number of frames as an upper limit.
 2203|  1.48k|  if (limits && limits->max_sequence_frames > 0 && num_chunks > limits->max_sequence_frames) {
  ------------------
  |  Branch (2203:7): [True: 1.48k, False: 0]
  |  Branch (2203:17): [True: 1.48k, False: 0]
  |  Branch (2203:52): [True: 39, False: 1.44k]
  ------------------
 2204|     39|    return {
 2205|     39|      heif_error_Memory_allocation_error,
 2206|     39|      heif_suberror_Security_limit_exceeded,
 2207|     39|      "Number of 'saio' chunks exceeds the maximum number of sequence frames."
 2208|     39|    };
 2209|     39|  }
 2210|       |
 2211|  1.44k|  if (auto err = m_memory_handle.alloc(num_chunks, sizeof(uint64_t),
  ------------------
  |  Branch (2211:12): [True: 0, False: 1.44k]
  ------------------
 2212|  1.44k|                                       limits, "the 'saio' table")) {
 2213|      0|    return err;
 2214|      0|  }
 2215|       |
 2216|  1.44k|  m_chunk_offset.resize(num_chunks);
 2217|       |
 2218|   281k|  for (uint32_t i = 0; i < num_chunks; i++) {
  ------------------
  |  Branch (2218:24): [True: 279k, False: 1.39k]
  ------------------
 2219|   279k|    uint64_t offset;
 2220|   279k|    if (get_version() == 1) {
  ------------------
  |  Branch (2220:9): [True: 396, False: 279k]
  ------------------
 2221|    396|      offset = range.read64();
 2222|    396|    }
 2223|   279k|    else {
 2224|   279k|      offset = range.read32();
 2225|   279k|    }
 2226|       |
 2227|   279k|    m_chunk_offset[i] = offset;
 2228|       |
 2229|   279k|    if (range.error()) {
  ------------------
  |  Branch (2229:9): [True: 49, False: 279k]
  ------------------
 2230|     49|      return range.get_error();
 2231|     49|    }
 2232|   279k|  }
 2233|       |
 2234|  1.39k|  return Error::Ok;
 2235|  1.44k|}
_ZNK8Box_sdtp4dumpER6Indent:
 2239|    535|{
 2240|    535|  std::stringstream sstr;
 2241|    535|  sstr << FullBox::dump(indent);
 2242|       |
 2243|    535|  assert(m_sample_information.size() <= UINT32_MAX);
  ------------------
  |  Branch (2243:3): [True: 535, False: 0]
  ------------------
 2244|       |
 2245|  8.37M|  for (uint32_t i = 0; i < static_cast<uint32_t>(m_sample_information.size()); i++) {
  ------------------
  |  Branch (2245:24): [True: 8.37M, False: 535]
  ------------------
 2246|  8.37M|    const char* spaces = "            ";
 2247|  8.37M|    int nSpaces = 6;
 2248|  8.37M|    int k = i;
 2249|  45.3M|    while (k >= 10 && nSpaces < 12) {
  ------------------
  |  Branch (2249:12): [True: 37.0M, False: 8.37M]
  |  Branch (2249:23): [True: 37.0M, False: 0]
  ------------------
 2250|  37.0M|      k /= 10;
 2251|  37.0M|      nSpaces++;
 2252|  37.0M|    }
 2253|       |
 2254|  8.37M|    spaces = spaces + 12 - nSpaces;
 2255|       |
 2256|  8.37M|    sstr << indent << "[" << i << "] : is_leading=" << (int) get_is_leading(i) << "\n"
 2257|  8.37M|        << indent << spaces << "depends_on=" << (int) get_depends_on(i) << "\n"
 2258|  8.37M|        << indent << spaces << "is_depended_on=" << (int) get_is_depended_on(i) << "\n"
 2259|  8.37M|        << indent << spaces << "has_redundancy=" << (int) get_has_redundancy(i) << "\n";
 2260|  8.37M|  }
 2261|       |
 2262|    535|  return sstr.str();
 2263|    535|}
_ZN8Box_sdtp5parseER14BitstreamRangePK20heif_security_limits:
 2267|    786|{
 2268|    786|  parse_full_box_header(range);
 2269|       |
 2270|       |  // We have no easy way to get the number of samples from 'saiz' or 'stz2' as specified
 2271|       |  // in the standard. Instead, we read until the end of the box.
 2272|    786|  size_t nSamples = range.get_remaining_bytes();
 2273|       |
 2274|    786|  m_sample_information.resize(nSamples);
 2275|    786|  range.read(m_sample_information.data(), nSamples);
 2276|       |
 2277|    786|  return Error::Ok;
 2278|    786|}
_ZN8Box_tref5parseER14BitstreamRangePK20heif_security_limits:
 2282|  1.05k|{
 2283|  3.58k|  while (!range.eof()) {
  ------------------
  |  Branch (2283:10): [True: 2.70k, False: 881]
  ------------------
 2284|  2.70k|    BoxHeader header;
 2285|  2.70k|    Error err = header.parse_header(range);
 2286|  2.70k|    if (err != Error::Ok) {
  ------------------
  |  Branch (2286:9): [True: 9, False: 2.69k]
  ------------------
 2287|      9|      return err;
 2288|      9|    }
 2289|       |
 2290|  2.69k|    if (header.get_box_size() < header.get_header_size()) {
  ------------------
  |  Branch (2290:9): [True: 2, False: 2.69k]
  ------------------
 2291|      2|      return {heif_error_Invalid_input,
 2292|      2|              heif_suberror_Unspecified,
 2293|      2|              "Invalid box size (smaller than header)"};
 2294|      2|    }
 2295|       |
 2296|  2.69k|    uint64_t dataSize = (header.get_box_size() - header.get_header_size());
 2297|       |
 2298|  2.69k|    if (dataSize % 4 != 0 || dataSize < 4) {
  ------------------
  |  Branch (2298:9): [True: 25, False: 2.66k]
  |  Branch (2298:30): [True: 1, False: 2.66k]
  ------------------
 2299|     26|      return {heif_error_Invalid_input,
 2300|     26|              heif_suberror_Unspecified,
 2301|     26|              "Input file has a 'tref' TrackReferenceTypeBox with invalid size."};
 2302|     26|    }
 2303|       |
 2304|  2.66k|    uint64_t nRefs = dataSize / 4;
 2305|       |
 2306|  2.66k|    if (limits->max_items && nRefs > limits->max_items) {
  ------------------
  |  Branch (2306:9): [True: 2.66k, False: 0]
  |  Branch (2306:30): [True: 110, False: 2.55k]
  ------------------
 2307|    110|      std::stringstream sstr;
 2308|    110|      sstr << "Number of references in tref box (" << nRefs << ") exceeds the security limits of " << limits->max_items << " references.";
 2309|       |
 2310|    110|      return {heif_error_Invalid_input,
 2311|    110|              heif_suberror_Security_limit_exceeded,
 2312|    110|              sstr.str()};
 2313|    110|    }
 2314|       |
 2315|  2.55k|    Reference ref;
 2316|  2.55k|    ref.reference_type = header.get_short_type();
 2317|       |
 2318|  13.0k|    for (uint64_t i = 0; i < nRefs; i++) {
  ------------------
  |  Branch (2318:26): [True: 10.5k, False: 2.53k]
  ------------------
 2319|  10.5k|      if (range.eof()) {
  ------------------
  |  Branch (2319:11): [True: 25, False: 10.5k]
  ------------------
 2320|     25|        std::stringstream sstr;
 2321|     25|        sstr << "tref box should contain " << nRefs << " references, but we can only read " << i << " references.";
 2322|       |
 2323|     25|        return {heif_error_Invalid_input,
 2324|     25|                heif_suberror_End_of_data,
 2325|     25|                sstr.str()};
 2326|     25|      }
 2327|       |
 2328|  10.5k|      ref.to_track_id.push_back(static_cast<uint32_t>(range.read32()));
 2329|  10.5k|    }
 2330|       |
 2331|  2.53k|    m_references.push_back(ref);
 2332|  2.53k|  }
 2333|       |
 2334|       |
 2335|       |  // --- check for duplicate references
 2336|       |
 2337|    881|  if (auto error = check_for_double_references()) {
  ------------------
  |  Branch (2337:12): [True: 17, False: 864]
  ------------------
 2338|     17|    return error;
 2339|     17|  }
 2340|       |
 2341|    864|  return range.get_error();
 2342|    881|}
_ZNK8Box_tref27check_for_double_referencesEv:
 2346|    881|{
 2347|  2.20k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (2347:24): [True: 2.20k, False: 864]
  ------------------
 2348|  2.20k|    std::set<uint32_t> to_ids;
 2349|  7.64k|    for (const auto to_id : ref.to_track_id) {
  ------------------
  |  Branch (2349:27): [True: 7.64k, False: 2.18k]
  ------------------
 2350|  7.64k|      if (to_ids.find(to_id) == to_ids.end()) {
  ------------------
  |  Branch (2350:11): [True: 7.62k, False: 17]
  ------------------
 2351|  7.62k|        to_ids.insert(to_id);
 2352|  7.62k|      }
 2353|     17|      else {
 2354|     17|        return {heif_error_Invalid_input,
 2355|     17|                heif_suberror_Unspecified,
 2356|     17|                "'tref' has double references"};
 2357|     17|      }
 2358|  7.64k|    }
 2359|  2.20k|  }
 2360|       |
 2361|    864|  return Error::Ok;
 2362|    881|}
_ZNK8Box_tref4dumpER6Indent:
 2392|    748|{
 2393|    748|  std::ostringstream sstr;
 2394|    748|  sstr << Box::dump(indent);
 2395|       |
 2396|  2.01k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (2396:24): [True: 2.01k, False: 748]
  ------------------
 2397|  2.01k|    sstr << indent << "reference with type '" << fourcc_to_string(ref.reference_type) << "'"
 2398|  2.01k|         << " to track IDs: ";
 2399|  6.67k|    for (uint32_t id : ref.to_track_id) {
  ------------------
  |  Branch (2399:22): [True: 6.67k, False: 2.01k]
  ------------------
 2400|  6.67k|      sstr << id << " ";
 2401|  6.67k|    }
 2402|  2.01k|    sstr << "\n";
 2403|  2.01k|  }
 2404|       |
 2405|    748|  return sstr.str();
 2406|    748|}
_ZN8Box_elst5parseER14BitstreamRangePK20heif_security_limits:
 2463|    914|{
 2464|    914|  Error err = parse_full_box_header(range);
 2465|    914|  if (err != Error::Ok) {
  ------------------
  |  Branch (2465:7): [True: 2, False: 912]
  ------------------
 2466|      2|    return err;
 2467|      2|  }
 2468|       |
 2469|    912|  if (get_version() > 1) {
  ------------------
  |  Branch (2469:7): [True: 1, False: 911]
  ------------------
 2470|      1|    return unsupported_version_error("edts");
 2471|      1|  }
 2472|       |
 2473|    911|  uint32_t nEntries = range.read32();
 2474|    911|  m_entries.clear();
 2475|       |
 2476|  70.4k|  for (uint64_t i = 0; i < nEntries; i++) {
  ------------------
  |  Branch (2476:24): [True: 69.5k, False: 836]
  ------------------
 2477|  69.5k|    if (range.eof()) {
  ------------------
  |  Branch (2477:9): [True: 75, False: 69.4k]
  ------------------
 2478|     75|      std::stringstream sstr;
 2479|     75|      sstr << "edts box should contain " << nEntries << " entries, but we can only read " << i << " entries.";
 2480|       |
 2481|     75|      return {heif_error_Invalid_input,
 2482|     75|              heif_suberror_End_of_data,
 2483|     75|              sstr.str()};
 2484|     75|    }
 2485|       |
 2486|  69.4k|    Entry entry{};
 2487|  69.4k|    if (get_version() == 1) {
  ------------------
  |  Branch (2487:9): [True: 235, False: 69.2k]
  ------------------
 2488|    235|      entry.segment_duration = range.read64();
 2489|    235|      entry.media_time = range.read64s();
 2490|    235|    }
 2491|  69.2k|    else {
 2492|  69.2k|      entry.segment_duration = range.read32();
 2493|  69.2k|      entry.media_time = range.read32s();
 2494|  69.2k|    }
 2495|       |
 2496|  69.4k|    entry.media_rate_integer = range.read16s();
 2497|  69.4k|    entry.media_rate_fraction = range.read16s();
 2498|       |
 2499|  69.4k|    m_entries.push_back(entry);
 2500|  69.4k|  }
 2501|       |
 2502|    836|  return range.get_error();
 2503|    911|}
_ZNK8Box_elst4dumpER6Indent:
 2543|    651|{
 2544|    651|  std::ostringstream sstr;
 2545|    651|  sstr << FullBox::dump(indent);
 2546|       |
 2547|    651|  sstr << indent << "repeat list: " << ((get_flags() & Flags::Repeat_EditList) ? "yes" : "no") << "\n";
  ------------------
  |  Branch (2547:41): [True: 90, False: 561]
  ------------------
 2548|       |
 2549|  68.6k|  for (const auto& entry : m_entries) {
  ------------------
  |  Branch (2549:26): [True: 68.6k, False: 651]
  ------------------
 2550|  68.6k|    sstr << indent << "segment duration: " << entry.segment_duration << "\n";
 2551|  68.6k|    sstr << indent << "media time: " << entry.media_time << "\n";
 2552|  68.6k|    sstr << indent << "media rate integer: " << entry.media_rate_integer << "\n";
 2553|  68.6k|    sstr << indent << "media rate fraction: " << entry.media_rate_fraction << "\n";
 2554|  68.6k|  }
 2555|       |
 2556|    651|  return sstr.str();
 2557|    651|}

_ZN13Box_containerC2EPKc:
   37|  2.58k|  {
   38|  2.58k|    set_short_type(fourcc(type));
   39|  2.58k|  }
_ZN8Box_moovC2Ev:
   51|    469|  Box_moov() : Box_container("moov") {}
_ZNK8Box_moov14debug_box_nameEv:
   53|    426|  const char* debug_box_name() const override { return "Movie"; }
_ZN8Box_mvhdC2Ev:
   61|  2.27k|  {
   62|  2.27k|    set_short_type(fourcc("mvhd"));
   63|  2.27k|  }
_ZNK8Box_mvhd14debug_box_nameEv:
   67|  1.83k|  const char* debug_box_name() const override { return "Movie Header"; }
_ZNK8Box_mvhd8get_rateEv:
   73|  1.83k|  double get_rate() const { return m_rate / double(0x10000); }
_ZNK8Box_mvhd10get_volumeEv:
   75|  1.83k|  float get_volume() const { return float(m_volume) / float(0x100); }
_ZN8Box_trakC2Ev:
  121|    324|  Box_trak() : Box_container("trak") {}
_ZNK8Box_trak14debug_box_nameEv:
  123|    295|  const char* debug_box_name() const override { return "Track"; }
_ZN8Box_tkhdC2Ev:
  131|  1.37k|  {
  132|  1.37k|    set_short_type(fourcc("tkhd"));
  133|       |
  134|       |    // set default flags according to ISO 14496-12
  135|  1.37k|    set_flags(Track_enabled | Track_in_movie | Track_in_preview);
  136|  1.37k|  }
_ZNK8Box_tkhd14debug_box_nameEv:
  147|  1.26k|  const char* debug_box_name() const override { return "Track Header"; }
_ZNK8Box_tkhd10get_volumeEv:
  153|  1.26k|  float get_volume() const { return float(m_volume) / float(0x100); }
_ZNK8Box_tkhd9get_widthEv:
  157|  1.26k|  double get_width() const { return float(m_width) / double(0x10000); }
_ZNK8Box_tkhd10get_heightEv:
  159|  1.26k|  double get_height() const { return float(m_height) / double(0x10000); }
_ZN8Box_mdiaC2Ev:
  198|     73|  Box_mdia() : Box_container("mdia") {}
_ZNK8Box_mdia14debug_box_nameEv:
  200|     70|  const char* debug_box_name() const override { return "Media"; }
_ZN8Box_mdhdC2Ev:
  208|    598|  {
  209|    598|    set_short_type(fourcc("mdhd"));
  210|    598|  }
_ZNK8Box_mdhd14debug_box_nameEv:
  214|    528|  const char* debug_box_name() const override { return "Media Header"; }
_ZN8Box_minfC2Ev:
  246|    435|  Box_minf() : Box_container("minf") {}
_ZNK8Box_minf14debug_box_nameEv:
  248|    377|  const char* debug_box_name() const override { return "Media Information"; }
_ZN8Box_vmhdC2Ev:
  256|    467|  {
  257|    467|    set_short_type(fourcc("vmhd"));
  258|    467|    set_flags(1);
  259|    467|  }
_ZNK8Box_vmhd14debug_box_nameEv:
  263|    393|  const char* debug_box_name() const override { return "Video Media Header"; }
_ZN8Box_nmhdC2Ev:
  280|    502|  {
  281|    502|    set_short_type(fourcc("nmhd"));
  282|    502|    set_flags(1);
  283|    502|  }
_ZNK8Box_nmhd14debug_box_nameEv:
  287|    496|  const char* debug_box_name() const override { return "Null Media Header"; }
_ZN8Box_stblC2Ev:
  299|    810|  Box_stbl() : Box_container("stbl") {}
_ZNK8Box_stbl14debug_box_nameEv:
  301|    698|  const char* debug_box_name() const override { return "Sample Table"; }
_ZN8Box_stsdC2Ev:
  309|  1.40k|  {
  310|  1.40k|    set_short_type(fourcc("stsd"));
  311|  1.40k|  }
_ZNK8Box_stsd14debug_box_nameEv:
  315|    963|  const char* debug_box_name() const override { return "Sample Description"; }
_ZN8Box_sttsC2Ev:
  347|    320|  {
  348|    320|    set_short_type(fourcc("stts"));
  349|    320|  }
_ZNK8Box_stts14debug_box_nameEv:
  353|    212|  const char* debug_box_name() const override { return "Decoding Time to Sample"; }
_ZN8Box_cttsC2Ev:
  393|  1.16k|  {
  394|  1.16k|    set_short_type(fourcc("ctts"));
  395|  1.16k|  }
_ZNK8Box_ctts14debug_box_nameEv:
  399|    874|  const char* debug_box_name() const override { return "Composition Time to Sample"; }
_ZN8Box_stscC2Ev:
  433|    315|  {
  434|    315|    set_short_type(fourcc("stsc"));
  435|    315|  }
_ZNK8Box_stsc14debug_box_nameEv:
  439|    119|  const char* debug_box_name() const override { return "Sample to Chunk"; }
_ZN8Box_stcoC2Ev:
  477|    531|  {
  478|    531|    set_short_type(fourcc("stco"));
  479|    531|  }
_ZNK8Box_stco14debug_box_nameEv:
  483|    498|  const char* debug_box_name() const override { return "Sample Offset"; }
_ZN8Box_stszC2Ev:
  510|  1.03k|  {
  511|  1.03k|    set_short_type(fourcc("stsz"));
  512|  1.03k|  }
_ZNK8Box_stsz14debug_box_nameEv:
  516|    927|  const char* debug_box_name() const override { return "Sample Size"; }
_ZN8Box_stssC2Ev:
  545|    465|  {
  546|    465|    set_short_type(fourcc("stss"));
  547|    465|  }
_ZNK8Box_stss14debug_box_nameEv:
  551|    329|  const char* debug_box_name() const override { return "Sync Sample"; }
_ZN8Box_ccstC2Ev:
  584|    692|  {
  585|    692|    set_short_type(fourcc("ccst"));
  586|    692|  }
_ZNK8Box_ccst14debug_box_nameEv:
  590|    687|  const char* debug_box_name() const override { return "Coding Constraints"; }
_ZN8Box_auxiC2Ev:
  609|  1.34k|  {
  610|  1.34k|    set_short_type(fourcc("auxi"));
  611|  1.34k|  }
_ZNK8Box_auxi14debug_box_nameEv:
  615|  1.18k|  const char* debug_box_name() const override { return "Auxiliary Info Type"; }
_ZNK17VisualSampleEntry25get_horizontal_resolutionEv:
  654|    511|  double get_horizontal_resolution() const { return horizresolution / double(0x10000); }
_ZNK17VisualSampleEntry23get_vertical_resolutionEv:
  656|    511|  double get_vertical_resolution() const { return vertresolution / double(0x10000); }
_ZN22Box_URIMetaSampleEntryC2Ev:
  687|    852|  {
  688|    852|    set_short_type(fourcc("urim"));
  689|    852|  }
_ZNK22Box_URIMetaSampleEntry14debug_box_nameEv:
  695|    656|  const char* debug_box_name() const override { return "URI Meta Sample Entry"; }
_ZN7Box_uriC2Ev:
  710|    740|  {
  711|    740|    set_short_type(fourcc("uri "));
  712|    740|  }
_ZNK7Box_uri14debug_box_nameEv:
  722|    579|  const char* debug_box_name() const override { return "URI"; }
_ZN8Box_sbgpC2Ev:
  736|    749|  {
  737|    749|    set_short_type(fourcc("sbgp"));
  738|    749|  }
_ZNK8Box_sbgp14debug_box_nameEv:
  744|    681|  const char* debug_box_name() const override { return "Sample to Group"; }
_ZN8Box_sgpdC2Ev:
  797|  1.67k|  {
  798|  1.67k|    set_short_type(fourcc("sgpd"));
  799|  1.67k|  }
_ZNK8Box_sgpd14debug_box_nameEv:
  805|  1.48k|  const char* debug_box_name() const override { return "Sample Group Description"; }
_ZN8Box_btrtC2Ev:
  830|    696|  {
  831|    696|    set_short_type(fourcc("btrt"));
  832|    696|  }
_ZNK8Box_btrt14debug_box_nameEv:
  836|    585|  const char* debug_box_name() const override { return "Bitrate"; }
_ZN8Box_saizC2Ev:
  853|  1.05k|  {
  854|  1.05k|    set_short_type(fourcc("saiz"));
  855|  1.05k|  }
_ZNK8Box_saiz14debug_box_nameEv:
  875|    923|  const char* debug_box_name() const override { return "Sample Auxiliary Information Sizes"; }
_ZN8Box_saioC2Ev:
  896|  1.48k|  {
  897|  1.48k|    set_short_type(fourcc("saio"));
  898|  1.48k|  }
_ZNK8Box_saio14debug_box_nameEv:
  915|  1.39k|  const char* debug_box_name() const override { return "Sample Auxiliary Information Offsets"; }
_ZN8Box_sdtpC2Ev:
  941|    788|  {
  942|    788|    set_short_type(fourcc("sdtp"));
  943|    788|  }
_ZNK8Box_sdtp14debug_box_nameEv:
  947|    535|  const char* debug_box_name() const override { return "Independent and Disposable Samples"; }
_ZNK8Box_sdtp14get_is_leadingEj:
  951|  8.37M|  uint8_t get_is_leading(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 6) & 3; }
_ZNK8Box_sdtp14get_depends_onEj:
  953|  8.37M|  uint8_t get_depends_on(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 4) & 3; }
_ZNK8Box_sdtp18get_is_depended_onEj:
  955|  8.37M|  uint8_t get_is_depended_on(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 2) & 3; }
_ZNK8Box_sdtp18get_has_redundancyEj:
  957|  8.37M|  uint8_t get_has_redundancy(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx]) & 3; }
_ZN8Box_trefC2Ev:
  971|  1.05k|  {
  972|  1.05k|    set_short_type(fourcc("tref"));
  973|  1.05k|  }
_ZNK8Box_tref14debug_box_nameEv:
  982|    748|  const char* debug_box_name() const override { return "Track Reference"; }
_ZN8Box_edtsC2Ev:
 1009|    478|  Box_edts() : Box_container("edts") {}
_ZNK8Box_edts14debug_box_nameEv:
 1011|    475|  const char* debug_box_name() const override { return "Edit List Container"; }
_ZN8Box_elstC2Ev:
 1019|    917|  {
 1020|    917|    set_short_type(fourcc("elst"));
 1021|    917|  }
_ZNK8Box_elst14debug_box_nameEv:
 1029|    651|  const char* debug_box_name() const override { return "Edit List"; }
_ZN16SampleGroupEntryD2Ev:
  768|   164k|  virtual ~SampleGroupEntry() = default;

aom_codec_version:
   25|      2|int aom_codec_version(void) { return VERSION_PACKED; }
  ------------------
  |  |   17|      2|  ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH))
  |  |  ------------------
  |  |  |  |   12|      2|#define VERSION_MAJOR 3
  |  |  ------------------
  |  |                 ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH))
  |  |  ------------------
  |  |  |  |   13|      2|#define VERSION_MINOR 2
  |  |  ------------------
  |  |                 ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH))
  |  |  ------------------
  |  |  |  |   14|      2|#define VERSION_PATCH 0
  |  |  ------------------
  ------------------

de265_init:
  212|      2|{
  213|      2|  std::lock_guard<std::mutex> lock(de265_init_mutex());
  214|       |
  215|      2|  de265_init_count++;
  216|       |
  217|      2|  if (de265_init_count > 1) {
  ------------------
  |  Branch (217:7): [True: 0, False: 2]
  ------------------
  218|       |    // we are not the first -> already initialized
  219|       |
  220|      0|    return DE265_OK;
  221|      0|  }
  222|       |
  223|       |
  224|       |  // do initializations
  225|       |
  226|      2|  init_scan_orders();
  227|      2|  pps_scan_cache_init();
  228|       |
  229|      2|  if (!alloc_and_init_significant_coeff_ctxIdx_lookupTable()) {
  ------------------
  |  Branch (229:7): [True: 0, False: 2]
  ------------------
  230|      0|    pps_scan_cache_free();
  231|      0|    de265_init_count--;
  232|      0|    return DE265_ERROR_LIBRARY_INITIALIZATION_FAILED;
  233|      0|  }
  234|       |
  235|      2|  return DE265_OK;
  236|      2|}
de265.cc:_ZL16de265_init_mutexv:
  205|      2|{
  206|      2|  static std::mutex de265_init_mutex;
  207|      2|  return de265_init_mutex;
  208|      2|}

_Z19pps_scan_cache_initv:
  700|      2|{
  701|      2|  if (!g_pps_scan_cache.load(std::memory_order_relaxed)) {
  ------------------
  |  Branch (701:7): [True: 2, False: 0]
  ------------------
  702|      2|    g_pps_scan_cache.store(new pps_scan_cache(), std::memory_order_release);
  703|      2|  }
  704|      2|}

_Z14get_scan_orderii:
   81|     48|{
   82|     48|  switch (scanIdx) {
   83|     16|  case 0: return scan_d[log2BlockSize];
  ------------------
  |  Branch (83:3): [True: 16, False: 32]
  ------------------
   84|     16|  case 1: return scan_h[log2BlockSize];
  ------------------
  |  Branch (84:3): [True: 16, False: 32]
  ------------------
   85|     16|  case 2: return scan_v[log2BlockSize];
  ------------------
  |  Branch (85:3): [True: 16, False: 32]
  ------------------
   86|      0|  default: return 0; // should never happen
  ------------------
  |  Branch (86:3): [True: 0, False: 48]
  ------------------
   87|     48|  }
   88|     48|}
_Z16init_scan_ordersv:
  131|      2|{
  132|     12|  for (int log2size=1;log2size<=5;log2size++)
  ------------------
  |  Branch (132:23): [True: 10, False: 2]
  ------------------
  133|     10|    {
  134|     10|      init_scan_h(scan_h[log2size], 1<<log2size);
  135|     10|      init_scan_v(scan_v[log2size], 1<<log2size);
  136|     10|      init_scan_d(scan_d[log2size], 1<<log2size);
  137|     10|    }
  138|       |
  139|     10|  for (int log2size=2;log2size<=5;log2size++)
  ------------------
  |  Branch (139:23): [True: 8, False: 2]
  ------------------
  140|     32|    for (int scanIdx=0;scanIdx<3;scanIdx++)
  ------------------
  |  Branch (140:24): [True: 24, False: 8]
  ------------------
  141|     24|      fill_scan_pos_table(scanpos[scanIdx][log2size], scanIdx, log2size);
  142|      2|}
scan.cc:_ZL11init_scan_hP8positioni:
   35|     10|{
   36|     10|  int i=0;
   37|    134|  for (int y=0;y<blkSize;y++)
  ------------------
  |  Branch (37:16): [True: 124, False: 10]
  ------------------
   38|  2.85k|    for (int x=0;x<blkSize;x++)
  ------------------
  |  Branch (38:18): [True: 2.72k, False: 124]
  ------------------
   39|  2.72k|      {
   40|  2.72k|        scan[i].x = x;
   41|  2.72k|        scan[i].y = y;
   42|  2.72k|        i++;
   43|  2.72k|      }
   44|     10|}
scan.cc:_ZL11init_scan_vP8positioni:
   47|     10|{
   48|     10|  int i=0;
   49|    134|  for (int x=0;x<blkSize;x++)
  ------------------
  |  Branch (49:16): [True: 124, False: 10]
  ------------------
   50|  2.85k|    for (int y=0;y<blkSize;y++)
  ------------------
  |  Branch (50:18): [True: 2.72k, False: 124]
  ------------------
   51|  2.72k|      {
   52|  2.72k|        scan[i].x = x;
   53|  2.72k|        scan[i].y = y;
   54|  2.72k|        i++;
   55|  2.72k|      }
   56|     10|}
scan.cc:_ZL11init_scan_dP8positioni:
   59|     10|{
   60|     10|  int i=0;
   61|     10|  int x=0,y=0;
   62|       |
   63|    238|  do {
   64|  5.57k|    while (y>=0) {
  ------------------
  |  Branch (64:12): [True: 5.33k, False: 238]
  ------------------
   65|  5.33k|      if (x<blkSize && y<blkSize) {
  ------------------
  |  Branch (65:11): [True: 4.03k, False: 1.30k]
  |  Branch (65:24): [True: 2.72k, False: 1.30k]
  ------------------
   66|  2.72k|        scan[i].x = x;
   67|  2.72k|        scan[i].y = y;
   68|  2.72k|        i++;
   69|  2.72k|      }
   70|  5.33k|      y--;
   71|  5.33k|      x++;
   72|  5.33k|    }
   73|       |
   74|    238|    y=x;
   75|    238|    x=0;
   76|    238|  } while (i < blkSize*blkSize);
  ------------------
  |  Branch (76:12): [True: 228, False: 10]
  ------------------
   77|     10|}
scan.cc:_ZL19fill_scan_pos_tableP13scan_positionii:
  109|     24|{
  110|     24|  int numSubBlocks = (1<<(log2TrafoSize-2)) * (1<<(log2TrafoSize-2));
  111|     24|  int blkSize = 1 << log2TrafoSize;
  112|       |
  113|     24|  const position* ScanOrderSub = get_scan_order(log2TrafoSize-2, scanIdx);
  114|     24|  const position* ScanOrderPos = get_scan_order(2, scanIdx);
  115|       |
  116|    534|  for (int sb = 0; sb < numSubBlocks; sb++)
  ------------------
  |  Branch (116:20): [True: 510, False: 24]
  ------------------
  117|    510|    {
  118|    510|      position S = ScanOrderSub[sb];
  119|  8.67k|      for (int sp = 0; sp < 16; sp++)
  ------------------
  |  Branch (119:24): [True: 8.16k, False: 510]
  ------------------
  120|  8.16k|        {
  121|  8.16k|          int xC = (S.x<<2) + ScanOrderPos[sp].x;
  122|  8.16k|          int yC = (S.y<<2) + ScanOrderPos[sp].y;
  123|  8.16k|          pos[yC * blkSize + xC].subBlock = sb;
  124|  8.16k|          pos[yC * blkSize + xC].scanPos  = sp;
  125|  8.16k|        }
  126|    510|    }
  127|     24|}

_Z51alloc_and_init_significant_coeff_ctxIdx_lookupTablev:
 1996|      2|{
 1997|      2|  int tableSize = 4 * 4 * (2) + 8 * 8 * (2 * 2 * 4) + 16 * 16 * (2 * 4) + 32 * 32 * (2 * 4);
 1998|       |
 1999|      2|  uint8_t* p = (uint8_t*) malloc(tableSize);
 2000|      2|  if (p == nullptr) {
  ------------------
  |  Branch (2000:7): [True: 0, False: 2]
  ------------------
 2001|      0|    return false;
 2002|      0|  }
 2003|       |
 2004|      2|  memset(p, 0xFF, tableSize); // just for debugging
 2005|       |
 2006|       |
 2007|       |  // --- Set pointers to memory areas. Note that some parameters share the same memory. ---
 2008|       |
 2009|       |  // 4x4
 2010|       |
 2011|      6|  for (int cIdx = 0; cIdx < 2; cIdx++) {
  ------------------
  |  Branch (2011:22): [True: 4, False: 2]
  ------------------
 2012|     12|    for (int scanIdx = 0; scanIdx < 2; scanIdx++)
  ------------------
  |  Branch (2012:27): [True: 8, False: 4]
  ------------------
 2013|     40|      for (int prevCsbf = 0; prevCsbf < 4; prevCsbf++)
  ------------------
  |  Branch (2013:30): [True: 32, False: 8]
  ------------------
 2014|     32|        ctxIdxLookup[0][cIdx][scanIdx][prevCsbf] = p;
 2015|       |
 2016|      4|    p += 4 * 4;
 2017|      4|  }
 2018|       |
 2019|       |  // 8x8
 2020|       |
 2021|      6|  for (int cIdx = 0; cIdx < 2; cIdx++)
  ------------------
  |  Branch (2021:22): [True: 4, False: 2]
  ------------------
 2022|     12|    for (int scanIdx = 0; scanIdx < 2; scanIdx++)
  ------------------
  |  Branch (2022:27): [True: 8, False: 4]
  ------------------
 2023|     40|      for (int prevCsbf = 0; prevCsbf < 4; prevCsbf++) {
  ------------------
  |  Branch (2023:30): [True: 32, False: 8]
  ------------------
 2024|     32|        ctxIdxLookup[1][cIdx][scanIdx][prevCsbf] = p;
 2025|     32|        p += 8 * 8;
 2026|     32|      }
 2027|       |
 2028|       |  // 16x16
 2029|       |
 2030|      6|  for (int cIdx = 0; cIdx < 2; cIdx++)
  ------------------
  |  Branch (2030:22): [True: 4, False: 2]
  ------------------
 2031|     20|    for (int prevCsbf = 0; prevCsbf < 4; prevCsbf++) {
  ------------------
  |  Branch (2031:28): [True: 16, False: 4]
  ------------------
 2032|     48|      for (int scanIdx = 0; scanIdx < 2; scanIdx++) {
  ------------------
  |  Branch (2032:29): [True: 32, False: 16]
  ------------------
 2033|     32|        ctxIdxLookup[2][cIdx][scanIdx][prevCsbf] = p;
 2034|     32|      }
 2035|       |
 2036|     16|      p += 16 * 16;
 2037|     16|    }
 2038|       |
 2039|       |  // 32x32
 2040|       |
 2041|      6|  for (int cIdx = 0; cIdx < 2; cIdx++)
  ------------------
  |  Branch (2041:22): [True: 4, False: 2]
  ------------------
 2042|     20|    for (int prevCsbf = 0; prevCsbf < 4; prevCsbf++) {
  ------------------
  |  Branch (2042:28): [True: 16, False: 4]
  ------------------
 2043|     48|      for (int scanIdx = 0; scanIdx < 2; scanIdx++) {
  ------------------
  |  Branch (2043:29): [True: 32, False: 16]
  ------------------
 2044|     32|        ctxIdxLookup[3][cIdx][scanIdx][prevCsbf] = p;
 2045|     32|      }
 2046|       |
 2047|     16|      p += 32 * 32;
 2048|     16|    }
 2049|       |
 2050|       |
 2051|       |  // --- precompute ctxIdx tables ---
 2052|       |
 2053|     10|  for (int log2w = 2; log2w <= 5; log2w++)
  ------------------
  |  Branch (2053:23): [True: 8, False: 2]
  ------------------
 2054|     24|    for (int cIdx = 0; cIdx < 2; cIdx++)
  ------------------
  |  Branch (2054:24): [True: 16, False: 8]
  ------------------
 2055|     48|      for (int scanIdx = 0; scanIdx < 2; scanIdx++)
  ------------------
  |  Branch (2055:29): [True: 32, False: 16]
  ------------------
 2056|    160|        for (int prevCsbf = 0; prevCsbf < 4; prevCsbf++) {
  ------------------
  |  Branch (2056:32): [True: 128, False: 32]
  ------------------
 2057|  2.04k|          for (int yC = 0; yC < (1 << log2w); yC++)
  ------------------
  |  Branch (2057:28): [True: 1.92k, False: 128]
  ------------------
 2058|  45.4k|            for (int xC = 0; xC < (1 << log2w); xC++) {
  ------------------
  |  Branch (2058:30): [True: 43.5k, False: 1.92k]
  ------------------
 2059|  43.5k|              int w = 1 << log2w;
 2060|  43.5k|              int sbWidth = w >> 2;
 2061|       |
 2062|  43.5k|              int sigCtx;
 2063|       |
 2064|       |              // if log2TrafoSize==2
 2065|  43.5k|              if (sbWidth == 1) {
  ------------------
  |  Branch (2065:19): [True: 512, False: 43.0k]
  ------------------
 2066|    512|                sigCtx = ctxIdxMap[(yC << 2) + xC];
 2067|    512|              }
 2068|  43.0k|              else if (xC + yC == 0) {
  ------------------
  |  Branch (2068:24): [True: 96, False: 42.9k]
  ------------------
 2069|     96|                sigCtx = 0;
 2070|     96|              }
 2071|  42.9k|              else {
 2072|  42.9k|                int xS = xC >> 2;
 2073|  42.9k|                int yS = yC >> 2;
 2074|       |                /*
 2075|       |                  int prevCsbf = 0;
 2076|       |
 2077|       |                  if (xS < sbWidth-1) { prevCsbf += coded_sub_block_flag[xS+1  +yS*sbWidth];    }
 2078|       |                  if (yS < sbWidth-1) { prevCsbf += coded_sub_block_flag[xS+(1+yS)*sbWidth]<<1; }
 2079|       |                */
 2080|  42.9k|                int xP = xC & 3;
 2081|  42.9k|                int yP = yC & 3;
 2082|       |
 2083|       |                //logtrace(LogSlice,"posInSubset: %d,%d\n",xP,yP);
 2084|       |                //logtrace(LogSlice,"prevCsbf: %d\n",prevCsbf);
 2085|       |
 2086|  42.9k|                switch (prevCsbf) {
 2087|  10.7k|                  case 0:
  ------------------
  |  Branch (2087:19): [True: 10.7k, False: 32.1k]
  ------------------
 2088|  10.7k|                    sigCtx = (xP + yP >= 3) ? 0 : (xP + yP > 0) ? 1 : 2;
  ------------------
  |  Branch (2088:30): [True: 6.72k, False: 4.00k]
  |  Branch (2088:51): [True: 3.36k, False: 648]
  ------------------
 2089|  10.7k|                    break;
 2090|  10.7k|                  case 1:
  ------------------
  |  Branch (2090:19): [True: 10.7k, False: 32.1k]
  ------------------
 2091|  10.7k|                    sigCtx = (yP == 0) ? 2 : (yP == 1) ? 1 : 0;
  ------------------
  |  Branch (2091:30): [True: 2.66k, False: 8.06k]
  |  Branch (2091:46): [True: 2.68k, False: 5.37k]
  ------------------
 2092|  10.7k|                    break;
 2093|  10.7k|                  case 2:
  ------------------
  |  Branch (2093:19): [True: 10.7k, False: 32.1k]
  ------------------
 2094|  10.7k|                    sigCtx = (xP == 0) ? 2 : (xP == 1) ? 1 : 0;
  ------------------
  |  Branch (2094:30): [True: 2.66k, False: 8.06k]
  |  Branch (2094:46): [True: 2.68k, False: 5.37k]
  ------------------
 2095|  10.7k|                    break;
 2096|  10.7k|                  default:
  ------------------
  |  Branch (2096:19): [True: 10.7k, False: 32.1k]
  ------------------
 2097|  10.7k|                    sigCtx = 2;
 2098|  10.7k|                    break;
 2099|  42.9k|                }
 2100|       |
 2101|       |                //logtrace(LogSlice,"a) sigCtx=%d\n",sigCtx);
 2102|       |
 2103|  42.9k|                if (cIdx == 0) {
  ------------------
  |  Branch (2103:21): [True: 21.4k, False: 21.4k]
  ------------------
 2104|  21.4k|                  if (xS + yS > 0) sigCtx += 3;
  ------------------
  |  Branch (2104:23): [True: 20.7k, False: 720]
  ------------------
 2105|       |
 2106|       |                  //logtrace(LogSlice,"b) sigCtx=%d\n",sigCtx);
 2107|       |
 2108|       |                  // if log2TrafoSize==3
 2109|  21.4k|                  if (sbWidth == 2) {
  ------------------
  |  Branch (2109:23): [True: 1.00k, False: 20.4k]
  ------------------
 2110|       |                    // 8x8 block
 2111|  1.00k|                    sigCtx += (scanIdx == 0) ? 9 : 15;
  ------------------
  |  Branch (2111:31): [True: 504, False: 504]
  ------------------
 2112|  1.00k|                  }
 2113|  20.4k|                  else {
 2114|  20.4k|                    sigCtx += 21;
 2115|  20.4k|                  }
 2116|       |
 2117|       |                  //logtrace(LogSlice,"c) sigCtx=%d\n",sigCtx);
 2118|  21.4k|                }
 2119|  21.4k|                else {
 2120|       |                  // if log2TrafoSize==3
 2121|  21.4k|                  if (sbWidth == 2) {
  ------------------
  |  Branch (2121:23): [True: 1.00k, False: 20.4k]
  ------------------
 2122|       |                    // 8x8 block
 2123|  1.00k|                    sigCtx += 9;
 2124|  1.00k|                  }
 2125|  20.4k|                  else {
 2126|  20.4k|                    sigCtx += 12;
 2127|  20.4k|                  }
 2128|  21.4k|                }
 2129|  42.9k|              }
 2130|       |
 2131|  43.5k|              int ctxIdxInc;
 2132|  43.5k|              if (cIdx == 0) { ctxIdxInc = sigCtx; }
  ------------------
  |  Branch (2132:19): [True: 21.7k, False: 21.7k]
  ------------------
 2133|  21.7k|              else { ctxIdxInc = 27 + sigCtx; }
 2134|       |
 2135|  43.5k|              if (ctxIdxLookup[log2w - 2][cIdx][scanIdx][prevCsbf][xC + (yC << log2w)] != 0xFF) {
  ------------------
  |  Branch (2135:19): [True: 20.9k, False: 22.5k]
  ------------------
 2136|  20.9k|                assert(ctxIdxLookup[log2w-2][cIdx][scanIdx][prevCsbf][xC+(yC<<log2w)] == ctxIdxInc);
  ------------------
  |  Branch (2136:17): [True: 20.9k, False: 0]
  ------------------
 2137|  20.9k|              }
 2138|       |
 2139|  43.5k|              ctxIdxLookup[log2w - 2][cIdx][scanIdx][prevCsbf][xC + (yC << log2w)] = ctxIdxInc;
 2140|       |
 2141|       |              //NOTE: when using this option, we have to include all three scanIdx in the table
 2142|       |              //ctxIdxLookup[log2w-2][cIdx][scanIdx][prevCsbf][s] = ctxIdxInc;
 2143|  43.5k|            }
 2144|    128|        }
 2145|       |
 2146|      2|  return true;
 2147|      2|}

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

ojph_codestream.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_local.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_params.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_file.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_mem.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_message.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_colour.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_colour_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_colour_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_colour_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_colour_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_transform_avx512.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_resolution.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_arch.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codeblock.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codeblock_fun.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_gen.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_precinct.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_decoder32.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_decoder64.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_encoder.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_decoder_ssse3.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_codestream_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_decoder_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_encoder_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }
ojph_block_encoder_avx512.cpp:_ZN4ojphL19count_leading_zerosEj:
  208|      2|  {
  209|       |  #ifdef OJPH_COMPILER_MSVC
  210|       |    unsigned long result = 0;
  211|       |    _BitScanReverse(&result, val);
  212|       |    return 31 ^ (ui32)result;
  213|       |  #elif (defined OJPH_COMPILER_GNUC)
  214|       |    return (ui32)__builtin_clz(val);
  215|       |  #else
  216|       |    val |= (val >> 1);
  217|       |    val |= (val >> 2);
  218|       |    val |= (val >> 4);
  219|       |    val |= (val >> 8);
  220|       |    val |= (val >> 16);
  221|       |    return 32 - population_count(val);
  222|       |  #endif
  223|      2|  }

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

_ZN5vvdec12PelBufferOpsC2Ev:
  341|      2|{
  342|      2|  addAvg4  = addAvgCore<Pel>;
  343|      2|  addAvg8  = addAvgCore<Pel>;
  344|      2|  addAvg16 = addAvgCore<Pel>;
  345|       |
  346|      2|  reco4 = reconstructCore<Pel>;
  347|      2|  reco8 = reconstructCore<Pel>;
  348|       |
  349|      2|  linTf4 = linTfCore<Pel>;
  350|      2|  linTf8 = linTfCore<Pel>;
  351|       |
  352|      2|  wghtAvg4 = addWeightedAvgCore<Pel>;
  353|      2|  wghtAvg8 = addWeightedAvgCore<Pel>;
  354|       |
  355|      2|  copyBuffer = copyBufferCore;
  356|       |
  357|      2|  transpose4x4 = transpose4x4Core<Pel>;
  358|      2|  transpose8x8 = transpose8x8Core<Pel>;
  359|       |
  360|      2|  applyLut = applyLutCore;
  361|      2|  rspFwd   = rspFwdCore;
  362|      2|  rspBcw   = nullptr;
  363|       |
  364|      2|  fillN_CU = fillN_CuCore;
  365|       |
  366|      2|  sampleRateConv = sampleRateConvCore;
  367|      2|}

_ZN5vvdec6CtxSetC2ESt16initializer_listIS0_E:
   82|      4|{
   83|      4|  uint16_t minOffset = std::numeric_limits<uint16_t>::max();
   84|      4|  uint16_t maxOffset = 0;
   85|      4|  for( auto& set: ctxSets )
  ------------------
  |  Branch (85:17): [True: 10, False: 4]
  ------------------
   86|     10|  {
   87|     10|    minOffset = std::min<uint16_t>( minOffset, set.Offset );
   88|     10|    maxOffset = std::max<uint16_t>( maxOffset, set.Offset + set.Size );
   89|     10|  }
   90|      4|  Offset = minOffset;
   91|      4|  Size   = maxOffset - minOffset;
   92|      4|}
_ZN5vvdec13ContextSetCfg9addCtxSetESt16initializer_listIS1_IhEE:
  103|    164|{
  104|    164|  const std::size_t startIdx  = sm_InitTables[0].size();
  105|    164|  const std::size_t numValues = ( *initSet2d.begin() ).size();
  106|    164|        std::size_t setId     = 0;
  107|    164|  for( auto& initSet: initSet2d )
  ------------------
  |  Branch (107:21): [True: 656, False: 164]
  ------------------
  108|    656|  {
  109|    656|    if( setId >= sm_InitTables.size() )
  ------------------
  |  Branch (109:9): [True: 0, False: 656]
  ------------------
  110|      0|      break;
  111|       |
  112|    656|    CHECK( initSet.size() != numValues,
  ------------------
  |  |  830|    656|#define CHECK( cond, msg )             { if UNLIKELY( cond ) { THROW_RECOVERABLE( msg << "\nERROR CONDITION: "   << #cond ); } }
  |  |  ------------------
  |  |  |  |  793|    656|#    define UNLIKELY( expr ) ( expr ) [[unlikely]]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (793:32): [True: 0, False: 656]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CHECK( cond, msg )             { if UNLIKELY( cond ) { THROW_RECOVERABLE( msg << "\nERROR CONDITION: "   << #cond ); } }
  |  |  ------------------
  |  |  |  |  820|      0|#  define THROW_RECOVERABLE( msg )     throw( RecoverableException       ( "\nERROR: " ) << FMT_ERROR_LOCATION << msg )
  |  |  |  |  ------------------
  |  |  |  |  |  |  813|      0|#define FMT_ERROR_LOCATION "In function \"" << __PRETTY_FUNCTION__ << "\" in " << __FILE__ ":" << __LINE__ << ": "
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|    656|                       "Number of init values do not match for all sets (" << initSet.size() << " != " << numValues << ")." );
  114|       |
  115|    656|    for( auto& elemIter: initSet )
  ------------------
  |  Branch (115:24): [True: 2.97k, False: 656]
  ------------------
  116|  2.97k|    {
  117|  2.97k|      sm_InitTables[setId].push_back( elemIter );
  118|  2.97k|    }
  119|       |
  120|    656|    setId++;
  121|    656|  }
  122|    164|  return CtxSet( (uint16_t)startIdx, (uint16_t)numValues );
  123|    164|}

_ZN5vvdec6CtxSetC2Ett:
  154|    164|  CtxSet( uint16_t offset, uint16_t size ) : Offset( offset ), Size( size ) {}

_ZN5vvdec9TCoeffOpsC2Ev:
  408|      2|{
  409|      2|  cpyResiClip[0] = cpyResiClipCore; //  1
  410|      2|  cpyResiClip[1] = cpyResiClipCore; //  2
  411|      2|  cpyResiClip[2] = cpyResiClipCore; //  4
  412|      2|  cpyResiClip[3] = cpyResiClipCore; //  8
  413|      2|  cpyResiClip[4] = cpyResiClipCore; // 16
  414|      2|  cpyResiClip[5] = cpyResiClipCore; // 32
  415|      2|  cpyResiClip[6] = cpyResiClipCore; // 64
  416|      2|  roundClip4     = clipCore;
  417|      2|  roundClip8     = clipCore;
  418|      2|  fastInvCore[0] = fastInvCore_< 4>;
  419|      2|  fastInvCore[1] = fastInvCore_< 8>;
  420|      2|  fastInvCore[2] = fastInvCore_<16>;
  421|      2|  fastInvCore[3] = fastInvCore_<32>;
  422|      2|  fastInvCore[4] = fastInvCore_<64>;
  423|      2|}

ThreadPool.cpp:_ZNK5vvdec3$_0clEv:
   59|      2|const static auto VVDEC_BUSY_WAIT_TIME_MIN = [] {
   60|      2|  const char* env = getenv( "VVDEC_BUSY_WAIT_TIME_MIN" );
   61|      2|  if( env )
  ------------------
  |  Branch (61:7): [True: 0, False: 2]
  ------------------
   62|      0|    return std::chrono::microseconds( int( atof( env ) * 1000 ) );
   63|      2|  return std::chrono::microseconds( 1ms );
   64|      2|}();
ThreadPool.cpp:_ZNK5vvdec3$_1clEv:
   67|      2|const static auto VVDEC_BUSY_WAIT_TIME_MAX = [] {
   68|      2|  const char* env = getenv( "VVDEC_BUSY_WAIT_TIME_MAX" );
   69|      2|  if( env )
  ------------------
  |  Branch (69:7): [True: 0, False: 2]
  ------------------
   70|      0|    return atoi( env ) * 1ms;
   71|      2|  return 5ms;
   72|      2|}();

_ZN5vvenc12PelBufferOpsC2Ev:
  438|      2|{
  439|      2|  addAvg            = addAvgCore<Pel>;
  440|      2|  reco              = recoCore<Pel>;
  441|      2|  copyClip          = copyClipCore<Pel>;
  442|      2|  roundGeo          = roundGeoCore<Pel>;
  443|       |
  444|      2|  addAvg4           = addAvgCore<Pel>;
  445|      2|  addAvg8           = addAvgCore<Pel>;
  446|      2|  addAvg16          = addAvgCore<Pel>;
  447|       |
  448|      2|  sub4              = subsCore<Pel>;
  449|      2|  sub8              = subsCore<Pel>;
  450|       |
  451|      2|  wghtAvg4          = addWeightedAvgCore<Pel>;
  452|      2|  wghtAvg8          = addWeightedAvgCore<Pel>;
  453|       |
  454|      2|  copyClip4         = copyClipCore<Pel>;
  455|      2|  copyClip8         = copyClipCore<Pel>;
  456|       |
  457|      2|  reco4             = reconstructCore<Pel>;
  458|      2|  reco8             = reconstructCore<Pel>;
  459|       |
  460|      2|  linTf4            = linTfCore<Pel>;
  461|      2|  linTf8            = linTfCore<Pel>;
  462|       |
  463|      2|  copyBuffer        = copyBufferCore;
  464|       |
  465|      2|  removeHighFreq8   = removeHighFreq;
  466|      2|  removeHighFreq4   = removeHighFreq;
  467|       |
  468|      2|  transpose4x4      = transposeNxNCore<Pel,4>;
  469|      2|  transpose8x8      = transposeNxNCore<Pel,8>;
  470|      2|  mipMatrixMul_4_4  = mipMatrixMulCore<4,4>;
  471|      2|  mipMatrixMul_8_4  = mipMatrixMulCore<8,4>;
  472|      2|  mipMatrixMul_8_8  = mipMatrixMulCore<8,8>;
  473|      2|  weightCiip        = weightCiipCore;
  474|      2|  roundIntVector    = nullptr;
  475|       |
  476|      2|  fillPtrMap        = fillMapPtr_Core;
  477|      2|  AvgHighPassWithDownsampling = AvgHighPassWithDownsamplingCore;
  478|      2|  AvgHighPass = AvgHighPassCore;
  479|      2|  AvgHighPassWithDownsamplingDiff1st = AvgHighPassWithDownsamplingDiff1stCore;
  480|      2|  AvgHighPassWithDownsamplingDiff2nd = AvgHighPassWithDownsamplingDiff2ndCore;
  481|      2|  HDHighPass = HDHighPassCore;
  482|      2|  HDHighPass2 = HDHighPass2Core;
  483|      2|}

_ZN5vvenc9UnitScaleC2Eii:
  127|      2|  UnitScale( int sx, int sy ) : posx(sx), posy(sy), area(posx+posy) {}

Rom.cpp:_ZN5vvencL5Clip3IiEET_S1_S1_S1_:
  568|   150k|template <typename T> constexpr static inline T Clip3  ( const T minVal, const T maxVal, const T a) { return std::min<T> (std::max<T> (minVal, a) , maxVal); }  ///< general min/max clip

_ZN5vvenc6CtxSetC2ESt16initializer_listIS0_E:
  151|      4|{
  152|      4|  uint16_t  minOffset = std::numeric_limits<uint16_t>::max();
  153|      4|  uint16_t  maxOffset = 0;
  154|     14|  for( auto iter = ctxSets.begin(); iter != ctxSets.end(); iter++ )
  ------------------
  |  Branch (154:37): [True: 10, False: 4]
  ------------------
  155|     10|  {
  156|     10|    minOffset = std::min<uint16_t>( minOffset, (*iter).Offset              );
  157|     10|    maxOffset = std::max<uint16_t>( maxOffset, (*iter).Offset+(*iter).Size );
  158|     10|  }
  159|      4|  Offset  = minOffset;
  160|      4|  Size    = maxOffset - minOffset;
  161|      4|}
_ZN5vvenc13ContextSetCfg9addCtxSetESt16initializer_listIS1_IhEE:
  176|    164|{
  177|    164|  const std::size_t startIdx  = sm_InitTables[0].size();
  178|    164|  const std::size_t numValues = ( *initSet2d.begin() ).size();
  179|    164|        std::size_t setId     = 0;
  180|    820|  for( auto setIter = initSet2d.begin(); setIter != initSet2d.end() && setId < sm_InitTables.size(); setIter++, setId++ )
  ------------------
  |  Branch (180:42): [True: 656, False: 164]
  |  Branch (180:72): [True: 656, False: 0]
  ------------------
  181|    656|  {
  182|    656|    const std::initializer_list<uint8_t>& initSet   = *setIter;
  183|    656|    std::vector<uint8_t>&           initTable = sm_InitTables[setId];
  184|    656|    CHECK( initSet.size() != numValues,
  ------------------
  |  |  636|    656|#define CHECK(c,x)          if(c){ THROW(x); }
  |  |  ------------------
  |  |  |  |  635|      0|#define THROW(x)            throw( Exception( "ERROR: In function \"" ) << __FUNCTION__ << "\" in " << __FILE__ << ":" << __LINE__ << ": " << x )
  |  |  ------------------
  |  |  |  Branch (636:32): [True: 0, False: 656]
  |  |  ------------------
  ------------------
  185|    656|           "Number of init values do not match for all sets (" << initSet.size() << " != " << numValues << ")." );
  186|    656|    initTable.resize( startIdx + numValues );
  187|    656|    std::size_t elemId = startIdx;
  188|  3.60k|    for( auto elemIter = ( *setIter ).begin(); elemIter != ( *setIter ).end(); elemIter++, elemId++ )
  ------------------
  |  Branch (188:48): [True: 2.95k, False: 656]
  ------------------
  189|  2.95k|    {
  190|  2.95k|      initTable[elemId] = *elemIter;
  191|  2.95k|    }
  192|    656|  }
  193|    164|  return CtxSet( (uint16_t)startIdx, (uint16_t)numValues );
  194|    164|}

_ZN5vvenc6CtxSetC2Ett:
  159|    164|  CtxSet( uint16_t offset, uint16_t size ) : Offset( offset ), Size( size ) {}
_ZN5vvenc6CtxSetC2ERKS0_:
  160|     10|  CtxSet( const CtxSet& ctxSet ) : Offset( ctxSet.Offset ), Size( ctxSet.Size ) {}

_ZN5vvenc2MvC2Eii:
   90|     36|  Mv( int iHor, int iVer ) : hor( iHor ), ver( iVer ) {}

_ZNK5vvenc10InitGeoRom15initGeoTemplateEv:
 1305|      2|{
 1306|      2|  int modeIdx = 0;
 1307|     66|  for (int angleIdx = 0; angleIdx < GEO_NUM_ANGLES; angleIdx++)
  ------------------
  |  Branch (1307:26): [True: 64, False: 2]
  ------------------
 1308|     64|  {
 1309|    320|    for (int distanceIdx = 0; distanceIdx < GEO_NUM_DISTANCES; distanceIdx++)
  ------------------
  |  Branch (1309:31): [True: 256, False: 64]
  ------------------
 1310|    256|    {
 1311|    256|      if ((distanceIdx == 0 && angleIdx >= 16)
  ------------------
  |  Branch (1311:12): [True: 64, False: 192]
  |  Branch (1311:32): [True: 32, False: 32]
  ------------------
 1312|    224|          || ((distanceIdx == 2 || distanceIdx == 0) && (g_angle2mask[angleIdx] == 0 || g_angle2mask[angleIdx] == 5))
  ------------------
  |  Branch (1312:16): [True: 64, False: 160]
  |  Branch (1312:36): [True: 32, False: 128]
  |  Branch (1312:58): [True: 6, False: 90]
  |  Branch (1312:89): [True: 6, False: 84]
  ------------------
 1313|    212|          || g_angle2mask[angleIdx] == -1)
  ------------------
  |  Branch (1313:14): [True: 84, False: 128]
  ------------------
 1314|    128|        continue;
 1315|    128|      g_GeoParams[modeIdx][0] = (int16_t) angleIdx;
 1316|    128|      g_GeoParams[modeIdx][1] = (int16_t) distanceIdx;
 1317|    128|      modeIdx++;
 1318|    128|    }
 1319|     64|  }
 1320|     20|  for (int angleIdx = 0; angleIdx < (GEO_NUM_ANGLES >> 2) + 1; angleIdx++)
  ------------------
  |  Branch (1320:26): [True: 18, False: 2]
  ------------------
 1321|     18|  {
 1322|     18|    if (g_angle2mask[angleIdx] == -1)
  ------------------
  |  Branch (1322:9): [True: 6, False: 12]
  ------------------
 1323|      6|      continue;
 1324|       |
 1325|     12|    int     distanceX = angleIdx;
 1326|     12|    int     distanceY = (distanceX + (GEO_NUM_ANGLES >> 2)) % GEO_NUM_ANGLES;
 1327|     12|    int16_t rho = (g_Dis[distanceX] * 2 * GEO_MAX_CU_SIZE) + (g_Dis[distanceY] * 2 * GEO_MAX_CU_SIZE);
 1328|     12|    static const int16_t maskOffset = (2 * GEO_MAX_CU_SIZE - GEO_WEIGHT_MASK_SIZE) >> 1;
 1329|     12|    int                  index      = 0;
 1330|  1.35k|    for (int y = 0; y < GEO_WEIGHT_MASK_SIZE; y++)
  ------------------
  |  Branch (1330:21): [True: 1.34k, False: 12]
  ------------------
 1331|  1.34k|    {
 1332|  1.34k|      int16_t lookUpY = (((y + maskOffset) << 1) + 1) * g_Dis[distanceY];
 1333|   151k|      for (int x = 0; x < GEO_WEIGHT_MASK_SIZE; x++, index++)
  ------------------
  |  Branch (1333:23): [True: 150k, False: 1.34k]
  ------------------
 1334|   150k|      {
 1335|   150k|        int16_t sx_i                                         = ((x + maskOffset) << 1) + 1;
 1336|   150k|        int16_t weightIdx                                    = sx_i * g_Dis[distanceX] + lookUpY - rho;
 1337|   150k|        int     weightLinearIdx                              = 32 + weightIdx;
 1338|   150k|        g_globalGeoWeights[g_angle2mask[angleIdx]][index]    = Clip3(0, 8, (weightLinearIdx + 4) >> 3);
 1339|   150k|        g_globalGeoEncSADmask[g_angle2mask[angleIdx]][index] = weightIdx > 0 ? 1 : 0;
  ------------------
  |  Branch (1339:64): [True: 75.1k, False: 75.3k]
  ------------------
 1340|   150k|      }
 1341|  1.34k|    }
 1342|     12|  }
 1343|       |
 1344|     10|  for (int hIdx = 0; hIdx < GEO_NUM_CU_SIZE; hIdx++)
  ------------------
  |  Branch (1344:22): [True: 8, False: 2]
  ------------------
 1345|      8|  {
 1346|      8|    int16_t height = 1 << (hIdx + GEO_MIN_CU_LOG2);
 1347|     40|    for (int wIdx = 0; wIdx < GEO_NUM_CU_SIZE; wIdx++)
  ------------------
  |  Branch (1347:24): [True: 32, False: 8]
  ------------------
 1348|     32|    {
 1349|     32|      int16_t width = 1 << (wIdx + GEO_MIN_CU_LOG2);
 1350|  2.08k|      for (int splitDir = 0; splitDir < GEO_NUM_PARTITION_MODE; splitDir++)
  ------------------
  |  Branch (1350:30): [True: 2.04k, False: 32]
  ------------------
 1351|  2.04k|      {
 1352|  2.04k|        int16_t angle    = g_GeoParams[splitDir][0];
 1353|  2.04k|        int16_t distance = g_GeoParams[splitDir][1];
 1354|  2.04k|        int16_t offsetX  = (GEO_WEIGHT_MASK_SIZE - width) >> 1;
 1355|  2.04k|        int16_t offsetY  = (GEO_WEIGHT_MASK_SIZE - height) >> 1;
 1356|  2.04k|        if (distance > 0)
  ------------------
  |  Branch (1356:13): [True: 1.79k, False: 256]
  ------------------
 1357|  1.79k|        {
 1358|  1.79k|          if (angle % 16 == 8 || (angle % 16 != 0 && height >= width))
  ------------------
  |  Branch (1358:15): [True: 128, False: 1.66k]
  |  Branch (1358:35): [True: 1.53k, False: 128]
  |  Branch (1358:54): [True: 960, False: 576]
  ------------------
 1359|  1.08k|          {
 1360|  1.08k|            offsetY += angle < 16 ? ((distance * (int32_t) height) >> 3) : -((distance * (int32_t) height) >> 3);
  ------------------
  |  Branch (1360:24): [True: 544, False: 544]
  ------------------
 1361|  1.08k|          }
 1362|    704|          else
 1363|    704|          {
 1364|    704|            offsetX += angle < 16 ? ((distance * (int32_t) width) >> 3) : -((distance * (int32_t) width) >> 3);
  ------------------
  |  Branch (1364:24): [True: 352, False: 352]
  ------------------
 1365|    704|          }
 1366|  1.79k|        }
 1367|  2.04k|        g_weightOffset[hIdx][wIdx][splitDir][0] = offsetX;
 1368|  2.04k|        g_weightOffset[hIdx][wIdx][splitDir][1] = offsetY;
 1369|  2.04k|      }
 1370|     32|    }
 1371|      8|  }
 1372|      2|}

_ZN5vvenc10InitGeoRomC2Ev:
   91|      2|    InitGeoRom() { initGeoTemplate(); }

_ZN5vvenc9TCoeffOpsC2Ev:
 2004|      2|{
 2005|      2|  cpyResi4        = cpyResiCore;
 2006|      2|  cpyResi8        = cpyResiCore;
 2007|      2|  cpyCoeff4       = cpyCoeffCore;
 2008|      2|  cpyCoeff8       = cpyCoeffCore;
 2009|      2|  roundClip4      = clipCore;
 2010|      2|  roundClip8      = clipCore;
 2011|      2|  fastInvCore[0]  = fastInvCore_< 4>;
 2012|      2|  fastInvCore[1]  = fastInvCore_< 8>;
 2013|      2|  fastInvCore[2]  = fastInvCore_<16>;
 2014|      2|  fastInvCore[3]  = fastInvCore_<32>;
 2015|      2|  fastInvCore[4]  = fastInvCore_<64>;
 2016|      2|  fastFwdCore_1D[0] = fastFwdCore< 4>;
 2017|      2|  fastFwdCore_1D[1] = fastFwdCore< 8>;
 2018|      2|  fastFwdCore_1D[2] = fastFwdCore<16>;
 2019|      2|  fastFwdCore_1D[3] = fastFwdCore<32>;
 2020|      2|  fastFwdCore_1D[4] = fastFwdCore<64>;
 2021|      2|  fastFwdCore_2D[0] = fastFwdCore< 4>;
 2022|      2|  fastFwdCore_2D[1] = fastFwdCore< 8>;
 2023|      2|  fastFwdCore_2D[2] = fastFwdCore<16>;
 2024|      2|  fastFwdCore_2D[3] = fastFwdCore<32>;
 2025|      2|  fastFwdCore_2D[4] = fastFwdCore<64>;
 2026|      2|}

vvencimpl.cpp:_ZNK5vvenc3$_0clEv:
   85|      2|const static auto BUSY_WAIT_TIME = [] {
   86|      2|  const char *env = getenv( "BUSY_WAIT_TIME" );
   87|      2|  if( env )
  ------------------
  |  Branch (87:7): [True: 0, False: 2]
  ------------------
   88|      0|    return std::chrono::milliseconds( atoi( env ) );
   89|      2|  return std::chrono::milliseconds( 1 );
   90|      2|}();
EncLib.cpp:_ZNK5vvenc3$_0clEv:
   85|      2|const static auto BUSY_WAIT_TIME = [] {
   86|      2|  const char *env = getenv( "BUSY_WAIT_TIME" );
   87|      2|  if( env )
  ------------------
  |  Branch (87:7): [True: 0, False: 2]
  ------------------
   88|      0|    return std::chrono::milliseconds( atoi( env ) );
   89|      2|  return std::chrono::milliseconds( 1 );
   90|      2|}();
NoMallocThreadPool.cpp:_ZNK5vvenc3$_0clEv:
   85|      2|const static auto BUSY_WAIT_TIME = [] {
   86|      2|  const char *env = getenv( "BUSY_WAIT_TIME" );
   87|      2|  if( env )
  ------------------
  |  Branch (87:7): [True: 0, False: 2]
  ------------------
   88|      0|    return std::chrono::milliseconds( atoi( env ) );
   89|      2|  return std::chrono::milliseconds( 1 );
   90|      2|}();
MCTF.cpp:_ZNK5vvenc3$_0clEv:
   85|      2|const static auto BUSY_WAIT_TIME = [] {
   86|      2|  const char *env = getenv( "BUSY_WAIT_TIME" );
   87|      2|  if( env )
  ------------------
  |  Branch (87:7): [True: 0, False: 2]
  ------------------
   88|      0|    return std::chrono::milliseconds( atoi( env ) );
   89|      2|  return std::chrono::milliseconds( 1 );
   90|      2|}();
EncGOP.cpp:_ZNK5vvenc3$_0clEv:
   85|      2|const static auto BUSY_WAIT_TIME = [] {
   86|      2|  const char *env = getenv( "BUSY_WAIT_TIME" );
   87|      2|  if( env )
  ------------------
  |  Branch (87:7): [True: 0, False: 2]
  ------------------
   88|      0|    return std::chrono::milliseconds( atoi( env ) );
   89|      2|  return std::chrono::milliseconds( 1 );
   90|      2|}();
EncPicture.cpp:_ZNK5vvenc3$_0clEv:
   85|      2|const static auto BUSY_WAIT_TIME = [] {
   86|      2|  const char *env = getenv( "BUSY_WAIT_TIME" );
   87|      2|  if( env )
  ------------------
  |  Branch (87:7): [True: 0, False: 2]
  ------------------
   88|      0|    return std::chrono::milliseconds( atoi( env ) );
   89|      2|  return std::chrono::milliseconds( 1 );
   90|      2|}();
EncSlice.cpp:_ZNK5vvenc3$_0clEv:
   85|      2|const static auto BUSY_WAIT_TIME = [] {
   86|      2|  const char *env = getenv( "BUSY_WAIT_TIME" );
   87|      2|  if( env )
  ------------------
  |  Branch (87:7): [True: 0, False: 2]
  ------------------
   88|      0|    return std::chrono::milliseconds( atoi( env ) );
   89|      2|  return std::chrono::milliseconds( 1 );
   90|      2|}();
EncAdaptiveLoopFilter.cpp:_ZNK5vvenc3$_0clEv:
   85|      2|const static auto BUSY_WAIT_TIME = [] {
   86|      2|  const char *env = getenv( "BUSY_WAIT_TIME" );
   87|      2|  if( env )
  ------------------
  |  Branch (87:7): [True: 0, False: 2]
  ------------------
   88|      0|    return std::chrono::milliseconds( atoi( env ) );
   89|      2|  return std::chrono::milliseconds( 1 );
   90|      2|}();
EncCu.cpp:_ZNK5vvenc3$_0clEv:
   85|      2|const static auto BUSY_WAIT_TIME = [] {
   86|      2|  const char *env = getenv( "BUSY_WAIT_TIME" );
   87|      2|  if( env )
  ------------------
  |  Branch (87:7): [True: 0, False: 2]
  ------------------
   88|      0|    return std::chrono::milliseconds( atoi( env ) );
   89|      2|  return std::chrono::milliseconds( 1 );
   90|      2|}();
IntraSearch.cpp:_ZNK5vvenc3$_0clEv:
   85|      2|const static auto BUSY_WAIT_TIME = [] {
   86|      2|  const char *env = getenv( "BUSY_WAIT_TIME" );
   87|      2|  if( env )
  ------------------
  |  Branch (87:7): [True: 0, False: 2]
  ------------------
   88|      0|    return std::chrono::milliseconds( atoi( env ) );
   89|      2|  return std::chrono::milliseconds( 1 );
   90|      2|}();

_ZN8apputils15program_options13ErrorReporterC2Ev:
   80|      2|  ErrorReporter() : is_errored(0) {}

_ZN4x2652MVC2Eii:
   49|     98|    MV(int32_t _x, int32_t _y) : x(_x), y(_y)  {}

