LLVMFuzzerTestOneInput:
   29|  15.0k|{
   30|  15.0k|  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|  15.0k|  HeifContext ctx;
   37|  15.0k|  ctx.get_security_limits()->max_total_memory = UINT64_C(2) * 1024 * 1024 * 1024;
   38|       |
   39|  15.0k|  BitstreamRange range(reader, size);
   40|   146k|  for (;;) {
   41|   146k|    std::shared_ptr<Box> box;
   42|   146k|    Error error = Box::read(range, &box, ctx.get_security_limits());
   43|   146k|    if (error != Error::Ok || range.error()) {
  ------------------
  |  Branch (43:9): [True: 15.0k, False: 131k]
  |  Branch (43:31): [True: 0, False: 131k]
  ------------------
   44|  15.0k|      break;
   45|  15.0k|    }
   46|       |
   47|   131k|    box->get_type();
   48|   131k|    box->get_type_string();
   49|   131k|    Indent indent;
   50|   131k|    box->dump_to_string(indent);
   51|   131k|  }
   52|       |
   53|  15.0k|  return 0;
   54|  15.0k|}

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

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

_ZN19StreamReader_memoryC2EPKhmb:
   78|  15.0k|    : m_length(size)
   79|  15.0k|{
   80|  15.0k|  if (copy) {
  ------------------
  |  Branch (80:7): [True: 0, False: 15.0k]
  ------------------
   81|      0|    m_owned_data = new uint8_t[m_length];
   82|      0|    if (size > 0) { // memcpy() from a NULL pointer is UB even for size 0 (until C2y/N3322), see read()
  ------------------
  |  Branch (82:9): [True: 0, False: 0]
  ------------------
   83|      0|      memcpy(m_owned_data, data, size);
   84|      0|    }
   85|       |
   86|      0|    m_data = m_owned_data;
   87|      0|  }
   88|  15.0k|  else {
   89|  15.0k|    m_data = data;
   90|  15.0k|  }
   91|  15.0k|}
_ZN19StreamReader_memoryD2Ev:
   94|  15.0k|{
   95|  15.0k|  if (m_owned_data) {
  ------------------
  |  Branch (95:7): [True: 0, False: 15.0k]
  ------------------
   96|      0|    delete[] m_owned_data;
   97|      0|  }
   98|  15.0k|}
_ZNK19StreamReader_memory12get_positionEv:
  101|   723k|{
  102|   723k|  return m_position;
  103|   723k|}
_ZN19StreamReader_memory18wait_for_file_sizeEm:
  106|   627k|{
  107|   627k|  return (target_size > m_length) ? grow_status::size_beyond_eof : grow_status::size_reached;
  ------------------
  |  Branch (107:10): [True: 9.49k, False: 618k]
  ------------------
  108|   627k|}
_ZN19StreamReader_memory4readEPvm:
  111|  20.1M|{
  112|  20.1M|  uint64_t end_pos = m_position + size;
  113|  20.1M|  if (end_pos > m_length) {
  ------------------
  |  Branch (113:7): [True: 0, False: 20.1M]
  ------------------
  114|      0|    return false;
  115|      0|  }
  116|       |
  117|       |  // Do not call memcpy() with a NULL pointer, even when size == 0. 'data' is NULL when the
  118|       |  // caller reads into an empty std::vector (e.g. a box with an empty payload), and passing
  119|       |  // NULL to memcpy() is undefined behaviour in C17 and C++. It trips UBSan's nonnull-attribute
  120|       |  // check on glibc's memcpy() declaration. C2y (WG14 N3322) makes zero-length operations on
  121|       |  // NULL pointers well-defined, but we cannot rely on that for many years.
  122|  20.1M|  if (size > 0) {
  ------------------
  |  Branch (122:7): [True: 20.1M, False: 39.5k]
  ------------------
  123|  20.1M|    memcpy(data, &m_data[m_position], size);
  124|  20.1M|  }
  125|  20.1M|  m_position += size;
  126|       |
  127|  20.1M|  return true;
  128|  20.1M|}
_ZN19StreamReader_memory4seekEm:
  131|  79.0k|{
  132|  79.0k|  if (position > m_length)
  ------------------
  |  Branch (132:7): [True: 0, False: 79.0k]
  ------------------
  133|      0|    return false;
  134|       |
  135|  79.0k|  m_position = position;
  136|  79.0k|  return true;
  137|  79.0k|}
_ZN14BitstreamRangeC2ENSt3__110shared_ptrI12StreamReaderEEmPS_:
  165|   324k|    : m_istr(std::move(istr)), m_parent_range(parent), m_remaining(length)
  166|   324k|{
  167|   324k|  if (parent) {
  ------------------
  |  Branch (167:7): [True: 309k, False: 15.0k]
  ------------------
  168|   309k|    m_nesting_level = parent->m_nesting_level + 1;
  169|   309k|  }
  170|   324k|}
_ZN14BitstreamRange5read8Ev:
  193|  4.78M|{
  194|  4.78M|  if (!prepare_read(1)) {
  ------------------
  |  Branch (194:7): [True: 99.1k, False: 4.68M]
  ------------------
  195|  99.1k|    return 0;
  196|  99.1k|  }
  197|       |
  198|  4.68M|  uint8_t buf;
  199|       |
  200|  4.68M|  auto istr = get_istream();
  201|  4.68M|  bool success = istr->read((char*) &buf, 1);
  202|       |
  203|  4.68M|  if (!success) {
  ------------------
  |  Branch (203:7): [True: 0, False: 4.68M]
  ------------------
  204|      0|    set_eof_while_reading();
  205|      0|    return 0;
  206|      0|  }
  207|       |
  208|  4.68M|  return buf;
  209|  4.68M|}
_ZN14BitstreamRange6read16Ev:
  213|  2.46M|{
  214|  2.46M|  if (!prepare_read(2)) {
  ------------------
  |  Branch (214:7): [True: 18.0k, False: 2.44M]
  ------------------
  215|  18.0k|    return 0;
  216|  18.0k|  }
  217|       |
  218|  2.44M|  uint8_t buf[2];
  219|       |
  220|  2.44M|  auto istr = get_istream();
  221|  2.44M|  bool success = istr->read((char*) buf, 2);
  222|       |
  223|  2.44M|  if (!success) {
  ------------------
  |  Branch (223:7): [True: 0, False: 2.44M]
  ------------------
  224|      0|    set_eof_while_reading();
  225|      0|    return 0;
  226|      0|  }
  227|       |
  228|  2.44M|  return static_cast<uint16_t>((buf[0] << 8) | (buf[1]));
  229|  2.44M|}
_ZN14BitstreamRange7read16sEv:
  233|  6.00k|{
  234|  6.00k|  uint16_t v = read16();
  235|       |
  236|  6.00k|  if (v & 0x8000) {
  ------------------
  |  Branch (236:7): [True: 914, False: 5.09k]
  ------------------
  237|    914|    auto val = static_cast<int16_t>((~v) & 0x7fff);
  238|    914|    return static_cast<int16_t>(-val - 1);
  239|    914|  }
  240|  5.09k|  else {
  241|  5.09k|    return static_cast<int16_t>(v);
  242|  5.09k|  }
  243|  6.00k|}
_ZN14BitstreamRange6read24Ev:
  247|    220|{
  248|    220|  if (!prepare_read(3)) {
  ------------------
  |  Branch (248:7): [True: 0, False: 220]
  ------------------
  249|      0|    return 0;
  250|      0|  }
  251|       |
  252|    220|  uint8_t buf[3];
  253|       |
  254|    220|  auto istr = get_istream();
  255|    220|  bool success = istr->read((char*) buf, 3);
  256|       |
  257|    220|  if (!success) {
  ------------------
  |  Branch (257:7): [True: 0, False: 220]
  ------------------
  258|      0|    set_eof_while_reading();
  259|      0|    return 0;
  260|      0|  }
  261|       |
  262|    220|  return (uint32_t) ((buf[0] << 16) |
  263|    220|                     (buf[1] << 8) |
  264|    220|                     (buf[2]));
  265|    220|}
_ZN14BitstreamRange6read32Ev:
  268|   698M|{
  269|   698M|  if (!prepare_read(4)) {
  ------------------
  |  Branch (269:7): [True: 694M, False: 3.89M]
  ------------------
  270|   694M|    return 0;
  271|   694M|  }
  272|       |
  273|  3.89M|  uint8_t buf[4];
  274|       |
  275|  3.89M|  auto istr = get_istream();
  276|  3.89M|  bool success = istr->read((char*) buf, 4);
  277|       |
  278|  3.89M|  if (!success) {
  ------------------
  |  Branch (278:7): [True: 0, False: 3.89M]
  ------------------
  279|      0|    set_eof_while_reading();
  280|      0|    return 0;
  281|      0|  }
  282|       |
  283|  3.89M|  return four_bytes_to_uint32(buf[0], buf[1], buf[2], buf[3]);
  284|  3.89M|}
_ZN14BitstreamRange9read_uintEi:
  288|   664k|{
  289|   664k|  switch (len)
  290|   664k|  {
  291|   518k|    case 8:
  ------------------
  |  Branch (291:5): [True: 518k, False: 145k]
  ------------------
  292|   518k|      return read8();
  293|   143k|    case 16:
  ------------------
  |  Branch (293:5): [True: 143k, False: 520k]
  ------------------
  294|   143k|      return read16();
  295|    220|    case 24:
  ------------------
  |  Branch (295:5): [True: 220, False: 663k]
  ------------------
  296|    220|      return read24();
  297|  1.51k|    case 32:
  ------------------
  |  Branch (297:5): [True: 1.51k, False: 662k]
  ------------------
  298|  1.51k|      return read32();
  299|    226|    case 64:
  ------------------
  |  Branch (299:5): [True: 226, False: 663k]
  ------------------
  300|    226|      return read64();
  301|      0|    default:
  ------------------
  |  Branch (301:5): [True: 0, False: 664k]
  ------------------
  302|      0|      assert(false);
  ------------------
  |  Branch (302:7): [Folded, False: 0]
  ------------------
  303|      0|      return 0;
  304|   664k|  }
  305|   664k|}
_ZN14BitstreamRange7read32sEv:
  309|  26.4k|{
  310|  26.4k|  uint32_t v = read32();
  311|       |
  312|  26.4k|  if (v & 0x80000000) {
  ------------------
  |  Branch (312:7): [True: 4.93k, False: 21.5k]
  ------------------
  313|  4.93k|    return -static_cast<int32_t>((~v) & 0x7fffffff) -1;
  314|  4.93k|  }
  315|  21.5k|  else {
  316|  21.5k|    return static_cast<int32_t>(v);
  317|  21.5k|  }
  318|  26.4k|}
_ZN14BitstreamRange6read64Ev:
  322|  3.31k|{
  323|  3.31k|  if (!prepare_read(8)) {
  ------------------
  |  Branch (323:7): [True: 71, False: 3.24k]
  ------------------
  324|     71|    return 0;
  325|     71|  }
  326|       |
  327|  3.24k|  uint8_t buf[8];
  328|       |
  329|  3.24k|  auto istr = get_istream();
  330|  3.24k|  bool success = istr->read((char*) buf, 8);
  331|       |
  332|  3.24k|  if (!success) {
  ------------------
  |  Branch (332:7): [True: 0, False: 3.24k]
  ------------------
  333|      0|    set_eof_while_reading();
  334|      0|    return 0;
  335|      0|  }
  336|       |
  337|  3.24k|  return ((static_cast<uint64_t>(buf[0]) << 56) |
  338|  3.24k|          (static_cast<uint64_t>(buf[1]) << 48) |
  339|  3.24k|          (static_cast<uint64_t>(buf[2]) << 40) |
  340|  3.24k|          (static_cast<uint64_t>(buf[3]) << 32) |
  341|  3.24k|          (static_cast<uint64_t>(buf[4]) << 24) |
  342|  3.24k|          (static_cast<uint64_t>(buf[5]) << 16) |
  343|  3.24k|          (static_cast<uint64_t>(buf[6]) << 8) |
  344|  3.24k|          (static_cast<uint64_t>(buf[7])));
  345|  3.24k|}
_ZN14BitstreamRange7read64sEv:
  349|    199|{
  350|    199|  uint64_t v = read64();
  351|       |
  352|    199|  if (v & 0x8000000000000000) {
  ------------------
  |  Branch (352:7): [True: 26, False: 173]
  ------------------
  353|     26|    return -static_cast<int64_t >((~v) & 0x7fffffffffffffff) -1;
  354|     26|  }
  355|    173|  else {
  356|    173|    return static_cast<int64_t >(v);
  357|    173|  }
  358|    199|}
_ZN14BitstreamRange12read_float32Ev:
  362|   694M|{
  363|   694M|#if __cpp_lib_bit_cast >= 201806L
  364|   694M|  uint32_t i = read32();
  365|   694M|  return std::bit_cast<float>(i); // this works directly on the value layout, thus we do not have to worry about memory layout
  366|       |#else
  367|       |  // compiler too old to support bit_cast
  368|       |
  369|       |  // TODO: I am not sure this works everywhere as there seem to be systems where
  370|       |  //       the float byte order is different from the integer endianness
  371|       |  //       https://en.wikipedia.org/wiki/Endianness#Floating_point
  372|       |  uint32_t i = read32();
  373|       |  float f;
  374|       |  memcpy(&f, &i, sizeof(float));
  375|       |  return f;
  376|       |#endif
  377|   694M|}
_ZN14BitstreamRange11read_stringEv:
  398|  24.1k|{
  399|  24.1k|  std::string str;
  400|       |
  401|       |  // Reading a string when no more data is available, returns an empty string.
  402|       |  // Such a case happens, for example, when reading a 'url' box without content.
  403|  24.1k|  if (eof()) {
  ------------------
  |  Branch (403:7): [True: 6.50k, False: 17.6k]
  ------------------
  404|  6.50k|    return std::string();
  405|  6.50k|  }
  406|       |
  407|  17.6k|  auto istr = get_istream();
  408|       |
  409|  8.95M|  for (;;) {
  410|  8.95M|    if (!prepare_read(1)) {
  ------------------
  |  Branch (410:9): [True: 0, False: 8.95M]
  ------------------
  411|      0|      return std::string();
  412|      0|    }
  413|       |
  414|  8.95M|    char c;
  415|  8.95M|    bool success = istr->read(&c, 1);
  416|       |
  417|  8.95M|    if (!success) {
  ------------------
  |  Branch (417:9): [True: 0, False: 8.95M]
  ------------------
  418|      0|      set_eof_while_reading();
  419|      0|      return std::string();
  420|      0|    }
  421|       |
  422|  8.95M|    if (c == 0 || m_remaining==0) {
  ------------------
  |  Branch (422:9): [True: 16.9k, False: 8.93M]
  |  Branch (422:19): [True: 667, False: 8.93M]
  ------------------
  423|  17.6k|      break;
  424|  17.6k|    }
  425|  8.93M|    else {
  426|  8.93M|      str += (char) c;
  427|  8.93M|    }
  428|  8.95M|  }
  429|       |
  430|  17.6k|  return str;
  431|  17.6k|}
_ZN14BitstreamRange17read_fixed_stringEi:
  435|  1.04k|{
  436|  1.04k|  std::string str;
  437|       |
  438|  1.04k|  if (!prepare_read(len)) {
  ------------------
  |  Branch (438:7): [True: 66, False: 976]
  ------------------
  439|     66|    return std::string();
  440|     66|  }
  441|       |
  442|    976|  auto istr = get_istream();
  443|       |
  444|    976|  uint8_t n;
  445|    976|  bool success = istr->read(&n, 1);
  446|    976|  if (!success || n > len - 1) {
  ------------------
  |  Branch (446:7): [True: 0, False: 976]
  |  Branch (446:19): [True: 323, False: 653]
  ------------------
  447|    323|    return {};
  448|    323|  }
  449|       |
  450|  4.93k|  for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (450:19): [True: 4.28k, False: 653]
  ------------------
  451|  4.28k|    char c;
  452|  4.28k|    success = istr->read(&c, 1);
  453|       |
  454|  4.28k|    if (!success) {
  ------------------
  |  Branch (454:9): [True: 0, False: 4.28k]
  ------------------
  455|      0|      set_eof_while_reading();
  456|      0|      return std::string();
  457|      0|    }
  458|       |
  459|  4.28k|    str += (char) c;
  460|  4.28k|  }
  461|       |
  462|    653|  istr->seek_cur(len-n-1);
  463|       |
  464|    653|  return str;
  465|    653|}
_ZN14BitstreamRange21read_string_until_eofEv:
  469|    937|{
  470|    937|  size_t n = get_remaining_bytes();
  471|       |
  472|    937|  [[maybe_unused]] bool success = prepare_read(n);
  473|    937|  assert(success); // we are reading exactly the rest of the box
  ------------------
  |  Branch (473:3): [True: 937, False: 0]
  ------------------
  474|       |
  475|    937|  std::string str;
  476|    937|  str.resize(n);
  477|    937|  get_istream()->read(str.data(), n);
  478|       |
  479|    937|  return str;
  480|    937|}
_ZN14BitstreamRange4readEPhm:
  484|   107k|{
  485|   107k|  if (!prepare_read(n)) {
  ------------------
  |  Branch (485:7): [True: 62, False: 106k]
  ------------------
  486|     62|    return false;
  487|     62|  }
  488|       |
  489|   106k|  auto istr = get_istream();
  490|   106k|  bool success = istr->read(data, n);
  491|       |
  492|   106k|  if (!success) {
  ------------------
  |  Branch (492:7): [True: 0, False: 106k]
  ------------------
  493|      0|    set_eof_while_reading();
  494|      0|  }
  495|       |
  496|   106k|  return success;
  497|   107k|}
_ZN14BitstreamRange12prepare_readEm:
  501|   772M|{
  502|       |  // Note: we do not test for negative nBytes anymore because we now use the unsigned size_t
  503|       |
  504|   772M|  if (m_remaining < nBytes) {
  ------------------
  |  Branch (504:7): [True: 694M, False: 78.1M]
  ------------------
  505|       |    // --- not enough data left in box -> move to end of box and set error flag
  506|       |
  507|   694M|    skip_to_end_of_box();
  508|       |
  509|   694M|    m_error = true;
  510|   694M|    return false;
  511|   694M|  }
  512|  78.1M|  else {
  513|       |    // --- this is the normal case (m_remaining >= nBytes)
  514|       |
  515|  78.1M|    if (m_parent_range) {
  ------------------
  |  Branch (515:9): [True: 58.0M, False: 20.1M]
  ------------------
  516|  58.0M|      if (!m_parent_range->prepare_read(nBytes)) {
  ------------------
  |  Branch (516:11): [True: 0, False: 58.0M]
  ------------------
  517|      0|        return false;
  518|      0|      }
  519|  58.0M|    }
  520|       |
  521|  78.1M|    m_remaining -= nBytes;
  522|       |
  523|  78.1M|    return true;
  524|  78.1M|  }
  525|   772M|}
_ZN14BitstreamRange24wait_for_available_bytesEm:
  529|   627k|{
  530|   627k|  int64_t target_size = m_istr->get_position() + nBytes;
  531|       |
  532|   627k|  return m_istr->wait_for_file_size(target_size);
  533|   627k|}
_ZN14BitstreamRange31skip_without_advancing_file_posEm:
  537|   359k|{
  538|   359k|  assert(n <= m_remaining);
  ------------------
  |  Branch (538:3): [True: 359k, False: 0]
  ------------------
  539|       |
  540|   359k|  m_remaining -= n;
  541|       |
  542|   359k|  if (m_parent_range) {
  ------------------
  |  Branch (542:7): [True: 283k, False: 76.5k]
  ------------------
  543|   283k|    m_parent_range->skip_without_advancing_file_pos(n);
  544|   283k|  }
  545|   359k|}
_ZN9BitReaderC2EPKhm:
  549|  12.8k|  : data_start(buffer),
  550|  12.8k|    data_length(len)
  551|  12.8k|{
  552|  12.8k|  data = buffer;
  553|  12.8k|  bytes_remaining = len;
  554|       |
  555|  12.8k|  nextbits = 0;
  556|  12.8k|  nextbits_cnt = 0;
  557|       |
  558|  12.8k|  refill();
  559|  12.8k|}
_ZN9BitReader8get_bitsEi:
  575|   994k|{
  576|   994k|  assert(n <= 32);
  ------------------
  |  Branch (576:3): [True: 994k, False: 0]
  ------------------
  577|       |
  578|   994k|  if (nextbits_cnt < n) {
  ------------------
  |  Branch (578:7): [True: 107k, False: 887k]
  ------------------
  579|   107k|    refill();
  580|   107k|  }
  581|       |
  582|   994k|  uint64_t val = nextbits;
  583|   994k|  val >>= 64 - n;
  584|       |
  585|   994k|#if AVOID_FUZZER_FALSE_POSITIVE
  586|       |  // Shifting an unsigned integer left such that some MSBs fall out is well defined in C++ despite the fuzzer claiming otherwise.
  587|   994k|  nextbits &= (0xffffffffffffffffULL >> n);
  588|   994k|#endif
  589|       |
  590|   994k|  nextbits <<= n;
  591|   994k|  nextbits_cnt -= n;
  592|       |
  593|   994k|  return static_cast<uint32_t>(val);
  594|   994k|}
_ZN9BitReader9get_bits8Ei:
  598|   379k|{
  599|   379k|  assert(n>0 && n <= 8);
  ------------------
  |  Branch (599:3): [True: 379k, False: 0]
  |  Branch (599:3): [True: 379k, False: 0]
  |  Branch (599:3): [True: 379k, False: 0]
  ------------------
  600|   379k|  return static_cast<uint8_t>(get_bits(n));
  601|   379k|}
_ZN9BitReader10get_bits16Ei:
  604|  40.4k|{
  605|  40.4k|  assert(n>0 && n <= 16);
  ------------------
  |  Branch (605:3): [True: 40.4k, False: 0]
  |  Branch (605:3): [True: 40.4k, False: 0]
  |  Branch (605:3): [True: 40.4k, False: 0]
  ------------------
  606|  40.4k|  return static_cast<uint16_t>(get_bits(n));
  607|  40.4k|}
_ZN9BitReader10get_bits32Ei:
  610|   139k|{
  611|   139k|  assert(n>0 && n <= 32);
  ------------------
  |  Branch (611:3): [True: 139k, False: 0]
  |  Branch (611:3): [True: 139k, False: 0]
  |  Branch (611:3): [True: 139k, False: 0]
  ------------------
  612|   139k|  return static_cast<uint32_t>(get_bits(n));
  613|   139k|}
_ZN9BitReader11get_bits32sEv:
  616|  4.84k|{
  617|  4.84k|  uint32_t bits = get_bits(32);
  618|  4.84k|  return static_cast<int32_t>(bits);
  619|  4.84k|}
_ZN9BitReader8get_flagEv:
  623|   429k|{
  624|   429k|  return (get_bits(1) == 0x01);
  625|   429k|}
_ZN9BitReader10read_bytesEj:
  628|  6.34k|{
  629|       |  // TODO: this implementation isn't very efficient
  630|  6.34k|  std::vector<uint8_t> bytes;
  631|   294k|  for (uint32_t i = 0; i < n; i++) {
  ------------------
  |  Branch (631:24): [True: 287k, False: 6.34k]
  ------------------
  632|   287k|    bytes.push_back(get_bits8(8));
  633|   287k|  }
  634|  6.34k|  return bytes;
  635|  6.34k|}
_ZN9BitReader10skip_bytesEj:
  663|  24.5k|{
  664|       |  // This has to run in constant time. The number of bytes to skip is taken directly
  665|       |  // from 32-bit file fields (e.g. the 'uncC' row/tile alignment), so a byte-at-a-time
  666|       |  // loop spins for billions of iterations when a malformed file asks to skip far
  667|       |  // beyond the end of the data. MinimizedImageBox::parse() guards against the same
  668|       |  // failure mode by validating its declared chunk sizes up front.
  669|       |
  670|  24.5k|  uint64_t nBits = uint64_t{nBytes} * 8;
  671|       |
  672|       |  // --- consume the bits that are already buffered in 'nextbits'
  673|       |
  674|  24.5k|  if (nextbits_cnt > 0) {
  ------------------
  |  Branch (674:7): [True: 17.9k, False: 6.56k]
  ------------------
  675|  17.9k|    uint64_t from_buffer = std::min(nBits, static_cast<uint64_t>(nextbits_cnt));
  676|       |
  677|  17.9k|    if (from_buffer >= 64) {
  ------------------
  |  Branch (677:9): [True: 250, False: 17.7k]
  ------------------
  678|    250|      nextbits = 0;
  679|    250|    }
  680|  17.7k|    else {
  681|  17.7k|#if AVOID_FUZZER_FALSE_POSITIVE
  682|  17.7k|      nextbits &= (0xffffffffffffffffULL >> from_buffer);
  683|  17.7k|#endif
  684|  17.7k|      nextbits <<= from_buffer;
  685|  17.7k|    }
  686|       |
  687|  17.9k|    nextbits_cnt -= static_cast<int64_t>(from_buffer);
  688|  17.9k|    nBits -= from_buffer;
  689|  17.9k|  }
  690|       |
  691|  24.5k|  if (nBits == 0) {
  ------------------
  |  Branch (691:7): [True: 17.3k, False: 7.18k]
  ------------------
  692|  17.3k|    return;
  693|  17.3k|  }
  694|       |
  695|       |  // --- skip whole bytes directly in the input buffer, without pushing them
  696|       |  //     through the bit buffer
  697|       |
  698|  7.18k|  uint64_t whole_bytes = nBits / 8;
  699|  7.18k|  int residual_bits = static_cast<int>(nBits % 8);
  700|       |
  701|  7.18k|  if (whole_bytes >= bytes_remaining) {
  ------------------
  |  Branch (701:7): [True: 555, False: 6.63k]
  ------------------
  702|       |    // Skipping past the end of the data. Record the overshoot in 'nextbits_cnt' (which
  703|       |    // thereby goes negative) so that get_current_byte_index() keeps advancing exactly
  704|       |    // as it did with the previous bit-by-bit implementation.
  705|    555|    uint64_t overshoot_bits = (whole_bytes - bytes_remaining) * 8 + static_cast<uint64_t>(residual_bits);
  706|       |
  707|    555|    data += bytes_remaining;
  708|    555|    bytes_remaining = 0;
  709|    555|    nextbits = 0;
  710|    555|    nextbits_cnt -= static_cast<int64_t>(overshoot_bits);
  711|    555|    return;
  712|    555|  }
  713|       |
  714|  6.63k|  data += static_cast<size_t>(whole_bytes);
  715|  6.63k|  bytes_remaining -= static_cast<size_t>(whole_bytes);
  716|  6.63k|  nextbits = 0;
  717|  6.63k|  nextbits_cnt = 0;
  718|       |
  719|  6.63k|  refill();
  720|       |
  721|  6.63k|  if (residual_bits > 0) {
  ------------------
  |  Branch (721:7): [True: 0, False: 6.63k]
  ------------------
  722|      0|    skip_bits(residual_bits);
  723|      0|  }
  724|  6.63k|}
_ZN9BitReader9skip_bitsEi:
  727|  33.2k|{
  728|  33.2k|  if (nextbits_cnt < n) {
  ------------------
  |  Branch (728:7): [True: 10.4k, False: 22.7k]
  ------------------
  729|  10.4k|    refill();
  730|  10.4k|  }
  731|       |
  732|  33.2k|#if AVOID_FUZZER_FALSE_POSITIVE
  733|  33.2k|  nextbits &= (0xffffffffffffffffULL >> n);
  734|  33.2k|#endif
  735|       |
  736|  33.2k|  nextbits <<= n;
  737|  33.2k|  nextbits_cnt -= n;
  738|  33.2k|}
_ZN9BitReader21skip_to_byte_boundaryEv:
  751|  12.8k|{
  752|  12.8k|  int nskip = static_cast<int>(nextbits_cnt & 7);
  753|       |
  754|  12.8k|#if AVOID_FUZZER_FALSE_POSITIVE
  755|  12.8k|  nextbits &= (0xffffffffffffffffULL >> nskip);
  756|  12.8k|#endif
  757|       |
  758|  12.8k|  nextbits <<= nskip;
  759|  12.8k|  nextbits_cnt -= nskip;
  760|  12.8k|}
_ZN9BitReader6refillEv:
  801|   137k|{
  802|       |#if 0
  803|       |  // TODO: activate me once I'm sure this works
  804|       |  while (nextbits_cnt <= 64-8 && bytes_remaining) {
  805|       |    uint64_t newval = *data++;
  806|       |    bytes_remaining--;
  807|       |
  808|       |    nextbits_cnt += 8;
  809|       |    newval <<= 64-nextbits_cnt;
  810|       |    nextbits |= newval;
  811|       |  }
  812|       |#else
  813|   137k|  if (bytes_remaining == 0) {
  ------------------
  |  Branch (813:7): [True: 5.30k, False: 131k]
  ------------------
  814|       |    // Nothing to refill. Returning early also keeps the shift below out of range
  815|       |    // when nextbits_cnt is far negative after skipping past the end of the data.
  816|  5.30k|    return;
  817|  5.30k|  }
  818|       |
  819|   131k|  int64_t shift = 64 - nextbits_cnt;
  820|       |
  821|  1.01M|  while (shift >= 8 && bytes_remaining) {
  ------------------
  |  Branch (821:10): [True: 887k, False: 127k]
  |  Branch (821:24): [True: 883k, False: 3.93k]
  ------------------
  822|   883k|    uint64_t newval = *data++;
  823|   883k|    bytes_remaining--;
  824|       |
  825|   883k|    shift -= 8;
  826|   883k|    newval <<= shift;
  827|   883k|    nextbits |= newval;
  828|   883k|  }
  829|       |
  830|   131k|  nextbits_cnt = 64 - shift;
  831|   131k|#endif
  832|   131k|}

_ZNK14BitstreamRange5errorEv:
  392|  2.81M|  {
  393|  2.81M|    return m_error;
  394|  2.81M|  }
_ZN12StreamReader8seek_curEm:
   62|  79.0k|  {
   63|  79.0k|    return seek(get_position() + position_offset);
   64|  79.0k|  }
_ZN14BitstreamRange19skip_to_end_of_fileEv:
  337|     53|  {
  338|       |    // we do not actually move the file position here (because the stream may still be incomplete),
  339|       |    // but we set all m_remaining to zero
  340|     53|    m_remaining = 0;
  341|       |
  342|     53|    if (m_parent_range) {
  ------------------
  |  Branch (342:9): [True: 45, False: 8]
  ------------------
  343|     45|      m_parent_range->skip_to_end_of_file();
  344|     45|    }
  345|     53|  }
_ZN14BitstreamRange4skipEm:
  348|  19.6k|  {
  349|  19.6k|    size_t actual_skip = std::min(static_cast<size_t>(n), m_remaining);
  350|       |
  351|  19.6k|    if (m_parent_range) {
  ------------------
  |  Branch (351:9): [True: 19.6k, False: 0]
  ------------------
  352|       |      // also advance position in parent range
  353|  19.6k|      m_parent_range->skip_without_advancing_file_pos(actual_skip);
  354|  19.6k|    }
  355|       |
  356|  19.6k|    assert(actual_skip <= static_cast<uint64_t>(std::numeric_limits<int64_t>::max()));
  ------------------
  |  Branch (356:5): [True: 19.6k, False: 0]
  ------------------
  357|       |
  358|  19.6k|    m_istr->seek_cur(static_cast<int64_t>(actual_skip));
  359|  19.6k|    m_remaining -= actual_skip;
  360|  19.6k|  }
_ZN14BitstreamRange18skip_to_end_of_boxEv:
  363|   695M|  {
  364|   695M|    if (m_remaining > 0) {
  ------------------
  |  Branch (364:9): [True: 56.8k, False: 695M]
  ------------------
  365|  56.8k|      if (m_parent_range) {
  ------------------
  |  Branch (365:11): [True: 56.8k, False: 1]
  ------------------
  366|       |        // also advance position in parent range
  367|  56.8k|        m_parent_range->skip_without_advancing_file_pos(m_remaining);
  368|  56.8k|      }
  369|       |
  370|  56.8k|      m_istr->seek_cur(m_remaining);
  371|  56.8k|      m_remaining = 0;
  372|  56.8k|    }
  373|   695M|  }
_ZNK14BitstreamRange3eofEv:
  387|  4.20M|  {
  388|  4.20M|    return m_remaining == 0;
  389|  4.20M|  }
_ZNK14BitstreamRange9get_errorEv:
  397|  1.23M|  {
  398|  1.23M|    if (m_error) {
  ------------------
  |  Branch (398:9): [True: 9.80k, False: 1.22M]
  ------------------
  399|  9.80k|      return Error(heif_error_Invalid_input,
  400|  9.80k|                   heif_suberror_End_of_data);
  401|  9.80k|    }
  402|  1.22M|    else {
  403|  1.22M|      return Error::Ok;
  404|  1.22M|    }
  405|  1.23M|  }
_ZN14BitstreamRange11get_istreamEv:
  407|  11.5M|  std::shared_ptr<StreamReader> get_istream() { return m_istr; }
_ZNK14BitstreamRange17get_nesting_levelEv:
  409|   312k|  int get_nesting_level() const { return m_nesting_level; }
_ZNK14BitstreamRange19get_remaining_bytesEv:
  411|   388k|  size_t get_remaining_bytes() const { return m_remaining; }
_ZNK9BitReader22get_current_byte_indexEv:
  469|  24.5k|  {
  470|       |    // Computed in signed arithmetic: when we skipped past the end of the data,
  471|       |    // nextbits_cnt is negative and the index keeps growing beyond data_length (the
  472|       |    // 'uncC' alignment handling relies on that). Doing the subtraction in size_t
  473|       |    // would convert the negative operand first, which trips the 'integer' sanitizer.
  474|       |    // The result itself is always >= 0.
  475|  24.5k|    int64_t bytes_read = static_cast<int64_t>(data_length - bytes_remaining);
  476|  24.5k|    return static_cast<size_t>(bytes_read - nextbits_cnt / 8);
  477|  24.5k|  }
_ZNK9BitReader18get_bits_remainingEv:
  480|  12.8k|  {
  481|  12.8k|    return ((int64_t) bytes_remaining) * 8 + nextbits_cnt;
  482|  12.8k|  }
_ZN12StreamReaderD2Ev:
   42|  15.0k|  virtual ~StreamReader() = default;

_ZN8FractionC2Eii:
   64|  5.16k|{
   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|  5.16k|  numerator = num;
   70|  5.16k|  denominator = den;
   71|       |
   72|  24.9k|  while (denominator > MAX_FRACTION_VALUE || denominator < -MAX_FRACTION_VALUE) {
  ------------------
  |  Branch (72:10): [True: 19.8k, False: 5.16k]
  |  Branch (72:46): [True: 0, False: 5.16k]
  ------------------
   73|  19.8k|    numerator /= 2;
   74|  19.8k|    denominator /= 2;
   75|  19.8k|  }
   76|       |
   77|  9.47k|  while (denominator > 1 && (numerator > MAX_FRACTION_VALUE || numerator < -MAX_FRACTION_VALUE)) {
  ------------------
  |  Branch (77:10): [True: 5.88k, False: 3.58k]
  |  Branch (77:30): [True: 4.07k, False: 1.81k]
  |  Branch (77:64): [True: 232, False: 1.57k]
  ------------------
   78|  4.30k|    numerator /= 2;
   79|  4.30k|    denominator /= 2;
   80|  4.30k|  }
   81|  5.16k|}
_ZN8Fraction11from_signedEll:
   84|  5.65k|{
   85|  5.65k|  if (num < std::numeric_limits<int32_t>::min() || num > std::numeric_limits<int32_t>::max() ||
  ------------------
  |  Branch (85:7): [True: 0, False: 5.65k]
  |  Branch (85:52): [True: 248, False: 5.40k]
  ------------------
   86|  5.40k|      den < std::numeric_limits<int32_t>::min() || den > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (86:7): [True: 0, False: 5.40k]
  |  Branch (86:52): [True: 242, False: 5.16k]
  ------------------
   87|    490|    return Error(heif_error_Invalid_input,
   88|    490|                 heif_suberror_Invalid_fractional_number,
   89|    490|                 "Fraction value exceeds the supported range");
   90|    490|  }
   91|       |
   92|  5.16k|  Fraction f(static_cast<int32_t>(num), static_cast<int32_t>(den));
   93|  5.16k|  if (!f.is_valid()) {
  ------------------
  |  Branch (93:7): [True: 3.31k, False: 1.85k]
  ------------------
   94|  3.31k|    return Error(heif_error_Invalid_input,
   95|  3.31k|                 heif_suberror_Invalid_fractional_number,
   96|  3.31k|                 "Fraction with zero denominator");
   97|  3.31k|  }
   98|       |
   99|  1.85k|  return f;
  100|  5.16k|}
_ZN8Fraction13from_unsignedEjj:
  103|  2.82k|{
  104|  2.82k|  return from_signed(num, den);
  105|  2.82k|}
_ZNK8Fraction8is_validEv:
  178|  5.16k|{
  179|  5.16k|  return denominator != 0;
  180|  5.16k|}
_ZN9BoxHeaderC2Ev:
  183|   729k|BoxHeader::BoxHeader() = default;
_ZNK9BoxHeader8get_typeEv:
  187|   131k|{
  188|   131k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (188:7): [True: 4.77k, False: 126k]
  ------------------
  189|  4.77k|    return m_uuid_type;
  190|  4.77k|  }
  191|   126k|  else {
  192|   126k|    std::vector<uint8_t> type(4);
  193|   126k|    type[0] = static_cast<uint8_t>((m_type >> 24) & 0xFF);
  194|   126k|    type[1] = static_cast<uint8_t>((m_type >> 16) & 0xFF);
  195|   126k|    type[2] = static_cast<uint8_t>((m_type >> 8) & 0xFF);
  196|   126k|    type[3] = static_cast<uint8_t>((m_type >> 0) & 0xFF);
  197|   126k|    return type;
  198|   126k|  }
  199|   131k|}
_ZNK9BoxHeader15get_type_stringEv:
  203|   665k|{
  204|   665k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (204:7): [True: 17.8k, False: 647k]
  ------------------
  205|       |    // 8-4-4-4-12
  206|       |
  207|  17.8k|    std::ostringstream sstr;
  208|  17.8k|    sstr << std::hex;
  209|  17.8k|    sstr << std::setfill('0');
  210|       |
  211|   303k|    for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (211:21): [True: 285k, False: 17.8k]
  ------------------
  212|   285k|      if (i == 4 || i == 6 || i == 8 || i == 10) {
  ------------------
  |  Branch (212:11): [True: 17.8k, False: 267k]
  |  Branch (212:21): [True: 17.8k, False: 249k]
  |  Branch (212:31): [True: 17.8k, False: 232k]
  |  Branch (212:41): [True: 17.8k, False: 214k]
  ------------------
  213|  71.3k|        sstr << '-';
  214|  71.3k|      }
  215|       |
  216|   285k|      sstr << std::setw(2);
  217|   285k|      sstr << ((int) m_uuid_type[i]);
  218|   285k|    }
  219|       |
  220|  17.8k|    return sstr.str();
  221|  17.8k|  }
  222|   647k|  else {
  223|   647k|    return fourcc_to_string(m_type);
  224|   647k|  }
  225|   665k|}
_ZNK9BoxHeader13get_uuid_typeEv:
  229|  22.3k|{
  230|  22.3k|  if (m_type != fourcc("uuid")) {
  ------------------
  |  Branch (230:7): [True: 0, False: 22.3k]
  ------------------
  231|      0|    return {};
  232|      0|  }
  233|       |
  234|  22.3k|  return m_uuid_type;
  235|  22.3k|}
_ZN9BoxHeader13set_uuid_typeERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  239|  1.98k|{
  240|  1.98k|  m_type = fourcc("uuid");
  241|  1.98k|  m_uuid_type = type;
  242|  1.98k|}
_ZN9BoxHeader12parse_headerER14BitstreamRange:
  246|   343k|{
  247|   343k|  StreamReader::grow_status status;
  248|   343k|  status = range.wait_for_available_bytes(8);
  249|   343k|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (249:7): [True: 6.19k, False: 337k]
  ------------------
  250|       |    // TODO: return recoverable error at timeout
  251|  6.19k|    return Error(heif_error_Invalid_input,
  252|  6.19k|                 heif_suberror_End_of_data);
  253|  6.19k|  }
  254|       |
  255|   337k|  m_size = range.read32();
  256|   337k|  m_type = range.read32();
  257|       |
  258|   337k|  m_header_size = 8;
  259|       |
  260|   337k|  if (m_size == 1) {
  ------------------
  |  Branch (260:7): [True: 377, False: 336k]
  ------------------
  261|    377|    status = range.wait_for_available_bytes(8);
  262|    377|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (262:9): [True: 4, False: 373]
  ------------------
  263|       |      // TODO: return recoverable error at timeout
  264|      4|      return Error(heif_error_Invalid_input,
  265|      4|                   heif_suberror_End_of_data);
  266|      4|    }
  267|       |
  268|    373|    uint64_t high = range.read32();
  269|    373|    uint64_t low = range.read32();
  270|       |
  271|    373|    m_size = (high << 32) | low;
  272|    373|    m_header_size += 8;
  273|       |
  274|    373|    std::stringstream sstr;
  275|    373|    sstr << "Box size " << m_size << " exceeds security limit.";
  276|       |
  277|    373|    if (m_size > MAX_LARGE_BOX_SIZE) {
  ------------------
  |  Branch (277:9): [True: 12, False: 361]
  ------------------
  278|     12|      return Error(heif_error_Memory_allocation_error,
  279|     12|                   heif_suberror_Security_limit_exceeded,
  280|     12|                   sstr.str());
  281|     12|    }
  282|    373|  }
  283|       |
  284|   337k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (284:7): [True: 7.93k, False: 329k]
  ------------------
  285|  7.93k|    status = range.wait_for_available_bytes(16);
  286|  7.93k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (286:9): [True: 1, False: 7.92k]
  ------------------
  287|       |      // TODO: return recoverable error at timeout
  288|      1|      return Error(heif_error_Invalid_input,
  289|      1|                   heif_suberror_End_of_data);
  290|      1|    }
  291|       |
  292|  7.92k|    if (range.prepare_read(16)) {
  ------------------
  |  Branch (292:9): [True: 7.92k, False: 1]
  ------------------
  293|  7.92k|      m_uuid_type.resize(16);
  294|  7.92k|      bool success = range.get_istream()->read((char*) m_uuid_type.data(), 16);
  295|  7.92k|      assert(success);
  ------------------
  |  Branch (295:7): [True: 7.92k, False: 0]
  ------------------
  296|  7.92k|      (void) success;
  297|  7.92k|    }
  298|       |
  299|  7.92k|    m_header_size += 16;
  300|  7.92k|  }
  301|       |
  302|   337k|  return range.get_error();
  303|   337k|}
_ZNK9BoxHeader4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  408|   205k|{
  409|   205k|  sstr << indent << "Box: " << get_type_string();
  410|   205k|  const char* debug_name = debug_box_name();
  411|   205k|  if (debug_name) {
  ------------------
  |  Branch (411:7): [True: 109k, False: 96.1k]
  ------------------
  412|   109k|    sstr << " ----- (" << debug_name << ")\n";
  413|   109k|  }
  414|  96.1k|  else {
  415|  96.1k|    sstr << " -----\n";
  416|  96.1k|  }
  417|       |
  418|   205k|  sstr << indent << "size: " << get_box_size() << "   (header size: " << get_header_size() << ")\n";
  419|       |
  420|   205k|  return;
  421|   205k|}
_ZN3Box5parseER14BitstreamRangePK20heif_security_limits:
  425|  1.88k|{
  426|       |  // skip box
  427|       |
  428|  1.88k|  if (get_box_size() == size_until_end_of_file) {
  ------------------
  |  Branch (428:7): [True: 8, False: 1.87k]
  ------------------
  429|      8|    range.skip_to_end_of_file();
  430|      8|  }
  431|  1.87k|  else {
  432|  1.87k|    uint64_t content_size = get_box_size() - get_header_size();
  433|       |
  434|  1.87k|    assert(MAX_BOX_SIZE <= SIZE_MAX);
  ------------------
  |  Branch (434:5): [True: 1.87k, Folded]
  ------------------
  435|       |
  436|  1.87k|    if (content_size > MAX_BOX_SIZE) {
  ------------------
  |  Branch (436:9): [True: 0, False: 1.87k]
  ------------------
  437|      0|      return Error(heif_error_Invalid_input,
  438|      0|                   heif_suberror_Invalid_box_size);
  439|      0|    }
  440|       |
  441|  1.87k|    if (range.prepare_read(static_cast<size_t>(content_size))) {
  ------------------
  |  Branch (441:9): [True: 1.87k, False: 0]
  ------------------
  442|  1.87k|      range.get_istream()->seek_cur(get_box_size() - get_header_size());
  443|  1.87k|    }
  444|  1.87k|  }
  445|       |
  446|       |  // Note: seekg() clears the eof flag and it will not be set again afterwards,
  447|       |  // hence we have to test for the fail flag.
  448|       |
  449|  1.88k|  return range.get_error();
  450|  1.88k|}
_ZN7FullBox21parse_full_box_headerER14BitstreamRange:
  454|  80.4k|{
  455|  80.4k|  uint32_t data = range.read32();
  456|  80.4k|  m_version = static_cast<uint8_t>(data >> 24);
  457|  80.4k|  m_flags = data & 0x00FFFFFF;
  458|       |  //m_is_full_box = true;
  459|       |
  460|  80.4k|  m_header_size += 4;
  461|       |
  462|  80.4k|  return range.get_error();
  463|  80.4k|}
_ZN3Box4readER14BitstreamRangePNSt3__110shared_ptrIS_EEPK20heif_security_limits:
  467|   318k|{
  468|   318k|  BoxHeader hdr;
  469|   318k|  Error err = hdr.parse_header(range);
  470|   318k|  if (err) {
  ------------------
  |  Branch (470:7): [True: 6.22k, False: 312k]
  ------------------
  471|  6.22k|    return err;
  472|  6.22k|  }
  473|       |
  474|   312k|  if (range.error()) {
  ------------------
  |  Branch (474:7): [True: 0, False: 312k]
  ------------------
  475|      0|    return range.get_error();
  476|      0|  }
  477|       |
  478|   312k|  result->reset();
  479|       |
  480|   312k|  std::shared_ptr<Box> box;
  481|       |
  482|   312k|  switch (hdr.get_short_type()) {
  483|  7.83k|    case fourcc("ftyp"):
  ------------------
  |  Branch (483:5): [True: 7.83k, False: 304k]
  ------------------
  484|  7.83k|      box = std::make_shared<Box_ftyp>();
  485|  7.83k|      break;
  486|       |
  487|    212|    case fourcc("free"):
  ------------------
  |  Branch (487:5): [True: 212, False: 312k]
  ------------------
  488|    472|    case fourcc("skip"):
  ------------------
  |  Branch (488:5): [True: 260, False: 312k]
  ------------------
  489|    472|      box = std::make_shared<Box_free>();
  490|    472|      break;
  491|       |
  492|  1.76k|    case fourcc("meta"):
  ------------------
  |  Branch (492:5): [True: 1.76k, False: 310k]
  ------------------
  493|  1.76k|      box = std::make_shared<Box_meta>();
  494|  1.76k|      break;
  495|       |
  496|  2.61k|    case fourcc("hdlr"):
  ------------------
  |  Branch (496:5): [True: 2.61k, False: 309k]
  ------------------
  497|  2.61k|      box = std::make_shared<Box_hdlr>();
  498|  2.61k|      break;
  499|       |
  500|  2.24k|    case fourcc("pitm"):
  ------------------
  |  Branch (500:5): [True: 2.24k, False: 310k]
  ------------------
  501|  2.24k|      box = std::make_shared<Box_pitm>();
  502|  2.24k|      break;
  503|       |
  504|  1.04k|    case fourcc("iloc"):
  ------------------
  |  Branch (504:5): [True: 1.04k, False: 311k]
  ------------------
  505|  1.04k|      box = std::make_shared<Box_iloc>();
  506|  1.04k|      break;
  507|       |
  508|  2.24k|    case fourcc("iinf"):
  ------------------
  |  Branch (508:5): [True: 2.24k, False: 310k]
  ------------------
  509|  2.24k|      box = std::make_shared<Box_iinf>();
  510|  2.24k|      break;
  511|       |
  512|  3.66k|    case fourcc("infe"):
  ------------------
  |  Branch (512:5): [True: 3.66k, False: 308k]
  ------------------
  513|  3.66k|      box = std::make_shared<Box_infe>();
  514|  3.66k|      break;
  515|       |
  516|  22.7k|    case fourcc("iprp"):
  ------------------
  |  Branch (516:5): [True: 22.7k, False: 289k]
  ------------------
  517|  22.7k|      box = std::make_shared<Box_iprp>();
  518|  22.7k|      break;
  519|       |
  520|  9.66k|    case fourcc("ipco"):
  ------------------
  |  Branch (520:5): [True: 9.66k, False: 302k]
  ------------------
  521|  9.66k|      box = std::make_shared<Box_ipco>();
  522|  9.66k|      break;
  523|       |
  524|  2.25k|    case fourcc("ipma"):
  ------------------
  |  Branch (524:5): [True: 2.25k, False: 310k]
  ------------------
  525|  2.25k|      box = std::make_shared<Box_ipma>();
  526|  2.25k|      break;
  527|       |
  528|  1.79k|    case fourcc("ispe"):
  ------------------
  |  Branch (528:5): [True: 1.79k, False: 310k]
  ------------------
  529|  1.79k|      box = std::make_shared<Box_ispe>();
  530|  1.79k|      break;
  531|       |
  532|    881|    case fourcc("auxC"):
  ------------------
  |  Branch (532:5): [True: 881, False: 311k]
  ------------------
  533|    881|      box = std::make_shared<Box_auxC>();
  534|    881|      break;
  535|       |
  536|  7.01k|    case fourcc("irot"):
  ------------------
  |  Branch (536:5): [True: 7.01k, False: 305k]
  ------------------
  537|  7.01k|      box = std::make_shared<Box_irot>();
  538|  7.01k|      break;
  539|       |
  540|  2.68k|    case fourcc("imir"):
  ------------------
  |  Branch (540:5): [True: 2.68k, False: 309k]
  ------------------
  541|  2.68k|      box = std::make_shared<Box_imir>();
  542|  2.68k|      break;
  543|       |
  544|  1.41k|    case fourcc("clap"):
  ------------------
  |  Branch (544:5): [True: 1.41k, False: 311k]
  ------------------
  545|  1.41k|      box = std::make_shared<Box_clap>();
  546|  1.41k|      break;
  547|       |
  548|    796|    case fourcc("iscl"):
  ------------------
  |  Branch (548:5): [True: 796, False: 311k]
  ------------------
  549|    796|      box = std::make_shared<Box_iscl>();
  550|    796|      break;
  551|       |
  552|  13.3k|    case fourcc("iref"):
  ------------------
  |  Branch (552:5): [True: 13.3k, False: 299k]
  ------------------
  553|  13.3k|      box = std::make_shared<Box_iref>();
  554|  13.3k|      break;
  555|       |
  556|    748|    case fourcc("rref"):
  ------------------
  |  Branch (556:5): [True: 748, False: 311k]
  ------------------
  557|    748|      box = std::make_shared<Box_rref>();
  558|    748|      break;
  559|       |
  560|  4.75k|    case fourcc("hvcC"):
  ------------------
  |  Branch (560:5): [True: 4.75k, False: 307k]
  ------------------
  561|  4.75k|      box = std::make_shared<Box_hvcC>();
  562|  4.75k|      break;
  563|       |
  564|    121|    case fourcc("hvc1"):
  ------------------
  |  Branch (564:5): [True: 121, False: 312k]
  ------------------
  565|    121|      box = std::make_shared<Box_hvc1>();
  566|    121|      break;
  567|       |
  568|  2.40k|    case fourcc("av1C"):
  ------------------
  |  Branch (568:5): [True: 2.40k, False: 310k]
  ------------------
  569|  2.40k|      box = std::make_shared<Box_av1C>();
  570|  2.40k|      break;
  571|       |
  572|     73|    case fourcc("av01"):
  ------------------
  |  Branch (572:5): [True: 73, False: 312k]
  ------------------
  573|     73|      box = std::make_shared<Box_av01>();
  574|     73|      break;
  575|       |
  576|  1.81k|    case fourcc("vvcC"):
  ------------------
  |  Branch (576:5): [True: 1.81k, False: 310k]
  ------------------
  577|  1.81k|      box = std::make_shared<Box_vvcC>();
  578|  1.81k|      break;
  579|       |
  580|     68|    case fourcc("vvc1"):
  ------------------
  |  Branch (580:5): [True: 68, False: 312k]
  ------------------
  581|     68|      box = std::make_shared<Box_vvc1>();
  582|     68|      break;
  583|       |
  584|  4.07k|    case fourcc("idat"):
  ------------------
  |  Branch (584:5): [True: 4.07k, False: 308k]
  ------------------
  585|  4.07k|      box = std::make_shared<Box_idat>();
  586|  4.07k|      break;
  587|       |
  588|  1.13k|    case fourcc("grpl"):
  ------------------
  |  Branch (588:5): [True: 1.13k, False: 311k]
  ------------------
  589|  1.13k|      box = std::make_shared<Box_grpl>();
  590|  1.13k|      break;
  591|       |
  592|  1.19k|    case fourcc("pymd"):
  ------------------
  |  Branch (592:5): [True: 1.19k, False: 311k]
  ------------------
  593|  1.19k|      box = std::make_shared<Box_pymd>();
  594|  1.19k|      break;
  595|       |
  596|    110|    case fourcc("altr"):
  ------------------
  |  Branch (596:5): [True: 110, False: 312k]
  ------------------
  597|    110|      box = std::make_shared<Box_EntityToGroup>();
  598|    110|      break;
  599|       |
  600|    351|    case fourcc("ster"):
  ------------------
  |  Branch (600:5): [True: 351, False: 312k]
  ------------------
  601|    351|      box = std::make_shared<Box_ster>();
  602|    351|      break;
  603|       |
  604|  4.06k|    case fourcc("dinf"):
  ------------------
  |  Branch (604:5): [True: 4.06k, False: 308k]
  ------------------
  605|  4.06k|      box = std::make_shared<Box_dinf>();
  606|  4.06k|      break;
  607|       |
  608|    386|    case fourcc("dref"):
  ------------------
  |  Branch (608:5): [True: 386, False: 312k]
  ------------------
  609|    386|      box = std::make_shared<Box_dref>();
  610|    386|      break;
  611|       |
  612|    646|    case fourcc("url "):
  ------------------
  |  Branch (612:5): [True: 646, False: 311k]
  ------------------
  613|    646|      box = std::make_shared<Box_url>();
  614|    646|      break;
  615|       |
  616|  5.35k|    case fourcc("colr"):
  ------------------
  |  Branch (616:5): [True: 5.35k, False: 307k]
  ------------------
  617|  5.35k|      box = std::make_shared<Box_colr>();
  618|  5.35k|      break;
  619|       |
  620|  3.51k|    case fourcc("pixi"):
  ------------------
  |  Branch (620:5): [True: 3.51k, False: 309k]
  ------------------
  621|  3.51k|      box = std::make_shared<Box_pixi>();
  622|  3.51k|      break;
  623|       |
  624|  11.9k|    case fourcc("pasp"):
  ------------------
  |  Branch (624:5): [True: 11.9k, False: 300k]
  ------------------
  625|  11.9k|      box = std::make_shared<Box_pasp>();
  626|  11.9k|      break;
  627|       |
  628|  5.09k|    case fourcc("lsel"):
  ------------------
  |  Branch (628:5): [True: 5.09k, False: 307k]
  ------------------
  629|  5.09k|      box = std::make_shared<Box_lsel>();
  630|  5.09k|      break;
  631|       |
  632|  12.1k|    case fourcc("a1op"):
  ------------------
  |  Branch (632:5): [True: 12.1k, False: 300k]
  ------------------
  633|  12.1k|      box = std::make_shared<Box_a1op>();
  634|  12.1k|      break;
  635|       |
  636|  3.32k|    case fourcc("a1lx"):
  ------------------
  |  Branch (636:5): [True: 3.32k, False: 309k]
  ------------------
  637|  3.32k|      box = std::make_shared<Box_a1lx>();
  638|  3.32k|      break;
  639|       |
  640|    751|    case fourcc("clli"):
  ------------------
  |  Branch (640:5): [True: 751, False: 311k]
  ------------------
  641|    751|      box = std::make_shared<Box_clli>();
  642|    751|      break;
  643|       |
  644|  1.33k|    case fourcc("mdcv"):
  ------------------
  |  Branch (644:5): [True: 1.33k, False: 311k]
  ------------------
  645|  1.33k|      box = std::make_shared<Box_mdcv>();
  646|  1.33k|      break;
  647|       |
  648|    787|    case fourcc("amve"):
  ------------------
  |  Branch (648:5): [True: 787, False: 311k]
  ------------------
  649|    787|      box = std::make_shared<Box_amve>();
  650|    787|      break;
  651|       |
  652|    586|    case fourcc("ndwt"):
  ------------------
  |  Branch (652:5): [True: 586, False: 311k]
  ------------------
  653|    586|      box = std::make_shared<Box_ndwt>();
  654|    586|      break;
  655|       |
  656|  1.75k|    case fourcc("cmin"):
  ------------------
  |  Branch (656:5): [True: 1.75k, False: 310k]
  ------------------
  657|  1.75k|      box = std::make_shared<Box_cmin>();
  658|  1.75k|      break;
  659|       |
  660|  2.47k|    case fourcc("cmex"):
  ------------------
  |  Branch (660:5): [True: 2.47k, False: 310k]
  ------------------
  661|  2.47k|      box = std::make_shared<Box_cmex>();
  662|  2.47k|      break;
  663|       |
  664|  1.13k|    case fourcc("udes"):
  ------------------
  |  Branch (664:5): [True: 1.13k, False: 311k]
  ------------------
  665|  1.13k|      box = std::make_shared<Box_udes>();
  666|  1.13k|      break;
  667|       |
  668|    764|    case fourcc("jpgC"):
  ------------------
  |  Branch (668:5): [True: 764, False: 311k]
  ------------------
  669|    764|      box = std::make_shared<Box_jpgC>();
  670|    764|      break;
  671|       |
  672|    103|    case fourcc("mjpg"):
  ------------------
  |  Branch (672:5): [True: 103, False: 312k]
  ------------------
  673|    103|      box = std::make_shared<Box_mjpg>();
  674|    103|      break;
  675|       |
  676|    696|    case fourcc("elng"):
  ------------------
  |  Branch (676:5): [True: 696, False: 311k]
  ------------------
  677|    696|      box = std::make_shared<Box_elng>();
  678|    696|      break;
  679|       |
  680|       |
  681|      0|#if WITH_UNCOMPRESSED_CODEC
  682|  1.04k|    case fourcc("cmpd"):
  ------------------
  |  Branch (682:5): [True: 1.04k, False: 311k]
  ------------------
  683|  1.04k|      box = std::make_shared<Box_cmpd>();
  684|  1.04k|      break;
  685|       |
  686|  3.62k|    case fourcc("uncC"):
  ------------------
  |  Branch (686:5): [True: 3.62k, False: 308k]
  ------------------
  687|  3.62k|      box = std::make_shared<Box_uncC>();
  688|  3.62k|      break;
  689|       |
  690|    637|    case fourcc("cmpC"):
  ------------------
  |  Branch (690:5): [True: 637, False: 311k]
  ------------------
  691|    637|      box = std::make_shared<Box_cmpC>();
  692|    637|      break;
  693|       |
  694|    762|    case fourcc("icef"):
  ------------------
  |  Branch (694:5): [True: 762, False: 311k]
  ------------------
  695|    762|      box = std::make_shared<Box_icef>();
  696|    762|      break;
  697|       |
  698|    485|    case fourcc("cpat"):
  ------------------
  |  Branch (698:5): [True: 485, False: 312k]
  ------------------
  699|    485|      box = std::make_shared<Box_cpat>();
  700|    485|      break;
  701|       |
  702|  1.02k|    case fourcc("splz"):
  ------------------
  |  Branch (702:5): [True: 1.02k, False: 311k]
  ------------------
  703|  1.02k|      box = std::make_shared<Box_splz>();
  704|  1.02k|      break;
  705|       |
  706|    601|    case fourcc("sbpm"):
  ------------------
  |  Branch (706:5): [True: 601, False: 311k]
  ------------------
  707|    601|      box = std::make_shared<Box_sbpm>();
  708|    601|      break;
  709|       |
  710|    364|    case fourcc("snuc"):
  ------------------
  |  Branch (710:5): [True: 364, False: 312k]
  ------------------
  711|    364|      box = std::make_shared<Box_snuc>();
  712|    364|      break;
  713|       |
  714|    366|    case fourcc("cloc"):
  ------------------
  |  Branch (714:5): [True: 366, False: 312k]
  ------------------
  715|    366|      box = std::make_shared<Box_cloc>();
  716|    366|      break;
  717|       |
  718|    519|    case fourcc("uncv"):
  ------------------
  |  Branch (718:5): [True: 519, False: 312k]
  ------------------
  719|    519|      box = std::make_shared<Box_uncv>();
  720|    519|      break;
  721|      0|#endif
  722|       |
  723|       |    // --- JPEG 2000
  724|       |
  725|  4.85k|    case fourcc("j2kH"):
  ------------------
  |  Branch (725:5): [True: 4.85k, False: 307k]
  ------------------
  726|  4.85k|      box = std::make_shared<Box_j2kH>();
  727|  4.85k|      break;
  728|       |
  729|  6.66k|    case fourcc("cdef"):
  ------------------
  |  Branch (729:5): [True: 6.66k, False: 305k]
  ------------------
  730|  6.66k|      box = std::make_shared<Box_cdef>();
  731|  6.66k|      break;
  732|       |
  733|  1.23k|    case fourcc("cmap"):
  ------------------
  |  Branch (733:5): [True: 1.23k, False: 311k]
  ------------------
  734|  1.23k|      box = std::make_shared<Box_cmap>();
  735|  1.23k|      break;
  736|       |
  737|    576|    case fourcc("pclr"):
  ------------------
  |  Branch (737:5): [True: 576, False: 311k]
  ------------------
  738|    576|      box = std::make_shared<Box_pclr>();
  739|    576|      break;
  740|       |
  741|    586|    case fourcc("j2kL"):
  ------------------
  |  Branch (741:5): [True: 586, False: 311k]
  ------------------
  742|    586|      box = std::make_shared<Box_j2kL>();
  743|    586|      break;
  744|       |
  745|    121|    case fourcc("j2ki"):
  ------------------
  |  Branch (745:5): [True: 121, False: 312k]
  ------------------
  746|    121|      box = std::make_shared<Box_j2ki>();
  747|    121|      break;
  748|       |
  749|       |
  750|       |    // --- mski
  751|       |
  752|    720|    case fourcc("mskC"):
  ------------------
  |  Branch (752:5): [True: 720, False: 311k]
  ------------------
  753|    720|      box = std::make_shared<Box_mskC>();
  754|    720|      break;
  755|       |
  756|       |    // --- TAI timestamps
  757|       |
  758|    349|    case fourcc("itai"):
  ------------------
  |  Branch (758:5): [True: 349, False: 312k]
  ------------------
  759|    349|      box = std::make_shared<Box_itai>();
  760|    349|      break;
  761|       |
  762|  1.26k|    case fourcc("taic"):
  ------------------
  |  Branch (762:5): [True: 1.26k, False: 311k]
  ------------------
  763|  1.26k|      box = std::make_shared<Box_taic>();
  764|  1.26k|      break;
  765|       |
  766|       |    // --- AVC (H.264)
  767|       |
  768|  4.35k|    case fourcc("avcC"):
  ------------------
  |  Branch (768:5): [True: 4.35k, False: 308k]
  ------------------
  769|  4.35k|      box = std::make_shared<Box_avcC>();
  770|  4.35k|      break;
  771|       |
  772|     51|    case fourcc("avc1"):
  ------------------
  |  Branch (772:5): [True: 51, False: 312k]
  ------------------
  773|     51|      box = std::make_shared<Box_avc1>();
  774|     51|      break;
  775|       |
  776|      0|#if HEIF_ENABLE_EXPERIMENTAL_FEATURES
  777|    787|    case fourcc("tilC"):
  ------------------
  |  Branch (777:5): [True: 787, False: 311k]
  ------------------
  778|    787|      box = std::make_shared<Box_tilC>();
  779|    787|      break;
  780|      0|#endif
  781|       |
  782|  12.8k|    case fourcc("mini"):
  ------------------
  |  Branch (782:5): [True: 12.8k, False: 299k]
  ------------------
  783|  12.8k|      box = std::make_shared<Box_mini>();
  784|  12.8k|      break;
  785|       |
  786|  1.88k|    case fourcc("mdat"):
  ------------------
  |  Branch (786:5): [True: 1.88k, False: 310k]
  ------------------
  787|       |      // avoid generating a 'Box_other'
  788|  1.88k|      box = std::make_shared<Box>();
  789|  1.88k|      break;
  790|       |
  791|  7.73k|    case fourcc("uuid"):
  ------------------
  |  Branch (791:5): [True: 7.73k, False: 304k]
  ------------------
  792|  7.73k|      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 (792:11): [True: 1.17k, False: 6.55k]
  ------------------
  793|  1.17k|        box = std::make_shared<Box_cmin>();
  794|  1.17k|      }
  795|  6.55k|      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 (795:16): [True: 2.03k, False: 4.52k]
  ------------------
  796|  2.03k|        box = std::make_shared<Box_cmex>();
  797|  2.03k|      }
  798|  4.52k|      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 (798:16): [True: 939, False: 3.58k]
  ------------------
  799|    939|        box = std::make_shared<Box_gimi_content_id>();
  800|    939|      }
  801|  3.58k|#if WITH_UNCOMPRESSED_CODEC
  802|  3.58k|      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 (802:16): [True: 1.04k, False: 2.54k]
  ------------------
  803|  1.04k|        box = std::make_shared<Box_gimi_component_content_ids>();
  804|  1.04k|      }
  805|  2.54k|#endif
  806|  2.54k|      else {
  807|  2.54k|        box = std::make_shared<Box_other>(hdr.get_short_type());
  808|  2.54k|      }
  809|  7.73k|      break;
  810|       |
  811|       |    // --- sequences
  812|       |
  813|    214|    case fourcc("moov"):
  ------------------
  |  Branch (813:5): [True: 214, False: 312k]
  ------------------
  814|    214|      box = std::make_shared<Box_moov>();
  815|    214|      break;
  816|       |
  817|  1.46k|    case fourcc("mvhd"):
  ------------------
  |  Branch (817:5): [True: 1.46k, False: 311k]
  ------------------
  818|  1.46k|      box = std::make_shared<Box_mvhd>();
  819|  1.46k|      break;
  820|       |
  821|    401|    case fourcc("trak"):
  ------------------
  |  Branch (821:5): [True: 401, False: 312k]
  ------------------
  822|    401|      box = std::make_shared<Box_trak>();
  823|    401|      break;
  824|       |
  825|  1.24k|    case fourcc("tkhd"):
  ------------------
  |  Branch (825:5): [True: 1.24k, False: 311k]
  ------------------
  826|  1.24k|      box = std::make_shared<Box_tkhd>();
  827|  1.24k|      break;
  828|       |
  829|     78|    case fourcc("mdia"):
  ------------------
  |  Branch (829:5): [True: 78, False: 312k]
  ------------------
  830|     78|      box = std::make_shared<Box_mdia>();
  831|     78|      break;
  832|       |
  833|    475|    case fourcc("mdhd"):
  ------------------
  |  Branch (833:5): [True: 475, False: 312k]
  ------------------
  834|    475|      box = std::make_shared<Box_mdhd>();
  835|    475|      break;
  836|       |
  837|    321|    case fourcc("minf"):
  ------------------
  |  Branch (837:5): [True: 321, False: 312k]
  ------------------
  838|    321|      box = std::make_shared<Box_minf>();
  839|    321|      break;
  840|       |
  841|    500|    case fourcc("vmhd"):
  ------------------
  |  Branch (841:5): [True: 500, False: 312k]
  ------------------
  842|    500|      box = std::make_shared<Box_vmhd>();
  843|    500|      break;
  844|       |
  845|    502|    case fourcc("stbl"):
  ------------------
  |  Branch (845:5): [True: 502, False: 312k]
  ------------------
  846|    502|      box = std::make_shared<Box_stbl>();
  847|    502|      break;
  848|       |
  849|  1.59k|    case fourcc("stsd"):
  ------------------
  |  Branch (849:5): [True: 1.59k, False: 310k]
  ------------------
  850|  1.59k|      box = std::make_shared<Box_stsd>();
  851|  1.59k|      break;
  852|       |
  853|    574|    case fourcc("stts"):
  ------------------
  |  Branch (853:5): [True: 574, False: 311k]
  ------------------
  854|    574|      box = std::make_shared<Box_stts>();
  855|    574|      break;
  856|       |
  857|    967|    case fourcc("ctts"):
  ------------------
  |  Branch (857:5): [True: 967, False: 311k]
  ------------------
  858|    967|      box = std::make_shared<Box_ctts>();
  859|    967|      break;
  860|       |
  861|    369|    case fourcc("stsc"):
  ------------------
  |  Branch (861:5): [True: 369, False: 312k]
  ------------------
  862|    369|      box = std::make_shared<Box_stsc>();
  863|    369|      break;
  864|       |
  865|    379|    case fourcc("stco"):
  ------------------
  |  Branch (865:5): [True: 379, False: 312k]
  ------------------
  866|    379|      box = std::make_shared<Box_stco>();
  867|    379|      break;
  868|       |
  869|    984|    case fourcc("stsz"):
  ------------------
  |  Branch (869:5): [True: 984, False: 311k]
  ------------------
  870|    984|      box = std::make_shared<Box_stsz>();
  871|    984|      break;
  872|       |
  873|    468|    case fourcc("stss"):
  ------------------
  |  Branch (873:5): [True: 468, False: 312k]
  ------------------
  874|    468|      box = std::make_shared<Box_stss>();
  875|    468|      break;
  876|       |
  877|    408|    case fourcc("ccst"):
  ------------------
  |  Branch (877:5): [True: 408, False: 312k]
  ------------------
  878|    408|      box = std::make_shared<Box_ccst>();
  879|    408|      break;
  880|       |
  881|    954|    case fourcc("auxi"):
  ------------------
  |  Branch (881:5): [True: 954, False: 311k]
  ------------------
  882|    954|      box = std::make_shared<Box_auxi>();
  883|    954|      break;
  884|       |
  885|    774|    case fourcc("edts"):
  ------------------
  |  Branch (885:5): [True: 774, False: 311k]
  ------------------
  886|    774|      box = std::make_shared<Box_edts>();
  887|    774|      break;
  888|       |
  889|    722|    case fourcc("elst"):
  ------------------
  |  Branch (889:5): [True: 722, False: 311k]
  ------------------
  890|    722|      box = std::make_shared<Box_elst>();
  891|    722|      break;
  892|       |
  893|    571|    case fourcc("sbgp"):
  ------------------
  |  Branch (893:5): [True: 571, False: 311k]
  ------------------
  894|    571|      box = std::make_shared<Box_sbgp>();
  895|    571|      break;
  896|       |
  897|  1.70k|    case fourcc("sgpd"):
  ------------------
  |  Branch (897:5): [True: 1.70k, False: 310k]
  ------------------
  898|  1.70k|      box = std::make_shared<Box_sgpd>();
  899|  1.70k|      break;
  900|       |
  901|    484|    case fourcc("btrt"):
  ------------------
  |  Branch (901:5): [True: 484, False: 312k]
  ------------------
  902|    484|      box = std::make_shared<Box_btrt>();
  903|    484|      break;
  904|       |
  905|    875|    case fourcc("saiz"):
  ------------------
  |  Branch (905:5): [True: 875, False: 311k]
  ------------------
  906|    875|      box = std::make_shared<Box_saiz>();
  907|    875|      break;
  908|       |
  909|  1.49k|    case fourcc("saio"):
  ------------------
  |  Branch (909:5): [True: 1.49k, False: 311k]
  ------------------
  910|  1.49k|      box = std::make_shared<Box_saio>();
  911|  1.49k|      break;
  912|       |
  913|    628|    case fourcc("urim"):
  ------------------
  |  Branch (913:5): [True: 628, False: 311k]
  ------------------
  914|    628|      box = std::make_shared<Box_URIMetaSampleEntry>();
  915|    628|      break;
  916|       |
  917|  1.09k|    case fourcc("uri "):
  ------------------
  |  Branch (917:5): [True: 1.09k, False: 311k]
  ------------------
  918|  1.09k|      box = std::make_shared<Box_uri>();
  919|  1.09k|      break;
  920|       |
  921|    354|    case fourcc("nmhd"):
  ------------------
  |  Branch (921:5): [True: 354, False: 312k]
  ------------------
  922|    354|      box = std::make_shared<Box_nmhd>();
  923|    354|      break;
  924|       |
  925|    752|    case fourcc("tref"):
  ------------------
  |  Branch (925:5): [True: 752, False: 311k]
  ------------------
  926|    752|      box = std::make_shared<Box_tref>();
  927|    752|      break;
  928|       |
  929|    272|    case fourcc("sdtp"):
  ------------------
  |  Branch (929:5): [True: 272, False: 312k]
  ------------------
  930|    272|      box = std::make_shared<Box_sdtp>();
  931|    272|      break;
  932|       |
  933|       |    // OMAF
  934|    881|    case fourcc("prfr"):
  ------------------
  |  Branch (934:5): [True: 881, False: 311k]
  ------------------
  935|    881|      box = std::make_shared<Box_prfr>();
  936|    881|      break;
  937|       |
  938|  78.2k|    default:
  ------------------
  |  Branch (938:5): [True: 78.2k, False: 234k]
  ------------------
  939|  78.2k|      box = std::make_shared<Box_other>(hdr.get_short_type());
  940|  78.2k|      break;
  941|   312k|  }
  942|       |
  943|   312k|  box->set_short_header(hdr);
  944|       |
  945|   312k|  box->m_debug_box_type = hdr.get_type_string(); // only for debugging
  946|       |
  947|       |
  948|   312k|  if (range.get_nesting_level() > MAX_BOX_NESTING_LEVEL) {
  ------------------
  |  Branch (948:7): [True: 4, False: 312k]
  ------------------
  949|      4|    return Error(heif_error_Memory_allocation_error,
  950|      4|                 heif_suberror_Security_limit_exceeded,
  951|      4|                 "Security limit for maximum nesting of boxes has been exceeded");
  952|      4|  }
  953|       |
  954|   312k|  if (hdr.has_fixed_box_size()) {
  ------------------
  |  Branch (954:7): [True: 267k, False: 44.5k]
  ------------------
  955|       |    // Sanity checks
  956|   267k|    if (hdr.get_box_size() < hdr.get_header_size()) {
  ------------------
  |  Branch (956:9): [True: 28, False: 267k]
  ------------------
  957|     28|      std::stringstream sstr;
  958|     28|      sstr << "Box size (" << hdr.get_box_size() << " bytes) smaller than header size ("
  959|     28|           << hdr.get_header_size() << " bytes)";
  960|       |
  961|     28|      return {heif_error_Invalid_input,
  962|     28|              heif_suberror_Invalid_box_size,
  963|     28|              sstr.str()};
  964|     28|    }
  965|       |
  966|       |    // this is >= 0 because of above condition
  967|   267k|    auto nBytes = static_cast<uint64_t>(hdr.get_box_size() - hdr.get_header_size());
  968|   267k|    if (nBytes > SIZE_MAX) {
  ------------------
  |  Branch (968:9): [True: 0, False: 267k]
  ------------------
  969|      0|      return {heif_error_Memory_allocation_error,
  970|      0|              heif_suberror_Invalid_box_size,
  971|      0|              "Box size too large"};
  972|      0|    }
  973|       |
  974|       |    // Security check: make sure that box size does not exceed int64 size.
  975|       |
  976|   267k|    if (hdr.get_box_size() > (uint64_t) std::numeric_limits<int64_t>::max()) {
  ------------------
  |  Branch (976:9): [True: 0, False: 267k]
  ------------------
  977|      0|      return {heif_error_Invalid_input,
  978|      0|              heif_suberror_Invalid_box_size};
  979|      0|    }
  980|       |
  981|       |    // --- wait for data to arrive
  982|       |
  983|   267k|    auto status = range.wait_for_available_bytes(static_cast<size_t>(nBytes));
  984|   267k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (984:9): [True: 3.25k, False: 264k]
  ------------------
  985|       |      // TODO: return recoverable error at timeout
  986|  3.25k|      return {heif_error_Invalid_input,
  987|  3.25k|              heif_suberror_End_of_data};
  988|  3.25k|    }
  989|   267k|  }
  990|       |
  991|   309k|  auto box_size = static_cast<int64_t>(hdr.get_box_size());
  992|   309k|  int64_t box_size_without_header = hdr.has_fixed_box_size() ? (box_size - hdr.get_header_size()) : (int64_t)range.get_remaining_bytes();
  ------------------
  |  Branch (992:37): [True: 264k, False: 44.5k]
  ------------------
  993|       |
  994|       |  // Box size may not be larger than remaining bytes in parent box.
  995|       |
  996|   309k|  if ((int64_t)range.get_remaining_bytes() < box_size_without_header) {
  ------------------
  |  Branch (996:7): [True: 2, False: 309k]
  ------------------
  997|      2|    return {heif_error_Invalid_input,
  998|      2|            heif_suberror_Invalid_box_size};
  999|      2|  }
 1000|       |
 1001|       |
 1002|       |  // Create child bitstream range and read box from that range.
 1003|       |
 1004|   309k|  BitstreamRange boxrange(range.get_istream(),
 1005|   309k|                          box_size_without_header,
 1006|   309k|                          &range);
 1007|       |
 1008|   309k|  err = box->parse(boxrange, limits);
 1009|   309k|  boxrange.skip_to_end_of_box();
 1010|       |
 1011|   309k|  if (err == Error::Ok) {
  ------------------
  |  Branch (1011:7): [True: 292k, False: 17.0k]
  ------------------
 1012|   292k|    *result = std::move(box);
 1013|   292k|  }
 1014|  17.0k|  else {
 1015|  17.0k|    parse_error_fatality fatality = box->get_parse_error_fatality();
 1016|       |
 1017|  17.0k|    box = std::make_shared<Box_Error>(box->get_short_type(), err, fatality);
 1018|       |
 1019|       |    // We return a Box_Error that represents the parse error.
 1020|  17.0k|    *result = std::move(box);
 1021|  17.0k|  }
 1022|       |
 1023|   309k|  return err;
 1024|   309k|}
_ZNK3Box4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1028|   154k|{
 1029|       |
 1030|   154k|  BoxHeader::dump(sstr, indent, full_log);
 1031|       |
 1032|   154k|  return;
 1033|   154k|}
_ZNK7FullBox4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1037|  18.2k|{
 1038|       |
 1039|  18.2k|  Box::dump(sstr, indent, full_log);
 1040|       |
 1041|  18.2k|  sstr << indent << "version: " << ((int) m_version) << "\n"
 1042|  18.2k|       << indent << "flags: " << std::hex << m_flags << std::dec << "\n";
 1043|       |
 1044|  18.2k|  return;
 1045|  18.2k|}
_ZN3Box13read_childrenER14BitstreamRangejPK20heif_security_limits:
 1106|  50.4k|{
 1107|       |  // A freshly parsed box has no children yet, so m_children.size() below tracks
 1108|       |  // the number of children read so far.
 1109|  50.4k|  assert(m_children.empty());
  ------------------
  |  Branch (1109:3): [True: 50.4k, False: 0]
  ------------------
 1110|       |
 1111|       |  // Determine the applicable limit on the number of child boxes.
 1112|  50.4k|  uint32_t max_children;
 1113|  50.4k|  if (get_short_type() == fourcc("iinf")) {
  ------------------
  |  Branch (1113:7): [True: 1.68k, False: 48.7k]
  ------------------
 1114|  1.68k|    max_children = limits->max_items;
 1115|  1.68k|  }
 1116|  48.7k|  else {
 1117|  48.7k|    max_children = limits->max_children_per_box;
 1118|  48.7k|  }
 1119|       |
 1120|       |  // If the number of children is known in advance, reject an excessive count
 1121|       |  // directly instead of reading children until the accumulated count reaches
 1122|       |  // the limit.
 1123|  50.4k|  if (max_number != READ_CHILDREN_ALL) {
  ------------------
  |  Branch (1123:7): [True: 2.23k, False: 48.1k]
  ------------------
 1124|  2.23k|    if (max_children && max_number > max_children) {
  ------------------
  |  Branch (1124:9): [True: 2.23k, False: 0]
  |  Branch (1124:25): [True: 32, False: 2.19k]
  ------------------
 1125|     32|      std::stringstream sstr;
 1126|     32|      sstr << "Number of child boxes (" << max_number << ") in '" << get_type_string()
 1127|     32|           << "' box exceeds the security limit of " << max_children << ".";
 1128|       |
 1129|     32|      return Error(heif_error_Memory_allocation_error,
 1130|     32|                   heif_suberror_Security_limit_exceeded,
 1131|     32|                   sstr.str());
 1132|     32|    }
 1133|       |
 1134|       |    // The declared number of children cannot exceed what the remaining input
 1135|       |    // could possibly hold (each box occupies at least an 8-byte header). A
 1136|       |    // larger count means the box is truncated or malformed, so reject it
 1137|       |    // before reading anything. This also bounds the reservation below, which
 1138|       |    // matters when security limits are disabled and 'max_number' is otherwise
 1139|       |    // unbounded.
 1140|  2.19k|    size_t max_possible_children = range.get_remaining_bytes() / 8;
 1141|  2.19k|    if (max_number > max_possible_children) {
  ------------------
  |  Branch (1141:9): [True: 14, False: 2.18k]
  ------------------
 1142|     14|      std::stringstream sstr;
 1143|     14|      sstr << "'" << get_type_string() << "' box declares " << max_number
 1144|     14|           << " child boxes, but the remaining data can hold at most "
 1145|     14|           << max_possible_children << ".";
 1146|     14|      return Error(heif_error_Invalid_input,
 1147|     14|                   heif_suberror_End_of_data,
 1148|     14|                   sstr.str());
 1149|     14|    }
 1150|       |
 1151|  2.18k|    m_children.reserve(max_number);
 1152|  2.18k|  }
 1153|       |
 1154|   215k|  while (!range.eof() && !range.error()) {
  ------------------
  |  Branch (1154:10): [True: 169k, False: 46.7k]
  |  Branch (1154:26): [True: 169k, False: 0]
  ------------------
 1155|   169k|    std::shared_ptr<Box> box;
 1156|   169k|    Error error = Box::read(range, &box, limits);
 1157|   169k|    if (error != Error::Ok && (!box || box->get_parse_error_fatality() == parse_error_fatality::fatal)) {
  ------------------
  |  Branch (1157:9): [True: 11.4k, False: 157k]
  |  Branch (1157:32): [True: 235, False: 11.2k]
  |  Branch (1157:40): [True: 1.64k, False: 9.55k]
  ------------------
 1158|  1.88k|      return error;
 1159|  1.88k|    }
 1160|       |
 1161|   167k|    if (max_number == READ_CHILDREN_ALL) {
  ------------------
  |  Branch (1161:9): [True: 99.5k, False: 67.7k]
  ------------------
 1162|  99.5k|      if (max_children && m_children.size() > max_children) {
  ------------------
  |  Branch (1162:11): [True: 99.5k, False: 0]
  |  Branch (1162:27): [True: 57, False: 99.5k]
  ------------------
 1163|     57|        std::stringstream sstr;
 1164|     57|        sstr << "Maximum number of child boxes (" << max_children << ") in '" << get_type_string() << "' box exceeded.";
 1165|       |
 1166|       |        // Sanity check.
 1167|     57|        return Error(heif_error_Memory_allocation_error,
 1168|     57|                     heif_suberror_Security_limit_exceeded,
 1169|     57|                     sstr.str());
 1170|     57|      }
 1171|  99.5k|    }
 1172|       |
 1173|   167k|    m_children.push_back(std::move(box));
 1174|       |
 1175|       |    // Stop once we have read the expected number of children.
 1176|   167k|    if (max_number != READ_CHILDREN_ALL &&
  ------------------
  |  Branch (1176:9): [True: 67.7k, False: 99.5k]
  ------------------
 1177|  67.7k|        m_children.size() == max_number) {
  ------------------
  |  Branch (1177:9): [True: 1.67k, False: 66.0k]
  ------------------
 1178|  1.67k|      break;
 1179|  1.67k|    }
 1180|   167k|  }
 1181|       |
 1182|       |  // If a specific number of children was expected, we must have read exactly
 1183|       |  // that many. A short read means the box is truncated or malformed. Prefer
 1184|       |  // this specific error over the lower-level range error below, which would
 1185|       |  // otherwise mask it.
 1186|  48.4k|  if (max_number != READ_CHILDREN_ALL && m_children.size() != max_number) {
  ------------------
  |  Branch (1186:7): [True: 2.03k, False: 46.4k]
  |  Branch (1186:42): [True: 30, False: 2.00k]
  ------------------
 1187|     30|    std::stringstream sstr;
 1188|     30|    sstr << "'" << get_type_string() << "' box declares " << max_number
 1189|     30|         << " child boxes, but only " << m_children.size() << " could be read.";
 1190|     30|    return Error(heif_error_Invalid_input,
 1191|     30|                 heif_suberror_End_of_data,
 1192|     30|                 sstr.str());
 1193|     30|  }
 1194|       |
 1195|  48.4k|  return range.get_error();
 1196|  48.4k|}
_ZNK3Box13dump_childrenERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentbb:
 1213|  43.1k|{
 1214|  43.1k|  bool first = true;
 1215|  43.1k|  int idx=1;
 1216|       |
 1217|  43.1k|  indent++;
 1218|  77.9k|  for (const auto& childBox : m_children) {
  ------------------
  |  Branch (1218:29): [True: 77.9k, False: 43.1k]
  ------------------
 1219|  77.9k|    if (first) {
  ------------------
  |  Branch (1219:9): [True: 36.6k, False: 41.3k]
  ------------------
 1220|  36.6k|      first = false;
 1221|  36.6k|    }
 1222|  41.3k|    else {
 1223|  41.3k|      sstr << indent << "\n";
 1224|  41.3k|    }
 1225|       |
 1226|  77.9k|    if (with_index) {
  ------------------
  |  Branch (1226:9): [True: 21.2k, False: 56.7k]
  ------------------
 1227|  21.2k|      sstr << indent << "index: " << idx << "\n";
 1228|  21.2k|      idx++;
 1229|  21.2k|    }
 1230|       |
 1231|  77.9k|    childBox->dump(sstr, indent, full_log);
 1232|  77.9k|    reset_stream_format(sstr);
 1233|  77.9k|  }
 1234|  43.1k|  indent--;
 1235|  43.1k|}
_ZN9Box_other5parseER14BitstreamRangePK20heif_security_limits:
 1259|  77.8k|{
 1260|  77.8k|  if (has_fixed_box_size()) {
  ------------------
  |  Branch (1260:7): [True: 74.3k, False: 3.48k]
  ------------------
 1261|  74.3k|    size_t len;
 1262|  74.3k|    if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (1262:9): [True: 74.3k, False: 0]
  ------------------
 1263|  74.3k|      auto len64 = get_box_size() - get_header_size();
 1264|  74.3k|      if (len64 > MAX_BOX_SIZE) {
  ------------------
  |  Branch (1264:11): [True: 0, False: 74.3k]
  ------------------
 1265|      0|        return {heif_error_Invalid_input,
 1266|      0|                heif_suberror_Security_limit_exceeded,
 1267|      0|                "Box size too large"};
 1268|      0|      }
 1269|       |
 1270|  74.3k|      len = static_cast<size_t>(len64);
 1271|       |
 1272|  74.3k|      m_data.resize(len);
 1273|  74.3k|      range.read(m_data.data(), len);
 1274|  74.3k|    }
 1275|      0|    else {
 1276|      0|      return {heif_error_Invalid_input,
 1277|      0|              heif_suberror_Invalid_box_size};
 1278|      0|    }
 1279|  74.3k|  }
 1280|  3.48k|  else {
 1281|       |    // TODO: boxes until end of file (we will probably never need this)
 1282|  3.48k|  }
 1283|       |
 1284|  77.8k|  return range.get_error();
 1285|  77.8k|}
_ZNK9Box_other4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1305|  45.9k|{
 1306|       |
 1307|  45.9k|  BoxHeader::dump(sstr, indent, full_log);
 1308|       |
 1309|       |  // --- show raw box content
 1310|       |
 1311|  45.9k|  size_t len = 0;
 1312|  45.9k|  if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (1312:7): [True: 43.3k, False: 2.59k]
  ------------------
 1313|       |    // We can cast because if it does not fit, it would fail during parsing.
 1314|  43.3k|    len = static_cast<size_t>(get_box_size() - get_header_size());
 1315|  43.3k|  }
 1316|  2.59k|  else {
 1317|  2.59k|    sstr << indent << "invalid box size " << get_box_size() << " (smaller than header)\n";
 1318|  2.59k|    return;
 1319|  2.59k|  }
 1320|       |
 1321|  43.3k|  sstr << write_raw_data_as_hex(m_data.data(), len,
 1322|  43.3k|                                indent.get_string() + "data: ",
 1323|  43.3k|                                indent.get_string() + "      ");
 1324|       |
 1325|  43.3k|  return;
 1326|  45.9k|}
_ZNK9Box_Error4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1330|  5.16k|{
 1331|  5.16k|  sstr << indent << '\'' << fourcc_to_string(m_box_type_with_parse_error) << "' parse error: " << m_error.message << "\n";
 1332|  5.16k|  sstr << indent << "fatality: ";
 1333|  5.16k|  switch (m_fatality) {
  ------------------
  |  Branch (1333:11): [True: 5.16k, False: 0]
  ------------------
 1334|      0|    case parse_error_fatality::fatal: sstr << "fatal\n"; break;
  ------------------
  |  Branch (1334:5): [True: 0, False: 5.16k]
  ------------------
 1335|  1.72k|    case parse_error_fatality::ignorable: sstr << "ignorable\n"; break;
  ------------------
  |  Branch (1335:5): [True: 1.72k, False: 3.43k]
  ------------------
 1336|  3.43k|    case parse_error_fatality::optional: sstr << "optional\n"; break;
  ------------------
  |  Branch (1336:5): [True: 3.43k, False: 1.72k]
  ------------------
 1337|  5.16k|  }
 1338|       |
 1339|  5.16k|  return;
 1340|  5.16k|}
_ZNK9Box_Error24get_parse_error_fatalityEv:
 1343|  11.2k|{
 1344|  11.2k|  return m_fatality;
 1345|  11.2k|}
_ZN8Box_ftyp5parseER14BitstreamRangePK20heif_security_limits:
 1349|  7.82k|{
 1350|  7.82k|  m_major_brand = range.read32();
 1351|  7.82k|  m_minor_version = range.read32();
 1352|       |
 1353|  7.82k|  uint64_t box_size = get_box_size();
 1354|  7.82k|  if (box_size < 8 || box_size - 8 < get_header_size()) {
  ------------------
  |  Branch (1354:7): [True: 2, False: 7.82k]
  |  Branch (1354:23): [True: 7, False: 7.82k]
  ------------------
 1355|       |    // Sanity check.
 1356|      9|    return Error(heif_error_Invalid_input,
 1357|      9|                 heif_suberror_Invalid_box_size,
 1358|      9|                 "ftyp box too small (less than 8 bytes)");
 1359|      9|  }
 1360|       |
 1361|  7.82k|  uint64_t n_minor_brands = (get_box_size() - get_header_size() - 8) / 4;
 1362|       |
 1363|  7.82k|  if (limits->max_number_of_file_brands && n_minor_brands > limits->max_number_of_file_brands) {
  ------------------
  |  Branch (1363:7): [True: 7.82k, False: 0]
  |  Branch (1363:44): [True: 12, False: 7.80k]
  ------------------
 1364|     12|    return {
 1365|     12|      heif_error_Memory_allocation_error,
 1366|     12|      heif_suberror_Security_limit_exceeded,
 1367|     12|      "Number of minor brands in file exceeds security limit"
 1368|     12|    };
 1369|     12|  }
 1370|       |
 1371|  33.7k|  for (uint64_t i = 0; i < n_minor_brands && !range.error(); i++) {
  ------------------
  |  Branch (1371:24): [True: 25.9k, False: 7.80k]
  |  Branch (1371:46): [True: 25.9k, False: 0]
  ------------------
 1372|  25.9k|    m_compatible_brands.push_back(range.read32());
 1373|  25.9k|  }
 1374|       |
 1375|  7.80k|  return range.get_error();
 1376|  7.82k|}
_ZNK8Box_ftyp4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1389|  4.52k|{
 1390|       |
 1391|  4.52k|  BoxHeader::dump(sstr, indent, full_log);
 1392|       |
 1393|  4.52k|  sstr << indent << "major brand: " << fourcc_to_string(m_major_brand) << "\n"
 1394|  4.52k|       << indent << "minor version: ";
 1395|  4.52k|  if (m_minor_version < ('A' << 24)) {
  ------------------
  |  Branch (1395:7): [True: 4.22k, False: 296]
  ------------------
 1396|       |    // This is probably a version number
 1397|  4.22k|    sstr << m_minor_version;
 1398|  4.22k|  } else {
 1399|       |    // probably a 4CC, as used for mif3
 1400|    296|    sstr << fourcc_to_string(m_minor_version);
 1401|    296|  }
 1402|  4.52k|  sstr << "\n" << indent << "compatible brands: ";
 1403|       |
 1404|  4.52k|  bool first = true;
 1405|  16.0k|  for (uint32_t brand : m_compatible_brands) {
  ------------------
  |  Branch (1405:23): [True: 16.0k, False: 4.52k]
  ------------------
 1406|  16.0k|    if (first) { first = false; }
  ------------------
  |  Branch (1406:9): [True: 4.34k, False: 11.6k]
  ------------------
 1407|  11.6k|    else { sstr << ','; }
 1408|       |
 1409|  16.0k|    sstr << fourcc_to_string(brand);
 1410|  16.0k|  }
 1411|  4.52k|  sstr << "\n";
 1412|       |
 1413|  4.52k|  return;
 1414|  4.52k|}
_ZN8Box_free5parseER14BitstreamRangePK20heif_security_limits:
 1443|    470|{
 1444|    470|  range.skip_to_end_of_box();
 1445|    470|  return range.get_error();
 1446|    470|}
_ZNK8Box_free4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1450|    422|{
 1451|    422|  BoxHeader::dump(sstr, indent, full_log);
 1452|    422|  return;
 1453|    422|}
_ZN8Box_meta5parseER14BitstreamRangePK20heif_security_limits:
 1465|  1.76k|{
 1466|  1.76k|  parse_full_box_header(range);
 1467|       |
 1468|  1.76k|  if (get_version() != 0) {
  ------------------
  |  Branch (1468:7): [True: 1, False: 1.76k]
  ------------------
 1469|      1|    return unsupported_version_error("meta");
 1470|      1|  }
 1471|       |
 1472|       |  /*
 1473|       |  uint64_t boxSizeLimit;
 1474|       |  if (get_box_size() == BoxHeader::size_until_end_of_file) {
 1475|       |    boxSizeLimit = sizeLimit;
 1476|       |  }
 1477|       |  else {
 1478|       |    boxSizeLimit = get_box_size() - get_header_size();
 1479|       |  }
 1480|       |  */
 1481|       |
 1482|  1.76k|  return read_children(range, READ_CHILDREN_ALL, limits);
 1483|  1.76k|}
_ZNK8Box_meta4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1487|  1.07k|{
 1488|  1.07k|  Box::dump(sstr, indent, full_log);
 1489|  1.07k|  dump_children(sstr, indent, full_log);
 1490|       |
 1491|  1.07k|  return;
 1492|  1.07k|}
_ZNK7FullBox25unsupported_version_errorEPKc:
 1496|  2.14k|{
 1497|  2.14k|  std::stringstream sstr;
 1498|  2.14k|  sstr << box << " box data version " << ((int) m_version) << " is not implemented yet";
 1499|       |
 1500|  2.14k|  return {heif_error_Unsupported_feature,
 1501|  2.14k|          heif_suberror_Unsupported_data_version,
 1502|  2.14k|          sstr.str()};
 1503|  2.14k|}
_ZN8Box_hdlr5parseER14BitstreamRangePK20heif_security_limits:
 1507|  2.61k|{
 1508|  2.61k|  parse_full_box_header(range);
 1509|       |
 1510|  2.61k|  if (get_version() != 0) {
  ------------------
  |  Branch (1510:7): [True: 5, False: 2.60k]
  ------------------
 1511|      5|    return unsupported_version_error("hdlr");
 1512|      5|  }
 1513|       |
 1514|  2.60k|  m_pre_defined = range.read32();
 1515|  2.60k|  m_handler_type = range.read32();
 1516|       |
 1517|  10.4k|  for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (1517:19): [True: 7.82k, False: 2.60k]
  ------------------
 1518|  7.82k|    m_reserved[i] = range.read32();
 1519|  7.82k|  }
 1520|       |
 1521|  2.60k|  m_name = range.read_string();
 1522|       |
 1523|  2.60k|  return range.get_error();
 1524|  2.61k|}
_ZNK8Box_hdlr4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1528|  1.60k|{
 1529|  1.60k|  Box::dump(sstr, indent, full_log);
 1530|  1.60k|  sstr << indent << "pre_defined: " << m_pre_defined << "\n"
 1531|  1.60k|       << indent << "handler_type: " << fourcc_to_string(m_handler_type) << "\n"
 1532|  1.60k|       << indent << "name: " << m_name << "\n";
 1533|       |
 1534|  1.60k|  return;
 1535|  1.60k|}
_ZN8Box_pitm5parseER14BitstreamRangePK20heif_security_limits:
 1558|  2.24k|{
 1559|  2.24k|  parse_full_box_header(range);
 1560|       |
 1561|  2.24k|  if (get_version() > 1) {
  ------------------
  |  Branch (1561:7): [True: 7, False: 2.23k]
  ------------------
 1562|      7|    return unsupported_version_error("pitm");
 1563|      7|  }
 1564|       |
 1565|       |
 1566|  2.23k|  if (get_version() == 0) {
  ------------------
  |  Branch (1566:7): [True: 1.79k, False: 439]
  ------------------
 1567|  1.79k|    m_item_ID = range.read16();
 1568|  1.79k|  }
 1569|    439|  else {
 1570|    439|    m_item_ID = range.read32();
 1571|    439|  }
 1572|       |
 1573|  2.23k|  return range.get_error();
 1574|  2.24k|}
_ZNK8Box_pitm4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1578|  1.39k|{
 1579|  1.39k|  Box::dump(sstr, indent, full_log);
 1580|  1.39k|  sstr << indent << "item_ID: " << m_item_ID << "\n";
 1581|       |
 1582|  1.39k|  return;
 1583|  1.39k|}
_ZN8Box_iloc5parseER14BitstreamRangePK20heif_security_limits:
 1616|  1.04k|{
 1617|  1.04k|  parse_full_box_header(range);
 1618|       |
 1619|  1.04k|  if (get_version() > 2) {
  ------------------
  |  Branch (1619:7): [True: 1, False: 1.04k]
  ------------------
 1620|      1|    return unsupported_version_error("iloc");
 1621|      1|  }
 1622|       |
 1623|  1.04k|  const int version = get_version();
 1624|       |
 1625|  1.04k|  uint16_t values4 = range.read16();
 1626|       |
 1627|  1.04k|  int offset_size = (values4 >> 12) & 0xF;
 1628|  1.04k|  int length_size = (values4 >> 8) & 0xF;
 1629|  1.04k|  int base_offset_size = (values4 >> 4) & 0xF;
 1630|  1.04k|  int index_size = 0;
 1631|       |
 1632|  1.04k|  if (version == 1 || version == 2) {
  ------------------
  |  Branch (1632:7): [True: 201, False: 844]
  |  Branch (1632:23): [True: 238, False: 606]
  ------------------
 1633|    439|    index_size = (values4 & 0xF);
 1634|    439|  }
 1635|       |
 1636|  1.04k|  uint32_t item_count = 0;
 1637|  1.04k|  if (version < 2) {
  ------------------
  |  Branch (1637:7): [True: 807, False: 238]
  ------------------
 1638|    807|    item_count = range.read16();
 1639|    807|  }
 1640|    238|  else if (version == 2) {
  ------------------
  |  Branch (1640:12): [True: 238, False: 0]
  ------------------
 1641|    238|    item_count = range.read32();
 1642|    238|  }
 1643|       |
 1644|       |  // Sanity check. (This might be obsolete now as we check for range.error() below).
 1645|  1.04k|  if (limits->max_items && item_count > limits->max_items) {
  ------------------
  |  Branch (1645:7): [True: 1.04k, False: 0]
  |  Branch (1645:28): [True: 50, False: 995]
  ------------------
 1646|     50|    std::stringstream sstr;
 1647|     50|    sstr << "iloc box contains " << item_count << " items, which exceeds the security limit of "
 1648|     50|         << limits->max_items << " items.";
 1649|       |
 1650|     50|    return Error(heif_error_Memory_allocation_error,
 1651|     50|                 heif_suberror_Security_limit_exceeded,
 1652|     50|                 sstr.str());
 1653|     50|  }
 1654|       |
 1655|  4.35k|  for (uint32_t i = 0; i < item_count; i++) {
  ------------------
  |  Branch (1655:24): [True: 3.52k, False: 831]
  ------------------
 1656|  3.52k|    Item item;
 1657|       |
 1658|  3.52k|    if (range.eof()) {
  ------------------
  |  Branch (1658:9): [True: 97, False: 3.42k]
  ------------------
 1659|     97|      std::stringstream sstr;
 1660|     97|      sstr << "iloc box should contain " << item_count << " items, but we can only read " << i << " items.";
 1661|       |
 1662|     97|      return {heif_error_Invalid_input,
 1663|     97|              heif_suberror_End_of_data,
 1664|     97|              sstr.str()};
 1665|     97|    }
 1666|       |
 1667|  3.42k|    if (version < 2) {
  ------------------
  |  Branch (1667:9): [True: 3.21k, False: 211]
  ------------------
 1668|  3.21k|      item.item_ID = range.read16();
 1669|  3.21k|    }
 1670|    211|    else if (version == 2) {
  ------------------
  |  Branch (1670:14): [True: 211, False: 0]
  ------------------
 1671|    211|      item.item_ID = range.read32();
 1672|    211|    }
 1673|       |
 1674|  3.42k|    if (version >= 1) {
  ------------------
  |  Branch (1674:9): [True: 673, False: 2.75k]
  ------------------
 1675|    673|      values4 = range.read16();
 1676|    673|      item.construction_method = (values4 & 0xF);
 1677|    673|    }
 1678|       |
 1679|  3.42k|    item.data_reference_index = range.read16();
 1680|       |
 1681|  3.42k|    item.base_offset = 0;
 1682|  3.42k|    if (base_offset_size == 4) {
  ------------------
  |  Branch (1682:9): [True: 341, False: 3.08k]
  ------------------
 1683|    341|      item.base_offset = range.read32();
 1684|    341|    }
 1685|  3.08k|    else if (base_offset_size == 8) {
  ------------------
  |  Branch (1685:14): [True: 198, False: 2.88k]
  ------------------
 1686|    198|      item.base_offset = ((uint64_t) range.read32()) << 32;
 1687|    198|      item.base_offset |= range.read32();
 1688|    198|    }
 1689|       |
 1690|  3.42k|    uint16_t extent_count = range.read16();
 1691|       |
 1692|       |    // Sanity check.
 1693|  3.42k|    auto max_iloc_extents = limits->max_iloc_extents_per_item;
 1694|  3.42k|    if (max_iloc_extents && extent_count > max_iloc_extents) {
  ------------------
  |  Branch (1694:9): [True: 3.42k, False: 0]
  |  Branch (1694:29): [True: 26, False: 3.40k]
  ------------------
 1695|     26|      std::stringstream sstr;
 1696|     26|      sstr << "Number of extents in iloc box (" << extent_count << ") exceeds security limit ("
 1697|     26|           << max_iloc_extents << ")\n";
 1698|       |
 1699|     26|      return Error(heif_error_Memory_allocation_error,
 1700|     26|                   heif_suberror_Security_limit_exceeded,
 1701|     26|                   sstr.str());
 1702|     26|    }
 1703|       |
 1704|  16.2k|    for (int e = 0; e < extent_count; e++) {
  ------------------
  |  Branch (1704:21): [True: 12.8k, False: 3.36k]
  ------------------
 1705|  12.8k|      Extent extent;
 1706|       |
 1707|  12.8k|      if (range.eof()) {
  ------------------
  |  Branch (1707:11): [True: 41, False: 12.8k]
  ------------------
 1708|     41|        std::stringstream sstr;
 1709|     41|        sstr << "iloc item should contain " << extent_count << " extents, but we can only read " << e << " extents.";
 1710|       |
 1711|     41|        return {heif_error_Invalid_input,
 1712|     41|                heif_suberror_End_of_data,
 1713|     41|                sstr.str()};
 1714|     41|      }
 1715|       |
 1716|  12.8k|      if ((version == 1 || version == 2) && index_size > 0) {
  ------------------
  |  Branch (1716:12): [True: 1.70k, False: 11.1k]
  |  Branch (1716:28): [True: 262, False: 10.8k]
  |  Branch (1716:45): [True: 1.44k, False: 519]
  ------------------
 1717|  1.44k|        if (index_size == 4) {
  ------------------
  |  Branch (1717:13): [True: 428, False: 1.01k]
  ------------------
 1718|    428|          extent.index = range.read32();
 1719|    428|        }
 1720|  1.01k|        else if (index_size == 8) {
  ------------------
  |  Branch (1720:18): [True: 429, False: 587]
  ------------------
 1721|    429|          extent.index = ((uint64_t) range.read32()) << 32;
 1722|    429|          extent.index |= range.read32();
 1723|    429|        }
 1724|  1.44k|      }
 1725|       |
 1726|  12.8k|      extent.offset = 0;
 1727|  12.8k|      if (offset_size == 4) {
  ------------------
  |  Branch (1727:11): [True: 341, False: 12.5k]
  ------------------
 1728|    341|        extent.offset = range.read32();
 1729|    341|      }
 1730|  12.5k|      else if (offset_size == 8) {
  ------------------
  |  Branch (1730:16): [True: 195, False: 12.3k]
  ------------------
 1731|    195|        extent.offset = ((uint64_t) range.read32()) << 32;
 1732|    195|        extent.offset |= range.read32();
 1733|    195|      }
 1734|       |
 1735|       |
 1736|  12.8k|      extent.length = 0;
 1737|  12.8k|      if (length_size == 4) {
  ------------------
  |  Branch (1737:11): [True: 374, False: 12.4k]
  ------------------
 1738|    374|        extent.length = range.read32();
 1739|    374|      }
 1740|  12.4k|      else if (length_size == 8) {
  ------------------
  |  Branch (1740:16): [True: 316, False: 12.1k]
  ------------------
 1741|    316|        extent.length = ((uint64_t) range.read32()) << 32;
 1742|    316|        extent.length |= range.read32();
 1743|    316|      }
 1744|       |
 1745|  12.8k|      item.extents.push_back(extent);
 1746|  12.8k|    }
 1747|       |
 1748|  3.36k|    if (!range.error()) {
  ------------------
  |  Branch (1748:9): [True: 3.27k, False: 84]
  ------------------
 1749|  3.27k|      m_items.push_back(item);
 1750|  3.27k|    }
 1751|  3.36k|  }
 1752|       |
 1753|    831|  return range.get_error();
 1754|    995|}
_ZN8Box_ilocC2Ev:
 1758|  1.04k|{
 1759|  1.04k|  set_short_type(fourcc("iloc"));
 1760|       |
 1761|  1.04k|  set_use_tmp_file(false);
 1762|  1.04k|}
_ZN8Box_ilocD2Ev:
 1766|  1.04k|{
 1767|  1.04k|  if (m_use_tmpfile) {
  ------------------
  |  Branch (1767:7): [True: 0, False: 1.04k]
  ------------------
 1768|      0|    unlink(m_tmp_filename);
 1769|      0|  }
 1770|  1.04k|}
_ZN8Box_iloc16set_use_tmp_fileEb:
 1774|  1.04k|{
 1775|  1.04k|  m_use_tmpfile = flag;
 1776|  1.04k|  if (flag) {
  ------------------
  |  Branch (1776:7): [True: 0, False: 1.04k]
  ------------------
 1777|      0|#if !defined(_WIN32)
 1778|      0|    strcpy(m_tmp_filename, "/tmp/libheif-XXXXXX");
 1779|      0|    m_tmpfile_fd = mkstemp(m_tmp_filename);
 1780|       |#else
 1781|       |    // TODO Currently unused code. Implement when needed.
 1782|       |    assert(false);
 1783|       |#  if 0
 1784|       |    char tmpname[L_tmpnam_s];
 1785|       |    // TODO: check return value (errno_t)
 1786|       |    tmpnam_s(tmpname, L_tmpnam_s);
 1787|       |    _sopen_s(&m_tmpfile_fd, tmpname, _O_CREAT | _O_TEMPORARY | _O_TRUNC | _O_RDWR, _SH_DENYRW, _S_IREAD | _S_IWRITE);
 1788|       |#  endif
 1789|       |#endif
 1790|      0|  }
 1791|  1.04k|}
_ZNK8Box_iloc4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1795|    790|{
 1796|    790|  Box::dump(sstr, indent, full_log);
 1797|       |
 1798|  1.42k|  for (const Item& item : m_items) {
  ------------------
  |  Branch (1798:25): [True: 1.42k, False: 790]
  ------------------
 1799|  1.42k|    sstr << indent << "item ID: " << item.item_ID << "\n"
 1800|  1.42k|         << indent << "  construction method: " << ((int) item.construction_method) << "\n"
 1801|  1.42k|         << indent << "  data_reference_index: " << std::hex
 1802|  1.42k|         << item.data_reference_index << std::dec << "\n"
 1803|  1.42k|         << indent << "  base_offset: " << item.base_offset << "\n";
 1804|       |
 1805|  1.42k|    sstr << indent << "  extents: ";
 1806|  6.96k|    for (const Extent& extent : item.extents) {
  ------------------
  |  Branch (1806:31): [True: 6.96k, False: 1.42k]
  ------------------
 1807|  6.96k|      sstr << extent.offset << "," << extent.length;
 1808|  6.96k|      if (extent.index != 0) {
  ------------------
  |  Branch (1808:11): [True: 393, False: 6.57k]
  ------------------
 1809|    393|        sstr << ";index=" << extent.index;
 1810|    393|      }
 1811|  6.96k|      sstr << " ";
 1812|  6.96k|    }
 1813|  1.42k|    sstr << "\n";
 1814|  1.42k|  }
 1815|       |
 1816|    790|  return;
 1817|    790|}
_ZN8Box_infe5parseER14BitstreamRangePK20heif_security_limits:
 2497|  3.66k|{
 2498|  3.66k|  parse_full_box_header(range);
 2499|       |
 2500|       |  // only versions 2,3 are required by HEIF
 2501|  3.66k|  if (get_version() > 3) {
  ------------------
  |  Branch (2501:7): [True: 6, False: 3.65k]
  ------------------
 2502|      6|    return unsupported_version_error("infe");
 2503|      6|  }
 2504|       |
 2505|  3.65k|  if (get_version() <= 1) {
  ------------------
  |  Branch (2505:7): [True: 271, False: 3.38k]
  ------------------
 2506|    271|    m_item_ID = range.read16();
 2507|    271|    m_item_protection_index = range.read16();
 2508|       |
 2509|    271|    m_item_name = range.read_string();
 2510|    271|    m_content_type = range.read_string();
 2511|    271|    m_content_encoding = range.read_string();
 2512|    271|  }
 2513|       |
 2514|  3.65k|  m_item_type_4cc = 0;
 2515|       |
 2516|  3.65k|  if (get_version() >= 2) {
  ------------------
  |  Branch (2516:7): [True: 3.38k, False: 271]
  ------------------
 2517|  3.38k|    m_hidden_item = (get_flags() & 1);
 2518|       |
 2519|  3.38k|    if (get_version() == 2) {
  ------------------
  |  Branch (2519:9): [True: 3.17k, False: 217]
  ------------------
 2520|  3.17k|      m_item_ID = range.read16();
 2521|  3.17k|    }
 2522|    217|    else {
 2523|    217|      m_item_ID = range.read32();
 2524|    217|    }
 2525|       |
 2526|  3.38k|    m_item_protection_index = range.read16();
 2527|  3.38k|    m_item_type_4cc = range.read32();
 2528|       |
 2529|  3.38k|    m_item_name = range.read_string();
 2530|  3.38k|    if (m_item_type_4cc == fourcc("mime")) {
  ------------------
  |  Branch (2530:9): [True: 445, False: 2.94k]
  ------------------
 2531|    445|      m_content_type = range.read_string();
 2532|    445|      m_content_encoding = range.read_string();
 2533|    445|    }
 2534|  2.94k|    else if (m_item_type_4cc == fourcc("uri ")) {
  ------------------
  |  Branch (2534:14): [True: 968, False: 1.97k]
  ------------------
 2535|    968|      m_item_uri_type = range.read_string();
 2536|    968|    }
 2537|  3.38k|  }
 2538|       |
 2539|  3.65k|  return range.get_error();
 2540|  3.66k|}
_ZNK8Box_infe4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2618|  2.65k|{
 2619|  2.65k|  Box::dump(sstr, indent, full_log);
 2620|       |
 2621|  2.65k|  sstr << indent << "item_ID: " << m_item_ID << "\n"
 2622|  2.65k|       << indent << "item_protection_index: " << m_item_protection_index << "\n"
 2623|  2.65k|       << indent << "item_type: " << fourcc_to_string(m_item_type_4cc) << "\n"
 2624|  2.65k|       << indent << "item_name: " << m_item_name << "\n";
 2625|       |
 2626|  2.65k|  if (m_item_type_4cc == fourcc("mime")) {
  ------------------
  |  Branch (2626:7): [True: 409, False: 2.25k]
  ------------------
 2627|    409|    sstr << indent << "content_type: " << m_content_type << "\n"
 2628|    409|         << indent << "content_encoding: " << m_content_encoding << "\n";
 2629|    409|  }
 2630|       |
 2631|  2.65k|  if (m_item_type_4cc == fourcc("uri ")) {
  ------------------
  |  Branch (2631:7): [True: 705, False: 1.95k]
  ------------------
 2632|    705|    sstr << indent << "item uri type: " << m_item_uri_type << "\n";
 2633|    705|  }
 2634|       |
 2635|  2.65k|  sstr << indent << "hidden item: " << std::boolalpha << m_hidden_item << "\n";
 2636|       |
 2637|  2.65k|  return;
 2638|  2.65k|}
_ZN8Box_iinf5parseER14BitstreamRangePK20heif_security_limits:
 2642|  2.24k|{
 2643|  2.24k|  parse_full_box_header(range);
 2644|       |
 2645|       |  // TODO: there are several images in circulation that have an iinf version=2. We should not enforce this with a hard error.
 2646|  2.24k|  if (false && get_version() > 1) {
  ------------------
  |  Branch (2646:7): [Folded, False: 2.24k]
  |  Branch (2646:16): [True: 0, False: 0]
  ------------------
 2647|      0|    return unsupported_version_error("iinf");
 2648|      0|  }
 2649|       |
 2650|  2.24k|  int nEntries_size = (get_version() > 0) ? 4 : 2;
  ------------------
  |  Branch (2650:23): [True: 172, False: 2.06k]
  ------------------
 2651|       |
 2652|  2.24k|  uint32_t item_count;
 2653|  2.24k|  if (nEntries_size == 2) {
  ------------------
  |  Branch (2653:7): [True: 2.06k, False: 172]
  ------------------
 2654|  2.06k|    item_count = range.read16();
 2655|  2.06k|  }
 2656|    172|  else {
 2657|    172|    item_count = range.read32();
 2658|    172|  }
 2659|       |
 2660|  2.24k|  if (item_count == 0) {
  ------------------
  |  Branch (2660:7): [True: 492, False: 1.74k]
  ------------------
 2661|    492|    return Error::Ok;
 2662|    492|  }
 2663|       |
 2664|       |  // Sanity check.
 2665|  1.74k|  if (limits->max_items && item_count > limits->max_items) {
  ------------------
  |  Branch (2665:7): [True: 1.74k, False: 0]
  |  Branch (2665:28): [True: 68, False: 1.68k]
  ------------------
 2666|     68|    std::stringstream sstr;
 2667|     68|    sstr << "iinf box contains " << item_count << " items, which exceeds the security limit of "
 2668|     68|         << limits->max_items << " items.";
 2669|       |
 2670|     68|    return Error(heif_error_Memory_allocation_error,
 2671|     68|                 heif_suberror_Security_limit_exceeded,
 2672|     68|                 sstr.str());
 2673|     68|  }
 2674|       |
 2675|  1.68k|  return read_children(range, item_count, limits);
 2676|  1.74k|}
_ZNK8Box_iinf4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2680|  1.33k|{
 2681|  1.33k|  Box::dump(sstr, indent, full_log);
 2682|       |
 2683|  1.33k|  dump_children(sstr, indent, full_log);
 2684|       |
 2685|  1.33k|  return;
 2686|  1.33k|}
_ZN8Box_iprp5parseER14BitstreamRangePK20heif_security_limits:
 2690|  22.7k|{
 2691|       |  //parse_full_box_header(range);
 2692|       |
 2693|  22.7k|  return read_children(range, READ_CHILDREN_ALL, limits);
 2694|  22.7k|}
_ZNK8Box_iprp4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2726|  21.0k|{
 2727|  21.0k|  Box::dump(sstr, indent, full_log);
 2728|       |
 2729|  21.0k|  dump_children(sstr, indent, full_log);
 2730|       |
 2731|  21.0k|  return;
 2732|  21.0k|}
_ZN8Box_ipco5parseER14BitstreamRangePK20heif_security_limits:
 2747|  9.66k|{
 2748|       |  //parse_full_box_header(range);
 2749|       |
 2750|  9.66k|  return read_children(range, READ_CHILDREN_ALL, limits);
 2751|  9.66k|}
_ZNK8Box_ipco4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2755|  8.03k|{
 2756|  8.03k|  Box::dump(sstr, indent, full_log);
 2757|       |
 2758|  8.03k|  dump_children(sstr, indent, full_log, true);
 2759|       |
 2760|  8.03k|  return;
 2761|  8.03k|}
_ZN8Box_pixi5parseER14BitstreamRangePK20heif_security_limits:
 2765|  3.51k|{
 2766|  3.51k|  parse_full_box_header(range);
 2767|       |
 2768|  3.51k|  if (get_version() != 0) {
  ------------------
  |  Branch (2768:7): [True: 521, False: 2.99k]
  ------------------
 2769|    521|    return unsupported_version_error("pixi");
 2770|    521|  }
 2771|       |
 2772|  2.99k|  StreamReader::grow_status status;
 2773|  2.99k|  uint8_t num_channels = range.read8();
 2774|  2.99k|  status = range.wait_for_available_bytes(num_channels);
 2775|  2.99k|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (2775:7): [True: 27, False: 2.96k]
  ------------------
 2776|       |    // TODO: return recoverable error at timeout
 2777|     27|    return Error(heif_error_Invalid_input,
 2778|     27|                 heif_suberror_End_of_data);
 2779|     27|  }
 2780|       |
 2781|  2.96k|  m_bits_per_channel.resize(num_channels);
 2782|  26.8k|  for (int i = 0; i < num_channels; i++) {
  ------------------
  |  Branch (2782:19): [True: 23.9k, False: 2.96k]
  ------------------
 2783|  23.9k|    m_bits_per_channel[i] = range.read8();
 2784|  23.9k|  }
 2785|       |
 2786|  2.96k|  return range.get_error();
 2787|  2.99k|}
_ZNK8Box_pixi4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2791|  1.69k|{
 2792|  1.69k|  Box::dump(sstr, indent, full_log);
 2793|       |
 2794|  1.69k|  sstr << indent << "bits_per_channel: ";
 2795|       |
 2796|  4.94k|  for (size_t i = 0; i < m_bits_per_channel.size(); i++) {
  ------------------
  |  Branch (2796:22): [True: 3.24k, False: 1.69k]
  ------------------
 2797|  3.24k|    if (i > 0) sstr << ",";
  ------------------
  |  Branch (2797:9): [True: 1.81k, False: 1.43k]
  ------------------
 2798|  3.24k|    sstr << ((int) m_bits_per_channel[i]);
 2799|  3.24k|  }
 2800|       |
 2801|  1.69k|  sstr << "\n";
 2802|       |
 2803|  1.69k|  return;
 2804|  1.69k|}
_ZN8Box_pasp5parseER14BitstreamRangePK20heif_security_limits:
 2829|  11.9k|{
 2830|       |  //parse_full_box_header(range);
 2831|       |
 2832|  11.9k|  hSpacing = range.read32();
 2833|  11.9k|  vSpacing = range.read32();
 2834|       |
 2835|  11.9k|  return range.get_error();
 2836|  11.9k|}
_ZNK8Box_pasp4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2840|  5.91k|{
 2841|  5.91k|  Box::dump(sstr, indent, full_log);
 2842|       |
 2843|  5.91k|  sstr << indent << "hSpacing: " << hSpacing << "\n";
 2844|  5.91k|  sstr << indent << "vSpacing: " << vSpacing << "\n";
 2845|       |
 2846|  5.91k|  return;
 2847|  5.91k|}
_ZN8Box_lsel5parseER14BitstreamRangePK20heif_security_limits:
 2864|  5.09k|{
 2865|  5.09k|  layer_id = range.read16();
 2866|       |
 2867|  5.09k|  return range.get_error();
 2868|  5.09k|}
_ZNK8Box_lsel4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2872|  2.70k|{
 2873|  2.70k|  Box::dump(sstr, indent, full_log);
 2874|       |
 2875|  2.70k|  sstr << indent << "layer_id: " << layer_id << "\n";
 2876|       |
 2877|  2.70k|  return;
 2878|  2.70k|}
_ZN8Box_clli5parseER14BitstreamRangePK20heif_security_limits:
 2894|    749|{
 2895|       |  //parse_full_box_header(range);
 2896|       |
 2897|    749|  clli.max_content_light_level = range.read16();
 2898|    749|  clli.max_pic_average_light_level = range.read16();
 2899|       |
 2900|    749|  return range.get_error();
 2901|    749|}
_ZNK8Box_clli4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2905|    278|{
 2906|    278|  Box::dump(sstr, indent, full_log);
 2907|       |
 2908|    278|  sstr << indent << "max_content_light_level: " << clli.max_content_light_level << "\n";
 2909|    278|  sstr << indent << "max_pic_average_light_level: " << clli.max_pic_average_light_level << "\n";
 2910|       |
 2911|    278|  return;
 2912|    278|}
_ZN8Box_mdcvC2Ev:
 2929|  4.58k|{
 2930|  4.58k|  set_short_type(fourcc("mdcv"));
 2931|       |
 2932|  4.58k|  memset(&mdcv, 0, sizeof(heif_mastering_display_colour_volume));
 2933|  4.58k|}
_ZN8Box_mdcv5parseER14BitstreamRangePK20heif_security_limits:
 2937|  1.33k|{
 2938|       |  //parse_full_box_header(range);
 2939|       |
 2940|  5.32k|  for (int c = 0; c < 3; c++) {
  ------------------
  |  Branch (2940:19): [True: 3.99k, False: 1.33k]
  ------------------
 2941|  3.99k|    mdcv.display_primaries_x[c] = range.read16();
 2942|  3.99k|    mdcv.display_primaries_y[c] = range.read16();
 2943|  3.99k|  }
 2944|       |
 2945|  1.33k|  mdcv.white_point_x = range.read16();
 2946|  1.33k|  mdcv.white_point_y = range.read16();
 2947|  1.33k|  mdcv.max_display_mastering_luminance = range.read32();
 2948|  1.33k|  mdcv.min_display_mastering_luminance = range.read32();
 2949|       |
 2950|  1.33k|  return range.get_error();
 2951|  1.33k|}
_ZNK8Box_mdcv4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2955|    987|{
 2956|    987|  Box::dump(sstr, indent, full_log);
 2957|       |
 2958|    987|  sstr << indent << "display_primaries (x,y): ";
 2959|    987|  sstr << "(" << mdcv.display_primaries_x[0] << ";" << mdcv.display_primaries_y[0] << "), ";
 2960|    987|  sstr << "(" << mdcv.display_primaries_x[1] << ";" << mdcv.display_primaries_y[1] << "), ";
 2961|    987|  sstr << "(" << mdcv.display_primaries_x[2] << ";" << mdcv.display_primaries_y[2] << ")\n";
 2962|       |
 2963|    987|  sstr << indent << "white point (x,y): (" << mdcv.white_point_x << ";" << mdcv.white_point_y << ")\n";
 2964|    987|  sstr << indent << "max display mastering luminance: " << mdcv.max_display_mastering_luminance << "\n";
 2965|    987|  sstr << indent << "min display mastering luminance: " << mdcv.min_display_mastering_luminance << "\n";
 2966|       |
 2967|    987|  return;
 2968|    987|}
_ZN8Box_amveC2Ev:
 2992|  4.62k|{
 2993|  4.62k|  set_short_type(fourcc("amve"));
 2994|       |
 2995|       |  // These values are not valid.
 2996|  4.62k|  amve.ambient_illumination = 0;
 2997|  4.62k|  amve.ambient_light_x = 0;
 2998|  4.62k|  amve.ambient_light_y = 0;
 2999|  4.62k|}
_ZN8Box_amve5parseER14BitstreamRangePK20heif_security_limits:
 3002|    786|{
 3003|    786|  amve.ambient_illumination = range.read32();
 3004|    786|  amve.ambient_light_x = range.read16();
 3005|    786|  amve.ambient_light_y = range.read16();
 3006|       |
 3007|    786|  return range.get_error();
 3008|    786|}
_ZNK8Box_amve4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 3012|    396|{
 3013|    396|  Box::dump(sstr, indent, full_log);
 3014|       |
 3015|    396|  sstr << indent << "ambient_illumination: " << amve.ambient_illumination << "\n";
 3016|    396|  sstr << indent << "ambient_light_x: " << amve.ambient_light_x << "\n";
 3017|    396|  sstr << indent << "ambient_light_y: " << amve.ambient_light_y << "\n";
 3018|       |
 3019|    396|  return;
 3020|    396|}
_ZN8Box_ndwt5parseER14BitstreamRangePK20heif_security_limits:
 3038|    582|{
 3039|    582|  parse_full_box_header(range);
 3040|       |
 3041|    582|  if (get_version() != 0) {
  ------------------
  |  Branch (3041:7): [True: 70, False: 512]
  ------------------
 3042|     70|    return unsupported_version_error("ndwt");
 3043|     70|  }
 3044|       |
 3045|    512|  m_diffuse_white_luminance = range.read32();
 3046|       |
 3047|    512|  return range.get_error();
 3048|    582|}
_ZNK8Box_ndwt4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 3052|    427|{
 3053|    427|  Box::dump(sstr, indent, full_log);
 3054|       |
 3055|    427|  sstr << indent << "diffuse_white_luminance: " << m_diffuse_white_luminance << "\n";
 3056|       |
 3057|    427|  return;
 3058|    427|}
_ZN8Box_cclvC2Ev:
 3074|  7.15k|{
 3075|  7.15k|  set_short_type(fourcc("cclv"));
 3076|       |
 3077|  7.15k|  m_ccv_primaries_valid = false;
 3078|  7.15k|}
_ZN8Box_cclv13set_primariesEiiiiii:
 3082|    807|{
 3083|    807|  m_ccv_primaries_valid = true;
 3084|    807|  m_ccv_primaries_x[0] = x0;
 3085|    807|  m_ccv_primaries_y[0] = y0;
 3086|    807|  m_ccv_primaries_x[1] = x1;
 3087|    807|  m_ccv_primaries_y[1] = y1;
 3088|    807|  m_ccv_primaries_x[2] = x2;
 3089|    807|  m_ccv_primaries_y[2] = y2;
 3090|    807|}
_ZN8Box_ispe5parseER14BitstreamRangePK20heif_security_limits:
 3273|  1.79k|{
 3274|  1.79k|  parse_full_box_header(range);
 3275|       |
 3276|  1.79k|  if (get_version() != 0) {
  ------------------
  |  Branch (3276:7): [True: 1, False: 1.79k]
  ------------------
 3277|      1|    return unsupported_version_error("ispe");
 3278|      1|  }
 3279|       |
 3280|  1.79k|  m_image_width = range.read32();
 3281|  1.79k|  m_image_height = range.read32();
 3282|       |
 3283|  1.79k|  return range.get_error();
 3284|  1.79k|}
_ZNK8Box_ispe4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 3288|  1.06k|{
 3289|  1.06k|  Box::dump(sstr, indent, full_log);
 3290|       |
 3291|  1.06k|  sstr << indent << "image width: " << m_image_width << "\n"
 3292|  1.06k|       << indent << "image height: " << m_image_height << "\n";
 3293|       |
 3294|  1.06k|  return;
 3295|  1.06k|}
_ZN8Box_ipma5parseER14BitstreamRangePK20heif_security_limits:
 3324|  2.24k|{
 3325|  2.24k|  parse_full_box_header(range);
 3326|       |
 3327|       |  // TODO: is there any specification of allowed values for the ipma version in the HEIF standards?
 3328|       |
 3329|  2.24k|  if (get_version() > 1) {
  ------------------
  |  Branch (3329:7): [True: 7, False: 2.24k]
  ------------------
 3330|      7|    return unsupported_version_error("ipma");
 3331|      7|  }
 3332|       |
 3333|  2.24k|  uint32_t entry_cnt = range.read32();
 3334|       |
 3335|  2.24k|  if (limits->max_items && entry_cnt > limits->max_items) {
  ------------------
  |  Branch (3335:7): [True: 2.24k, False: 0]
  |  Branch (3335:28): [True: 45, False: 2.19k]
  ------------------
 3336|     45|    std::stringstream sstr;
 3337|     45|    sstr << "ipma box wants to define properties for " << entry_cnt
 3338|     45|         << " items, but the security limit has been set to " << limits->max_items << " items";
 3339|     45|    return {heif_error_Invalid_input,
 3340|     45|            heif_suberror_Security_limit_exceeded,
 3341|     45|            sstr.str()};
 3342|     45|  }
 3343|       |
 3344|  11.1k|  for (uint32_t i = 0; i < entry_cnt && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (3344:24): [True: 9.22k, False: 1.91k]
  |  Branch (3344:41): [True: 9.15k, False: 70]
  |  Branch (3344:59): [True: 8.94k, False: 215]
  ------------------
 3345|  8.94k|    Entry entry;
 3346|  8.94k|    if (get_version() < 1) {
  ------------------
  |  Branch (3346:9): [True: 6.67k, False: 2.26k]
  ------------------
 3347|  6.67k|      entry.item_ID = range.read16();
 3348|  6.67k|    }
 3349|  2.26k|    else {
 3350|  2.26k|      entry.item_ID = range.read32();
 3351|  2.26k|    }
 3352|       |
 3353|  8.94k|    int assoc_cnt = range.read8();
 3354|   248k|    for (int k = 0; k < assoc_cnt; k++) {
  ------------------
  |  Branch (3354:21): [True: 240k, False: 8.94k]
  ------------------
 3355|   240k|      PropertyAssociation association{};
 3356|       |
 3357|   240k|      uint16_t index;
 3358|   240k|      if (get_flags() & 1) {
  ------------------
  |  Branch (3358:11): [True: 531, False: 239k]
  ------------------
 3359|    531|        index = range.read16();
 3360|    531|        association.essential = !!(index & 0x8000);
 3361|    531|        association.property_index = (index & 0x7fff);
 3362|    531|      }
 3363|   239k|      else {
 3364|   239k|        index = range.read8();
 3365|   239k|        association.essential = !!(index & 0x80);
 3366|   239k|        association.property_index = (index & 0x7f);
 3367|   239k|      }
 3368|       |
 3369|   240k|      entry.associations.push_back(association);
 3370|   240k|    }
 3371|       |
 3372|  8.94k|    m_entries.push_back(entry);
 3373|  8.94k|  }
 3374|       |
 3375|  2.19k|  return range.get_error();
 3376|  2.24k|}
_ZNK8Box_ipma4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 3477|  1.48k|{
 3478|  1.48k|  Box::dump(sstr, indent, full_log);
 3479|       |
 3480|  6.89k|  for (const Entry& entry : m_entries) {
  ------------------
  |  Branch (3480:27): [True: 6.89k, False: 1.48k]
  ------------------
 3481|  6.89k|    sstr << indent << "associations for item ID: " << entry.item_ID << "\n";
 3482|  6.89k|    indent++;
 3483|   227k|    for (const auto& assoc : entry.associations) {
  ------------------
  |  Branch (3483:28): [True: 227k, False: 6.89k]
  ------------------
 3484|   227k|      sstr << indent << "property index: " << assoc.property_index
 3485|   227k|           << " (essential: " << std::boolalpha << assoc.essential << ")\n";
 3486|   227k|    }
 3487|  6.89k|    indent--;
 3488|  6.89k|  }
 3489|       |
 3490|  1.48k|  return;
 3491|  1.48k|}
_ZN8Box_auxC5parseER14BitstreamRangePK20heif_security_limits:
 3586|    876|{
 3587|    876|  parse_full_box_header(range);
 3588|       |
 3589|    876|  if (get_version() != 0) {
  ------------------
  |  Branch (3589:7): [True: 3, False: 873]
  ------------------
 3590|      3|    return unsupported_version_error("auxC");
 3591|      3|  }
 3592|       |
 3593|    873|  m_aux_type = range.read_string();
 3594|       |
 3595|  1.06M|  while (!range.eof()) {
  ------------------
  |  Branch (3595:10): [True: 1.06M, False: 873]
  ------------------
 3596|  1.06M|    m_aux_subtypes.push_back(range.read8());
 3597|  1.06M|  }
 3598|       |
 3599|    873|  return range.get_error();
 3600|    876|}
_ZNK8Box_auxC4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 3620|    740|{
 3621|    740|  Box::dump(sstr, indent, full_log);
 3622|       |
 3623|    740|  sstr << indent << "aux type: " << m_aux_type << "\n"
 3624|    740|       << indent << "aux subtypes: ";
 3625|  1.05M|  for (uint8_t subtype : m_aux_subtypes) {
  ------------------
  |  Branch (3625:24): [True: 1.05M, False: 740]
  ------------------
 3626|  1.05M|    sstr << std::hex << std::setw(2) << std::setfill('0') << ((int) subtype) << " ";
 3627|  1.05M|  }
 3628|       |
 3629|    740|  sstr << "\n";
 3630|       |
 3631|    740|  return;
 3632|    740|}
_ZN8Box_irot5parseER14BitstreamRangePK20heif_security_limits:
 3636|  7.01k|{
 3637|       |  //parse_full_box_header(range);
 3638|       |
 3639|  7.01k|  uint16_t rotation = range.read8();
 3640|  7.01k|  rotation &= 0x03;
 3641|       |
 3642|  7.01k|  m_rotation = rotation * 90;
 3643|       |
 3644|  7.01k|  return range.get_error();
 3645|  7.01k|}
_ZNK8Box_irot4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 3661|  4.09k|{
 3662|  4.09k|  Box::dump(sstr, indent, full_log);
 3663|       |
 3664|  4.09k|  sstr << indent << "rotation: " << m_rotation << " degrees (CCW)\n";
 3665|       |
 3666|  4.09k|  return;
 3667|  4.09k|}
_ZN8Box_imir5parseER14BitstreamRangePK20heif_security_limits:
 3671|  2.68k|{
 3672|       |  //parse_full_box_header(range);
 3673|       |
 3674|  2.68k|  uint8_t axis = range.read8();
 3675|  2.68k|  if (axis & 1) {
  ------------------
  |  Branch (3675:7): [True: 365, False: 2.32k]
  ------------------
 3676|    365|    m_axis = heif_transform_mirror_direction_horizontal;
 3677|    365|  }
 3678|  2.32k|  else {
 3679|  2.32k|    m_axis = heif_transform_mirror_direction_vertical;
 3680|  2.32k|  }
 3681|       |
 3682|  2.68k|  return range.get_error();
 3683|  2.68k|}
_ZNK8Box_imir4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 3699|  1.29k|{
 3700|  1.29k|  Box::dump(sstr, indent, full_log);
 3701|       |
 3702|  1.29k|  sstr << indent << "mirror direction: ";
 3703|  1.29k|  switch (m_axis) {
  ------------------
  |  Branch (3703:11): [True: 1.29k, False: 0]
  ------------------
 3704|  1.03k|    case heif_transform_mirror_direction_vertical:
  ------------------
  |  Branch (3704:5): [True: 1.03k, False: 262]
  ------------------
 3705|  1.03k|      sstr << "vertical\n";
 3706|  1.03k|      break;
 3707|    262|    case heif_transform_mirror_direction_horizontal:
  ------------------
  |  Branch (3707:5): [True: 262, False: 1.03k]
  ------------------
 3708|    262|      sstr << "horizontal\n";
 3709|    262|      break;
 3710|      0|    case heif_transform_mirror_direction_invalid:
  ------------------
  |  Branch (3710:5): [True: 0, False: 1.29k]
  ------------------
 3711|      0|      sstr << "invalid\n";
 3712|      0|      break;
 3713|  1.29k|  }
 3714|       |
 3715|  1.29k|  return;
 3716|  1.29k|}
_ZN8Box_iscl5parseER14BitstreamRangePK20heif_security_limits:
 3720|    793|{
 3721|    793|  parse_full_box_header(range);
 3722|       |
 3723|    793|  if (get_version() != 0) {
  ------------------
  |  Branch (3723:7): [True: 74, False: 719]
  ------------------
 3724|     74|    return unsupported_version_error("iscl");
 3725|     74|  }
 3726|       |
 3727|    719|  m_target_width_numerator = range.read16();
 3728|    719|  m_target_width_denominator = range.read16();
 3729|    719|  m_target_height_numerator = range.read16();
 3730|    719|  m_target_height_denominator = range.read16();
 3731|       |
 3732|    719|  if (m_target_width_numerator == 0 || m_target_width_denominator == 0 ||
  ------------------
  |  Branch (3732:7): [True: 45, False: 674]
  |  Branch (3732:40): [True: 94, False: 580]
  ------------------
 3733|    580|      m_target_height_numerator == 0 || m_target_height_denominator == 0) {
  ------------------
  |  Branch (3733:7): [True: 199, False: 381]
  |  Branch (3733:41): [True: 79, False: 302]
  ------------------
 3734|    417|    return {heif_error_Invalid_input,
 3735|    417|            heif_suberror_Invalid_fractional_number,
 3736|    417|            "iscl property has zero numerator or denominator"};
 3737|    417|  }
 3738|       |
 3739|    302|  return range.get_error();
 3740|    719|}
_ZNK8Box_iscl4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 3759|    283|{
 3760|    283|  FullBox::dump(sstr, indent, full_log);
 3761|       |
 3762|    283|  sstr << indent << "horizontal scaling factor: " << m_target_width_numerator << " / " << m_target_width_denominator << "\n";
 3763|    283|  sstr << indent << "vertical scaling factor:   " << m_target_height_numerator << " / " << m_target_height_denominator << "\n";
 3764|       |
 3765|    283|  return;
 3766|    283|}
_ZN8Box_clap5parseER14BitstreamRangePK20heif_security_limits:
 3770|  1.41k|{
 3771|       |  //parse_full_box_header(range);
 3772|       |
 3773|  1.41k|  uint32_t clean_aperture_width_num = range.read32();
 3774|  1.41k|  uint32_t clean_aperture_width_den = range.read32();
 3775|  1.41k|  uint32_t clean_aperture_height_num = range.read32();
 3776|  1.41k|  uint32_t clean_aperture_height_den = range.read32();
 3777|       |
 3778|       |  // Note: in the standard document 14496-12(2015), it says that the offset values should also be unsigned integers,
 3779|       |  // but this is obviously an error. Even the accompanying standard text says that offsets may be negative.
 3780|  1.41k|  int32_t horizontal_offset_num = (int32_t) range.read32();
 3781|  1.41k|  uint32_t horizontal_offset_den = (uint32_t) range.read32();
 3782|  1.41k|  int32_t vertical_offset_num = (int32_t) range.read32();
 3783|  1.41k|  uint32_t vertical_offset_den = (uint32_t) range.read32();
 3784|       |
 3785|       |  // The checked Fraction construction rejects values outside the int32_t range and
 3786|       |  // zero denominators.
 3787|  1.41k|  auto clean_aperture_width = Fraction::from_unsigned(clean_aperture_width_num, clean_aperture_width_den);
 3788|  1.41k|  auto clean_aperture_height = Fraction::from_unsigned(clean_aperture_height_num, clean_aperture_height_den);
 3789|  1.41k|  auto horizontal_offset = Fraction::from_signed(horizontal_offset_num, horizontal_offset_den);
 3790|  1.41k|  auto vertical_offset = Fraction::from_signed(vertical_offset_num, vertical_offset_den);
 3791|       |
 3792|  1.41k|  for (const Result<Fraction>* f : {&clean_aperture_width, &clean_aperture_height,
  ------------------
  |  Branch (3792:34): [True: 2.67k, False: 236]
  ------------------
 3793|  2.67k|                                    &horizontal_offset, &vertical_offset}) {
 3794|  2.67k|    if (!*f) {
  ------------------
  |  Branch (3794:9): [True: 1.17k, False: 1.50k]
  ------------------
 3795|  1.17k|      return f->error();
 3796|  1.17k|    }
 3797|  2.67k|  }
 3798|       |
 3799|    236|  m_clean_aperture_width = *clean_aperture_width;
 3800|    236|  m_clean_aperture_height = *clean_aperture_height;
 3801|    236|  m_horizontal_offset = *horizontal_offset;
 3802|    236|  m_vertical_offset = *vertical_offset;
 3803|       |
 3804|    236|  return range.get_error();
 3805|  1.41k|}
_ZNK8Box_clap4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 3828|    194|{
 3829|    194|  Box::dump(sstr, indent, full_log);
 3830|       |
 3831|    194|  sstr << indent << "clean_aperture: " << m_clean_aperture_width.numerator
 3832|    194|       << "/" << m_clean_aperture_width.denominator << " x "
 3833|    194|       << m_clean_aperture_height.numerator << "/"
 3834|    194|       << m_clean_aperture_height.denominator << "\n";
 3835|    194|  sstr << indent << "offset: " << m_horizontal_offset.numerator << "/"
 3836|    194|       << m_horizontal_offset.denominator << " ; "
 3837|    194|       << m_vertical_offset.numerator << "/"
 3838|    194|       << m_vertical_offset.denominator << "\n";
 3839|       |
 3840|    194|  return;
 3841|    194|}
_ZN8Box_iref5parseER14BitstreamRangePK20heif_security_limits:
 3940|  13.3k|{
 3941|  13.3k|  parse_full_box_header(range);
 3942|       |
 3943|  13.3k|  if (get_version() > 1) {
  ------------------
  |  Branch (3943:7): [True: 3, False: 13.3k]
  ------------------
 3944|      3|    return unsupported_version_error("iref");
 3945|      3|  }
 3946|       |
 3947|  36.0k|  while (!range.eof()) {
  ------------------
  |  Branch (3947:10): [True: 22.7k, False: 13.2k]
  ------------------
 3948|       |    // Cap the total number of reference entries, matching the item-count caps in
 3949|       |    // Box_iloc/Box_iinf/Box_ipma (and the per-entry nRefs cap below). Without it
 3950|       |    // the entry count is bounded only by the file size. That is a linear,
 3951|       |    // file-bounded allocation rather than an amplification, so this is a
 3952|       |    // consistency limit and not a security fix, but it rejects a pathological
 3953|       |    // 'iref' early with a clear error instead of parsing it in full.
 3954|       |    //
 3955|       |    // max_items is a heuristic ceiling here, not a semantically exact bound: the
 3956|       |    // number of entries is not strictly limited by the number of items, because
 3957|       |    // one item may be the source (from_item_ID) of several entries, one per
 3958|       |    // reference type (e.g. 'dimg', 'thmb', 'cdsc'). A well-formed file stays far
 3959|       |    // below max_items (default 1000) regardless, so the generous ceiling is fine
 3960|       |    // as a sanity limit; raise max_items if a legitimate file ever exceeds it.
 3961|  22.7k|    if (limits->max_items && m_references.size() >= limits->max_items) {
  ------------------
  |  Branch (3961:9): [True: 22.7k, False: 0]
  |  Branch (3961:30): [True: 1, False: 22.7k]
  ------------------
 3962|      1|      std::stringstream sstr;
 3963|      1|      sstr << "'iref' box contains more than " << limits->max_items
 3964|      1|           << " reference entries, which exceeds the security limit.";
 3965|       |
 3966|      1|      return {heif_error_Invalid_input,
 3967|      1|              heif_suberror_Security_limit_exceeded,
 3968|      1|              sstr.str()};
 3969|      1|    }
 3970|       |
 3971|  22.7k|    Reference ref;
 3972|       |
 3973|  22.7k|    Error err = ref.header.parse_header(range);
 3974|  22.7k|    if (err != Error::Ok) {
  ------------------
  |  Branch (3974:9): [True: 6, False: 22.7k]
  ------------------
 3975|      6|      return err;
 3976|      6|    }
 3977|       |
 3978|  22.7k|    int read_len = (get_version() == 0) ? 16 : 32;
  ------------------
  |  Branch (3978:20): [True: 22.3k, False: 332]
  ------------------
 3979|       |
 3980|  22.7k|    ref.from_item_ID = static_cast<uint32_t>(range.read_uint(read_len));
 3981|  22.7k|    uint16_t nRefs = range.read16();
 3982|       |
 3983|  22.7k|    if (nRefs==0) {
  ------------------
  |  Branch (3983:9): [True: 3, False: 22.7k]
  ------------------
 3984|      3|      return {heif_error_Invalid_input,
 3985|      3|              heif_suberror_Unspecified,
 3986|      3|              "Input file has an 'iref' box with no references."};
 3987|      3|    }
 3988|       |
 3989|  22.7k|    if (limits->max_items && nRefs > limits->max_items) {
  ------------------
  |  Branch (3989:9): [True: 22.7k, False: 0]
  |  Branch (3989:30): [True: 17, False: 22.6k]
  ------------------
 3990|     17|      std::stringstream sstr;
 3991|     17|      sstr << "Number of references in iref box (" << nRefs << ") exceeds the security limits of " << limits->max_items << " references.";
 3992|       |
 3993|     17|      return {heif_error_Invalid_input,
 3994|     17|              heif_suberror_Security_limit_exceeded,
 3995|     17|              sstr.str()};
 3996|     17|    }
 3997|       |
 3998|   144k|    for (int i = 0; i < nRefs; i++) {
  ------------------
  |  Branch (3998:21): [True: 121k, False: 22.6k]
  ------------------
 3999|   121k|      if (range.eof()) {
  ------------------
  |  Branch (3999:11): [True: 35, False: 121k]
  ------------------
 4000|     35|        std::stringstream sstr;
 4001|     35|        sstr << "iref box should contain " << nRefs << " references, but we can only read " << i << " references.";
 4002|       |
 4003|     35|        return {heif_error_Invalid_input,
 4004|     35|                heif_suberror_End_of_data,
 4005|     35|                sstr.str()};
 4006|     35|      }
 4007|       |
 4008|   121k|      ref.to_item_ID.push_back(static_cast<uint32_t>(range.read_uint(read_len)));
 4009|   121k|    }
 4010|       |
 4011|  22.6k|    m_references.push_back(ref);
 4012|  22.6k|  }
 4013|       |
 4014|       |
 4015|       |  // Note: the same item may be listed several times within one reference entry.
 4016|       |  // ISO/IEC 14496-12 does not forbid it, and derived images rely on it: an 'iovl'
 4017|       |  // that places the same input image at two positions references it twice in its
 4018|       |  // 'dimg' entry (one offset per reference). Conformance file C021 does this.
 4019|       |
 4020|       |
 4021|       |#if 0
 4022|       |  // Note: This input sanity check first did not work as expected.
 4023|       |  // Its idea was to prevent infinite recursions while decoding when the input file
 4024|       |  // contains cyclic references. However, apparently there are cases where cyclic
 4025|       |  // references are actually allowed, like with images that have premultiplied alpha channels:
 4026|       |  // | Box: iref -----
 4027|       |  // | size: 40   (header size: 12)
 4028|       |  // | reference with type 'auxl' from ID: 2 to IDs: 1
 4029|       |  // | reference with type 'prem' from ID: 1 to IDs: 2
 4030|       |  //
 4031|       |  // We now test for cyclic references during the image decoding.
 4032|       |  // We pass down the item IDs that have already been seen during the decoding process.
 4033|       |  // If we try to decode an image IDs that has already been seen previously, we throw an error.
 4034|       |  // The advantage is that the error only occurs when we are trying to decode the faulty image.
 4035|       |
 4036|       |  // --- check for cyclic references
 4037|       |
 4038|       |  for (const auto& ref : m_references) {
 4039|       |    if (ref.header.get_short_type() != fourcc("dimg") &&
 4040|       |        ref.header.get_short_type() != fourcc("auxl")) {
 4041|       |      continue;
 4042|       |    }
 4043|       |
 4044|       |    std::set<heif_item_id> reached_ids; // IDs that we have already reached in the DAG
 4045|       |    std::set<heif_item_id> todo;    // IDs that still need to be followed
 4046|       |
 4047|       |    bool reverse = (ref.header.get_short_type() != fourcc("auxl"));
 4048|       |
 4049|       |    if (!reverse) {
 4050|       |      todo.insert(ref.from_item_ID);  // start at base item
 4051|       |    }
 4052|       |    else {
 4053|       |      if (ref.to_item_ID.empty()) {
 4054|       |        continue;
 4055|       |      }
 4056|       |
 4057|       |      // TODO: what if aux image is assigned to multiple images?
 4058|       |      todo.insert(ref.to_item_ID[0]);  // start at base item
 4059|       |    }
 4060|       |
 4061|       |    while (!todo.empty()) {
 4062|       |      // transfer ID into set of reached IDs
 4063|       |      auto id = *todo.begin();
 4064|       |      todo.erase(id);
 4065|       |      reached_ids.insert(id);
 4066|       |
 4067|       |      // if this ID refers to another 'iref', follow it
 4068|       |
 4069|       |      for (const auto& succ_ref : m_references) {
 4070|       |        if (succ_ref.header.get_short_type() != fourcc("dimg") &&
 4071|       |            succ_ref.header.get_short_type() != fourcc("auxl")) {
 4072|       |          continue;
 4073|       |        }
 4074|       |
 4075|       |        heif_item_id from;
 4076|       |        std::vector<heif_item_id> to;
 4077|       |
 4078|       |        if (succ_ref.header.get_short_type() == fourcc("auxl")) {
 4079|       |          if (succ_ref.to_item_ID.empty()) {
 4080|       |            continue;
 4081|       |          }
 4082|       |
 4083|       |          from = succ_ref.to_item_ID[0];
 4084|       |          to = {succ_ref.from_item_ID};
 4085|       |        }
 4086|       |        else {
 4087|       |          from = succ_ref.from_item_ID;
 4088|       |          to = succ_ref.to_item_ID;
 4089|       |        }
 4090|       |
 4091|       |        if (from == id) {
 4092|       |
 4093|       |          // Check whether any successor IDs has been visited yet, which would be an error.
 4094|       |          // Otherwise, put that ID into the 'todo' set.
 4095|       |
 4096|       |          for (const auto& succ_ref_id : to) {
 4097|       |            if (reached_ids.find(succ_ref_id) != reached_ids.end()) {
 4098|       |              return Error(heif_error_Invalid_input,
 4099|       |                           heif_suberror_Unspecified,
 4100|       |                           "'iref' has cyclic references");
 4101|       |            }
 4102|       |
 4103|       |            todo.insert(succ_ref_id);
 4104|       |          }
 4105|       |        }
 4106|       |      }
 4107|       |    }
 4108|       |  }
 4109|       |#endif
 4110|       |
 4111|  13.2k|  build_index();
 4112|       |
 4113|  13.2k|  return range.get_error();
 4114|  13.3k|}
_ZNK8Box_iref4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4167|  7.45k|{
 4168|  7.45k|  Box::dump(sstr, indent, full_log);
 4169|       |
 4170|  15.7k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (4170:24): [True: 15.7k, False: 7.45k]
  ------------------
 4171|  15.7k|    sstr << indent << "reference with type '" << ref.header.get_type_string() << "'"
 4172|  15.7k|         << " from ID: " << ref.from_item_ID
 4173|  15.7k|         << " to IDs: ";
 4174|  81.4k|    for (uint32_t id : ref.to_item_ID) {
  ------------------
  |  Branch (4174:22): [True: 81.4k, False: 15.7k]
  ------------------
 4175|  81.4k|      sstr << id << " ";
 4176|  81.4k|    }
 4177|  15.7k|    sstr << "\n";
 4178|  15.7k|  }
 4179|       |
 4180|  7.45k|  return;
 4181|  7.45k|}
_ZN8Box_iref11build_indexEv:
 4185|  13.2k|{
 4186|  13.2k|  m_from_id_index.clear();
 4187|  13.2k|  m_from_id_index.reserve(m_references.size());
 4188|  34.7k|  for (size_t i = 0; i < m_references.size(); i++) {
  ------------------
  |  Branch (4188:22): [True: 21.4k, False: 13.2k]
  ------------------
 4189|  21.4k|    add_to_index(i);
 4190|  21.4k|  }
 4191|  13.2k|}
_ZN8Box_iref12add_to_indexEm:
 4195|  21.4k|{
 4196|  21.4k|  m_from_id_index[m_references[reference_index].from_item_ID].push_back(reference_index);
 4197|  21.4k|}
_ZN8Box_rref5parseER14BitstreamRangePK20heif_security_limits:
 4268|    744|{
 4269|    744|  parse_full_box_header(range);
 4270|       |
 4271|    744|  if (get_version() > 1) {
  ------------------
  |  Branch (4271:7): [True: 4, False: 740]
  ------------------
 4272|      4|    return unsupported_version_error("rref");
 4273|      4|  }
 4274|       |
 4275|    740|  size_t remainingBytes = range.get_remaining_bytes();
 4276|       |
 4277|       |  // The number of reference types should be stored in uint(8), but the
 4278|       |  // common test images C043, C044 store them as uint(32).
 4279|       |  // Let us detect this case by the number of data bytes in this box.
 4280|    740|  bool cnt_as_uint32 = (remainingBytes > 0 && remainingBytes % 4 == 0);
  ------------------
  |  Branch (4280:25): [True: 735, False: 5]
  |  Branch (4280:47): [True: 366, False: 369]
  ------------------
 4281|       |
 4282|    740|  uint8_t nRefTypes;
 4283|    740|  if (cnt_as_uint32) {
  ------------------
  |  Branch (4283:7): [True: 366, False: 374]
  ------------------
 4284|       |    // fix broken C043, C044 files
 4285|       |    // TODO: remove me when the files have been corrected as the above check can misfire when there is extra padding
 4286|    366|    nRefTypes = (uint8_t)range.read32();
 4287|    366|  }
 4288|    374|  else {
 4289|    374|    nRefTypes = range.read8();
 4290|    374|  }
 4291|       |
 4292|  4.32k|  for (uint8_t i = 0; i < nRefTypes; i++) {
  ------------------
  |  Branch (4292:23): [True: 3.61k, False: 709]
  ------------------
 4293|  3.61k|    uint32_t refType = range.read32();
 4294|       |
 4295|  3.61k|    if (range.error()) {
  ------------------
  |  Branch (4295:9): [True: 31, False: 3.58k]
  ------------------
 4296|     31|      std::stringstream sstr;
 4297|     31|      sstr << "rref box should contain " << ((int)nRefTypes) << " reference types, but we can only read " << m_reference_types.size() << " reference types.";
 4298|       |
 4299|     31|      return {
 4300|     31|        heif_error_Invalid_input,
 4301|     31|        heif_suberror_End_of_data,
 4302|     31|        sstr.str()
 4303|     31|      };
 4304|     31|    }
 4305|       |
 4306|  3.58k|    m_reference_types.push_back(refType);
 4307|  3.58k|  }
 4308|       |
 4309|    709|  return range.get_error();
 4310|    740|}
_ZNK8Box_rref4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4395|    695|{
 4396|    695|  Box::dump(sstr, indent, full_log);
 4397|       |
 4398|    695|  sstr << indent << "reference types: ";
 4399|  3.49k|  for (size_t i = 0; i < m_reference_types.size(); i++) {
  ------------------
  |  Branch (4399:22): [True: 2.79k, False: 695]
  ------------------
 4400|  2.79k|    if (i > 0) sstr << ", ";
  ------------------
  |  Branch (4400:9): [True: 2.21k, False: 585]
  ------------------
 4401|  2.79k|    sstr << fourcc_to_string(m_reference_types[i]);
 4402|  2.79k|  }
 4403|    695|  sstr << "\n";
 4404|       |
 4405|    695|  return;
 4406|    695|}
_ZN8Box_idat5parseER14BitstreamRangePK20heif_security_limits:
 4410|  4.07k|{
 4411|       |  //parse_full_box_header(range);
 4412|       |
 4413|  4.07k|  m_data_start_pos = range.get_istream()->get_position();
 4414|       |
 4415|  4.07k|  return range.get_error();
 4416|  4.07k|}
_ZNK8Box_idat4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4432|  2.44k|{
 4433|  2.44k|  Box::dump(sstr, indent, full_log);
 4434|       |
 4435|  2.44k|  if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (4435:7): [True: 2.02k, False: 427]
  ------------------
 4436|  2.02k|    sstr << indent << "number of data bytes: " << get_box_size() - get_header_size() << "\n";
 4437|  2.02k|  } else {
 4438|    427|     sstr << indent << "number of data bytes is invalid\n";
 4439|    427|  }
 4440|       |
 4441|  2.44k|  return;
 4442|  2.44k|}
_ZN8Box_grpl5parseER14BitstreamRangePK20heif_security_limits:
 4505|  1.13k|{
 4506|       |  //parse_full_box_header(range);
 4507|       |
 4508|  1.13k|  return read_children(range, READ_CHILDREN_ALL, limits); // should we pass the parsing context 'grpl' or are the box types unique?
 4509|  1.13k|}
_ZNK8Box_grpl4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4513|    827|{
 4514|    827|  Box::dump(sstr, indent, full_log);
 4515|    827|  dump_children(sstr, indent, full_log);
 4516|    827|  return;
 4517|    827|}
_ZN17Box_EntityToGroup5parseER14BitstreamRangePK20heif_security_limits:
 4521|  1.64k|{
 4522|  1.64k|  Error err = parse_full_box_header(range);
 4523|  1.64k|  if (err != Error::Ok) {
  ------------------
  |  Branch (4523:7): [True: 336, False: 1.31k]
  ------------------
 4524|    336|    return err;
 4525|    336|  }
 4526|       |
 4527|  1.31k|  group_id = range.read32();
 4528|  1.31k|  uint32_t nEntities = range.read32();
 4529|       |
 4530|  1.31k|  if (nEntities > range.get_remaining_bytes() / 4) {
  ------------------
  |  Branch (4530:7): [True: 86, False: 1.22k]
  ------------------
 4531|     86|    std::stringstream sstr;
 4532|     86|    size_t maxEntries = range.get_remaining_bytes() / 4;
 4533|     86|    sstr << "entity group box should contain " << nEntities << " entities, but we can only read " << maxEntries << " entities.";
 4534|       |
 4535|     86|    return {heif_error_Invalid_input,
 4536|     86|            heif_suberror_End_of_data,
 4537|     86|            sstr.str()};
 4538|     86|  }
 4539|       |
 4540|  1.22k|  if (limits->max_size_entity_group && nEntities > limits->max_size_entity_group) {
  ------------------
  |  Branch (4540:7): [True: 1.22k, False: 0]
  |  Branch (4540:40): [True: 41, False: 1.18k]
  ------------------
 4541|     41|    std::stringstream sstr;
 4542|     41|    sstr << "entity group box contains " << nEntities << " entities, but the security limit is set to " << limits->max_size_entity_group << " entities.";
 4543|       |
 4544|     41|    return {heif_error_Invalid_input,
 4545|     41|            heif_suberror_Security_limit_exceeded,
 4546|     41|            sstr.str()};
 4547|     41|  }
 4548|       |
 4549|  1.18k|  entity_ids.resize(nEntities);
 4550|  3.22k|  for (uint32_t i = 0; i < nEntities; i++) {
  ------------------
  |  Branch (4550:24): [True: 2.03k, False: 1.18k]
  ------------------
 4551|  2.03k|    entity_ids[i] = range.read32();
 4552|  2.03k|  }
 4553|       |
 4554|  1.18k|  return Error::Ok;
 4555|  1.22k|}
_ZNK17Box_EntityToGroup4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4584|    721|{
 4585|    721|  Box::dump(sstr, indent, full_log);
 4586|       |
 4587|    721|  sstr << indent << "group id: " << group_id << "\n"
 4588|    721|       << indent << "entity IDs: ";
 4589|       |
 4590|    721|  bool first = true;
 4591|  1.18k|  for (uint32_t id : entity_ids) {
  ------------------
  |  Branch (4591:20): [True: 1.18k, False: 721]
  ------------------
 4592|  1.18k|    if (first) {
  ------------------
  |  Branch (4592:9): [True: 476, False: 713]
  ------------------
 4593|    476|      first = false;
 4594|    476|    }
 4595|    713|    else {
 4596|    713|      sstr << ' ';
 4597|    713|    }
 4598|       |
 4599|  1.18k|    sstr << id;
 4600|  1.18k|  }
 4601|       |
 4602|    721|  sstr << "\n";
 4603|       |
 4604|    721|  return;
 4605|    721|}
_ZN8Box_ster5parseER14BitstreamRangePK20heif_security_limits:
 4609|    347|{
 4610|    347|  Error err = Box_EntityToGroup::parse(range, limits);
 4611|    347|  if (err) {
  ------------------
  |  Branch (4611:7): [True: 9, False: 338]
  ------------------
 4612|      9|    return err;
 4613|      9|  }
 4614|       |
 4615|    338|  if (entity_ids.size() != 2) {
  ------------------
  |  Branch (4615:7): [True: 2, False: 336]
  ------------------
 4616|      2|    return {heif_error_Invalid_input,
 4617|      2|            heif_suberror_Invalid_box_size,
 4618|      2|            "'ster' entity group does not exists of exactly two images"};
 4619|      2|  }
 4620|       |
 4621|    336|  return Error::Ok;
 4622|    338|}
_ZNK8Box_ster4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4626|    317|{
 4627|    317|  Box::dump(sstr, indent, full_log);
 4628|       |
 4629|    317|  sstr << indent << "group id: " << group_id << "\n"
 4630|    317|       << indent << "left image ID: " << entity_ids[0] << "\n"
 4631|    317|       << indent << "right image ID: " << entity_ids[1] << "\n";
 4632|       |
 4633|    317|  return;
 4634|    317|}
_ZN8Box_pymd5parseER14BitstreamRangePK20heif_security_limits:
 4639|  1.19k|{
 4640|  1.19k|  Error err = Box_EntityToGroup::parse(range, limits);
 4641|  1.19k|  if (err) {
  ------------------
  |  Branch (4641:7): [True: 447, False: 749]
  ------------------
 4642|    447|    return err;
 4643|    447|  }
 4644|       |
 4645|    749|  tile_size_x = range.read16();
 4646|    749|  tile_size_y = range.read16();
 4647|       |
 4648|  2.03k|  for (size_t i = 0; i < entity_ids.size(); i++) {
  ------------------
  |  Branch (4648:22): [True: 1.28k, False: 749]
  ------------------
 4649|  1.28k|    LayerInfo layer{};
 4650|  1.28k|    layer.layer_binning = range.read16();
 4651|  1.28k|    layer.tiles_in_layer_row_minus1 = range.read16();
 4652|  1.28k|    layer.tiles_in_layer_column_minus1 = range.read16();
 4653|       |
 4654|  1.28k|    m_layer_infos.push_back(layer);
 4655|  1.28k|  }
 4656|       |
 4657|    749|  return Error::Ok;
 4658|  1.19k|}
_ZNK8Box_pymd4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4685|    639|{
 4686|    639|  Box_EntityToGroup::dump(sstr, indent, full_log);
 4687|       |
 4688|    639|  sstr << indent << "tile size: " << tile_size_x << "x" << tile_size_y << "\n";
 4689|       |
 4690|    639|  int layerNr = 0;
 4691|  1.12k|  for (const auto& layer : m_layer_infos) {
  ------------------
  |  Branch (4691:26): [True: 1.12k, False: 639]
  ------------------
 4692|  1.12k|    sstr << indent << "layer " << layerNr << ":\n"
 4693|  1.12k|         << indent << "| binning: " << layer.layer_binning << "\n"
 4694|  1.12k|         << indent << "| tiles: " << (layer.tiles_in_layer_row_minus1 + 1) << "x" << (layer.tiles_in_layer_column_minus1 + 1) << "\n";
 4695|       |
 4696|  1.12k|    layerNr++;
 4697|  1.12k|  }
 4698|       |
 4699|    639|  return;
 4700|    639|}
_ZN8Box_dinf5parseER14BitstreamRangePK20heif_security_limits:
 4704|  4.06k|{
 4705|       |  //parse_full_box_header(range);
 4706|       |
 4707|  4.06k|  return read_children(range, READ_CHILDREN_ALL, limits);
 4708|  4.06k|}
_ZNK8Box_dinf4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4712|  2.72k|{
 4713|  2.72k|  Box::dump(sstr, indent, full_log);
 4714|  2.72k|  dump_children(sstr, indent, full_log);
 4715|       |
 4716|  2.72k|  return;
 4717|  2.72k|}
_ZN8Box_dref5parseER14BitstreamRangePK20heif_security_limits:
 4721|    385|{
 4722|    385|  parse_full_box_header(range);
 4723|       |
 4724|    385|  if (get_version() != 0) {
  ------------------
  |  Branch (4724:7): [True: 2, False: 383]
  ------------------
 4725|      2|    return unsupported_version_error("dref");
 4726|      2|  }
 4727|       |
 4728|    383|  uint32_t nEntities = range.read32();
 4729|       |
 4730|       |  /*
 4731|       |  for (int i=0;i<nEntities;i++) {
 4732|       |    if (range.eof()) {
 4733|       |      break;
 4734|       |    }
 4735|       |  }
 4736|       |  */
 4737|       |
 4738|    383|  if (nEntities > (uint32_t)std::numeric_limits<int>::max()) {
  ------------------
  |  Branch (4738:7): [True: 17, False: 366]
  ------------------
 4739|     17|    return Error(heif_error_Memory_allocation_error,
 4740|     17|                 heif_suberror_Security_limit_exceeded,
 4741|     17|                 "Too many entities in dref box.");
 4742|     17|  }
 4743|       |
 4744|       |  // read_children verifies that exactly nEntities children are present.
 4745|    366|  return read_children(range, (int)nEntities, limits);
 4746|    383|}
_ZNK8Box_dref4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4770|    235|{
 4771|    235|  Box::dump(sstr, indent, full_log);
 4772|    235|  dump_children(sstr, indent, full_log);
 4773|       |
 4774|    235|  return;
 4775|    235|}
_ZN7Box_url5parseER14BitstreamRangePK20heif_security_limits:
 4779|    644|{
 4780|    644|  parse_full_box_header(range);
 4781|       |
 4782|    644|  if (get_version() > 0) {
  ------------------
  |  Branch (4782:7): [True: 8, False: 636]
  ------------------
 4783|      8|    return unsupported_version_error("url");
 4784|      8|  }
 4785|       |
 4786|    636|  if (get_flags() & 1) {
  ------------------
  |  Branch (4786:7): [True: 346, False: 290]
  ------------------
 4787|       |    // data in same file
 4788|    346|    m_location.clear();
 4789|    346|  }
 4790|    290|  else {
 4791|    290|    m_location = range.read_string();
 4792|    290|  }
 4793|       |
 4794|    636|  return range.get_error();
 4795|    644|}
_ZNK7Box_url4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4816|    540|{
 4817|    540|  Box::dump(sstr, indent, full_log);
 4818|       |  //dump_children(sstr, indent, full_log);
 4819|       |
 4820|    540|  sstr << indent << "location: " << m_location << "\n";
 4821|       |
 4822|    540|  return;
 4823|    540|}
_ZN8Box_udes5parseER14BitstreamRangePK20heif_security_limits:
 4827|  1.13k|{
 4828|  1.13k|  parse_full_box_header(range);
 4829|       |
 4830|  1.13k|  if (get_version() > 0) {
  ------------------
  |  Branch (4830:7): [True: 123, False: 1.01k]
  ------------------
 4831|    123|    return unsupported_version_error("udes");
 4832|    123|  }
 4833|       |
 4834|  1.01k|  m_lang = range.read_string();
 4835|  1.01k|  m_name = range.read_string();
 4836|  1.01k|  m_description = range.read_string();
 4837|  1.01k|  m_tags = range.read_string();
 4838|  1.01k|  return range.get_error();
 4839|  1.13k|}
_ZNK8Box_udes4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4842|    870|{
 4843|    870|  Box::dump(sstr, indent, full_log);
 4844|    870|  sstr << indent << "lang: " << m_lang << "\n";
 4845|    870|  sstr << indent << "name: " << m_name << "\n";
 4846|    870|  sstr << indent << "description: " << m_description << "\n";
 4847|    870|  sstr << indent << "tags: " << m_tags << "\n";
 4848|    870|  return;
 4849|    870|}
_ZNK8Box_cmin4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 4897|    946|{
 4898|    946|  Box::dump(sstr, indent, full_log);
 4899|    946|  sstr << indent << "principal-point: " << m_matrix.principal_point_x << ", " << m_matrix.principal_point_y << "\n";
 4900|    946|  if (m_matrix.is_anisotropic) {
  ------------------
  |  Branch (4900:7): [True: 400, False: 546]
  ------------------
 4901|    400|    sstr << indent << "focal-length: " << m_matrix.focal_length_x << ", " << m_matrix.focal_length_y << "\n";
 4902|    400|    sstr << indent << "skew: " << m_matrix.skew << "\n";
 4903|    400|  }
 4904|    546|  else {
 4905|    546|    sstr << indent << "focal-length: " << m_matrix.focal_length_x << "\n";
 4906|    546|    sstr << indent << "no skew\n";
 4907|    546|  }
 4908|       |
 4909|    946|  return;
 4910|    946|}
_ZN8Box_cmin5parseER14BitstreamRangePK20heif_security_limits:
 4914|  2.92k|{
 4915|  2.92k|  parse_full_box_header(range);
 4916|       |
 4917|  2.92k|  if (get_version() > 0) {
  ------------------
  |  Branch (4917:7): [True: 105, False: 2.82k]
  ------------------
 4918|    105|    return unsupported_version_error("cmin");
 4919|    105|  }
 4920|       |
 4921|  2.82k|  m_denominatorShift = (get_flags() & 0x1F00) >> 8;
 4922|  2.82k|  uint32_t denominator = (1U << m_denominatorShift);
 4923|       |
 4924|  2.82k|  m_matrix.focal_length_x = range.read32s() / (double)denominator;
 4925|  2.82k|  m_matrix.principal_point_x = range.read32s() / (double)denominator;
 4926|  2.82k|  m_matrix.principal_point_y = range.read32s() / (double)denominator;
 4927|       |
 4928|  2.82k|  if (get_flags() & 1) {
  ------------------
  |  Branch (4928:7): [True: 553, False: 2.27k]
  ------------------
 4929|    553|    m_skewDenominatorShift = ((get_flags()) & 0x1F0000) >> 16;
 4930|    553|    uint32_t skewDenominator = (1U << m_skewDenominatorShift);
 4931|       |
 4932|    553|    m_matrix.focal_length_y = range.read32s() / (double)denominator;
 4933|    553|    m_matrix.skew = range.read32s() / (double)skewDenominator;
 4934|       |
 4935|    553|    m_matrix.is_anisotropic = true;
 4936|    553|  }
 4937|  2.27k|  else {
 4938|  2.27k|    m_matrix.is_anisotropic = false;
 4939|  2.27k|    m_matrix.focal_length_y = 0;
 4940|  2.27k|    m_matrix.skew = 0;
 4941|  2.27k|  }
 4942|  2.82k|  return range.get_error();
 4943|  2.92k|}
_ZN8Box_cmex5parseER14BitstreamRangePK20heif_security_limits:
 5101|  4.50k|{
 5102|  4.50k|  parse_full_box_header(range);
 5103|       |
 5104|  4.50k|  if (get_version() > 0) {
  ------------------
  |  Branch (5104:7): [True: 950, False: 3.55k]
  ------------------
 5105|    950|    return unsupported_version_error("cmex");
 5106|    950|  }
 5107|       |
 5108|  3.55k|  m_matrix = ExtrinsicMatrix{};
 5109|       |
 5110|  3.55k|  if (get_flags() & pos_x_present) {
  ------------------
  |  Branch (5110:7): [True: 2.41k, False: 1.13k]
  ------------------
 5111|  2.41k|    m_has_pos_x = true;
 5112|  2.41k|    m_matrix.pos_x = range.read32s();
 5113|  2.41k|  }
 5114|       |
 5115|  3.55k|  if (get_flags() & pos_y_present) {
  ------------------
  |  Branch (5115:7): [True: 2.50k, False: 1.04k]
  ------------------
 5116|  2.50k|    m_has_pos_y = true;
 5117|  2.50k|    m_matrix.pos_y = range.read32s();
 5118|  2.50k|  }
 5119|       |
 5120|  3.55k|  if (get_flags() & pos_z_present) {
  ------------------
  |  Branch (5120:7): [True: 935, False: 2.61k]
  ------------------
 5121|    935|    m_has_pos_z = true;
 5122|    935|    m_matrix.pos_z = range.read32s();
 5123|    935|  }
 5124|       |
 5125|  3.55k|  if (get_flags() & orientation_present) {
  ------------------
  |  Branch (5125:7): [True: 1.25k, False: 2.29k]
  ------------------
 5126|  1.25k|    m_has_orientation = true;
 5127|       |
 5128|  1.25k|    if (get_version() == 0) {
  ------------------
  |  Branch (5128:9): [True: 1.25k, False: 0]
  ------------------
 5129|  1.25k|      bool use32bit = (get_flags() & rot_large_field_size);
 5130|  1.25k|      int32_t quat_x = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (5130:24): [True: 691, False: 565]
  ------------------
 5131|  1.25k|      int32_t quat_y = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (5131:24): [True: 691, False: 565]
  ------------------
 5132|  1.25k|      int32_t quat_z = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (5132:24): [True: 691, False: 565]
  ------------------
 5133|       |
 5134|  1.25k|      uint32_t div = 1U << (14 + (use32bit ? 16 : 0));
  ------------------
  |  Branch (5134:35): [True: 691, False: 565]
  ------------------
 5135|       |
 5136|  1.25k|      m_matrix.rotation_as_quaternions = true;
 5137|  1.25k|      m_matrix.quaternion_x = quat_x / (double)div;
 5138|  1.25k|      m_matrix.quaternion_y = quat_y / (double)div;
 5139|  1.25k|      m_matrix.quaternion_z = quat_z / (double)div;
 5140|       |
 5141|  1.25k|      double q_sum = (m_matrix.quaternion_x * m_matrix.quaternion_x +
 5142|  1.25k|                      m_matrix.quaternion_y * m_matrix.quaternion_y +
 5143|  1.25k|                      m_matrix.quaternion_z * m_matrix.quaternion_z);
 5144|       |
 5145|  1.25k|      if (q_sum > 1.0) {
  ------------------
  |  Branch (5145:11): [True: 314, False: 942]
  ------------------
 5146|    314|        return Error(heif_error_Invalid_input,
 5147|    314|                     heif_suberror_Unspecified,
 5148|    314|                     "Invalid quaternion in extrinsic rotation matrix");
 5149|    314|      }
 5150|       |
 5151|    942|      m_matrix.quaternion_w = sqrt(1 - q_sum);
 5152|       |
 5153|    942|    } else if (get_version() == 1) {
  ------------------
  |  Branch (5153:16): [True: 0, False: 0]
  ------------------
 5154|      0|      uint32_t div = 1<<16;
 5155|      0|      m_matrix.rotation_yaw = range.read32s() / (double)div;
 5156|      0|      m_matrix.rotation_pitch = range.read32s() / (double)div;
 5157|      0|      m_matrix.rotation_roll = range.read32s() / (double)div;
 5158|      0|    }
 5159|  1.25k|  }
 5160|       |
 5161|  3.23k|  if (get_flags() & id_present) {
  ------------------
  |  Branch (5161:7): [True: 2.40k, False: 831]
  ------------------
 5162|  2.40k|    m_has_world_coordinate_system_id = true;
 5163|  2.40k|    m_matrix.world_coordinate_system_id = range.read32();
 5164|  2.40k|  }
 5165|       |
 5166|  3.23k|  return range.get_error();
 5167|  3.55k|}
_ZNK8Box_cmex4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 5171|    948|{
 5172|    948|  Box::dump(sstr, indent, full_log);
 5173|    948|  sstr << indent << "camera position (um): ";
 5174|    948|  sstr << m_matrix.pos_x << " ; ";
 5175|    948|  sstr << m_matrix.pos_y << " ; ";
 5176|    948|  sstr << m_matrix.pos_z << "\n";
 5177|       |
 5178|    948|  sstr << indent << "orientation ";
 5179|    948|  if (m_matrix.rotation_as_quaternions) {
  ------------------
  |  Branch (5179:7): [True: 948, False: 0]
  ------------------
 5180|    948|    sstr << "(quaterion)\n";
 5181|    948|    sstr << indent << "  q = ["
 5182|    948|         << m_matrix.quaternion_x << ";"
 5183|    948|         << m_matrix.quaternion_y << ";"
 5184|    948|         << m_matrix.quaternion_z << ";"
 5185|    948|         << m_matrix.quaternion_w << "]\n";
 5186|    948|  }
 5187|      0|  else {
 5188|      0|    sstr << "(angles)\n";
 5189|      0|    sstr << indent << "  yaw:   " << m_matrix.rotation_yaw << "\n";
 5190|      0|    sstr << indent << "  pitch: " << m_matrix.rotation_pitch << "\n";
 5191|      0|    sstr << indent << "  roll:  " << m_matrix.rotation_roll << "\n";
 5192|      0|  }
 5193|       |
 5194|    948|  sstr << indent << "world coordinate system id: " << m_matrix.world_coordinate_system_id << "\n";
 5195|       |
 5196|    948|  return;
 5197|    948|}
_ZN8Box_taic4dumpERK19heif_tai_clock_infoR6Indent:
 5337|  1.24k|{
 5338|  1.24k|  std::ostringstream sstr;
 5339|  1.24k|  sstr << indent << "time_uncertainty: ";
 5340|  1.24k|  if (info.time_uncertainty == heif_tai_clock_info_time_uncertainty_unknown) {
  ------------------
  |  |   52|  1.24k|#define heif_tai_clock_info_time_uncertainty_unknown UINT64_C(0xFFFFFFFFFFFFFFFF)
  ------------------
  |  Branch (5340:7): [True: 522, False: 721]
  ------------------
 5341|    522|    sstr << "unknown\n";
 5342|    522|  }
 5343|    721|  else {
 5344|    721|    sstr << info.time_uncertainty << "\n";
 5345|    721|  }
 5346|  1.24k|  sstr << indent << "clock_resolution: " << info.clock_resolution << "\n";
 5347|  1.24k|  sstr << indent << "clock_drift_rate: ";
 5348|  1.24k|  if (info.clock_drift_rate == heif_tai_clock_info_clock_drift_rate_unknown) {
  ------------------
  |  |   53|  1.24k|#define heif_tai_clock_info_clock_drift_rate_unknown INT32_C(0x7FFFFFFF)
  ------------------
  |  Branch (5348:7): [True: 438, False: 805]
  ------------------
 5349|    438|    sstr << "undefined\n";
 5350|    438|  }
 5351|    805|  else {
 5352|    805|    sstr << info.clock_drift_rate << "\n";
 5353|    805|  }
 5354|       |
 5355|  1.24k|  sstr << indent << "clock_type: " << int(info.clock_type) << " ";
 5356|  1.24k|  switch (info.clock_type) {
 5357|    356|    case heif_tai_clock_info_clock_type_unknown: sstr << "(unknown)\n"; break;
  ------------------
  |  |   54|    356|#define heif_tai_clock_info_clock_type_unknown 0
  ------------------
  |  Branch (5357:5): [True: 356, False: 887]
  ------------------
 5358|     45|    case heif_tai_clock_info_clock_type_synchronized_to_atomic_source: sstr << "(synchronized to atomic source)\n"; break;
  ------------------
  |  |   56|     45|#define heif_tai_clock_info_clock_type_synchronized_to_atomic_source 2
  ------------------
  |  Branch (5358:5): [True: 45, False: 1.19k]
  ------------------
 5359|     49|    case heif_tai_clock_info_clock_type_not_synchronized_to_atomic_source: sstr << "(not synchronized to atomic source)\n"; break;
  ------------------
  |  |   55|     49|#define heif_tai_clock_info_clock_type_not_synchronized_to_atomic_source 1
  ------------------
  |  Branch (5359:5): [True: 49, False: 1.19k]
  ------------------
 5360|    793|    default: sstr << "(illegal value)\n"; break;;
  ------------------
  |  Branch (5360:5): [True: 793, False: 450]
  ------------------
 5361|  1.24k|  }
 5362|  1.24k|  return sstr.str();
 5363|  1.24k|}
_ZNK8Box_taic4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 5366|  1.24k|void Box_taic::dump(std::ostream& sstr, Indent& indent, bool full_log) const {
 5367|  1.24k|  Box::dump(sstr, indent, full_log);
 5368|  1.24k|  sstr << dump(m_info, indent);
 5369|       |
 5370|  1.24k|  return;
 5371|  1.24k|}
_ZN8Box_taic5parseER14BitstreamRangePK20heif_security_limits:
 5385|  1.26k|Error Box_taic::parse(BitstreamRange& range, const heif_security_limits*) {
 5386|  1.26k|  parse_full_box_header(range);
 5387|       |
 5388|  1.26k|  m_info.time_uncertainty = range.read64();
 5389|  1.26k|  m_info.clock_resolution = range.read32();
 5390|       |
 5391|  1.26k|  m_info.clock_drift_rate = range.read32s();
 5392|  1.26k|  m_info.clock_type = range.read8() >> 6;
 5393|  1.26k|  return range.get_error();
 5394|  1.26k|}
_ZNK8Box_itai4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 5418|    328|void Box_itai::dump(std::ostream& sstr, Indent& indent, bool full_log) const {
 5419|    328|  Box::dump(sstr, indent, full_log);
 5420|    328|  sstr << indent << "tai_timestamp: " << m_timestamp.tai_timestamp << "\n";
 5421|    328|  sstr << indent << "synchronization_state: " << int(m_timestamp.synchronization_state) << "\n";
 5422|    328|  sstr << indent << "timestamp_generation_failure: " << int(m_timestamp.timestamp_generation_failure) << "\n";
 5423|    328|  sstr << indent << "timestamp_is_modified: " << int(m_timestamp.timestamp_is_modified) << "\n";
 5424|    328|  return;
 5425|    328|}
_ZN8Box_itai5parseER14BitstreamRangePK20heif_security_limits:
 5512|    345|Error Box_itai::parse(BitstreamRange& range, const heif_security_limits*) {
 5513|    345|  parse_full_box_header(range);
 5514|       |
 5515|    345|  m_timestamp.version = 1;
 5516|    345|  m_timestamp.tai_timestamp = range.read64();
 5517|       |
 5518|    345|  uint8_t status_bits = range.read8();
 5519|       |
 5520|    345|  m_timestamp.synchronization_state = !!(status_bits & 0x80);
 5521|    345|  m_timestamp.timestamp_generation_failure = !!(status_bits & 0x40);
 5522|    345|  m_timestamp.timestamp_is_modified = !!(status_bits & 0x20);
 5523|       |
 5524|    345|  return range.get_error();
 5525|    345|}
_ZN8Box_elng5parseER14BitstreamRangePK20heif_security_limits:
 5528|    692|{
 5529|    692|  parse_full_box_header(range);
 5530|       |
 5531|    692|  if (get_version() > 0) {
  ------------------
  |  Branch (5531:7): [True: 69, False: 623]
  ------------------
 5532|     69|    return unsupported_version_error("elng");
 5533|     69|  }
 5534|       |
 5535|    623|  m_lang = range.read_string();
 5536|    623|  return range.get_error();
 5537|    692|}
_ZNK8Box_elng4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 5540|    478|{
 5541|    478|  Box::dump(sstr, indent, full_log);
 5542|    478|  sstr << indent << "extended_language: " << m_lang << "\n";
 5543|    478|  return;
 5544|    478|}
_ZN19Box_gimi_content_id5parseER14BitstreamRangePK20heif_security_limits:
 5556|    937|{
 5557|    937|  m_content_id = range.read_string_until_eof();
 5558|       |
 5559|    937|  return range.get_error();
 5560|    937|}
_ZNK19Box_gimi_content_id4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 5576|    875|{
 5577|    875|  Box::dump(sstr, indent, full_log);
 5578|       |
 5579|    875|  sstr << indent << "content ID: " << m_content_id << "\n";
 5580|       |
 5581|    875|  return;
 5582|    875|}

_ZNK9BoxHeader14dump_to_stringER6Indentb:
  156|   131k|  {
  157|   131k|    std::ostringstream sstr;
  158|   131k|    dump(sstr, indent, full_log);
  159|   131k|    return sstr.str();
  160|   131k|  }
_ZNK9BoxHeader12get_box_sizeEv:
  125|  1.59M|  uint64_t get_box_size() const { return m_size; }
_ZNK9BoxHeader18has_fixed_box_sizeEv:
  127|   707k|  bool has_fixed_box_size() const { return m_size != 0; }
_ZNK9BoxHeader15get_header_sizeEv:
  129|  1.27M|  uint32_t get_header_size() const { return m_header_size; }
_ZNK9BoxHeader14get_short_typeEv:
  131|   462k|  uint32_t get_short_type() const { return m_type; }
_ZNK9BoxHeader14debug_box_nameEv:
  137|  96.1k|  virtual const char* debug_box_name() const { return nullptr; }
_ZN9BoxHeader14set_short_typeEj:
  139|   378k|  void set_short_type(uint32_t type) { m_type = type; }
_ZN3Box16set_short_headerERK9BoxHeader:
  199|   312k|  {
  200|   312k|    *(BoxHeader*) this = hdr;
  201|   312k|  }
_ZN3Box19set_output_positionEm:
  278|  15.0k|  void set_output_position(uint64_t pos) { m_output_position = pos; }
_ZNK3Box24get_parse_error_fatalityEv:
  280|  7.17k|  virtual parse_error_fatality get_parse_error_fatality() const { return parse_error_fatality::fatal; }
_ZNK7FullBox11get_versionEv:
  338|   203k|  uint8_t get_version() const { return m_version; }
_ZNK7FullBox9get_flagsEv:
  342|   277k|  uint32_t get_flags() const { return m_flags; }
_ZN7FullBox9set_flagsEj:
  344|  2.74k|  void set_flags(uint32_t flags) { m_flags = flags; }
_ZN9Box_otherC2Ej:
  366|  80.8k|  {
  367|  80.8k|    set_short_type(short_type);
  368|  80.8k|  }
_ZN9Box_ErrorC2Ej5Error20parse_error_fatality:
  390|  17.0k|  {
  391|  17.0k|    set_short_type(fourcc("ERR "));
  392|       |
  393|  17.0k|    m_box_type_with_parse_error = box4cc;
  394|  17.0k|    m_error = std::move(err);
  395|  17.0k|    m_fatality = fatality;
  396|  17.0k|  }
_ZN8Box_ftypC2Ev:
  421|  37.8k|  {
  422|  37.8k|    set_short_type(fourcc("ftyp"));
  423|  37.8k|  }
_ZNK8Box_ftyp14debug_box_nameEv:
  427|  4.52k|  const char* debug_box_name() const override { return "File Type"; }
_ZN8Box_freeC2Ev:
  461|    472|  {
  462|    472|    set_short_type(fourcc("free"));
  463|    472|  }
_ZNK8Box_free14debug_box_nameEv:
  467|    422|  const char* debug_box_name() const override { return "Free Space"; }
_ZN8Box_metaC2Ev:
  480|  1.76k|  {
  481|  1.76k|    set_short_type(fourcc("meta"));
  482|  1.76k|  }
_ZNK8Box_meta14debug_box_nameEv:
  486|  1.07k|  const char* debug_box_name() const override { return "Metadata"; }
_ZN8Box_hdlrC2Ev:
  497|  2.61k|  {
  498|  2.61k|    set_short_type(fourcc("hdlr"));
  499|  2.61k|  }
_ZNK8Box_hdlr14debug_box_nameEv:
  503|  1.60k|  const char* debug_box_name() const override { return "Handler Reference"; }
_ZN8Box_pitmC2Ev:
  528|  2.24k|  {
  529|  2.24k|    set_short_type(fourcc("pitm"));
  530|  2.24k|  }
_ZNK8Box_pitm14debug_box_nameEv:
  534|  1.39k|  const char* debug_box_name() const override { return "Primary Item"; }
_ZNK8Box_iloc14debug_box_nameEv:
  563|    790|  const char* debug_box_name() const override { return "Item Location"; }
_ZN8Box_infeC2Ev:
  658|  3.66k|  {
  659|  3.66k|    set_short_type(fourcc("infe"));
  660|  3.66k|  }
_ZNK8Box_infe14debug_box_nameEv:
  664|  2.65k|  const char* debug_box_name() const override { return "Item Info Entry"; }
_ZN8Box_iinfC2Ev:
  720|  2.24k|  {
  721|  2.24k|    set_short_type(fourcc("iinf"));
  722|  2.24k|  }
_ZNK8Box_iinf14debug_box_nameEv:
  726|  1.33k|  const char* debug_box_name() const override { return "Item Information"; }
_ZN8Box_iprpC2Ev:
  744|  22.7k|  {
  745|  22.7k|    set_short_type(fourcc("iprp"));
  746|  22.7k|  }
_ZNK8Box_iprp14debug_box_nameEv:
  750|  21.0k|  const char* debug_box_name() const override { return "Item Properties"; }
_ZN8Box_ipcoC2Ev:
  761|  9.66k|  {
  762|  9.66k|    set_short_type(fourcc("ipco"));
  763|  9.66k|  }
_ZNK8Box_ipco14debug_box_nameEv:
  781|  8.03k|  const char* debug_box_name() const override { return "Item Property Container"; }
_ZN8Box_ispeC2Ev:
  792|  1.79k|  {
  793|  1.79k|    set_short_type(fourcc("ispe"));
  794|  1.79k|  }
_ZNK8Box_ispe14debug_box_nameEv:
  808|  1.06k|  const char* debug_box_name() const override { return "Image Spatial Extents"; }
_ZN8Box_ipmaC2Ev:
  830|  2.25k|  {
  831|  2.25k|    set_short_type(fourcc("ipma"));
  832|  2.25k|  }
_ZNK8Box_ipma14debug_box_nameEv:
  836|  1.48k|  const char* debug_box_name() const override { return "Item Property Association"; }
_ZN8Box_auxCC2Ev:
  887|    881|  {
  888|    881|    set_short_type(fourcc("auxC"));
  889|    881|  }
_ZNK8Box_auxC14debug_box_nameEv:
  901|    740|  const char* debug_box_name() const override { return "Image Properties for Auxiliary Images"; }
_ZN8Box_irotC2Ev:
  918|  7.01k|  {
  919|  7.01k|    set_short_type(fourcc("irot"));
  920|  7.01k|  }
_ZNK8Box_irot14debug_box_nameEv:
  928|  4.09k|  const char* debug_box_name() const override { return "Image Rotation"; }
_ZNK8Box_irot24get_parse_error_fatalityEv:
  935|     87|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_imirC2Ev:
  951|  2.68k|  {
  952|  2.68k|    set_short_type(fourcc("imir"));
  953|  2.68k|  }
_ZNK8Box_imir14debug_box_nameEv:
  965|  1.29k|  const char* debug_box_name() const override { return "Image Mirroring"; }
_ZNK8Box_imir24get_parse_error_fatalityEv:
  967|    666|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_isclC2Ev:
  983|    796|  {
  984|    796|    set_short_type(fourcc("iscl"));
  985|    796|  }
_ZNK8Box_iscl14debug_box_nameEv:
 1006|    283|  const char* debug_box_name() const override { return "Image Scaling"; }
_ZNK8Box_iscl24get_parse_error_fatalityEv:
 1008|    491|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_clapC2Ev:
 1027|  1.41k|  {
 1028|  1.41k|    set_short_type(fourcc("clap"));
 1029|  1.41k|  }
_ZNK8Box_clap14debug_box_nameEv:
 1037|    194|  const char* debug_box_name() const override { return "Clean Aperture"; }
_ZNK8Box_clap24get_parse_error_fatalityEv:
 1065|  1.17k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_irefC2Ev:
 1084|  13.3k|  {
 1085|  13.3k|    set_short_type(fourcc("iref"));
 1086|  13.3k|  }
_ZNK8Box_iref14debug_box_nameEv:
 1099|  7.45k|  const char* debug_box_name() const override { return "Item Reference"; }
_ZN8Box_rrefC2Ev:
 1138|    748|  {
 1139|    748|    set_short_type(fourcc("rref"));
 1140|    748|  }
_ZNK8Box_rref14debug_box_nameEv:
 1146|    695|  const char* debug_box_name() const override { return "Required Reference Types"; }
_ZNK8Box_idat14debug_box_nameEv:
 1171|  2.44k|  const char* debug_box_name() const override { return "Item Data"; }
_ZN8Box_grplC2Ev:
 1204|  1.13k|  {
 1205|  1.13k|    set_short_type(fourcc("grpl"));
 1206|  1.13k|  }
_ZNK8Box_grpl14debug_box_nameEv:
 1210|    827|  const char* debug_box_name() const override { return "Groups List"; }
_ZN8Box_sterC2Ev:
 1246|    351|  {
 1247|    351|    set_short_type(fourcc("ster"));
 1248|    351|  }
_ZNK8Box_ster14debug_box_nameEv:
 1252|    317|  const char* debug_box_name() const override { return "Stereo pair"; }
_ZN8Box_pymdC2Ev:
 1267|  1.19k|  {
 1268|  1.19k|    set_short_type(fourcc("pymd"));
 1269|  1.19k|  }
_ZNK8Box_pymd14debug_box_nameEv:
 1273|    639|  const char* debug_box_name() const override { return "Image pyramid group"; }
_ZNK8Box_pymd24get_parse_error_fatalityEv:
 1296|    447|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_dinfC2Ev:
 1314|  4.06k|  {
 1315|  4.06k|    set_short_type(fourcc("dinf"));
 1316|  4.06k|  }
_ZNK8Box_dinf14debug_box_nameEv:
 1320|  2.72k|  const char* debug_box_name() const override { return "Data Information"; }
_ZN8Box_drefC2Ev:
 1331|    386|  {
 1332|    386|    set_short_type(fourcc("dref"));
 1333|    386|  }
_ZNK8Box_dref14debug_box_nameEv:
 1337|    235|  const char* debug_box_name() const override { return "Data Reference"; }
_ZN7Box_urlC2Ev:
 1350|    646|  {
 1351|    646|    set_short_type(fourcc("url "));
 1352|    646|    set_flags(1);
 1353|    646|  }
_ZNK7Box_url14debug_box_nameEv:
 1357|    540|  const char* debug_box_name() const override { return "Data Entry URL"; }
_ZN8Box_pixiC2Ev:
 1377|  3.51k|  {
 1378|  3.51k|    set_short_type(fourcc("pixi"));
 1379|  3.51k|  }
_ZNK8Box_pixi14debug_box_nameEv:
 1398|  1.69k|  const char* debug_box_name() const override { return "Pixel Information"; }
_ZNK8Box_pixi24get_parse_error_fatalityEv:
 1402|    923|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_paspC2Ev:
 1416|  11.9k|  {
 1417|  11.9k|    set_short_type(fourcc("pasp"));
 1418|  11.9k|  }
_ZNK8Box_pasp14debug_box_nameEv:
 1425|  5.91k|  const char* debug_box_name() const override { return "Pixel Aspect Ratio"; }
_ZNK8Box_pasp24get_parse_error_fatalityEv:
 1429|    342|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_lselC2Ev:
 1440|  5.09k|  {
 1441|  5.09k|    set_short_type(fourcc("lsel"));
 1442|  5.09k|  }
_ZNK8Box_lsel14debug_box_nameEv:
 1448|  2.70k|  const char* debug_box_name() const override { return "Layer Selection"; }
_ZNK8Box_lsel24get_parse_error_fatalityEv:
 1452|    381|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_clliC2Ev:
 1463|  8.06k|  {
 1464|  8.06k|    set_short_type(fourcc("clli"));
 1465|       |
 1466|  8.06k|    clli.max_content_light_level = 0;
 1467|  8.06k|    clli.max_pic_average_light_level = 0;
 1468|  8.06k|  }
_ZNK8Box_clli14debug_box_nameEv:
 1474|    278|  const char* debug_box_name() const override { return "Content Light Level Information"; }
_ZNK8Box_clli24get_parse_error_fatalityEv:
 1478|    435|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_mdcv14debug_box_nameEv:
 1494|    987|  const char* debug_box_name() const override { return "Master Display Colour Volume"; }
_ZNK8Box_mdcv24get_parse_error_fatalityEv:
 1498|    307|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_amve14debug_box_nameEv:
 1514|    396|  const char* debug_box_name() const override { return "Ambient Viewing Environment"; }
_ZNK8Box_amve24get_parse_error_fatalityEv:
 1518|    291|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_ndwtC2Ev:
 1529|  5.90k|  {
 1530|  5.90k|    set_short_type(fourcc("ndwt"));
 1531|  5.90k|  }
_ZNK8Box_ndwt27get_diffuse_white_luminanceEv:
 1535|  5.09k|  uint32_t get_diffuse_white_luminance() const { return m_diffuse_white_luminance; }
_ZN8Box_ndwt27set_diffuse_white_luminanceEj:
 1537|  5.31k|  void set_diffuse_white_luminance(uint32_t luminance) { m_diffuse_white_luminance = luminance; }
_ZNK8Box_ndwt14debug_box_nameEv:
 1541|    427|  const char* debug_box_name() const override { return "Nominal Diffuse White"; }
_ZNK8Box_ndwt24get_parse_error_fatalityEv:
 1545|     74|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_cclv23ccv_primaries_are_validEv:
 1560|  13.5k|  bool ccv_primaries_are_valid() const { return m_ccv_primaries_valid; }
_ZNK8Box_cclv18get_ccv_primary_x0Ev:
 1561|    653|  int32_t get_ccv_primary_x0() const { return m_ccv_primaries_x[0]; }
_ZNK8Box_cclv18get_ccv_primary_y0Ev:
 1562|    653|  int32_t get_ccv_primary_y0() const { return m_ccv_primaries_y[0]; }
_ZNK8Box_cclv18get_ccv_primary_x1Ev:
 1563|    653|  int32_t get_ccv_primary_x1() const { return m_ccv_primaries_x[1]; }
_ZNK8Box_cclv18get_ccv_primary_y1Ev:
 1564|    653|  int32_t get_ccv_primary_y1() const { return m_ccv_primaries_y[1]; }
_ZNK8Box_cclv18get_ccv_primary_x2Ev:
 1565|    653|  int32_t get_ccv_primary_x2() const { return m_ccv_primaries_x[2]; }
_ZNK8Box_cclv18get_ccv_primary_y2Ev:
 1566|    653|  int32_t get_ccv_primary_y2() const { return m_ccv_primaries_y[2]; }
_ZNK8Box_cclv22min_luminance_is_validEv:
 1569|  13.5k|  bool min_luminance_is_valid() const { return m_ccv_min_luminance_value.has_value(); }
_ZNK8Box_cclv17get_min_luminanceEv:
 1570|    873|  uint32_t get_min_luminance() const { return *m_ccv_min_luminance_value; }
_ZN8Box_cclv17set_min_luminanceEj:
 1571|  1.00k|  void set_min_luminance(uint32_t luminance) { m_ccv_min_luminance_value = luminance; }
_ZNK8Box_cclv22max_luminance_is_validEv:
 1573|  13.5k|  bool max_luminance_is_valid() const { return m_ccv_max_luminance_value.has_value(); }
_ZNK8Box_cclv17get_max_luminanceEv:
 1574|  2.40k|  uint32_t get_max_luminance() const { return *m_ccv_max_luminance_value; }
_ZN8Box_cclv17set_max_luminanceEj:
 1575|  2.61k|  void set_max_luminance(uint32_t luminance) { m_ccv_max_luminance_value = luminance; }
_ZNK8Box_cclv22avg_luminance_is_validEv:
 1577|  13.5k|  bool avg_luminance_is_valid() const { return m_ccv_avg_luminance_value.has_value(); }
_ZNK8Box_cclv17get_avg_luminanceEv:
 1578|    913|  uint32_t get_avg_luminance() const { return *m_ccv_avg_luminance_value; }
_ZN8Box_cclv17set_avg_luminanceEj:
 1579|  1.05k|  void set_avg_luminance(uint32_t luminance) { m_ccv_avg_luminance_value = luminance; }
_ZN8Box_cminC2Ev:
 1607|  2.93k|  {
 1608|  2.93k|    set_short_type(fourcc("cmin"));
 1609|  2.93k|  }
_ZNK8Box_cmin14debug_box_nameEv:
 1664|    946|  const char* debug_box_name() const override { return "Camera Intrinsic Matrix"; }
_ZNK8Box_cmin24get_parse_error_fatalityEv:
 1670|  1.16k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_cmexC2Ev:
 1689|  4.50k|  {
 1690|  4.50k|    set_short_type(fourcc("cmex"));
 1691|  4.50k|  }
_ZNK8Box_cmex14debug_box_nameEv:
 1721|    948|  const char* debug_box_name() const override { return "Camera Extrinsic Matrix"; }
_ZNK8Box_cmex24get_parse_error_fatalityEv:
 1727|  2.50k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_udesC2Ev:
 1769|  1.13k|  {
 1770|  1.13k|    set_short_type(fourcc("udes"));
 1771|  1.13k|  }
_ZNK8Box_udes14debug_box_nameEv:
 1775|    870|  const char* debug_box_name() const override { return "User Description"; }
_ZNK8Box_udes24get_parse_error_fatalityEv:
 1841|    189|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_taicC2Ev:
 1862|  1.26k|  {
 1863|  1.26k|    set_short_type(fourcc("taic"));
 1864|  1.26k|    initialize_heif_tai_clock_info(&m_info);
 1865|  1.26k|  }
_ZNK8Box_taic14debug_box_nameEv:
 1871|  1.24k|  const char* debug_box_name() const override { return "TAI Clock Information"; }
_ZN8Box_itaiC2Ev:
 1942|    349|  {
 1943|    349|    set_short_type(fourcc("itai"));
 1944|    349|    initialize_heif_tai_timestamp_packet(&m_timestamp);
 1945|    349|  }
_ZNK8Box_itai14debug_box_nameEv:
 1949|    328|  const char* debug_box_name() const override { return "Item TAI Timestamp"; }
_ZN19Box_gimi_content_idC2Ev:
 2007|    939|  {
 2008|    939|    set_uuid_type(std::vector<uint8_t>{0x26, 0x1e, 0xf3, 0x74, 0x1d, 0x97, 0x5b, 0xba, 0xac, 0xbd, 0x9d, 0x2c, 0x8e, 0xa7, 0x35, 0x22});
 2009|    939|  }
_ZNK19Box_gimi_content_id14debug_box_nameEv:
 2017|    875|  const char* debug_box_name() const override { return "GIMI Content ID"; }
_ZN8Box_elngC2Ev:
 2050|    696|  {
 2051|    696|    set_short_type(fourcc("elng"));
 2052|    696|  }
_ZNK8Box_elng14debug_box_nameEv:
 2056|    478|  const char* debug_box_name() const override { return "Extended language"; }
_ZNK8Box_elng24get_parse_error_fatalityEv:
 2076|     80|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN9BoxHeaderD2Ev:
  121|   768k|  virtual ~BoxHeader() = default;
_ZN3BoxC2Ev:
  196|   386k|  Box() = default;
_ZN8FractionC2Ev:
   67|  5.66k|  Fraction() = default;

_ZN8Box_avcC5parseER14BitstreamRangePK20heif_security_limits:
   35|  4.35k|{
   36|  4.35k|  m_configuration.configuration_version = range.read8();
   37|  4.35k|  m_configuration.AVCProfileIndication = range.read8();
   38|  4.35k|  m_configuration.profile_compatibility = range.read8();
   39|  4.35k|  m_configuration.AVCLevelIndication = range.read8();
   40|  4.35k|  uint8_t lengthSizeMinusOneWithReserved = range.read8();
   41|  4.35k|  m_configuration.lengthSize =
   42|  4.35k|      (lengthSizeMinusOneWithReserved & 0b00000011) + 1;
   43|       |
   44|  4.35k|  uint8_t numOfSequenceParameterSets = (range.read8() & 0b00011111);
   45|  8.39k|  for (int i = 0; i < numOfSequenceParameterSets; i++) {
  ------------------
  |  Branch (45:19): [True: 4.04k, False: 4.35k]
  ------------------
   46|  4.04k|    uint16_t sequenceParameterSetLength = range.read16();
   47|  4.04k|    std::vector<uint8_t> sps(sequenceParameterSetLength);
   48|  4.04k|    range.read(sps.data(), sps.size());
   49|  4.04k|    m_sps.push_back(sps);
   50|  4.04k|  }
   51|       |
   52|  4.35k|  uint8_t numOfPictureParameterSets = range.read8();
   53|  9.54k|  for (int i = 0; i < numOfPictureParameterSets; i++) {
  ------------------
  |  Branch (53:19): [True: 5.19k, False: 4.35k]
  ------------------
   54|  5.19k|    uint16_t pictureParameterSetLength = range.read16();
   55|  5.19k|    std::vector<uint8_t> pps(pictureParameterSetLength);
   56|  5.19k|    range.read(pps.data(), pps.size());
   57|  5.19k|    m_pps.push_back(pps);
   58|  5.19k|  }
   59|       |
   60|       |  // See ISO/IEC 14496-15 2017 Section 5.3.3.1.2
   61|  4.35k|  if (range.get_remaining_bytes() > 0) {
  ------------------
  |  Branch (61:7): [True: 2.90k, False: 1.44k]
  ------------------
   62|  2.90k|    if ((m_configuration.AVCProfileIndication != 66) &&
  ------------------
  |  Branch (62:9): [True: 2.63k, False: 265]
  ------------------
   63|  2.63k|        (m_configuration.AVCProfileIndication != 77) &&
  ------------------
  |  Branch (63:9): [True: 2.41k, False: 221]
  ------------------
   64|  2.41k|        (m_configuration.AVCProfileIndication != 88)) {
  ------------------
  |  Branch (64:9): [True: 1.94k, False: 472]
  ------------------
   65|  1.94k|      m_configuration.chroma_format = (heif_chroma) (range.read8() & 0b00000011);
   66|  1.94k|      m_configuration.bit_depth_luma = 8 + (range.read8() & 0b00000111);
   67|  1.94k|      m_configuration.bit_depth_chroma = 8 + (range.read8() & 0b00000111);
   68|  1.94k|      uint8_t numOfSequenceParameterSetExt = range.read8();
   69|  8.57k|      for (int i = 0; i < numOfSequenceParameterSetExt; i++) {
  ------------------
  |  Branch (69:23): [True: 6.62k, False: 1.94k]
  ------------------
   70|  6.62k|        uint16_t sequenceParameterSetExtLength = range.read16();
   71|  6.62k|        std::vector<uint8_t> sps_ext(sequenceParameterSetExtLength);
   72|  6.62k|        range.read(sps_ext.data(), sps_ext.size());
   73|  6.62k|        m_sps_ext.push_back(sps_ext);
   74|  6.62k|      }
   75|  1.94k|    }
   76|  2.90k|  }
   77|       |
   78|  4.35k|  return range.get_error();
   79|  4.35k|}
_ZNK8Box_avcC4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  170|  3.94k|{
  171|  3.94k|  Box::dump(sstr, indent, full_log);
  172|  3.94k|  sstr << indent << "configuration_version: " << ((int) m_configuration.configuration_version) << "\n"
  173|  3.94k|      << indent << "AVCProfileIndication: " << ((int) m_configuration.AVCProfileIndication) << " (" << profileIndicationAsText() << ")\n"
  174|  3.94k|      << indent << "profile_compatibility: " << ((int) m_configuration.profile_compatibility) << "\n"
  175|  3.94k|      << indent << "AVCLevelIndication: " << ((int) m_configuration.AVCLevelIndication) << "\n"
  176|  3.94k|      << indent << "Chroma format: ";
  177|       |
  178|  3.94k|  switch (m_configuration.chroma_format) {
  179|  1.15k|    case heif_chroma_monochrome:
  ------------------
  |  |   75|  1.15k|#define heif_chroma_monochrome heif_chroma_planar
  ------------------
  |  Branch (179:5): [True: 1.15k, False: 2.78k]
  ------------------
  180|  1.15k|      sstr << "4:0:0\n";
  181|  1.15k|      break;
  182|  2.31k|    case heif_chroma_420:
  ------------------
  |  Branch (182:5): [True: 2.31k, False: 1.62k]
  ------------------
  183|  2.31k|      sstr << "4:2:0\n";
  184|  2.31k|      break;
  185|     94|    case heif_chroma_422:
  ------------------
  |  Branch (185:5): [True: 94, False: 3.84k]
  ------------------
  186|     94|      sstr << "4:2:2\n";
  187|     94|      break;
  188|    371|    case heif_chroma_444:
  ------------------
  |  Branch (188:5): [True: 371, False: 3.56k]
  ------------------
  189|    371|      sstr << "4:4:4\n";
  190|    371|      break;
  191|      0|    default:
  ------------------
  |  Branch (191:5): [True: 0, False: 3.94k]
  ------------------
  192|      0|      sstr << "unsupported\n";
  193|      0|      break;
  194|  3.94k|  }
  195|       |
  196|  3.94k|  sstr << indent << "Bit depth luma: " << ((int) m_configuration.bit_depth_luma) << "\n"
  197|  3.94k|      << indent << "Bit depth chroma: " << ((int) m_configuration.bit_depth_chroma) << "\n";
  198|       |
  199|  3.94k|  for (const auto& sps : m_sps) {
  ------------------
  |  Branch (199:24): [True: 3.31k, False: 3.94k]
  ------------------
  200|  3.31k|    sstr << indent << "SPS: ";
  201|  9.11k|    for (uint8_t b : sps) {
  ------------------
  |  Branch (201:20): [True: 9.11k, False: 3.31k]
  ------------------
  202|  9.11k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  203|  9.11k|    }
  204|  3.31k|    sstr << "\n";
  205|  3.31k|    sstr << std::dec;
  206|  3.31k|  }
  207|       |
  208|  3.94k|  for (const auto& spsext : m_sps_ext) {
  ------------------
  |  Branch (208:27): [True: 3.25k, False: 3.94k]
  ------------------
  209|  3.25k|    sstr << indent << "SPS-EXT: ";
  210|   129k|    for (uint8_t b : spsext) {
  ------------------
  |  Branch (210:20): [True: 129k, False: 3.25k]
  ------------------
  211|   129k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  212|   129k|    }
  213|  3.25k|    sstr << "\n";
  214|  3.25k|    sstr << std::dec;
  215|  3.25k|  }
  216|       |
  217|  3.94k|  for (const auto& pps : m_pps) {
  ------------------
  |  Branch (217:24): [True: 1.92k, False: 3.94k]
  ------------------
  218|  1.92k|    sstr << indent << "PPS: ";
  219|  1.92k|    for (uint8_t b : pps) {
  ------------------
  |  Branch (219:20): [True: 1.08k, False: 1.92k]
  ------------------
  220|  1.08k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  221|  1.08k|    }
  222|  1.92k|    sstr << "\n";
  223|  1.92k|    sstr << std::dec;
  224|  1.92k|  }
  225|       |
  226|  3.94k|  return;
  227|  3.94k|}
_ZNK8Box_avcC23profileIndicationAsTextEv:
  230|  3.94k|{
  231|       |  // See ISO/IEC 14496-10:2022 Annex A
  232|  3.94k|  switch (m_configuration.AVCProfileIndication) {
  233|    870|    case 44:
  ------------------
  |  Branch (233:5): [True: 870, False: 3.07k]
  ------------------
  234|    870|      return "CALVC 4:4:4";
  235|    638|    case 66:
  ------------------
  |  Branch (235:5): [True: 638, False: 3.30k]
  ------------------
  236|    638|      return "Constrained Baseline";
  237|    515|    case 77:
  ------------------
  |  Branch (237:5): [True: 515, False: 3.42k]
  ------------------
  238|    515|      return "Main";
  239|    647|    case 88:
  ------------------
  |  Branch (239:5): [True: 647, False: 3.29k]
  ------------------
  240|    647|      return "Extended";
  241|    126|    case 100:
  ------------------
  |  Branch (241:5): [True: 126, False: 3.81k]
  ------------------
  242|    126|      return "High variant";
  243|    104|    case 110:
  ------------------
  |  Branch (243:5): [True: 104, False: 3.83k]
  ------------------
  244|    104|      return "High 10";
  245|     69|    case 122:
  ------------------
  |  Branch (245:5): [True: 69, False: 3.87k]
  ------------------
  246|     69|      return "High 4:2:2";
  247|    257|    case 244:
  ------------------
  |  Branch (247:5): [True: 257, False: 3.68k]
  ------------------
  248|    257|      return "High 4:4:4";
  249|    714|    default:
  ------------------
  |  Branch (249:5): [True: 714, False: 3.22k]
  ------------------
  250|    714|      return "Unknown";
  251|  3.94k|  }
  252|  3.94k|}

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

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

_ZN8Box_av1CC2Ev:
   45|  2.40k|  {
   46|  2.40k|    set_short_type(fourcc("av1C"));
   47|  2.40k|  }
_ZN8Box_av01C2Ev:
  122|     73|  {
  123|     73|    set_short_type(fourcc("av01"));
  124|     73|  }
_ZN8Box_a1opC2Ev:
  131|  12.1k|  {
  132|  12.1k|    set_short_type(fourcc("a1op"));
  133|  12.1k|  }
_ZN8Box_a1lxC2Ev:
  150|  3.32k|  {
  151|  3.32k|    set_short_type(fourcc("a1lx"));
  152|  3.32k|  }

_ZN30HEVCDecoderConfigurationRecord5parseER14BitstreamRangePK20heif_security_limits:
   38|  4.75k|{
   39|  4.75k|  uint8_t byte;
   40|       |
   41|  4.75k|  configuration_version = range.read8();
   42|  4.75k|  byte = range.read8();
   43|  4.75k|  general_profile_space = (byte >> 6) & 3;
   44|  4.75k|  general_tier_flag = (byte >> 5) & 1;
   45|  4.75k|  general_profile_idc = (byte & 0x1F);
   46|       |
   47|  4.75k|  general_profile_compatibility_flags = range.read32();
   48|       |
   49|  33.2k|  for (int i = 0; i < 6; i++) {
  ------------------
  |  Branch (49:19): [True: 28.5k, False: 4.75k]
  ------------------
   50|  28.5k|    byte = range.read8();
   51|       |
   52|   256k|    for (int b = 0; b < 8; b++) {
  ------------------
  |  Branch (52:21): [True: 228k, False: 28.5k]
  ------------------
   53|   228k|      general_constraint_indicator_flags[i * 8 + b] = (byte >> (7 - b)) & 1;
   54|   228k|    }
   55|  28.5k|  }
   56|       |
   57|  4.75k|  general_level_idc = range.read8();
   58|  4.75k|  min_spatial_segmentation_idc = range.read16() & 0x0FFF;
   59|  4.75k|  parallelism_type = range.read8() & 0x03;
   60|  4.75k|  chroma_format = range.read8() & 0x03;
   61|  4.75k|  bit_depth_luma = static_cast<uint8_t>((range.read8() & 0x07) + 8);
   62|  4.75k|  bit_depth_chroma = static_cast<uint8_t>((range.read8() & 0x07) + 8);
   63|  4.75k|  avg_frame_rate = range.read16();
   64|       |
   65|  4.75k|  byte = range.read8();
   66|  4.75k|  constant_frame_rate = (byte >> 6) & 0x03;
   67|  4.75k|  num_temporal_layers = (byte >> 3) & 0x07;
   68|  4.75k|  temporal_id_nested = (byte >> 2) & 1;
   69|       |
   70|  4.75k|  m_length_size = static_cast<uint8_t>((byte & 0x03) + 1);
   71|       |
   72|  4.75k|  int nArrays = range.read8();
   73|       |
   74|  9.29k|  for (int i = 0; i < nArrays && !range.error(); i++) {
  ------------------
  |  Branch (74:19): [True: 4.63k, False: 4.66k]
  |  Branch (74:34): [True: 4.54k, False: 87]
  ------------------
   75|  4.54k|    byte = range.read8();
   76|       |
   77|  4.54k|    NalArray array;
   78|       |
   79|  4.54k|    array.m_array_completeness = (byte >> 6) & 1;
   80|  4.54k|    array.m_NAL_unit_type = (byte & 0x3F);
   81|       |
   82|  4.54k|    int nUnits = range.read16();
   83|  45.9k|    for (int u = 0; u < nUnits && !range.error(); u++) {
  ------------------
  |  Branch (83:21): [True: 41.4k, False: 4.48k]
  |  Branch (83:35): [True: 41.4k, False: 63]
  ------------------
   84|       |
   85|  41.4k|      std::vector<uint8_t> nal_unit;
   86|  41.4k|      int size = range.read16();
   87|  41.4k|      if (!size) {
  ------------------
  |  Branch (87:11): [True: 3.58k, False: 37.8k]
  ------------------
   88|       |        // Ignore empty NAL units.
   89|  3.58k|        continue;
   90|  3.58k|      }
   91|       |
   92|  37.8k|      if (range.prepare_read(size)) {
  ------------------
  |  Branch (92:11): [True: 37.7k, False: 40]
  ------------------
   93|  37.7k|        nal_unit.resize(size);
   94|  37.7k|        bool success = range.get_istream()->read((char*) nal_unit.data(), size);
   95|  37.7k|        if (!success) {
  ------------------
  |  Branch (95:13): [True: 0, False: 37.7k]
  ------------------
   96|      0|          return Error{heif_error_Invalid_input, heif_suberror_End_of_data, "error while reading hvcC box"};
   97|      0|        }
   98|  37.7k|      }
   99|       |
  100|  37.8k|      array.m_nal_units.push_back(std::move(nal_unit));
  101|  37.8k|    }
  102|       |
  103|  4.54k|    m_nal_array.push_back(std::move(array));
  104|  4.54k|  }
  105|       |
  106|  4.75k|  range.skip_to_end_of_box();
  107|       |
  108|  4.75k|  return range.get_error();
  109|  4.75k|}
_ZN8Box_hvcC5parseER14BitstreamRangePK20heif_security_limits:
  270|  4.75k|{
  271|  4.75k|  return m_configuration.parse(range, limits);
  272|  4.75k|}
_ZNK8Box_hvcC4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  276|  4.17k|{
  277|  4.17k|  Box::dump(sstr, indent, full_log);
  278|       |
  279|  4.17k|  const auto& c = m_configuration; // abbreviation
  280|       |
  281|  4.17k|  sstr << indent << "configuration_version: " << ((int) c.configuration_version) << "\n"
  282|  4.17k|       << indent << "general_profile_space: " << ((int) c.general_profile_space) << "\n"
  283|  4.17k|       << indent << "general_tier_flag: " << c.general_tier_flag << "\n"
  284|  4.17k|       << indent << "general_profile_idc: " << ((int) c.general_profile_idc) << "\n";
  285|       |
  286|  4.17k|  sstr << indent << "general_profile_compatibility_flags: ";
  287|   137k|  for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (287:19): [True: 133k, False: 4.17k]
  ------------------
  288|   133k|    sstr << ((c.general_profile_compatibility_flags >> (31 - i)) & 1);
  289|   133k|    if ((i % 8) == 7) sstr << ' ';
  ------------------
  |  Branch (289:9): [True: 16.6k, False: 116k]
  ------------------
  290|   116k|    else if ((i % 4) == 3) sstr << '.';
  ------------------
  |  Branch (290:14): [True: 16.6k, False: 100k]
  ------------------
  291|   133k|  }
  292|  4.17k|  sstr << "\n";
  293|       |
  294|  4.17k|  sstr << indent << "general_constraint_indicator_flags: ";
  295|  4.17k|  int cnt = 0;
  296|   204k|  for (int i = 0; i < HEVCDecoderConfigurationRecord::NUM_CONSTRAINT_INDICATOR_FLAGS; i++) {
  ------------------
  |  Branch (296:19): [True: 200k, False: 4.17k]
  ------------------
  297|   200k|    bool b = c.general_constraint_indicator_flags[i];
  298|       |
  299|   200k|    sstr << (b ? 1 : 0);
  ------------------
  |  Branch (299:14): [True: 76.5k, False: 123k]
  ------------------
  300|   200k|    cnt++;
  301|   200k|    if ((cnt % 8) == 0)
  ------------------
  |  Branch (301:9): [True: 25.0k, False: 175k]
  ------------------
  302|  25.0k|      sstr << ' ';
  303|   200k|  }
  304|  4.17k|  sstr << "\n";
  305|       |
  306|  4.17k|  sstr << indent << "general_level_idc: " << ((int) c.general_level_idc) << "\n"
  307|  4.17k|       << indent << "min_spatial_segmentation_idc: " << c.min_spatial_segmentation_idc << "\n"
  308|  4.17k|       << indent << "parallelism_type: " << ((int) c.parallelism_type) << "\n"
  309|  4.17k|       << indent << "chroma_format: ";
  310|       |
  311|  4.17k|  switch (c.chroma_format) {
  312|  1.78k|    case 0:
  ------------------
  |  Branch (312:5): [True: 1.78k, False: 2.39k]
  ------------------
  313|  1.78k|      sstr << "monochrome";
  314|  1.78k|      break;
  315|     97|    case 1:
  ------------------
  |  Branch (315:5): [True: 97, False: 4.07k]
  ------------------
  316|     97|      sstr << "4:2:0";
  317|     97|      break;
  318|  1.13k|    case 2:
  ------------------
  |  Branch (318:5): [True: 1.13k, False: 3.03k]
  ------------------
  319|  1.13k|      sstr << "4:2:2";
  320|  1.13k|      break;
  321|  1.15k|    case 3:
  ------------------
  |  Branch (321:5): [True: 1.15k, False: 3.01k]
  ------------------
  322|  1.15k|      sstr << "4:4:4";
  323|  1.15k|      break;
  324|      0|    default:
  ------------------
  |  Branch (324:5): [True: 0, False: 4.17k]
  ------------------
  325|      0|      sstr << ((int) c.chroma_format);
  326|      0|      break;
  327|  4.17k|  }
  328|       |
  329|  4.17k|  sstr << "\n"
  330|  4.17k|       << indent << "bit_depth_luma: " << ((int) c.bit_depth_luma) << "\n"
  331|  4.17k|       << indent << "bit_depth_chroma: " << ((int) c.bit_depth_chroma) << "\n"
  332|  4.17k|       << indent << "avg_frame_rate: " << c.avg_frame_rate << "\n"
  333|  4.17k|       << indent << "constant_frame_rate: " << ((int) c.constant_frame_rate) << "\n"
  334|  4.17k|       << indent << "num_temporal_layers: " << ((int) c.num_temporal_layers) << "\n"
  335|  4.17k|       << indent << "temporal_id_nested: " << ((int) c.temporal_id_nested) << "\n"
  336|  4.17k|       << indent << "length_size: " << ((int) c.m_length_size) << "\n";
  337|       |
  338|  4.17k|  for (const auto& array : c.m_nal_array) {
  ------------------
  |  Branch (338:26): [True: 3.30k, False: 4.17k]
  ------------------
  339|  3.30k|    sstr << indent << "<array>\n";
  340|       |
  341|  3.30k|    indent++;
  342|  3.30k|    sstr << indent << "array_completeness: " << ((int) array.m_array_completeness) << "\n"
  343|  3.30k|         << indent << "NAL_unit_type: " << ((int) array.m_NAL_unit_type) << "\n";
  344|       |
  345|  3.30k|    for (const auto& unit : array.m_nal_units) {
  ------------------
  |  Branch (345:27): [True: 619, False: 3.30k]
  ------------------
  346|       |      //sstr << "  unit with " << unit.size() << " bytes of data\n";
  347|    619|      sstr << indent;
  348|    881|      for (uint8_t b : unit) {
  ------------------
  |  Branch (348:22): [True: 881, False: 619]
  ------------------
  349|    881|        sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  350|    881|      }
  351|    619|      sstr << "\n";
  352|    619|      sstr << std::dec;
  353|    619|    }
  354|       |
  355|  3.30k|    indent--;
  356|  3.30k|  }
  357|       |
  358|  4.17k|  return;
  359|  4.17k|}

_ZN8Box_hvcCC2Ev:
  101|  4.75k|  {
  102|  4.75k|    set_short_type(fourcc("hvcC"));
  103|  4.75k|  }
_ZN8Box_hvc1C2Ev:
  142|    121|  {
  143|    121|    set_short_type(fourcc("hvc1"));
  144|    121|  }
_ZNK8Box_hvcC14debug_box_nameEv:
  110|  4.17k|  const char* debug_box_name() const override { return "HEVC Configuration Item"; }

_ZN8Box_cdef5parseER14BitstreamRangePK20heif_security_limits:
   33|  6.66k|{
   34|  6.66k|  uint16_t channel_count = range.read16();
   35|       |
   36|  6.66k|  if (limits->max_components && channel_count > limits->max_components) {
  ------------------
  |  Branch (36:7): [True: 6.66k, False: 0]
  |  Branch (36:33): [True: 10, False: 6.65k]
  ------------------
   37|     10|    std::stringstream sstr;
   38|     10|    sstr << "cdef box wants to define " << channel_count << " JPEG-2000 channels, but the security limit is set to "
   39|     10|         << limits->max_components << " components";
   40|     10|    return {heif_error_Invalid_input,
   41|     10|            heif_suberror_Security_limit_exceeded,
   42|     10|            sstr.str()};
   43|     10|  }
   44|       |
   45|  6.65k|  if (channel_count > range.get_remaining_bytes() / 6) {
  ------------------
  |  Branch (45:7): [True: 12, False: 6.64k]
  ------------------
   46|     12|    std::stringstream sstr;
   47|     12|    sstr << "cdef box wants to define " << channel_count << " JPEG-2000 channels, but file only contains "
   48|     12|         << range.get_remaining_bytes() / 6 << " components";
   49|     12|    return {heif_error_Invalid_input,
   50|     12|            heif_suberror_End_of_data,
   51|     12|            sstr.str()};
   52|     12|  }
   53|       |
   54|  6.64k|  m_channels.resize(channel_count);
   55|       |
   56|  10.4k|  for (uint16_t i = 0; i < channel_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (56:24): [True: 3.78k, False: 6.64k]
  |  Branch (56:45): [True: 3.78k, False: 0]
  |  Branch (56:63): [True: 3.78k, False: 0]
  ------------------
   57|  3.78k|    Channel channel;
   58|  3.78k|    channel.channel_index = range.read16();
   59|  3.78k|    channel.channel_type = range.read16();
   60|  3.78k|    channel.channel_association = range.read16();
   61|  3.78k|    m_channels[i] = channel;
   62|  3.78k|  }
   63|       |
   64|  6.64k|  return range.get_error();
   65|  6.65k|}
_ZNK8Box_cdef4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
   68|  3.20k|{
   69|  3.20k|  Box::dump(sstr, indent, full_log);
   70|       |
   71|  3.20k|  for (const auto& channel : m_channels) {
  ------------------
  |  Branch (71:28): [True: 3.00k, False: 3.20k]
  ------------------
   72|  3.00k|    sstr << indent << "channel_index: " << channel.channel_index
   73|  3.00k|         << ", channel_type: " << channel.channel_type
   74|  3.00k|         << ", channel_association: " << channel.channel_association << "\n";
   75|  3.00k|  }
   76|       |
   77|  3.20k|  return;
   78|  3.20k|}
_ZN8Box_cmap5parseER14BitstreamRangePK20heif_security_limits:
  135|  1.23k|{
  136|   971k|  while (!range.eof() && !range.error()) {
  ------------------
  |  Branch (136:10): [True: 969k, False: 1.23k]
  |  Branch (136:26): [True: 969k, False: 0]
  ------------------
  137|   969k|    Component component;
  138|   969k|    component.component_index = range.read16();
  139|   969k|    component.mapping_type = range.read8();
  140|   969k|    component.palette_colour = range.read8();
  141|   969k|    m_components.push_back(component);
  142|   969k|  }
  143|       |
  144|  1.23k|  return range.get_error();
  145|  1.23k|}
_ZNK8Box_cmap4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  149|    759|{
  150|    759|  Box::dump(sstr, indent, full_log);
  151|       |
  152|   660k|  for (const auto& component : m_components) {
  ------------------
  |  Branch (152:30): [True: 660k, False: 759]
  ------------------
  153|   660k|    sstr << indent << "component_index: " << component.component_index
  154|   660k|         << ", mapping_type: " << (int) (component.mapping_type)
  155|   660k|         << ", palette_colour: " << (int) (component.palette_colour) << "\n";
  156|   660k|  }
  157|       |
  158|    759|  return;
  159|    759|}
_ZN8Box_pclr5parseER14BitstreamRangePK20heif_security_limits:
  179|    574|{
  180|    574|  uint16_t num_entries = range.read16();
  181|    574|  uint8_t num_palette_columns = range.read8();
  182|       |
  183|       |  // ISO/IEC 15444-1 (Table I.12) requires NPC to be in the range 1 to 255.
  184|       |  // A palette without columns carries no entry data, so the per-entry byte
  185|       |  // count below would be zero and could not bound num_entries. The entry loop
  186|       |  // then allocated up to 65535 empty PaletteEntry vectors from an 11-byte box,
  187|       |  // and nested 'j2kH' containers could repeat this hundreds of times without
  188|       |  // any of it being charged to the memory limits (GHSA-9c75-9g8r-4728).
  189|    574|  if (num_palette_columns == 0) {
  ------------------
  |  Branch (189:7): [True: 2, False: 572]
  ------------------
  190|      2|    return Error(heif_error_Invalid_input,
  191|      2|                 heif_suberror_Invalid_J2K_codestream,
  192|      2|                 "pclr box declares zero palette columns");
  193|      2|  }
  194|       |
  195|  7.73k|  for (uint8_t i = 0; i < num_palette_columns; i++) {
  ------------------
  |  Branch (195:23): [True: 7.16k, False: 569]
  ------------------
  196|       |    // B_i (Table I.13): the high bit marks signed values, the low 7 bits hold
  197|       |    // the column precision minus one (0..37 for 1..38 bits).
  198|  7.16k|    uint8_t b = range.read8();
  199|  7.16k|    if (b & 0x80) {
  ------------------
  |  Branch (199:9): [True: 1, False: 7.16k]
  ------------------
  200|      1|      return Error(heif_error_Unsupported_feature,
  201|      1|                   heif_suberror_Unsupported_data_version,
  202|      1|                   "pclr with signed data is not supported");
  203|      1|    }
  204|  7.16k|    uint8_t bit_depth = static_cast<uint8_t>((b & 0x7F) + 1);
  205|  7.16k|    if (bit_depth > 16) {
  ------------------
  |  Branch (205:9): [True: 2, False: 7.16k]
  ------------------
  206|      2|      return Error(heif_error_Unsupported_feature,
  207|      2|                   heif_suberror_Unsupported_data_version,
  208|      2|                   "pclr more than 16 bits per channel is not supported");
  209|      2|    }
  210|  7.16k|    m_bitDepths.push_back(bit_depth);
  211|  7.16k|  }
  212|       |  // Number of bytes each palette entry occupies in the box: each C_ji value is
  213|       |  // padded to a whole number of bytes (I.5.3.4). Used to bound num_entries by
  214|       |  // the data actually present, so a small header cannot force a large
  215|       |  // allocation (analogous to the 'cdef'/'j2kL' checks). The precision is at
  216|       |  // least 1 bit, so every entry occupies at least one byte and the bound is
  217|       |  // never vacuous. num_entries is a uint16_t and bytes_per_entry is at most
  218|       |  // 255 * 2, so the product cannot overflow.
  219|    569|  size_t bytes_per_entry = 0;
  220|  7.16k|  for (uint8_t bd : m_bitDepths) {
  ------------------
  |  Branch (220:19): [True: 7.16k, False: 569]
  ------------------
  221|  7.16k|    bytes_per_entry += (bd + 7) / 8;
  222|  7.16k|  }
  223|       |
  224|    569|  if (static_cast<size_t>(num_entries) * bytes_per_entry > range.get_remaining_bytes()) {
  ------------------
  |  Branch (224:7): [True: 44, False: 525]
  ------------------
  225|     44|    return Error(heif_error_Invalid_input,
  226|     44|                 heif_suberror_End_of_data,
  227|     44|                 "pclr box declares more entries than the box contains");
  228|     44|  }
  229|       |
  230|       |  // Each entry is stored as its own vector, so the palette costs noticeably
  231|       |  // more memory than the bytes it occupies in the file. Charge that storage
  232|       |  // to the memory limits before allocating it.
  233|    525|  size_t bytes_per_stored_entry = sizeof(PaletteEntry) + num_palette_columns * sizeof(uint16_t);
  234|    525|  if (auto err = m_memory_handle.alloc(num_entries, bytes_per_stored_entry,
  ------------------
  |  Branch (234:12): [True: 0, False: 525]
  ------------------
  235|    525|                                       limits, "the 'pclr' palette")) {
  236|      0|    return err;
  237|      0|  }
  238|       |
  239|    525|  m_entries.reserve(num_entries);
  240|       |
  241|  72.7k|  for (uint16_t j = 0; j < num_entries; j++) {
  ------------------
  |  Branch (241:24): [True: 72.1k, False: 525]
  ------------------
  242|  72.1k|    PaletteEntry entry;
  243|   158k|    for (size_t i = 0; i < m_bitDepths.size(); i++) {
  ------------------
  |  Branch (243:24): [True: 85.9k, False: 72.1k]
  ------------------
  244|  85.9k|      if (m_bitDepths[i] <= 8) {
  ------------------
  |  Branch (244:11): [True: 85.4k, False: 479]
  ------------------
  245|  85.4k|        entry.columns.push_back(range.read8());
  246|  85.4k|      }
  247|    479|      else {
  248|    479|        entry.columns.push_back(range.read16());
  249|    479|      }
  250|  85.9k|    }
  251|  72.1k|    m_entries.push_back(std::move(entry));
  252|  72.1k|  }
  253|       |
  254|    525|  return range.get_error();
  255|    525|}
_ZNK8Box_pclr4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  259|    516|{
  260|    516|  Box::dump(sstr, indent, full_log);
  261|       |
  262|    516|  sstr << indent << "NE: " << m_entries.size();
  263|    516|  sstr << ", NPC: " << (int) get_num_columns();
  264|    516|  sstr << ", B: ";
  265|  2.23k|  for (uint8_t b : m_bitDepths) {
  ------------------
  |  Branch (265:18): [True: 2.23k, False: 516]
  ------------------
  266|  2.23k|    sstr << (int) b << ", ";
  267|  2.23k|  }
  268|       |  // TODO: maybe dump entries too?
  269|    516|  sstr << "\n";
  270|       |
  271|    516|  return;
  272|    516|}
_ZN8Box_j2kL5parseER14BitstreamRangePK20heif_security_limits:
  315|    584|{
  316|    584|  uint16_t layer_count = range.read16();
  317|       |
  318|    584|  if (layer_count > range.get_remaining_bytes() / (2+1+2)) {
  ------------------
  |  Branch (318:7): [True: 12, False: 572]
  ------------------
  319|     12|    std::stringstream sstr;
  320|     12|    sstr << "j2kL box wants to define " << layer_count << "JPEG-2000 layers, but the box only contains "
  321|     12|         << range.get_remaining_bytes() / (2 + 1 + 2) << " layers entries";
  322|     12|    return {heif_error_Invalid_input,
  323|     12|            heif_suberror_End_of_data,
  324|     12|            sstr.str()};
  325|     12|  }
  326|       |
  327|    572|  m_layers.resize(layer_count);
  328|       |
  329|   560k|  for (int i = 0; i < layer_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (329:19): [True: 559k, False: 572]
  |  Branch (329:38): [True: 559k, False: 0]
  |  Branch (329:56): [True: 559k, False: 0]
  ------------------
  330|   559k|    Layer layer;
  331|   559k|    layer.layer_id = range.read16();
  332|   559k|    layer.discard_levels = range.read8();
  333|   559k|    layer.decode_layers = range.read16();
  334|   559k|    m_layers[i] = layer;
  335|   559k|  }
  336|       |
  337|    572|  if (range.get_error()) {
  ------------------
  |  Branch (337:7): [True: 4, False: 568]
  ------------------
  338|      4|    m_layers.clear();
  339|      4|  }
  340|       |
  341|    572|  return range.get_error();
  342|    584|}
_ZNK8Box_j2kL4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  345|    468|{
  346|    468|  Box::dump(sstr, indent, full_log);
  347|       |
  348|   559k|  for (const auto& layer : m_layers) {
  ------------------
  |  Branch (348:26): [True: 559k, False: 468]
  ------------------
  349|   559k|    sstr << indent << "layer_id: " << layer.layer_id
  350|   559k|         << ", discard_levels: " << (int) (layer.discard_levels)
  351|   559k|         << ", decode_layers: " << layer.decode_layers << "\n";
  352|   559k|  }
  353|       |
  354|    468|  return;
  355|    468|}
_ZN8Box_j2kH5parseER14BitstreamRangePK20heif_security_limits:
  376|  4.85k|{
  377|  4.85k|  return read_children(range, READ_CHILDREN_ALL, limits);
  378|  4.85k|}
_ZNK8Box_j2kH4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  381|  4.50k|{
  382|  4.50k|  Box::dump(sstr, indent, full_log);
  383|       |
  384|  4.50k|  dump_children(sstr, indent, full_log);
  385|       |
  386|  4.50k|  return;
  387|  4.50k|}

_ZN8Box_j2kHC2Ev:
  320|  4.85k|    Box_j2kH() { set_short_type(fourcc("j2kH")); }
_ZN8Box_cdefC2Ev:
   58|  6.66k|    Box_cdef() { set_short_type(fourcc("cdef")); }
_ZN8Box_cmapC2Ev:
  142|  1.23k|    Box_cmap() { set_short_type(fourcc("cmap")); }
_ZN8Box_pclrC2Ev:
  187|    576|    {
  188|    576|        set_short_type(fourcc("pclr"));
  189|    576|    }
_ZN8Box_j2kLC2Ev:
  275|    586|    Box_j2kL() { set_short_type(fourcc("j2kL")); }
_ZN8Box_j2kiC2Ev:
  533|    121|  {
  534|    121|    set_short_type(fourcc("j2ki"));
  535|    121|  }
_ZNK8Box_pclr15get_num_columnsEv:
  232|    516|    {
  233|    516|        return static_cast<uint8_t>(m_bitDepths.size());
  234|    516|    }

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

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

_Z25is_valid_component_formath:
   43|  2.73k|{
   44|  2.73k|  return format <= component_format_max_valid;
   45|  2.73k|}
_Z24is_valid_interleave_modeh:
   62|    641|{
   63|    641|  return interleave <= interleave_mode_max_valid;
   64|    641|}
_Z22is_valid_sampling_modeh:
   83|    650|{
   84|    650|  return sampling <= sampling_mode_max_valid;
   85|    650|}
_Z28is_predefined_component_typet:
   96|  5.09k|{
   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|  5.09k|  return type <= heif_cmpd_component_type_max_valid;
  ------------------
  |  |   29|  5.09k|#define heif_cmpd_component_type_max_valid heif_cmpd_component_type_key_black
  ------------------
  100|  5.09k|}
_ZN8Box_cmpd5parseER14BitstreamRangePK20heif_security_limits:
  144|  1.04k|{
  145|  1.04k|  uint32_t component_count = range.read32();
  146|       |
  147|  1.04k|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (147:7): [True: 1.04k, False: 0]
  |  Branch (147:33): [True: 50, False: 996]
  ------------------
  148|     50|    std::stringstream sstr;
  149|     50|    sstr << "cmpd box should contain " << component_count << " components, but security limit is set to "
  150|     50|         << limits->max_components << " components";
  151|       |
  152|     50|    return {heif_error_Invalid_input,
  153|     50|            heif_suberror_Security_limit_exceeded,
  154|     50|            sstr.str()
  155|     50|    };
  156|     50|  }
  157|       |
  158|  9.35k|  for (unsigned int i = 0; i < component_count ; i++) {
  ------------------
  |  Branch (158:28): [True: 8.43k, False: 923]
  ------------------
  159|  8.43k|    if (range.eof()) {
  ------------------
  |  Branch (159:9): [True: 73, False: 8.36k]
  ------------------
  160|     73|      std::stringstream sstr;
  161|     73|      sstr << "cmpd box should contain " << component_count << " components, but box only contained "
  162|     73|           << i << " components";
  163|       |
  164|     73|      return {heif_error_Invalid_input,
  165|     73|              heif_suberror_End_of_data,
  166|     73|              sstr.str()
  167|     73|      };
  168|     73|    }
  169|       |
  170|  8.36k|    Component component;
  171|  8.36k|    component.component_type = range.read16();
  172|  8.36k|    if (component.component_type >= 0x8000) {
  ------------------
  |  Branch (172:9): [True: 1.88k, False: 6.47k]
  ------------------
  173|  1.88k|      component.component_type_uri = range.read_string();
  174|  1.88k|    }
  175|  6.47k|    else {
  176|  6.47k|      component.component_type_uri = std::string();
  177|  6.47k|    }
  178|  8.36k|    m_components.push_back(component);
  179|  8.36k|  }
  180|       |
  181|    923|  return range.get_error();
  182|    996|}
_ZN8Box_cmpd9Component23get_component_type_nameEt:
  185|  5.09k|{
  186|  5.09k|  std::stringstream sstr;
  187|       |
  188|  5.09k|  if (is_predefined_component_type(component_type)) {
  ------------------
  |  Branch (188:7): [True: 1.99k, False: 3.09k]
  ------------------
  189|  1.99k|    sstr << get_name(heif_cmpd_component_type(component_type), sNames_uncompressed_component_type) << "\n";
  190|  1.99k|  }
  191|  3.09k|  else {
  192|  3.09k|    sstr << "0x" << std::hex << component_type << std::dec << "\n";
  193|  3.09k|  }
  194|       |
  195|  5.09k|  return sstr.str();
  196|  5.09k|}
_ZNK8Box_cmpd4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  207|    657|{
  208|    657|  Box::dump(sstr, indent, full_log);
  209|       |
  210|  5.09k|  for (const auto& component : m_components) {
  ------------------
  |  Branch (210:30): [True: 5.09k, False: 657]
  ------------------
  211|  5.09k|    sstr << indent << "component_type: " << component.get_component_type_name();
  212|       |
  213|  5.09k|    if (component.component_type >= 0x8000) {
  ------------------
  |  Branch (213:9): [True: 861, False: 4.22k]
  ------------------
  214|    861|      sstr << indent << "| component_type_uri: " << component.component_type_uri << "\n";
  215|    861|    }
  216|  5.09k|  }
  217|       |
  218|    657|  return;
  219|    657|}
_ZN8Box_uncC5parseER14BitstreamRangePK20heif_security_limits:
  239|  3.61k|{
  240|  3.61k|  parse_full_box_header(range);
  241|       |
  242|  3.61k|  m_profile = range.read32();
  243|       |
  244|  3.61k|  if (get_version() == 1) {
  ------------------
  |  Branch (244:7): [True: 2.68k, False: 929]
  ------------------
  245|  2.68k|    switch (m_profile) {
  246|     84|      case fourcc("rgb3"):
  ------------------
  |  Branch (246:7): [True: 84, False: 2.60k]
  ------------------
  247|    150|      case fourcc("rgba"):
  ------------------
  |  Branch (247:7): [True: 66, False: 2.62k]
  ------------------
  248|    358|      case fourcc("abgr"):
  ------------------
  |  Branch (248:7): [True: 208, False: 2.47k]
  ------------------
  249|    564|      case fourcc("2vuy"):
  ------------------
  |  Branch (249:7): [True: 206, False: 2.48k]
  ------------------
  250|    999|      case fourcc("yuv2"):
  ------------------
  |  Branch (250:7): [True: 435, False: 2.25k]
  ------------------
  251|  1.03k|      case fourcc("yvyu"):
  ------------------
  |  Branch (251:7): [True: 34, False: 2.65k]
  ------------------
  252|  1.10k|      case fourcc("vyuy"):
  ------------------
  |  Branch (252:7): [True: 71, False: 2.61k]
  ------------------
  253|  1.18k|      case fourcc("yuv1"):
  ------------------
  |  Branch (253:7): [True: 78, False: 2.60k]
  ------------------
  254|  1.37k|      case fourcc("v308"):
  ------------------
  |  Branch (254:7): [True: 194, False: 2.49k]
  ------------------
  255|  1.45k|      case fourcc("v408"):
  ------------------
  |  Branch (255:7): [True: 76, False: 2.61k]
  ------------------
  256|  1.53k|      case fourcc("y210"):
  ------------------
  |  Branch (256:7): [True: 82, False: 2.60k]
  ------------------
  257|  1.60k|      case fourcc("v410"):
  ------------------
  |  Branch (257:7): [True: 67, False: 2.61k]
  ------------------
  258|  1.66k|      case fourcc("v210"):
  ------------------
  |  Branch (258:7): [True: 67, False: 2.61k]
  ------------------
  259|  1.86k|      case fourcc("i420"):
  ------------------
  |  Branch (259:7): [True: 196, False: 2.49k]
  ------------------
  260|  1.93k|      case fourcc("nv12"):
  ------------------
  |  Branch (260:7): [True: 67, False: 2.61k]
  ------------------
  261|  1.97k|      case fourcc("nv21"):
  ------------------
  |  Branch (261:7): [True: 41, False: 2.64k]
  ------------------
  262|  2.03k|      case fourcc("yu22"):
  ------------------
  |  Branch (262:7): [True: 66, False: 2.62k]
  ------------------
  263|  2.10k|      case fourcc("yv22"):
  ------------------
  |  Branch (263:7): [True: 66, False: 2.62k]
  ------------------
  264|  2.17k|      case fourcc("yv20"):
  ------------------
  |  Branch (264:7): [True: 69, False: 2.61k]
  ------------------
  265|  2.17k|        break;
  266|    513|      default:
  ------------------
  |  Branch (266:7): [True: 513, False: 2.17k]
  ------------------
  267|    513|        return Error{heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Unknown uncC v1 profile"};
  268|  2.68k|    }
  269|  2.68k|  } else if (get_version() == 0) {
  ------------------
  |  Branch (269:14): [True: 692, False: 237]
  ------------------
  270|       |
  271|    692|    uint32_t component_count = range.read32();
  272|       |
  273|    692|    if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (273:9): [True: 692, False: 0]
  |  Branch (273:35): [True: 23, False: 669]
  ------------------
  274|     23|      std::stringstream sstr;
  275|     23|      sstr << "Number of image components (" << component_count << ") exceeds security limit ("
  276|     23|           << limits->max_components << ")";
  277|       |
  278|     23|      return {heif_error_Invalid_input,
  279|     23|              heif_suberror_Security_limit_exceeded,
  280|     23|              sstr.str()};
  281|     23|    }
  282|       |
  283|  3.38k|    for (uint32_t i = 0; i < component_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (283:26): [True: 2.79k, False: 598]
  |  Branch (283:49): [True: 2.75k, False: 34]
  |  Branch (283:67): [True: 2.73k, False: 18]
  ------------------
  284|  2.73k|      Component component;
  285|  2.73k|      component.component_index = range.read16();
  286|  2.73k|      component.component_bit_depth = uint16_t(range.read8() + 1);
  287|  2.73k|      component.component_format = range.read8();
  288|  2.73k|      component.component_align_size = range.read8();
  289|  2.73k|      m_components.push_back(component);
  290|       |
  291|  2.73k|      if (!is_valid_component_format(component.component_format)) {
  ------------------
  |  Branch (291:11): [True: 17, False: 2.72k]
  ------------------
  292|     17|        return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid component format"};
  293|     17|      }
  294|       |
  295|       |      // When component_align_size != 0, the component is padded up to that many bytes.
  296|       |      // It therefore must be large enough to hold the component's bit depth; otherwise
  297|       |      // the decoder computes a negative pad-bits count and shifts by a negative amount.
  298|  2.72k|      if (component.component_align_size != 0 &&
  ------------------
  |  Branch (298:11): [True: 858, False: 1.86k]
  ------------------
  299|    858|          uint32_t(component.component_align_size) * 8 < component.component_bit_depth) {
  ------------------
  |  Branch (299:11): [True: 2, False: 856]
  ------------------
  300|      2|        std::stringstream sstr;
  301|      2|        sstr << "Component alignment (" << int(component.component_align_size)
  302|      2|             << " bytes) is too small for component bit depth (" << component.component_bit_depth << " bits)";
  303|      2|        return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, sstr.str()};
  304|      2|      }
  305|  2.72k|    }
  306|       |
  307|    650|    m_sampling_type = range.read8();
  308|    650|    if (!is_valid_sampling_mode(m_sampling_type)) {
  ------------------
  |  Branch (308:9): [True: 9, False: 641]
  ------------------
  309|      9|      return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid sampling mode"};
  310|      9|    }
  311|       |
  312|    641|    m_interleave_type = range.read8();
  313|    641|    if (!is_valid_interleave_mode(m_interleave_type)) {
  ------------------
  |  Branch (313:9): [True: 6, False: 635]
  ------------------
  314|      6|      return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid interleave mode"};
  315|      6|    }
  316|       |
  317|    635|    m_block_size = range.read8();
  318|       |
  319|    635|    uint8_t flags = range.read8();
  320|    635|    m_components_little_endian = !!(flags & 0x80);
  321|    635|    m_block_pad_lsb = !!(flags & 0x40);
  322|    635|    m_block_little_endian = !!(flags & 0x20);
  323|    635|    m_block_reversed = !!(flags & 0x10);
  324|    635|    m_pad_unknown = !!(flags & 0x08);
  325|       |
  326|    635|    m_pixel_size = range.read32();
  327|       |
  328|    635|    if (limits->version >= 4 &&
  ------------------
  |  Branch (328:9): [True: 635, False: 0]
  ------------------
  329|    635|        limits->max_iso23001_17_pixel_size_bytes != 0 &&
  ------------------
  |  Branch (329:9): [True: 635, False: 0]
  ------------------
  330|    635|        m_pixel_size > limits->max_iso23001_17_pixel_size_bytes) {
  ------------------
  |  Branch (330:9): [True: 44, False: 591]
  ------------------
  331|     44|      std::stringstream sstr;
  332|     44|      sstr << "uncC pixel_size (" << m_pixel_size << " bytes) exceeds security limit of "
  333|     44|           << limits->max_iso23001_17_pixel_size_bytes << " bytes";
  334|     44|      return {heif_error_Memory_allocation_error,
  335|     44|              heif_suberror_Security_limit_exceeded,
  336|     44|              sstr.str()};
  337|     44|    }
  338|       |
  339|    591|    m_row_align_size = range.read32();
  340|       |
  341|    591|    m_tile_align_size = range.read32();
  342|       |
  343|    591|    uint32_t num_tile_cols_minus_one = range.read32();
  344|    591|    uint32_t num_tile_rows_minus_one = range.read32();
  345|       |
  346|       |    // The field is stored as `count - 1`, so 0xFFFFFFFF would mean 2^32 tiles,
  347|       |    // which we cannot represent in our uint32 m_num_tile_cols/rows. Reject this
  348|       |    // before the security-limit check so that disabling the security limit does
  349|       |    // not silently turn this into a divide-by-zero in get_heif_image_tiling().
  350|    591|    if (num_tile_cols_minus_one == 0xFFFFFFFF || num_tile_rows_minus_one == 0xFFFFFFFF) {
  ------------------
  |  Branch (350:9): [True: 1, False: 590]
  |  Branch (350:50): [True: 1, False: 589]
  ------------------
  351|      2|      return {heif_error_Unsupported_feature,
  352|      2|              heif_suberror_Invalid_parameter_value,
  353|      2|              "uncC num_tile_cols/rows_minus_one of 0xFFFFFFFF (2^32 tiles) exceeds the supported range"};
  354|      2|    }
  355|       |
  356|    589|    if (limits->max_number_of_tiles &&
  ------------------
  |  Branch (356:9): [True: 589, False: 0]
  ------------------
  357|    589|        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 (357:9): [True: 11, False: 578]
  ------------------
  358|     11|      std::stringstream sstr;
  359|     11|      sstr << "Tiling size "
  360|     11|           << ((uint64_t)num_tile_cols_minus_one + 1) << " x " << ((uint64_t)num_tile_rows_minus_one + 1)
  361|     11|           << " exceeds the maximum allowed number " << limits->max_number_of_tiles << " set as security limit";
  362|     11|      return {heif_error_Memory_allocation_error,
  363|     11|              heif_suberror_Security_limit_exceeded,
  364|     11|              sstr.str()};
  365|     11|    }
  366|       |
  367|    578|    m_num_tile_cols = num_tile_cols_minus_one + 1;
  368|    578|    m_num_tile_rows = num_tile_rows_minus_one + 1;
  369|    578|  }
  370|       |
  371|  2.98k|  return range.get_error();
  372|  3.61k|}
_ZNK8Box_uncC4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  377|  2.82k|{
  378|  2.82k|  Box::dump(sstr, indent, full_log);
  379|       |
  380|  2.82k|  sstr << indent << "profile: " << m_profile;
  381|  2.82k|  if (m_profile != 0) {
  ------------------
  |  Branch (381:7): [True: 2.55k, False: 277]
  ------------------
  382|  2.55k|    sstr << " (" << fourcc_to_string(m_profile) << ")";
  383|  2.55k|  }
  384|  2.82k|  sstr << "\n";
  385|  2.82k|  if (get_version() == 0) {
  ------------------
  |  Branch (385:7): [True: 516, False: 2.31k]
  ------------------
  386|  1.62k|    for (const auto& component : m_components) {
  ------------------
  |  Branch (386:32): [True: 1.62k, False: 516]
  ------------------
  387|  1.62k|      sstr << indent << "component_index: " << component.component_index << "\n";
  388|  1.62k|      indent++;
  389|  1.62k|      sstr << indent << "component_bit_depth: " << (int) component.component_bit_depth << "\n";
  390|  1.62k|      sstr << indent << "component_format: " << get_name(heif_uncompressed_component_format(component.component_format), sNames_uncompressed_component_format) << "\n";
  391|  1.62k|      sstr << indent << "component_align_size: " << (int) component.component_align_size << "\n";
  392|  1.62k|      indent--;
  393|  1.62k|    }
  394|       |
  395|    516|    sstr << indent << "sampling_type: " << get_name(heif_uncompressed_sampling_mode(m_sampling_type), sNames_uncompressed_sampling_mode) << "\n";
  396|       |
  397|    516|    sstr << indent << "interleave_type: " << get_name(heif_uncompressed_interleave_mode(m_interleave_type), sNames_uncompressed_interleave_mode) << "\n";
  398|       |
  399|    516|    sstr << indent << "block_size: " << (int) m_block_size << "\n";
  400|       |
  401|    516|    sstr << indent << "components_little_endian: " << m_components_little_endian << "\n";
  402|    516|    sstr << indent << "block_pad_lsb: " << m_block_pad_lsb << "\n";
  403|    516|    sstr << indent << "block_little_endian: " << m_block_little_endian << "\n";
  404|    516|    sstr << indent << "block_reversed: " << m_block_reversed << "\n";
  405|    516|    sstr << indent << "pad_unknown: " << m_pad_unknown << "\n";
  406|       |
  407|    516|    sstr << indent << "pixel_size: " << m_pixel_size << "\n";
  408|       |
  409|    516|    sstr << indent << "row_align_size: " << m_row_align_size << "\n";
  410|       |
  411|    516|    sstr << indent << "tile_align_size: " << m_tile_align_size << "\n";
  412|       |
  413|    516|    sstr << indent << "num_tile_cols: " << m_num_tile_cols << "\n";
  414|       |
  415|    516|    sstr << indent << "num_tile_rows: " << m_num_tile_rows << "\n";
  416|    516|  }
  417|  2.82k|  return;
  418|  2.82k|}
_ZN8Box_cmpC5parseER14BitstreamRangePK20heif_security_limits:
  748|    633|{
  749|    633|  parse_full_box_header(range);
  750|       |
  751|    633|  if (get_version() != 0) {
  ------------------
  |  Branch (751:7): [True: 5, False: 628]
  ------------------
  752|      5|    return unsupported_version_error("cmpC");
  753|      5|  }
  754|       |
  755|    628|  m_compression_type = range.read32();
  756|       |
  757|    628|  uint8_t unit_type = range.read8();
  758|    628|  if (unit_type > heif_cmpC_compressed_unit_type_image_pixel) {
  ------------------
  |  Branch (758:7): [True: 1, False: 627]
  ------------------
  759|      1|    return {heif_error_Invalid_input,
  760|      1|            heif_suberror_Unsupported_parameter,
  761|      1|            "Unsupported cmpC compressed unit type"};
  762|    627|  };
  763|       |
  764|    627|  m_compressed_unit_type = static_cast<heif_cmpC_compressed_unit_type>(unit_type);
  765|       |
  766|    627|  return range.get_error();
  767|    628|}
_ZNK8Box_cmpC4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  771|    403|{
  772|    403|  Box::dump(sstr, indent, full_log);
  773|    403|  sstr << indent << "compression_type: " << fourcc_to_string(m_compression_type) << "\n";
  774|    403|  sstr << indent << "compressed_entity_type: " << (int)m_compressed_unit_type << "\n";
  775|    403|  return;
  776|    403|}
_ZN8Box_icef5parseER14BitstreamRangePK20heif_security_limits:
  795|    757|{
  796|    757|  parse_full_box_header(range);
  797|       |
  798|    757|  if (get_version() != 0) {
  ------------------
  |  Branch (798:7): [True: 7, False: 750]
  ------------------
  799|      7|    return unsupported_version_error("icef");
  800|      7|  }
  801|    750|  uint8_t codes = range.read8();
  802|    750|  uint8_t unit_offset_code = (codes & 0b11100000) >> 5;
  803|    750|  uint8_t unit_size_code = (codes & 0b00011100) >> 2;
  804|    750|  uint32_t num_compressed_units = range.read32();
  805|    750|  uint64_t implied_offset = 0;
  806|       |
  807|    750|  if (unit_offset_code > 4) {
  ------------------
  |  Branch (807:7): [True: 2, False: 748]
  ------------------
  808|      2|    return {heif_error_Usage_error, heif_suberror_Unsupported_parameter, "Unsupported icef unit offset code"};
  809|      2|  }
  810|       |
  811|    748|  if (unit_size_code > 4) {
  ------------------
  |  Branch (811:7): [True: 4, False: 744]
  ------------------
  812|      4|    return {heif_error_Usage_error, heif_suberror_Unsupported_parameter, "Unsupported icef unit size code"};
  813|      4|  }
  814|       |
  815|       |  // --- precompute fields lengths
  816|       |
  817|    744|  uint8_t unit_offset_bits = unit_offset_bits_table[unit_offset_code];
  818|    744|  uint8_t unit_size_bits = unit_size_bits_table[unit_size_code];
  819|       |
  820|       |  // --- check if box is large enough for all the data
  821|       |
  822|       |  // range.get_remaining_bytes() is bounded by the real file size: Box::read() rejects any box whose
  823|       |  // declared size exceeds either the bytes actually available in the file (wait_for_available_bytes())
  824|       |  // or the parent box's remaining bytes. So this check already prevents an unbounded allocation:
  825|       |  // num_compressed_units cannot exceed the bytes present in the file.
  826|       |  // It is, however, not sufficient on its own. With unit_offset_code==0 and unit_size_code==0 a unit
  827|       |  // occupies only 1 byte in the file but allocates a 16-byte CompressedUnitInfo, a ~16x amplification
  828|       |  // that bypasses the configured memory budget. The alloc() below therefore additionally enforces the
  829|       |  // security limits (mirroring Box_snuc).
  830|       |
  831|    744|  uint64_t data_size_bytes = static_cast<uint64_t>(num_compressed_units) * (unit_offset_bits + unit_size_bits) / 8;
  832|    744|  if (data_size_bytes > range.get_remaining_bytes()) {
  ------------------
  |  Branch (832:7): [True: 52, False: 692]
  ------------------
  833|     52|    uint64_t contained_units = range.get_remaining_bytes() / ((unit_offset_bits + unit_size_bits) * 8);
  834|     52|    std::stringstream sstr;
  835|     52|    sstr << "icef box declares " << num_compressed_units << " units, but only " << contained_units
  836|     52|         << " were contained in the file";
  837|     52|    return {heif_error_Invalid_input,
  838|     52|            heif_suberror_End_of_data,
  839|     52|            sstr.str()};
  840|     52|  }
  841|       |
  842|       |  // --- read box content
  843|       |
  844|    692|  if (auto err = m_memory_handle.alloc(num_compressed_units, sizeof(CompressedUnitInfo),
  ------------------
  |  Branch (844:12): [True: 0, False: 692]
  ------------------
  845|    692|                                       limits, "icef box compressed unit infos")) {
  846|      0|    return err;
  847|      0|  }
  848|       |
  849|    692|  m_unit_infos.resize(num_compressed_units);
  850|       |
  851|   520k|  for (uint32_t r = 0; r < num_compressed_units; r++) {
  ------------------
  |  Branch (851:24): [True: 519k, False: 688]
  ------------------
  852|   519k|    CompressedUnitInfo unitInfo;
  853|   519k|    if (unit_offset_code == 0) {
  ------------------
  |  Branch (853:9): [True: 519k, False: 393]
  ------------------
  854|   519k|      unitInfo.unit_offset = implied_offset;
  855|   519k|    } else {
  856|    393|      unitInfo.unit_offset = range.read_uint(unit_offset_bits);
  857|    393|    }
  858|       |
  859|   519k|    unitInfo.unit_size = range.read_uint(unit_size_bits);
  860|       |
  861|       |    // Reject unit_offset + unit_size wrapping past the 64 bit range.
  862|   519k|    if (unitInfo.unit_size >= UINT64_MAX - unitInfo.unit_offset) {
  ------------------
  |  Branch (862:9): [True: 4, False: 519k]
  ------------------
  863|      4|      return {heif_error_Invalid_input,
  864|      4|              heif_suberror_Invalid_parameter_value,
  865|      4|              "icef unit offset + size exceeds 64 bit range"};
  866|      4|    }
  867|       |
  868|       |    // implied_offset is only used as unit_offset when unit_offset_code==0.
  869|       |    // Accumulating it for other offset codes would be unused and could overflow, so only do it if needed.
  870|   519k|    if (unit_offset_code == 0) {
  ------------------
  |  Branch (870:9): [True: 519k, False: 392]
  ------------------
  871|   519k|      implied_offset += unitInfo.unit_size;
  872|   519k|    }
  873|       |
  874|   519k|    if (range.get_error() != Error::Ok) {
  ------------------
  |  Branch (874:9): [True: 0, False: 519k]
  ------------------
  875|      0|      return range.get_error();
  876|      0|    }
  877|       |
  878|   519k|    m_unit_infos[r] = unitInfo;
  879|   519k|  }
  880|       |
  881|    688|  return range.get_error();
  882|    692|}
_ZNK8Box_icef4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  886|    645|{
  887|    645|  Box::dump(sstr, indent, full_log);
  888|    645|  sstr << indent << "num_compressed_units: " << m_unit_infos.size() << "\n";
  889|   518k|  for (CompressedUnitInfo unit_info: m_unit_infos) {
  ------------------
  |  Branch (889:36): [True: 518k, False: 645]
  ------------------
  890|   518k|    sstr << indent << "unit_offset: " << unit_info.unit_offset << ", unit_size: " << unit_info.unit_size << "\n";
  891|   518k|  }
  892|    645|  return;
  893|    645|}
_ZN8Box_cpat5parseER14BitstreamRangePK20heif_security_limits:
 1010|    480|{
 1011|    480|  parse_full_box_header(range);
 1012|       |
 1013|    480|  if (get_version() != 0) {
  ------------------
  |  Branch (1013:7): [True: 6, False: 474]
  ------------------
 1014|      6|    return unsupported_version_error("cpat");
 1015|      6|  }
 1016|       |
 1017|    474|  m_pattern.pattern_width = range.read16();
 1018|    474|  m_pattern.pattern_height = range.read16();
 1019|       |
 1020|    474|  if (m_pattern.pattern_width == 0 || m_pattern.pattern_height == 0) {
  ------------------
  |  Branch (1020:7): [True: 3, False: 471]
  |  Branch (1020:39): [True: 13, False: 458]
  ------------------
 1021|     16|    return {heif_error_Invalid_input,
 1022|     16|            heif_suberror_Invalid_parameter_value,
 1023|     16|            "Zero Bayer pattern size."};
 1024|     16|  }
 1025|       |
 1026|    458|  auto max_bayer_pattern_size = limits->max_bayer_pattern_pixels;
 1027|    458|  if (max_bayer_pattern_size && m_pattern.pattern_height > max_bayer_pattern_size / m_pattern.pattern_width) {
  ------------------
  |  Branch (1027:7): [True: 458, False: 0]
  |  Branch (1027:33): [True: 11, False: 447]
  ------------------
 1028|     11|    return {heif_error_Invalid_input,
 1029|     11|            heif_suberror_Security_limit_exceeded,
 1030|     11|            "Maximum Bayer pattern size exceeded."};
 1031|     11|  }
 1032|       |
 1033|    447|  size_t num_pixels = size_t{m_pattern.pattern_width} * m_pattern.pattern_height;
 1034|    447|  m_pattern.pixels.resize(num_pixels);
 1035|       |
 1036|  2.89k|  for (size_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1036:22): [True: 2.44k, False: 447]
  ------------------
 1037|  2.44k|    BayerPatternPixelCmpd pixel{};
 1038|  2.44k|    pixel.cmpd_index = range.read32();
 1039|  2.44k|    pixel.component_gain = range.read_float32();
 1040|  2.44k|    m_pattern.pixels[i] = pixel;
 1041|  2.44k|  }
 1042|       |
 1043|    447|  return range.get_error();
 1044|    458|}
_ZNK8Box_cpat4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1048|    430|{
 1049|       |
 1050|    430|  FullBox::dump(sstr, indent, full_log);
 1051|    430|  sstr << indent << "pattern_width: " << get_pattern_width() << "\n";
 1052|    430|  sstr << indent << "pattern_height: " << get_pattern_height() << "\n";
 1053|       |
 1054|  1.22k|  for (const auto& pixel : m_pattern.pixels) {
  ------------------
  |  Branch (1054:26): [True: 1.22k, False: 430]
  ------------------
 1055|  1.22k|    sstr << indent << "component index: " << pixel.cmpd_index << ", gain: " << pixel.component_gain << "\n";
 1056|  1.22k|  }
 1057|    430|  return;
 1058|    430|}
_ZN8Box_splz5parseER14BitstreamRangePK20heif_security_limits:
 1086|  1.01k|{
 1087|  1.01k|  parse_full_box_header(range);
 1088|       |
 1089|  1.01k|  if (get_version() != 0) {
  ------------------
  |  Branch (1089:7): [True: 8, False: 1.00k]
  ------------------
 1090|      8|    return unsupported_version_error("splz");
 1091|      8|  }
 1092|       |
 1093|  1.00k|  uint32_t component_count = range.read32();
 1094|  1.00k|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1094:7): [True: 1.00k, False: 0]
  |  Branch (1094:33): [True: 49, False: 959]
  ------------------
 1095|     49|    return {heif_error_Invalid_input,
 1096|     49|            heif_suberror_Security_limit_exceeded,
 1097|     49|            "Number of components in splz box exceeds the security limits."};
 1098|     49|  }
 1099|       |
 1100|    959|  m_pattern.component_ids.resize(component_count);
 1101|  3.69k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1101:24): [True: 2.74k, False: 959]
  ------------------
 1102|  2.74k|    m_pattern.component_ids[i] = range.read32();
 1103|  2.74k|  }
 1104|       |
 1105|    959|  m_pattern.pattern_width = range.read16();
 1106|    959|  m_pattern.pattern_height = range.read16();
 1107|       |
 1108|    959|  if (m_pattern.pattern_width == 0 || m_pattern.pattern_height == 0) {
  ------------------
  |  Branch (1108:7): [True: 16, False: 943]
  |  Branch (1108:39): [True: 2, False: 941]
  ------------------
 1109|     18|    return {heif_error_Invalid_input,
 1110|     18|            heif_suberror_Invalid_parameter_value,
 1111|     18|            "Zero polarization pattern size."};
 1112|     18|  }
 1113|       |
 1114|    941|  auto max_pattern_size = limits->max_bayer_pattern_pixels;
 1115|    941|  if (max_pattern_size && m_pattern.pattern_height > max_pattern_size / m_pattern.pattern_width) {
  ------------------
  |  Branch (1115:7): [True: 941, False: 0]
  |  Branch (1115:27): [True: 13, False: 928]
  ------------------
 1116|     13|    return {heif_error_Invalid_input,
 1117|     13|            heif_suberror_Security_limit_exceeded,
 1118|     13|            "Maximum polarization pattern size exceeded."};
 1119|     13|  }
 1120|       |
 1121|    928|  size_t num_pixels = size_t{m_pattern.pattern_width} * m_pattern.pattern_height;
 1122|    928|  m_pattern.polarization_angles.resize(num_pixels);
 1123|       |
 1124|  39.2k|  for (size_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1124:22): [True: 38.2k, False: 928]
  ------------------
 1125|  38.2k|    m_pattern.polarization_angles[i] = range.read_float32();
 1126|  38.2k|  }
 1127|       |
 1128|    928|  return range.get_error();
 1129|    941|}
_ZNK8Box_splz4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1133|    680|{
 1134|       |
 1135|    680|  FullBox::dump(sstr, indent, full_log);
 1136|       |
 1137|    680|  sstr << indent << "component_count: " << m_pattern.component_ids.size() << "\n";
 1138|  2.32k|  for (size_t i = 0; i < m_pattern.component_ids.size(); i++) {
  ------------------
  |  Branch (1138:22): [True: 1.64k, False: 680]
  ------------------
 1139|  1.64k|    sstr << indent << "  component_index[" << i << "]: " << m_pattern.component_ids[i] << "\n";
 1140|  1.64k|  }
 1141|       |
 1142|    680|  sstr << indent << "pattern_width: " << m_pattern.pattern_width << "\n";
 1143|    680|  sstr << indent << "pattern_height: " << m_pattern.pattern_height << "\n";
 1144|       |
 1145|  10.2k|  for (uint16_t y = 0; y < m_pattern.pattern_height; y++) {
  ------------------
  |  Branch (1145:24): [True: 9.61k, False: 680]
  ------------------
 1146|  45.5k|    for (uint16_t x = 0; x < m_pattern.pattern_width; x++) {
  ------------------
  |  Branch (1146:26): [True: 35.9k, False: 9.61k]
  ------------------
 1147|  35.9k|      float angle = m_pattern.polarization_angles[y * m_pattern.pattern_width + x];
 1148|  35.9k|      if (heif_polarization_angle_is_no_filter(angle)) {
  ------------------
  |  Branch (1148:11): [True: 1.00k, False: 34.9k]
  ------------------
 1149|  1.00k|        sstr << indent << "  [" << x << "," << y << "]: no filter\n";
 1150|  1.00k|      }
 1151|  34.9k|      else {
 1152|  34.9k|        sstr << indent << "  [" << x << "," << y << "]: " << angle << " degrees\n";
 1153|  34.9k|      }
 1154|  35.9k|    }
 1155|  9.61k|  }
 1156|       |
 1157|    680|  return;
 1158|    680|}
_ZN8Box_sbpm5parseER14BitstreamRangePK20heif_security_limits:
 1190|    598|{
 1191|    598|  parse_full_box_header(range);
 1192|       |
 1193|    598|  if (get_version() != 0) {
  ------------------
  |  Branch (1193:7): [True: 1, False: 597]
  ------------------
 1194|      1|    return unsupported_version_error("sbpm");
 1195|      1|  }
 1196|       |
 1197|    597|  uint32_t component_count = range.read32();
 1198|       |
 1199|    597|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1199:7): [True: 597, False: 0]
  |  Branch (1199:33): [True: 44, False: 553]
  ------------------
 1200|     44|    return {heif_error_Invalid_input,
 1201|     44|            heif_suberror_Security_limit_exceeded,
 1202|     44|            "sbpm component_count exceeds security limit."};
 1203|     44|  }
 1204|       |
 1205|    553|  m_map.component_ids.resize(component_count);
 1206|  2.04k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1206:24): [True: 1.49k, False: 553]
  ------------------
 1207|  1.49k|    m_map.component_ids[i] = range.read32();
 1208|  1.49k|  }
 1209|       |
 1210|    553|  uint8_t flags = range.read8();
 1211|    553|  m_map.correction_applied = !!(flags & 0x80);
 1212|       |
 1213|    553|  uint32_t num_bad_rows = range.read32();
 1214|    553|  uint32_t num_bad_cols = range.read32();
 1215|    553|  uint32_t num_bad_pixels = range.read32();
 1216|       |
 1217|       |  // Security check: limit total number of entries
 1218|    553|  uint64_t total_entries = static_cast<uint64_t>(num_bad_rows) + num_bad_cols + num_bad_pixels;
 1219|    553|  if (limits->max_bad_pixels && total_entries > limits->max_bad_pixels) {
  ------------------
  |  Branch (1219:7): [True: 553, False: 0]
  |  Branch (1219:33): [True: 46, False: 507]
  ------------------
 1220|     46|    return {heif_error_Invalid_input,
 1221|     46|            heif_suberror_Security_limit_exceeded,
 1222|     46|            "sbpm total bad pixel entries exceed security limit."};
 1223|     46|  }
 1224|       |
 1225|    507|  m_map.bad_rows.resize(num_bad_rows);
 1226|  3.94k|  for (uint32_t i = 0; i < num_bad_rows; i++) {
  ------------------
  |  Branch (1226:24): [True: 3.44k, False: 507]
  ------------------
 1227|  3.44k|    m_map.bad_rows[i] = range.read32();
 1228|  3.44k|  }
 1229|       |
 1230|    507|  m_map.bad_columns.resize(num_bad_cols);
 1231|  3.79k|  for (uint32_t i = 0; i < num_bad_cols; i++) {
  ------------------
  |  Branch (1231:24): [True: 3.28k, False: 507]
  ------------------
 1232|  3.28k|    m_map.bad_columns[i] = range.read32();
 1233|  3.28k|  }
 1234|       |
 1235|    507|  m_map.bad_pixels.resize(num_bad_pixels);
 1236|  3.60k|  for (uint32_t i = 0; i < num_bad_pixels; i++) {
  ------------------
  |  Branch (1236:24): [True: 3.09k, False: 507]
  ------------------
 1237|  3.09k|    m_map.bad_pixels[i].row = range.read32();
 1238|  3.09k|    m_map.bad_pixels[i].column = range.read32();
 1239|  3.09k|  }
 1240|       |
 1241|    507|  return range.get_error();
 1242|    553|}
_ZNK8Box_sbpm4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1246|    410|{
 1247|       |
 1248|    410|  FullBox::dump(sstr, indent, full_log);
 1249|       |
 1250|    410|  sstr << indent << "component_count: " << m_map.component_ids.size() << "\n";
 1251|  1.10k|  for (size_t i = 0; i < m_map.component_ids.size(); i++) {
  ------------------
  |  Branch (1251:22): [True: 691, False: 410]
  ------------------
 1252|    691|    sstr << indent << "  component_index[" << i << "]: " << m_map.component_ids[i] << "\n";
 1253|    691|  }
 1254|       |
 1255|    410|  sstr << indent << "correction_applied: " << m_map.correction_applied << "\n";
 1256|       |
 1257|    410|  sstr << indent << "num_bad_rows: " << m_map.bad_rows.size() << "\n";
 1258|  1.15k|  for (size_t i = 0; i < m_map.bad_rows.size(); i++) {
  ------------------
  |  Branch (1258:22): [True: 744, False: 410]
  ------------------
 1259|    744|    sstr << indent << "  bad_row[" << i << "]: " << m_map.bad_rows[i] << "\n";
 1260|    744|  }
 1261|       |
 1262|    410|  sstr << indent << "num_bad_columns: " << m_map.bad_columns.size() << "\n";
 1263|  1.19k|  for (size_t i = 0; i < m_map.bad_columns.size(); i++) {
  ------------------
  |  Branch (1263:22): [True: 788, False: 410]
  ------------------
 1264|    788|    sstr << indent << "  bad_column[" << i << "]: " << m_map.bad_columns[i] << "\n";
 1265|    788|  }
 1266|       |
 1267|    410|  sstr << indent << "num_bad_pixels: " << m_map.bad_pixels.size() << "\n";
 1268|  1.93k|  for (size_t i = 0; i < m_map.bad_pixels.size(); i++) {
  ------------------
  |  Branch (1268:22): [True: 1.52k, False: 410]
  ------------------
 1269|  1.52k|    sstr << indent << "  bad_pixel[" << i << "]: row=" << m_map.bad_pixels[i].row
 1270|  1.52k|         << ", column=" << m_map.bad_pixels[i].column << "\n";
 1271|  1.52k|  }
 1272|       |
 1273|    410|  return;
 1274|    410|}
_ZN8Box_snuc5parseER14BitstreamRangePK20heif_security_limits:
 1313|    360|{
 1314|    360|  parse_full_box_header(range);
 1315|       |
 1316|    360|  if (get_version() != 0) {
  ------------------
  |  Branch (1316:7): [True: 1, False: 359]
  ------------------
 1317|      1|    return unsupported_version_error("snuc");
 1318|      1|  }
 1319|       |
 1320|    359|  uint32_t component_count = range.read32();
 1321|       |
 1322|    359|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1322:7): [True: 359, False: 0]
  |  Branch (1322:33): [True: 35, False: 324]
  ------------------
 1323|     35|    return {heif_error_Invalid_input,
 1324|     35|            heif_suberror_Security_limit_exceeded,
 1325|     35|            "snuc component_count exceeds security limit."};
 1326|     35|  }
 1327|       |
 1328|    324|  m_nuc.component_ids.resize(component_count);
 1329|  2.18k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1329:24): [True: 1.85k, False: 324]
  ------------------
 1330|  1.85k|    m_nuc.component_ids[i] = range.read32();
 1331|  1.85k|  }
 1332|       |
 1333|    324|  uint8_t flags = range.read8();
 1334|    324|  m_nuc.nuc_is_applied = !!(flags & 0x80);
 1335|       |
 1336|    324|  m_nuc.image_width = range.read32();
 1337|    324|  m_nuc.image_height = range.read32();
 1338|       |
 1339|    324|  if (m_nuc.image_width == 0 || m_nuc.image_height == 0) {
  ------------------
  |  Branch (1339:7): [True: 15, False: 309]
  |  Branch (1339:33): [True: 27, False: 282]
  ------------------
 1340|     42|    return {heif_error_Invalid_input,
 1341|     42|            heif_suberror_Invalid_parameter_value,
 1342|     42|            "snuc image width and height must be non-zero."};
 1343|     42|  }
 1344|       |
 1345|    282|  uint64_t num_pixels = static_cast<uint64_t>(m_nuc.image_width) * m_nuc.image_height;
 1346|       |
 1347|    282|  if (limits->max_image_size_pixels && num_pixels > limits->max_image_size_pixels) {
  ------------------
  |  Branch (1347:7): [True: 282, False: 0]
  |  Branch (1347:40): [True: 40, False: 242]
  ------------------
 1348|     40|    return {heif_error_Invalid_input,
 1349|     40|            heif_suberror_Security_limit_exceeded,
 1350|     40|            "snuc image dimensions exceed security limit."};
 1351|     40|  }
 1352|       |
 1353|    242|  Error err = m_memory_handle.alloc(num_pixels, 2 * sizeof(float), limits, "snuc box");
 1354|    242|  if (err) {
  ------------------
  |  Branch (1354:7): [True: 6, False: 236]
  ------------------
 1355|      6|    return err;
 1356|      6|  }
 1357|       |
 1358|    236|  m_nuc.nuc_gains.resize(num_pixels);
 1359|   347M|  for (uint64_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1359:24): [True: 347M, False: 236]
  ------------------
 1360|   347M|    m_nuc.nuc_gains[i] = range.read_float32();
 1361|   347M|  }
 1362|       |
 1363|    236|  m_nuc.nuc_offsets.resize(num_pixels);
 1364|   347M|  for (uint64_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1364:24): [True: 347M, False: 236]
  ------------------
 1365|   347M|    m_nuc.nuc_offsets[i] = range.read_float32();
 1366|   347M|  }
 1367|       |
 1368|    236|  return range.get_error();
 1369|    242|}
_ZNK8Box_snuc4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1373|    211|{
 1374|       |
 1375|    211|  FullBox::dump(sstr, indent, full_log);
 1376|       |
 1377|    211|  sstr << indent << "component_count: " << m_nuc.component_ids.size() << "\n";
 1378|  1.01k|  for (size_t i = 0; i < m_nuc.component_ids.size(); i++) {
  ------------------
  |  Branch (1378:22): [True: 808, False: 211]
  ------------------
 1379|    808|    sstr << indent << "  component_index[" << i << "]: " << m_nuc.component_ids[i] << "\n";
 1380|    808|  }
 1381|       |
 1382|    211|  sstr << indent << "nuc_is_applied: " << m_nuc.nuc_is_applied << "\n";
 1383|    211|  sstr << indent << "image_width: " << m_nuc.image_width << "\n";
 1384|    211|  sstr << indent << "image_height: " << m_nuc.image_height << "\n";
 1385|       |
 1386|    211|  uint64_t num_pixels = static_cast<uint64_t>(m_nuc.image_width) * m_nuc.image_height;
 1387|    211|  sstr << indent << "nuc_gains: " << num_pixels << " values\n";
 1388|    211|  sstr << indent << "nuc_offsets: " << num_pixels << " values\n";
 1389|       |
 1390|    211|  return;
 1391|    211|}
_ZN8Box_cloc5parseER14BitstreamRangePK20heif_security_limits:
 1424|    363|{
 1425|    363|  parse_full_box_header(range);
 1426|       |
 1427|    363|  if (get_version() != 0) {
  ------------------
  |  Branch (1427:7): [True: 1, False: 362]
  ------------------
 1428|      1|    return unsupported_version_error("cloc");
 1429|      1|  }
 1430|       |
 1431|    362|  m_chroma_location = range.read8();
 1432|       |
 1433|    362|  if (m_chroma_location > 6) {
  ------------------
  |  Branch (1433:7): [True: 4, False: 358]
  ------------------
 1434|      4|    return {heif_error_Invalid_input,
 1435|      4|            heif_suberror_Invalid_parameter_value,
 1436|      4|            "cloc chroma_location value out of range (must be 0-6)."};
 1437|      4|  }
 1438|       |
 1439|    358|  return range.get_error();
 1440|    362|}
_ZNK8Box_cloc4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1444|    269|{
 1445|       |
 1446|    269|  FullBox::dump(sstr, indent, full_log);
 1447|       |
 1448|    269|  static const char* location_names[] = {
 1449|    269|    "h=0,   v=0.5",   // 0
 1450|    269|    "h=0.5, v=0.5",   // 1
 1451|    269|    "h=0,   v=0",     // 2
 1452|    269|    "h=0.5, v=0",     // 3
 1453|    269|    "h=0,   v=1",     // 4
 1454|    269|    "h=0.5, v=1",     // 5
 1455|    269|    "Cr:0,0 / Cb:1,0" // 6
 1456|    269|  };
 1457|       |
 1458|    269|  sstr << indent << "chroma_location: " << static_cast<int>(m_chroma_location);
 1459|    269|  if (m_chroma_location <= 6) {
  ------------------
  |  Branch (1459:7): [True: 269, False: 0]
  ------------------
 1460|    269|    sstr << " (" << location_names[m_chroma_location] << ")";
 1461|    269|  }
 1462|    269|  sstr << "\n";
 1463|       |
 1464|    269|  return;
 1465|    269|}
_ZN30Box_gimi_component_content_ids5parseER14BitstreamRangePK20heif_security_limits:
 1481|  1.03k|{
 1482|  1.03k|  uint32_t number_of_components = range.read32();
 1483|       |
 1484|  1.03k|  if (limits->max_components && number_of_components > limits->max_components) {
  ------------------
  |  Branch (1484:7): [True: 1.03k, False: 0]
  |  Branch (1484:33): [True: 83, False: 954]
  ------------------
 1485|     83|    std::stringstream sstr;
 1486|     83|    sstr << "GIMI component content IDs box contains " << number_of_components
 1487|     83|         << " components, but security limit is set to " << limits->max_components << " components";
 1488|     83|    return {heif_error_Invalid_input,
 1489|     83|            heif_suberror_Security_limit_exceeded,
 1490|     83|            sstr.str()};
 1491|     83|  }
 1492|       |
 1493|  6.68k|  for (uint32_t i = 0; i < number_of_components; i++) {
  ------------------
  |  Branch (1493:24): [True: 5.87k, False: 809]
  ------------------
 1494|  5.87k|    if (range.eof()) {
  ------------------
  |  Branch (1494:9): [True: 145, False: 5.73k]
  ------------------
 1495|    145|      return {heif_error_Invalid_input,
 1496|    145|              heif_suberror_End_of_data,
 1497|    145|              "Not enough data for all component content IDs"};
 1498|    145|    }
 1499|  5.73k|    m_content_ids.push_back(range.read_string());
 1500|  5.73k|  }
 1501|       |
 1502|    809|  return range.get_error();
 1503|    954|}
_ZNK30Box_gimi_component_content_ids4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1523|    744|{
 1524|    744|  Box::dump(sstr, indent, full_log);
 1525|       |
 1526|  4.41k|  for (size_t i = 0; i < m_content_ids.size(); i++) {
  ------------------
  |  Branch (1526:22): [True: 3.67k, False: 744]
  ------------------
 1527|  3.67k|    sstr << indent << "[" << i << "] content ID: " << m_content_ids[i] << "\n";
 1528|  3.67k|  }
 1529|       |
 1530|    744|  return;
 1531|    744|}
_Z8get_nameI24heif_cmpd_component_typeEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|  1.99k|{
  124|  1.99k|  auto iter = table.find(val);
  125|  1.99k|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 1.99k]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|  1.99k|  else {
  129|  1.99k|    return iter->second;
  130|  1.99k|  }
  131|  1.99k|}
_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|    516|{
  124|    516|  auto iter = table.find(val);
  125|    516|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 516]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|    516|  else {
  129|    516|    return iter->second;
  130|    516|  }
  131|    516|}
_Z8get_nameI33heif_uncompressed_interleave_modeEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|    516|{
  124|    516|  auto iter = table.find(val);
  125|    516|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 516]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|    516|  else {
  129|    516|    return iter->second;
  130|    516|  }
  131|    516|}

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

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

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

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

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

_ZN11HeifContextC2Ev:
  164|  15.0k|    : m_limits(initial_security_limits()),
  165|  15.0k|      m_memory_tracker(&m_limits)
  166|  15.0k|{
  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|  15.0k|  reset_to_empty_heif();
  171|  15.0k|}
_ZN11HeifContextD2Ev:
  175|  15.0k|{
  176|       |  // Break circular references between Images (when a faulty input image has circular image references)
  177|  15.0k|  for (auto& it : m_all_images) {
  ------------------
  |  Branch (177:17): [True: 0, False: 15.0k]
  ------------------
  178|      0|    std::shared_ptr<ImageItem> image = it.second;
  179|      0|    image->clear();
  180|      0|  }
  181|  15.0k|}
_ZN11HeifContext19reset_to_empty_heifEv:
  290|  15.0k|{
  291|  15.0k|  m_heif_file = std::make_shared<HeifFile>();
  292|  15.0k|  m_heif_file->set_security_limits(&m_limits);
  293|  15.0k|  m_heif_file->new_empty_file();
  294|       |
  295|  15.0k|  m_all_images.clear();
  296|  15.0k|  m_top_level_images.clear();
  297|  15.0k|  m_primary_image.reset();
  298|  15.0k|}
context.cc:_ZL23initial_security_limitsv:
  150|  15.0k|{
  151|  15.0k|  const char* security_limits_variable = getenv("LIBHEIF_SECURITY_LIMITS");
  152|       |
  153|  15.0k|  if (security_limits_variable && (strcmp(security_limits_variable, "off") == 0 ||
  ------------------
  |  Branch (153:7): [True: 0, False: 15.0k]
  |  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|  15.0k|  else {
  158|  15.0k|    return global_security_limits;
  159|  15.0k|  }
  160|  15.0k|}

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

_ZN5ErrorC2Ev:
   58|  32.1k|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|   862k|  bool operator!=(const Error& other) const { return !(*this == other); }
_ZNK5ErroreqERKS_:
  101|  1.17M|  bool operator==(const Error& other) const { return error_code == other.error_code; }
_ZNK5ErrorcvbEv:
  117|   419k|  explicit operator bool() const { return error_code != heif_error_Ok; }
_ZN6ResultI8FractionEC2ERK5Error:
  141|  3.80k|  Result(const Error& e) : m_data(e) {}
_ZN6ResultI8FractionEC2ES0_:
  139|  1.85k|  Result(T v) : m_data(std::move(v)) {}
_ZNK6ResultI8FractionEcvbEv:
  147|  4.80k|  explicit operator bool() const { return std::holds_alternative<T>(m_data); }
_ZNK6ResultI8FractionE5errorEv:
  171|  1.17k|  {
  172|  1.17k|    if (*this) {
  ------------------
  |  Branch (172:9): [True: 0, False: 1.17k]
  ------------------
  173|      0|      return Error::Ok;
  174|      0|    }
  175|       |
  176|  1.17k|    return std::get<Error>(m_data);
  177|  1.17k|  }
_ZN6ResultI8FractionEdeEv:
  160|    944|  {
  161|    944|    assert(*this);
  ------------------
  |  Branch (161:5): [True: 944, False: 0]
  ------------------
  162|    944|    return std::get<T>(m_data);
  163|    944|  }
_ZN11ErrorBufferC2Ev:
   52|  15.0k|  ErrorBuffer() = default;

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

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

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

_ZN8Box_mskC5parseER14BitstreamRangePK20heif_security_limits:
   37|    716|{
   38|    716|  parse_full_box_header(range);
   39|    716|  m_bits_per_pixel = range.read8();
   40|    716|  return range.get_error();
   41|    716|}
_ZNK8Box_mskC4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
   44|    451|{
   45|    451|  Box::dump(sstr, indent, full_log);
   46|    451|  sstr << indent << "bits_per_pixel: " << ((int)m_bits_per_pixel) << "\n";
   47|    451|  return;
   48|    451|}

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

_ZN8Box_tilC32init_heif_tiled_image_parametersER27heif_tiled_image_parameters:
  115|    787|{
  116|    787|  params.version = 1;
  117|       |
  118|    787|  params.image_width = 0;
  119|    787|  params.image_height = 0;
  120|    787|  params.tile_width = 0;
  121|    787|  params.tile_height = 0;
  122|    787|  params.compression_format_fourcc = 0;
  123|    787|  params.offset_field_length = 40;
  124|    787|  params.size_field_length = 24;
  125|    787|  params.number_of_extra_dimensions = 0;
  126|       |
  127|  6.29k|  for (uint32_t& dim : params.extra_dimensions) {
  ------------------
  |  Branch (127:22): [True: 6.29k, False: 787]
  ------------------
  128|  6.29k|    dim = 0;
  129|  6.29k|  }
  130|       |
  131|    787|  params.tiles_are_sequential = false;
  132|    787|}
_ZNK8Box_tilC4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  222|    474|{
  223|       |
  224|    474|  BoxHeader::dump(sstr, indent, full_log);
  225|       |
  226|    474|  sstr << indent << "version: " << ((int) get_version()) << "\n"
  227|       |       //<< indent << "image size: " << m_parameters.image_width << "x" << m_parameters.image_height << "\n"
  228|    474|       << indent << "tile size: " << m_parameters.tile_width << "x" << m_parameters.tile_height << "\n"
  229|    474|       << indent << "compression: " << fourcc_to_string(m_parameters.compression_format_fourcc) << "\n"
  230|    474|       << indent << "tiles are sequential: " << (m_parameters.tiles_are_sequential ? "yes" : "no") << "\n"
  ------------------
  |  Branch (230:50): [True: 65, False: 409]
  ------------------
  231|    474|       << indent << "offset field length: " << ((int) m_parameters.offset_field_length) << " bits\n"
  232|    474|       << indent << "size field length: " << ((int) m_parameters.size_field_length) << " bits\n"
  233|    474|       << indent << "number of extra dimensions: " << ((int) m_parameters.number_of_extra_dimensions) << "\n";
  234|       |
  235|    474|  sstr << indent << "tile properties:\n";
  236|    474|  dump_children(sstr, indent, full_log, true);
  237|    474|}
_ZN8Box_tilC5parseER14BitstreamRangePK20heif_security_limits:
  241|    785|{
  242|    785|  parse_full_box_header(range);
  243|       |
  244|       |  // Note: actually, we should allow 0 only, but there are a few images around that use version 1.
  245|    785|  if (get_version() > 1) {
  ------------------
  |  Branch (245:7): [True: 7, False: 778]
  ------------------
  246|      7|    std::stringstream sstr;
  247|      7|    sstr << "'tili' image version " << ((int) get_version()) << " is not implemented yet";
  248|       |
  249|      7|    return {heif_error_Unsupported_feature,
  250|      7|            heif_suberror_Unsupported_data_version,
  251|      7|            sstr.str()};
  252|      7|  }
  253|       |
  254|    778|  m_parameters.version = get_version();
  255|       |
  256|    778|  uint32_t flags = get_flags();
  257|       |
  258|    778|  switch (flags & 0x03) {
  ------------------
  |  Branch (258:11): [True: 778, False: 0]
  ------------------
  259|    532|    case 0:
  ------------------
  |  Branch (259:5): [True: 532, False: 246]
  ------------------
  260|    532|      m_parameters.offset_field_length = 32;
  261|    532|      break;
  262|     42|    case 1:
  ------------------
  |  Branch (262:5): [True: 42, False: 736]
  ------------------
  263|     42|      m_parameters.offset_field_length = 40;
  264|     42|      break;
  265|    118|    case 2:
  ------------------
  |  Branch (265:5): [True: 118, False: 660]
  ------------------
  266|    118|      m_parameters.offset_field_length = 48;
  267|    118|      break;
  268|     86|    case 3:
  ------------------
  |  Branch (268:5): [True: 86, False: 692]
  ------------------
  269|     86|      m_parameters.offset_field_length = 64;
  270|     86|      break;
  271|    778|  }
  272|       |
  273|    778|  switch (flags & 0x0c) {
  ------------------
  |  Branch (273:11): [True: 778, False: 0]
  ------------------
  274|    542|    case 0x00:
  ------------------
  |  Branch (274:5): [True: 542, False: 236]
  ------------------
  275|    542|      m_parameters.size_field_length = 0;
  276|    542|      break;
  277|     85|    case 0x04:
  ------------------
  |  Branch (277:5): [True: 85, False: 693]
  ------------------
  278|     85|      m_parameters.size_field_length = 24;
  279|     85|      break;
  280|     70|    case 0x08:
  ------------------
  |  Branch (280:5): [True: 70, False: 708]
  ------------------
  281|     70|      m_parameters.size_field_length = 32;
  282|     70|      break;
  283|     81|    case 0x0c:
  ------------------
  |  Branch (283:5): [True: 81, False: 697]
  ------------------
  284|     81|      m_parameters.size_field_length = 64;
  285|     81|      break;
  286|    778|  }
  287|       |
  288|    778|  m_parameters.tiles_are_sequential = !!(flags & 0x10);
  289|       |
  290|       |
  291|    778|  m_parameters.tile_width = range.read32();
  292|    778|  m_parameters.tile_height = range.read32();
  293|    778|  m_parameters.compression_format_fourcc = range.read32();
  294|       |
  295|    778|  if (m_parameters.tile_width == 0 || m_parameters.tile_height == 0) {
  ------------------
  |  Branch (295:7): [True: 10, False: 768]
  |  Branch (295:39): [True: 42, False: 726]
  ------------------
  296|     52|    return {heif_error_Invalid_input,
  297|     52|            heif_suberror_Unspecified,
  298|     52|            "Tile with zero width or height."};
  299|     52|  }
  300|       |
  301|       |
  302|       |  // --- extra dimensions
  303|       |
  304|    726|  m_parameters.number_of_extra_dimensions = range.read8();
  305|       |
  306|  1.78k|  for (int i = 0; i < m_parameters.number_of_extra_dimensions; i++) {
  ------------------
  |  Branch (306:19): [True: 1.11k, False: 674]
  ------------------
  307|  1.11k|    uint32_t size = range.read32();
  308|       |
  309|  1.11k|    if (size == 0) {
  ------------------
  |  Branch (309:9): [True: 52, False: 1.06k]
  ------------------
  310|     52|      return {heif_error_Invalid_input,
  311|     52|              heif_suberror_Unspecified,
  312|     52|              "'tili' extra dimension may not be zero."};
  313|     52|    }
  314|       |
  315|  1.06k|    if (i < 8) {
  ------------------
  |  Branch (315:9): [True: 724, False: 338]
  ------------------
  316|    724|      m_parameters.extra_dimensions[i] = size;
  317|    724|    }
  318|    338|    else {
  319|       |      // TODO: error: too many dimensions (not supported)
  320|    338|    }
  321|  1.06k|  }
  322|       |
  323|       |  // --- read tile properties
  324|       |
  325|       |  // Check version for backwards compatibility with old format.
  326|       |  // TODO: remove when spec is final and old test images have been converted
  327|    674|  if (get_version() == 0) {
  ------------------
  |  Branch (327:7): [True: 184, False: 490]
  ------------------
  328|    184|    uint8_t num_properties = range.read8();
  329|       |
  330|    184|    Error error = read_children(range, num_properties, limits);
  331|    184|    if (error) {
  ------------------
  |  Branch (331:9): [True: 129, False: 55]
  ------------------
  332|    129|      return error;
  333|    129|    }
  334|    184|  }
  335|       |
  336|    545|  return range.get_error();
  337|    674|}

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

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

_ZN6IndentC2Ev:
   46|   131k|  Indent() = default;
_ZNK6Indent10get_indentEv:
   48|  20.8M|  int get_indent() const { return m_indent; }
_ZN6IndentppEi:
   50|  60.4k|  void operator++(int) { m_indent++; }
_ZN6IndentmmEi:
   53|  60.4k|  {
   54|  60.4k|    m_indent--;
   55|  60.4k|    if (m_indent < 0) m_indent = 0;
  ------------------
  |  Branch (55:9): [True: 0, False: 60.4k]
  ------------------
   56|  60.4k|  }
_ZlsRNSt3__113basic_ostreamIcNS_11char_traitsIcEEEERK6Indent:
   66|  3.43M|{
   67|  3.43M|  ostr << indent.get_string();
   68|  3.43M|  return ostr;
   69|  3.43M|}
_Z19reset_stream_formatRNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE:
   77|  77.9k|{
   78|  77.9k|  ostr << std::dec << std::noboolalpha;
   79|  77.9k|  ostr.fill(' ');
   80|  77.9k|}
_Z24dump_reached_entry_limitRNSt3__113basic_ostreamIcNS_11char_traitsIcEEEERK6Indentbmm:
   90|  37.9k|{
   91|  37.9k|  if (full_log || index < MAX_DUMP_ENTRIES) {
  ------------------
  |  Branch (91:7): [True: 0, False: 37.9k]
  |  Branch (91:19): [True: 37.6k, False: 303]
  ------------------
   92|  37.6k|    return false;
   93|  37.6k|  }
   94|       |
   95|    303|  ostr << indent << "... (" << (total - index) << " more)\n";
   96|    303|  return true;
   97|  37.9k|}

_ZN8Box_mini5parseER14BitstreamRangePK20heif_security_limits:
   42|  12.8k|{
   43|  12.8k|  uint64_t start_offset = range.get_istream()->get_position();
   44|  12.8k|  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|  12.8k|  MemoryHandle mini_data_handle;
   50|  12.8k|  if (auto err = mini_data_handle.alloc(length, limits, "MinimizedImageBox payload")) {
  ------------------
  |  Branch (50:12): [True: 0, False: 12.8k]
  ------------------
   51|      0|    return err;
   52|      0|  }
   53|       |
   54|  12.8k|  std::vector<uint8_t> mini_data(length);
   55|  12.8k|  if (!range.read(mini_data.data(), mini_data.size())) {
  ------------------
  |  Branch (55:7): [True: 0, False: 12.8k]
  ------------------
   56|      0|    return range.get_error();
   57|      0|  }
   58|       |
   59|  12.8k|  BitReader bits(mini_data.data(), mini_data.size());
   60|       |
   61|  12.8k|  m_version = bits.get_bits8(2);
   62|  12.8k|  m_explicit_codec_types_flag = bits.get_flag();
   63|  12.8k|  m_float_flag = bits.get_flag();
   64|  12.8k|  m_full_range_flag = bits.get_flag();
   65|  12.8k|  m_alpha_flag = bits.get_flag();
   66|  12.8k|  m_explicit_cicp_flag = bits.get_flag();
   67|  12.8k|  m_hdr_flag = bits.get_flag();
   68|  12.8k|  m_icc_flag = bits.get_flag();
   69|  12.8k|  m_exif_flag = bits.get_flag();
   70|  12.8k|  m_xmp_flag = bits.get_flag();
   71|  12.8k|  m_chroma_subsampling = bits.get_bits8(2);
   72|  12.8k|  m_orientation = bits.get_bits8(3) + 1;
   73|       |
   74|  12.8k|  bool large_dimensions_flag = bits.get_flag();
   75|       |  // large_dimensions_flag = !large_dimensions_flag;  // HACK to get old behavior
   76|  12.8k|  m_width = 1 + bits.get_bits32(large_dimensions_flag ? 15 : 7);
  ------------------
  |  Branch (76:33): [True: 4.72k, False: 8.15k]
  ------------------
   77|  12.8k|  m_height = 1 + bits.get_bits32(large_dimensions_flag ? 15 : 7);
  ------------------
  |  Branch (77:34): [True: 4.72k, False: 8.15k]
  ------------------
   78|       |
   79|  12.8k|  if ((m_chroma_subsampling == 1) || (m_chroma_subsampling == 2))
  ------------------
  |  Branch (79:7): [True: 910, False: 11.9k]
  |  Branch (79:38): [True: 5.21k, False: 6.75k]
  ------------------
   80|  6.12k|  {
   81|  6.12k|    m_chroma_is_horizontally_centered = bits.get_flag();
   82|  6.12k|  }
   83|  12.8k|  if (m_chroma_subsampling == 1)
  ------------------
  |  Branch (83:7): [True: 910, False: 11.9k]
  ------------------
   84|    910|  {
   85|    910|    m_chroma_is_vertically_centered = bits.get_flag();
   86|    910|  }
   87|       |
   88|  12.8k|  bool high_bit_depth_flag = false;
   89|  12.8k|  if (m_float_flag)
  ------------------
  |  Branch (89:7): [True: 2.27k, False: 10.6k]
  ------------------
   90|  2.27k|  {
   91|  2.27k|    uint8_t bit_depth_log2 = bits.get_bits8(2) + 4; // [4;6] (7 is reserved)
   92|  2.27k|    if (bit_depth_log2 > 6) {
  ------------------
  |  Branch (92:9): [True: 4, False: 2.26k]
  ------------------
   93|      4|      return {heif_error_Invalid_input,
   94|      4|              heif_suberror_Invalid_mini_box,
   95|      4|              "Reserved float bit_depth_log2 value 7 in MinimizedImageBox"};
   96|      4|    }
   97|  2.26k|    m_bit_depth = (uint8_t)powl(2, (bit_depth_log2)); // [16,32,64]
   98|  2.26k|  }
   99|  10.6k|  else
  100|  10.6k|  {
  101|  10.6k|    high_bit_depth_flag = bits.get_flag();
  102|  10.6k|    if (high_bit_depth_flag)
  ------------------
  |  Branch (102:9): [True: 5.35k, False: 5.25k]
  ------------------
  103|  5.35k|    {
  104|  5.35k|      m_bit_depth = bits.get_bits8(3) + 9; // [9;16]
  105|  5.35k|    }
  106|  10.6k|  }
  107|       |
  108|  12.8k|  if (m_alpha_flag)
  ------------------
  |  Branch (108:7): [True: 4.55k, False: 8.32k]
  ------------------
  109|  4.55k|  {
  110|  4.55k|    m_alpha_is_premultiplied = bits.get_flag();
  111|  4.55k|  }
  112|       |
  113|  12.8k|  if (m_explicit_cicp_flag)
  ------------------
  |  Branch (113:7): [True: 5.66k, False: 7.21k]
  ------------------
  114|  5.66k|  {
  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|  5.66k|    m_colour_primaries = bits.get_bits8(8);
  120|  5.66k|    m_transfer_characteristics = bits.get_bits8(8);
  121|  5.66k|    m_matrix_coefficients = bits.get_bits8(8);
  122|  5.66k|  }
  123|  7.21k|  else
  124|  7.21k|  {
  125|  7.21k|    m_colour_primaries = m_icc_flag ? 2 : 1;
  ------------------
  |  Branch (125:26): [True: 750, False: 6.46k]
  ------------------
  126|  7.21k|    m_transfer_characteristics = m_icc_flag ? 2 : 13;
  ------------------
  |  Branch (126:34): [True: 750, False: 6.46k]
  ------------------
  127|  7.21k|    m_matrix_coefficients = (m_chroma_subsampling == 0) ? 2 : 6;
  ------------------
  |  Branch (127:29): [True: 2.23k, False: 4.98k]
  ------------------
  128|  7.21k|  }
  129|       |
  130|  12.8k|  if (m_explicit_codec_types_flag)
  ------------------
  |  Branch (130:7): [True: 5.50k, False: 7.37k]
  ------------------
  131|  5.50k|  {
  132|  5.50k|    m_infe_type = bits.get_bits32(32);
  133|  5.50k|    m_codec_config_type = bits.get_bits32(32);
  134|  5.50k|  }
  135|       |
  136|  12.8k|  if (m_hdr_flag)
  ------------------
  |  Branch (136:7): [True: 11.6k, False: 1.23k]
  ------------------
  137|  11.6k|  {
  138|  11.6k|    m_gainmap_flag = bits.get_flag();
  139|  11.6k|    if (m_gainmap_flag)
  ------------------
  |  Branch (139:9): [True: 9.30k, False: 2.33k]
  ------------------
  140|  9.30k|    {
  141|  9.30k|      bool gainmap_dimension_same_as_main_item_flag = bits.get_flag();
  142|  9.30k|      if (gainmap_dimension_same_as_main_item_flag) {
  ------------------
  |  Branch (142:11): [True: 4.94k, False: 4.36k]
  ------------------
  143|  4.94k|        m_gainmap_width = m_width;
  144|  4.94k|        m_gainmap_height = m_height;
  145|  4.94k|      }
  146|  4.36k|      else {
  147|  4.36k|        m_gainmap_width = bits.get_bits32(large_dimensions_flag ? 15 : 7) + 1;
  ------------------
  |  Branch (147:43): [True: 1.33k, False: 3.02k]
  ------------------
  148|  4.36k|        m_gainmap_height = bits.get_bits32(large_dimensions_flag ? 15 : 7) + 1;
  ------------------
  |  Branch (148:44): [True: 1.33k, False: 3.02k]
  ------------------
  149|  4.36k|      }
  150|       |
  151|  9.30k|      m_gainmap_matrix_coefficients = bits.get_bits8(8);
  152|  9.30k|      m_gainmap_full_range_flag = bits.get_flag();
  153|  9.30k|      m_gainmap_chroma_subsampling = bits.get_bits8(2);
  154|  9.30k|      if ((m_gainmap_chroma_subsampling == 1) || (m_gainmap_chroma_subsampling == 2))
  ------------------
  |  Branch (154:11): [True: 5.21k, False: 4.09k]
  |  Branch (154:50): [True: 2.66k, False: 1.42k]
  ------------------
  155|  7.87k|      {
  156|  7.87k|        m_gainmap_chroma_is_horizontally_centred = bits.get_flag();
  157|  7.87k|      }
  158|  9.30k|      if (m_gainmap_chroma_subsampling == 1)
  ------------------
  |  Branch (158:11): [True: 5.21k, False: 4.09k]
  ------------------
  159|  5.21k|      {
  160|  5.21k|        m_gainmap_chroma_is_vertically_centred = bits.get_flag();
  161|  5.21k|      }
  162|       |
  163|  9.30k|      m_gainmap_float_flag = bits.get_flag();
  164|       |
  165|  9.30k|      bool gainmap_high_bit_depth_flag = false;
  166|  9.30k|      if (m_gainmap_float_flag)
  ------------------
  |  Branch (166:11): [True: 1.56k, False: 7.74k]
  ------------------
  167|  1.56k|      {
  168|  1.56k|        uint8_t bit_depth_log2 = bits.get_bits8(2) + 4;
  169|  1.56k|        if (bit_depth_log2 > 6) {
  ------------------
  |  Branch (169:13): [True: 3, False: 1.55k]
  ------------------
  170|      3|          return {heif_error_Invalid_input,
  171|      3|                  heif_suberror_Invalid_mini_box,
  172|      3|                  "Reserved float gainmap bit_depth_log2 value 7 in MinimizedImageBox"};
  173|      3|        }
  174|  1.55k|        m_gainmap_bit_depth = (uint8_t)powl(2, (bit_depth_log2));
  175|  1.55k|      }
  176|  7.74k|      else
  177|  7.74k|      {
  178|  7.74k|        gainmap_high_bit_depth_flag = bits.get_flag();
  179|  7.74k|        if (gainmap_high_bit_depth_flag)
  ------------------
  |  Branch (179:13): [True: 1.33k, False: 6.41k]
  ------------------
  180|  1.33k|        {
  181|  1.33k|          m_gainmap_bit_depth = 9 + bits.get_bits8(3);
  182|  1.33k|        }
  183|  7.74k|      }
  184|       |
  185|  9.30k|      m_tmap_icc_flag = bits.get_flag();
  186|  9.30k|      m_tmap_explicit_cicp_flag = bits.get_flag();
  187|  9.30k|      if (m_tmap_explicit_cicp_flag)
  ------------------
  |  Branch (187:11): [True: 2.43k, False: 6.86k]
  ------------------
  188|  2.43k|      {
  189|  2.43k|        m_tmap_colour_primaries = bits.get_bits8(8);
  190|  2.43k|        m_tmap_transfer_characteristics = bits.get_bits8(8);
  191|  2.43k|        m_tmap_matrix_coefficients = bits.get_bits8(8);
  192|  2.43k|        m_tmap_full_range_flag = bits.get_flag();
  193|  2.43k|      }
  194|  6.86k|      else
  195|  6.86k|      {
  196|  6.86k|        m_tmap_colour_primaries = 1;
  197|  6.86k|        m_tmap_transfer_characteristics = 13;
  198|  6.86k|        m_tmap_matrix_coefficients = 6;
  199|  6.86k|        m_tmap_full_range_flag = true;
  200|  6.86k|      }
  201|  9.30k|    }
  202|       |
  203|  11.6k|    bool clli_flag = bits.get_flag();
  204|  11.6k|    bool mdcv_flag = bits.get_flag();
  205|  11.6k|    bool cclv_flag = bits.get_flag();
  206|  11.6k|    bool amve_flag = bits.get_flag();
  207|  11.6k|    m_reve_flag = bits.get_flag();
  208|  11.6k|    bool ndwt_flag = bits.get_flag();
  209|       |
  210|  11.6k|    if (clli_flag)
  ------------------
  |  Branch (210:9): [True: 3.36k, False: 8.27k]
  ------------------
  211|  3.36k|    {
  212|  3.36k|      m_clli = std::make_shared<Box_clli>();
  213|  3.36k|      m_clli->clli.max_content_light_level = bits.get_bits16(16);
  214|  3.36k|      m_clli->clli.max_pic_average_light_level = bits.get_bits16(16);
  215|  3.36k|    }
  216|       |
  217|  11.6k|    if (mdcv_flag)
  ------------------
  |  Branch (217:9): [True: 923, False: 10.7k]
  ------------------
  218|    923|    {
  219|    923|      m_mdcv = std::make_shared<Box_mdcv>();
  220|  3.69k|      for (int c = 0; c < 3; c++)
  ------------------
  |  Branch (220:23): [True: 2.76k, False: 923]
  ------------------
  221|  2.76k|      {
  222|  2.76k|        m_mdcv->mdcv.display_primaries_x[c] = bits.get_bits16(16);
  223|  2.76k|        m_mdcv->mdcv.display_primaries_y[c] = bits.get_bits16(16);
  224|  2.76k|      }
  225|       |
  226|    923|      m_mdcv->mdcv.white_point_x = bits.get_bits16(16);
  227|    923|      m_mdcv->mdcv.white_point_y = bits.get_bits16(16);
  228|    923|      m_mdcv->mdcv.max_display_mastering_luminance = bits.get_bits32(32);
  229|    923|      m_mdcv->mdcv.min_display_mastering_luminance = bits.get_bits32(32);
  230|    923|    }
  231|       |
  232|  11.6k|    if (cclv_flag)
  ------------------
  |  Branch (232:9): [True: 2.88k, False: 8.75k]
  ------------------
  233|  2.88k|    {
  234|  2.88k|      m_cclv = std::make_shared<Box_cclv>();
  235|  2.88k|      bits.skip_bits(2);
  236|  2.88k|      bool ccv_primaries_present_flag = bits.get_flag();
  237|  2.88k|      bool ccv_min_luminance_value_present_flag = bits.get_flag();
  238|  2.88k|      bool ccv_max_luminance_value_present_flag = bits.get_flag();
  239|  2.88k|      bool ccv_avg_luminance_value_present_flag = bits.get_flag();
  240|  2.88k|      bits.skip_bits(2);
  241|  2.88k|      if (ccv_primaries_present_flag)
  ------------------
  |  Branch (241:11): [True: 423, False: 2.45k]
  ------------------
  242|    423|      {
  243|    423|        int32_t x0 = bits.get_bits32s();
  244|    423|        int32_t y0 = bits.get_bits32s();
  245|    423|        int32_t x1 = bits.get_bits32s();
  246|    423|        int32_t y1 = bits.get_bits32s();
  247|    423|        int32_t x2 = bits.get_bits32s();
  248|    423|        int32_t y2 = bits.get_bits32s();
  249|    423|        m_cclv->set_primaries(x0, y0, x1, y1, x2, y2);
  250|    423|      }
  251|  2.88k|      if (ccv_min_luminance_value_present_flag)
  ------------------
  |  Branch (251:11): [True: 414, False: 2.46k]
  ------------------
  252|    414|      {
  253|    414|        m_cclv->set_min_luminance(bits.get_bits32(32));
  254|    414|      }
  255|  2.88k|      if (ccv_max_luminance_value_present_flag)
  ------------------
  |  Branch (255:11): [True: 1.96k, False: 915]
  ------------------
  256|  1.96k|      {
  257|  1.96k|        m_cclv->set_max_luminance(bits.get_bits32(32));
  258|  1.96k|      }
  259|  2.88k|      if (ccv_avg_luminance_value_present_flag)
  ------------------
  |  Branch (259:11): [True: 494, False: 2.38k]
  ------------------
  260|    494|      {
  261|    494|        m_cclv->set_avg_luminance(bits.get_bits32(32));
  262|    494|      }
  263|  2.88k|    }
  264|       |
  265|  11.6k|    if (amve_flag)
  ------------------
  |  Branch (265:9): [True: 600, False: 11.0k]
  ------------------
  266|    600|    {
  267|    600|      m_amve = std::make_shared<Box_amve>();
  268|    600|      m_amve->amve.ambient_illumination = bits.get_bits32(32);
  269|    600|      m_amve->amve.ambient_light_x = bits.get_bits16(16);
  270|    600|      m_amve->amve.ambient_light_y = bits.get_bits16(16);
  271|    600|    }
  272|       |
  273|  11.6k|    if (m_reve_flag)
  ------------------
  |  Branch (273:9): [True: 2.24k, False: 9.39k]
  ------------------
  274|  2.24k|    {
  275|       |      // TODO: ReferenceViewingEnvironment isn't published yet
  276|  2.24k|      bits.skip_bits(32);
  277|  2.24k|      bits.skip_bits(16);
  278|  2.24k|      bits.skip_bits(16);
  279|  2.24k|      bits.skip_bits(32);
  280|  2.24k|      bits.skip_bits(16);
  281|  2.24k|      bits.skip_bits(16);
  282|  2.24k|    }
  283|       |
  284|  11.6k|    if (ndwt_flag)
  ------------------
  |  Branch (284:9): [True: 3.62k, False: 8.01k]
  ------------------
  285|  3.62k|    {
  286|  3.62k|      m_ndwt = std::make_shared<Box_ndwt>();
  287|  3.62k|      m_ndwt->set_diffuse_white_luminance(bits.get_bits32(32));
  288|  3.62k|    }
  289|       |
  290|  11.6k|    if (m_gainmap_flag)
  ------------------
  |  Branch (290:9): [True: 9.30k, False: 2.33k]
  ------------------
  291|  9.30k|    {
  292|  9.30k|      bool tmap_clli_flag = bits.get_flag();
  293|  9.30k|      bool tmap_mdcv_flag = bits.get_flag();
  294|  9.30k|      bool tmap_cclv_flag = bits.get_flag();
  295|  9.30k|      bool tmap_amve_flag = bits.get_flag();
  296|  9.30k|      m_tmap_reve_flag = bits.get_flag();
  297|  9.30k|      bool tmap_ndwt_flag = bits.get_flag();
  298|       |
  299|  9.30k|      if (tmap_clli_flag)
  ------------------
  |  Branch (299:11): [True: 3.94k, False: 5.35k]
  ------------------
  300|  3.94k|      {
  301|  3.94k|        m_tmap_clli = std::make_shared<Box_clli>();
  302|  3.94k|        m_tmap_clli->clli.max_content_light_level = (uint16_t)bits.get_bits32(16);
  303|  3.94k|        m_tmap_clli->clli.max_pic_average_light_level = (uint16_t)bits.get_bits32(16);
  304|  3.94k|      }
  305|       |
  306|  9.30k|      if (tmap_mdcv_flag)
  ------------------
  |  Branch (306:11): [True: 2.33k, False: 6.96k]
  ------------------
  307|  2.33k|      {
  308|  2.33k|        m_tmap_mdcv = std::make_shared<Box_mdcv>();
  309|  9.32k|        for (int c = 0; c < 3; c++)
  ------------------
  |  Branch (309:25): [True: 6.99k, False: 2.33k]
  ------------------
  310|  6.99k|        {
  311|  6.99k|          m_tmap_mdcv->mdcv.display_primaries_x[c] = bits.get_bits16(16);
  312|  6.99k|          m_tmap_mdcv->mdcv.display_primaries_y[c] = bits.get_bits16(16);
  313|  6.99k|        }
  314|       |
  315|  2.33k|        m_tmap_mdcv->mdcv.white_point_x = bits.get_bits16(16);
  316|  2.33k|        m_tmap_mdcv->mdcv.white_point_y = bits.get_bits16(16);
  317|  2.33k|        m_tmap_mdcv->mdcv.max_display_mastering_luminance = bits.get_bits32(32);
  318|  2.33k|        m_tmap_mdcv->mdcv.min_display_mastering_luminance = bits.get_bits32(32);
  319|  2.33k|      }
  320|       |
  321|  9.30k|      if (tmap_cclv_flag)
  ------------------
  |  Branch (321:11): [True: 4.27k, False: 5.02k]
  ------------------
  322|  4.27k|      {
  323|  4.27k|        m_tmap_cclv = std::make_shared<Box_cclv>();
  324|  4.27k|        bits.skip_bits(2); // skip ccv_cancel_flag and ccv_persistence_flag
  325|  4.27k|        bool ccv_primaries_present_flag = bits.get_flag();
  326|  4.27k|        bool ccv_min_luminance_value_present_flag = bits.get_flag();
  327|  4.27k|        bool ccv_max_luminance_value_present_flag = bits.get_flag();
  328|  4.27k|        bool ccv_avg_luminance_value_present_flag = bits.get_flag();
  329|  4.27k|        bits.skip_bits(2);
  330|  4.27k|        if (ccv_primaries_present_flag)
  ------------------
  |  Branch (330:13): [True: 384, False: 3.89k]
  ------------------
  331|    384|        {
  332|    384|          int32_t x0 = bits.get_bits32s();
  333|    384|          int32_t y0 = bits.get_bits32s();
  334|    384|          int32_t x1 = bits.get_bits32s();
  335|    384|          int32_t y1 = bits.get_bits32s();
  336|    384|          int32_t x2 = bits.get_bits32s();
  337|    384|          int32_t y2 = bits.get_bits32s();
  338|    384|          m_tmap_cclv->set_primaries(x0, y0, x1, y1, x2, y2);
  339|    384|        }
  340|  4.27k|        if (ccv_min_luminance_value_present_flag)
  ------------------
  |  Branch (340:13): [True: 595, False: 3.67k]
  ------------------
  341|    595|        {
  342|    595|          m_tmap_cclv->set_min_luminance(bits.get_bits32(32));
  343|    595|        }
  344|  4.27k|        if (ccv_max_luminance_value_present_flag)
  ------------------
  |  Branch (344:13): [True: 644, False: 3.63k]
  ------------------
  345|    644|        {
  346|    644|          m_tmap_cclv->set_max_luminance(bits.get_bits32(32));
  347|    644|        }
  348|  4.27k|        if (ccv_avg_luminance_value_present_flag)
  ------------------
  |  Branch (348:13): [True: 561, False: 3.71k]
  ------------------
  349|    561|        {
  350|    561|          m_tmap_cclv->set_avg_luminance(bits.get_bits32(32));
  351|    561|        }
  352|  4.27k|      }
  353|       |
  354|  9.30k|      if (tmap_amve_flag)
  ------------------
  |  Branch (354:11): [True: 3.24k, False: 6.05k]
  ------------------
  355|  3.24k|      {
  356|  3.24k|        m_tmap_amve = std::make_shared<Box_amve>();
  357|  3.24k|        m_tmap_amve->amve.ambient_illumination = bits.get_bits32(32);
  358|  3.24k|        m_tmap_amve->amve.ambient_light_x = bits.get_bits16(16);
  359|  3.24k|        m_tmap_amve->amve.ambient_light_y = bits.get_bits16(16);
  360|  3.24k|      }
  361|       |
  362|  9.30k|      if (m_tmap_reve_flag)
  ------------------
  |  Branch (362:11): [True: 906, False: 8.39k]
  ------------------
  363|    906|      {
  364|       |        // TODO: ReferenceViewingEnvironment isn't published yet
  365|    906|        bits.skip_bits(32);
  366|    906|        bits.skip_bits(16);
  367|    906|        bits.skip_bits(16);
  368|    906|        bits.skip_bits(32);
  369|    906|        bits.skip_bits(16);
  370|    906|        bits.skip_bits(16);
  371|    906|      }
  372|       |
  373|  9.30k|      if (tmap_ndwt_flag)
  ------------------
  |  Branch (373:11): [True: 1.69k, False: 7.60k]
  ------------------
  374|  1.69k|      {
  375|  1.69k|        m_tmap_ndwt = std::make_shared<Box_ndwt>();
  376|  1.69k|        m_tmap_ndwt->set_diffuse_white_luminance(bits.get_bits32(32));
  377|  1.69k|      }
  378|  9.30k|    }
  379|  11.6k|  }
  380|       |
  381|       |  // Chunk sizes
  382|  12.8k|  bool large_metadata_flag = false;
  383|  12.8k|  if (m_icc_flag || m_exif_flag || m_xmp_flag || (m_hdr_flag && m_gainmap_flag))
  ------------------
  |  Branch (383:7): [True: 3.69k, False: 9.17k]
  |  Branch (383:21): [True: 1.35k, False: 7.82k]
  |  Branch (383:36): [True: 2.07k, False: 5.74k]
  |  Branch (383:51): [True: 4.76k, False: 987]
  |  Branch (383:65): [True: 3.21k, False: 1.54k]
  ------------------
  384|  10.3k|  {
  385|  10.3k|    large_metadata_flag = bits.get_flag();
  386|  10.3k|  }
  387|       |
  388|  12.8k|  bool large_codec_config_flag = bits.get_flag();
  389|  12.8k|  bool large_item_data_flag = bits.get_flag();
  390|       |
  391|  12.8k|  uint32_t icc_data_size = 0;
  392|  12.8k|  if (m_icc_flag)
  ------------------
  |  Branch (392:7): [True: 3.69k, False: 9.17k]
  ------------------
  393|  3.69k|  {
  394|  3.69k|    icc_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (394:37): [True: 12, False: 3.68k]
  ------------------
  395|  3.69k|  }
  396|       |
  397|  12.8k|  uint32_t tmap_icc_data_size = 0;
  398|  12.8k|  if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag)
  ------------------
  |  Branch (398:7): [True: 11.6k, False: 1.23k]
  |  Branch (398:21): [True: 9.30k, False: 2.33k]
  |  Branch (398:39): [True: 1.03k, False: 8.26k]
  ------------------
  399|  1.03k|  {
  400|  1.03k|    tmap_icc_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (400:42): [True: 282, False: 749]
  ------------------
  401|  1.03k|  }
  402|       |
  403|  12.8k|  uint32_t gainmap_metadata_size = 0;
  404|  12.8k|  if (m_hdr_flag && m_gainmap_flag)
  ------------------
  |  Branch (404:7): [True: 11.6k, False: 1.23k]
  |  Branch (404:21): [True: 9.30k, False: 2.33k]
  ------------------
  405|  9.30k|  {
  406|  9.30k|    gainmap_metadata_size = bits.get_bits32(large_metadata_flag ? 20 : 10);
  ------------------
  |  Branch (406:45): [True: 301, False: 8.99k]
  ------------------
  407|  9.30k|  }
  408|       |
  409|  12.8k|  if (m_hdr_flag && m_gainmap_flag)
  ------------------
  |  Branch (409:7): [True: 11.6k, False: 1.23k]
  |  Branch (409:21): [True: 9.30k, False: 2.33k]
  ------------------
  410|  9.30k|  {
  411|  9.30k|    m_gainmap_item_data_size = bits.get_bits32(large_item_data_flag ? 28 : 15);
  ------------------
  |  Branch (411:48): [True: 44, False: 9.25k]
  ------------------
  412|  9.30k|  }
  413|       |
  414|  12.8k|  uint32_t gainmap_item_codec_config_size = 0;
  415|  12.8k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0)
  ------------------
  |  Branch (415:7): [True: 11.6k, False: 1.23k]
  |  Branch (415:21): [True: 9.30k, False: 2.33k]
  |  Branch (415:39): [True: 1.42k, False: 7.87k]
  ------------------
  416|  1.42k|  {
  417|  1.42k|    gainmap_item_codec_config_size = bits.get_bits32(large_codec_config_flag ? 12 : 3);
  ------------------
  |  Branch (417:54): [True: 41, False: 1.38k]
  ------------------
  418|  1.42k|  }
  419|       |
  420|  12.8k|  uint32_t main_item_codec_config_size = bits.get_bits32(large_codec_config_flag ? 12 : 3);
  ------------------
  |  Branch (420:58): [True: 980, False: 11.8k]
  ------------------
  421|  12.8k|  m_main_item_data_size = bits.get_bits32(large_item_data_flag ? 28 : 15) + 1;
  ------------------
  |  Branch (421:43): [True: 113, False: 12.7k]
  ------------------
  422|       |
  423|  12.8k|  if (m_alpha_flag)
  ------------------
  |  Branch (423:7): [True: 4.55k, False: 8.31k]
  ------------------
  424|  4.55k|  {
  425|  4.55k|    m_alpha_item_data_size = bits.get_bits32(large_item_data_flag ? 28 : 15);
  ------------------
  |  Branch (425:46): [True: 49, False: 4.50k]
  ------------------
  426|  4.55k|  }
  427|       |
  428|  12.8k|  uint32_t alpha_item_codec_config_size = 0;
  429|  12.8k|  if (m_alpha_flag && m_alpha_item_data_size > 0)
  ------------------
  |  Branch (429:7): [True: 4.55k, False: 8.31k]
  |  Branch (429:23): [True: 325, False: 4.23k]
  ------------------
  430|    325|  {
  431|    325|    alpha_item_codec_config_size = bits.get_bits32(large_codec_config_flag ? 12 : 3);
  ------------------
  |  Branch (431:52): [True: 30, False: 295]
  ------------------
  432|    325|  }
  433|       |
  434|  12.8k|  if (m_exif_flag || m_xmp_flag)
  ------------------
  |  Branch (434:7): [True: 4.18k, False: 8.68k]
  |  Branch (434:22): [True: 2.64k, False: 6.04k]
  ------------------
  435|  6.82k|  {
  436|  6.82k|    m_exif_xmp_compressed_flag = bits.get_flag();
  437|  6.82k|  }
  438|       |
  439|  12.8k|  if (m_exif_flag)
  ------------------
  |  Branch (439:7): [True: 4.18k, False: 8.68k]
  ------------------
  440|  4.18k|  {
  441|  4.18k|    m_exif_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (441:40): [True: 16, False: 4.16k]
  ------------------
  442|  4.18k|  }
  443|  12.8k|  if (m_xmp_flag)
  ------------------
  |  Branch (443:7): [True: 6.52k, False: 6.34k]
  ------------------
  444|  6.52k|  {
  445|  6.52k|    m_xmp_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (445:39): [True: 297, False: 6.22k]
  ------------------
  446|  6.52k|  }
  447|       |
  448|  12.8k|  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|  12.8k|  {
  455|  12.8k|    uint64_t required_bytes = (uint64_t) main_item_codec_config_size + m_main_item_data_size;
  456|  12.8k|    if (m_alpha_flag && m_alpha_item_data_size > 0) {
  ------------------
  |  Branch (456:9): [True: 4.55k, False: 8.31k]
  |  Branch (456:25): [True: 325, False: 4.23k]
  ------------------
  457|    325|      required_bytes += alpha_item_codec_config_size;
  458|    325|      required_bytes += m_alpha_item_data_size;
  459|    325|    }
  460|  12.8k|    if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0) {
  ------------------
  |  Branch (460:9): [True: 11.6k, False: 1.23k]
  |  Branch (460:23): [True: 9.30k, False: 2.33k]
  |  Branch (460:41): [True: 1.42k, False: 7.87k]
  ------------------
  461|  1.42k|      required_bytes += gainmap_item_codec_config_size;
  462|  1.42k|      required_bytes += m_gainmap_item_data_size;
  463|  1.42k|    }
  464|  12.8k|    if (m_icc_flag) required_bytes += icc_data_size;
  ------------------
  |  Branch (464:9): [True: 3.69k, False: 9.17k]
  ------------------
  465|  12.8k|    if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag) required_bytes += tmap_icc_data_size;
  ------------------
  |  Branch (465:9): [True: 11.6k, False: 1.23k]
  |  Branch (465:23): [True: 9.30k, False: 2.33k]
  |  Branch (465:41): [True: 1.03k, False: 8.26k]
  ------------------
  466|  12.8k|    if (m_hdr_flag && m_gainmap_flag) required_bytes += gainmap_metadata_size;
  ------------------
  |  Branch (466:9): [True: 11.6k, False: 1.23k]
  |  Branch (466:23): [True: 9.30k, False: 2.33k]
  ------------------
  467|  12.8k|    if (m_exif_flag) required_bytes += m_exif_data_size;
  ------------------
  |  Branch (467:9): [True: 4.18k, False: 8.68k]
  ------------------
  468|  12.8k|    if (m_xmp_flag) required_bytes += m_xmp_data_size;
  ------------------
  |  Branch (468:9): [True: 6.52k, False: 6.34k]
  ------------------
  469|       |
  470|  12.8k|    int64_t remaining_bits = bits.get_bits_remaining();
  471|  12.8k|    if (remaining_bits < 0 || required_bytes > (uint64_t) remaining_bits / 8) {
  ------------------
  |  Branch (471:9): [True: 314, False: 12.5k]
  |  Branch (471:31): [True: 122, False: 12.4k]
  ------------------
  472|    436|      return {heif_error_Invalid_input,
  473|    436|              heif_suberror_Invalid_mini_box,
  474|    436|              "Declared chunk sizes in MinimizedImageBox exceed available payload."};
  475|    436|    }
  476|  12.8k|  }
  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|  12.4k|  if (limits && limits->max_color_profile_size) {
  ------------------
  |  Branch (480:7): [True: 12.4k, False: 0]
  |  Branch (480:17): [True: 12.4k, False: 0]
  ------------------
  481|  12.4k|    if (m_icc_flag && icc_data_size > limits->max_color_profile_size) {
  ------------------
  |  Branch (481:9): [True: 3.61k, False: 8.82k]
  |  Branch (481:23): [True: 0, False: 3.61k]
  ------------------
  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|  12.4k|    if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag &&
  ------------------
  |  Branch (486:9): [True: 11.2k, False: 1.14k]
  |  Branch (486:23): [True: 9.11k, False: 2.17k]
  |  Branch (486:41): [True: 965, False: 8.14k]
  ------------------
  487|    965|        tmap_icc_data_size > limits->max_color_profile_size) {
  ------------------
  |  Branch (487:9): [True: 0, False: 965]
  ------------------
  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|  12.4k|  }
  493|       |
  494|  12.4k|  if (main_item_codec_config_size > 0)
  ------------------
  |  Branch (494:7): [True: 591, False: 11.8k]
  ------------------
  495|    591|  {
  496|    591|    m_main_item_codec_config = bits.read_bytes(main_item_codec_config_size);
  497|    591|  }
  498|       |
  499|       |  // Chunks
  500|  12.4k|  if (m_alpha_flag && m_alpha_item_data_size > 0) {
  ------------------
  |  Branch (500:7): [True: 4.42k, False: 8.01k]
  |  Branch (500:23): [True: 274, False: 4.14k]
  ------------------
  501|    274|    if (alpha_item_codec_config_size == 0) {
  ------------------
  |  Branch (501:9): [True: 171, False: 103]
  ------------------
  502|    171|      m_alpha_item_codec_config = m_main_item_codec_config;
  503|    171|    }
  504|    103|    else {
  505|       |      // TODO: should we have a flag indicating that we have explicit config for alpha?
  506|    103|      m_alpha_item_codec_config = bits.read_bytes(alpha_item_codec_config_size);
  507|    103|    }
  508|    274|  }
  509|       |
  510|  12.4k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0)
  ------------------
  |  Branch (510:7): [True: 11.2k, False: 1.14k]
  |  Branch (510:21): [True: 9.11k, False: 2.17k]
  |  Branch (510:39): [True: 1.36k, False: 7.74k]
  ------------------
  511|  1.36k|  {
  512|  1.36k|    if (gainmap_item_codec_config_size == 0) {
  ------------------
  |  Branch (512:9): [True: 476, False: 891]
  ------------------
  513|    476|      m_gainmap_item_codec_config = m_main_item_codec_config;
  514|    476|    }
  515|    891|    else {
  516|       |      // TODO: should we have a flag indicating that we have explicit config for the gain map?
  517|    891|      m_gainmap_item_codec_config = bits.read_bytes(gainmap_item_codec_config_size);
  518|    891|    }
  519|  1.36k|  }
  520|       |
  521|  12.4k|  if (m_icc_flag)
  ------------------
  |  Branch (521:7): [True: 3.61k, False: 8.82k]
  ------------------
  522|  3.61k|  {
  523|  3.61k|    m_icc_data = bits.read_bytes(icc_data_size);
  524|  3.61k|  }
  525|       |
  526|  12.4k|  if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag)
  ------------------
  |  Branch (526:7): [True: 11.2k, False: 1.14k]
  |  Branch (526:21): [True: 9.11k, False: 2.17k]
  |  Branch (526:39): [True: 965, False: 8.14k]
  ------------------
  527|    965|  {
  528|    965|    m_tmap_icc_data = bits.read_bytes(tmap_icc_data_size);
  529|    965|  }
  530|       |
  531|  12.4k|  if (m_hdr_flag && m_gainmap_flag && gainmap_metadata_size > 0)
  ------------------
  |  Branch (531:7): [True: 11.2k, False: 1.14k]
  |  Branch (531:21): [True: 9.11k, False: 2.17k]
  |  Branch (531:39): [True: 180, False: 8.93k]
  ------------------
  532|    180|  {
  533|    180|    m_gainmap_metadata = bits.read_bytes(gainmap_metadata_size);
  534|    180|  }
  535|       |
  536|  12.4k|  if (m_alpha_flag && m_alpha_item_data_size > 0)
  ------------------
  |  Branch (536:7): [True: 4.42k, False: 8.01k]
  |  Branch (536:23): [True: 274, False: 4.14k]
  ------------------
  537|    274|  {
  538|    274|    m_alpha_item_data_offset = bits.get_current_byte_index() + start_offset;
  539|    274|    bits.skip_bytes(m_alpha_item_data_size);
  540|    274|  }
  541|  12.4k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0)
  ------------------
  |  Branch (541:7): [True: 11.2k, False: 1.14k]
  |  Branch (541:21): [True: 9.11k, False: 2.17k]
  |  Branch (541:39): [True: 1.36k, False: 7.74k]
  ------------------
  542|  1.36k|  {
  543|  1.36k|    m_gainmap_item_data_offset = bits.get_current_byte_index() + start_offset;
  544|  1.36k|    bits.skip_bytes(m_gainmap_item_data_size);
  545|  1.36k|  }
  546|       |
  547|  12.4k|  m_main_item_data_offset = bits.get_current_byte_index() + start_offset;
  548|  12.4k|  bits.skip_bytes(m_main_item_data_size);
  549|       |
  550|  12.4k|  if (m_exif_flag)
  ------------------
  |  Branch (550:7): [True: 4.07k, False: 8.36k]
  ------------------
  551|  4.07k|  {
  552|  4.07k|    m_exif_item_data_offset = bits.get_current_byte_index() + start_offset;
  553|  4.07k|    bits.skip_bytes(m_exif_data_size);
  554|  4.07k|  }
  555|  12.4k|  if (m_xmp_flag)
  ------------------
  |  Branch (555:7): [True: 6.39k, False: 6.04k]
  ------------------
  556|  6.39k|  {
  557|  6.39k|    m_xmp_item_data_offset = bits.get_current_byte_index() + start_offset;
  558|  6.39k|    bits.skip_bytes(m_xmp_data_size);
  559|  6.39k|  }
  560|       |
  561|  12.4k|  return range.get_error();
  562|  12.4k|}
_ZNK8Box_mini4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  565|  12.1k|{
  566|  12.1k|  Box::dump(sstr, indent, full_log);
  567|  12.1k|  sstr << indent << "version: " << (int)m_version << "\n";
  568|       |
  569|  12.1k|  sstr << indent << "explicit_codec_types_flag: " << m_explicit_codec_types_flag << "\n";
  570|  12.1k|  sstr << indent << "float_flag: " << m_float_flag << "\n";
  571|  12.1k|  sstr << indent << "full_range_flag: " << m_full_range_flag << "\n";
  572|  12.1k|  sstr << indent << "alpha_flag: " << m_alpha_flag << "\n";
  573|  12.1k|  sstr << indent << "explicit_cicp_flag: " << m_explicit_cicp_flag << "\n";
  574|  12.1k|  sstr << indent << "hdr_flag: " << m_hdr_flag << "\n";
  575|  12.1k|  sstr << indent << "icc_flag: " << m_icc_flag << "\n";
  576|  12.1k|  sstr << indent << "exif_flag: " << m_exif_flag << "\n";
  577|  12.1k|  sstr << indent << "xmp_flag: " << m_xmp_flag << "\n";
  578|       |
  579|  12.1k|  sstr << indent << "chroma_subsampling: " << (int)m_chroma_subsampling << "\n";
  580|  12.1k|  sstr << indent << "orientation: " << (int)m_orientation << "\n";
  581|       |
  582|  12.1k|  sstr << indent << "width: " << m_width << "\n";
  583|  12.1k|  sstr << indent << "height: " << m_height << "\n";
  584|       |
  585|  12.1k|  if ((m_chroma_subsampling == 1) || (m_chroma_subsampling == 2))
  ------------------
  |  Branch (585:7): [True: 857, False: 11.3k]
  |  Branch (585:38): [True: 5.05k, False: 6.25k]
  ------------------
  586|  5.90k|  {
  587|  5.90k|    sstr << indent << "chroma_is_horizontally_centered: " << m_chroma_is_horizontally_centered << "\n";
  588|  5.90k|  }
  589|  12.1k|  if (m_chroma_subsampling == 1)
  ------------------
  |  Branch (589:7): [True: 857, False: 11.3k]
  ------------------
  590|    857|  {
  591|    857|    sstr << indent << "chroma_is_vertically_centered: " << m_chroma_is_vertically_centered << "\n";
  592|    857|  }
  593|       |
  594|  12.1k|  sstr << "bit_depth: " << (int)m_bit_depth << "\n";
  595|       |
  596|  12.1k|  if (m_alpha_flag)
  ------------------
  |  Branch (596:7): [True: 4.31k, False: 7.84k]
  ------------------
  597|  4.31k|  {
  598|  4.31k|    sstr << "alpha_is_premultiplied: " << m_alpha_is_premultiplied << "\n";
  599|  4.31k|  }
  600|       |
  601|  12.1k|  sstr << "colour_primaries: " << (int)m_colour_primaries << "\n";
  602|  12.1k|  sstr << "transfer_characteristics: " << (int)m_transfer_characteristics << "\n";
  603|  12.1k|  sstr << "matrix_coefficients: " << (int)m_matrix_coefficients << "\n";
  604|       |
  605|  12.1k|  if (m_explicit_codec_types_flag)
  ------------------
  |  Branch (605:7): [True: 5.30k, False: 6.85k]
  ------------------
  606|  5.30k|  {
  607|  5.30k|    sstr << "infe_type: " << fourcc_to_string(m_infe_type) << " (" << m_infe_type << ")" << "\n";
  608|  5.30k|    sstr << "codec_config_type: " << fourcc_to_string(m_codec_config_type) << " (" << m_codec_config_type << ")" << "\n";
  609|  5.30k|  }
  610|       |
  611|  12.1k|  if (m_hdr_flag)
  ------------------
  |  Branch (611:7): [True: 11.0k, False: 1.14k]
  ------------------
  612|  11.0k|  {
  613|  11.0k|    sstr << indent << "gainmap_flag: " << m_gainmap_flag << "\n";
  614|  11.0k|    if (m_gainmap_flag)
  ------------------
  |  Branch (614:9): [True: 8.94k, False: 2.06k]
  ------------------
  615|  8.94k|    {
  616|  8.94k|      sstr << indent << "gainmap_width: " << m_gainmap_width << "\n";
  617|  8.94k|      sstr << indent << "gainmap_height: " << m_gainmap_height << "\n";
  618|  8.94k|      sstr << indent << "gainmap_matrix_coefficients: " << (int)m_gainmap_matrix_coefficients << "\n";
  619|  8.94k|      sstr << indent << "gainmap_full_range_flag: " << m_gainmap_full_range_flag << "\n";
  620|  8.94k|      sstr << indent << "gainmap_chroma_subsampling: " << (int)m_gainmap_chroma_subsampling << "\n";
  621|  8.94k|      if ((m_gainmap_chroma_subsampling == 1) || (m_gainmap_chroma_subsampling == 2))
  ------------------
  |  Branch (621:11): [True: 5.09k, False: 3.85k]
  |  Branch (621:50): [True: 2.60k, False: 1.24k]
  ------------------
  622|  7.69k|      {
  623|  7.69k|        sstr << indent << "gainmap_chroma_is_horizontally_centred: " << m_gainmap_chroma_is_horizontally_centred << "\n";
  624|  7.69k|      }
  625|  8.94k|      if (m_gainmap_chroma_subsampling == 1)
  ------------------
  |  Branch (625:11): [True: 5.09k, False: 3.85k]
  ------------------
  626|  5.09k|      {
  627|  5.09k|        sstr << indent << "gainmap_chroma_is_vertically_centred: " << m_gainmap_chroma_is_vertically_centred << "\n";
  628|  5.09k|      }
  629|  8.94k|      sstr << indent << "gainmap_float_flag: " << m_gainmap_float_flag << "\n";
  630|  8.94k|      sstr << "gainmap_bit_depth: " << (int)m_gainmap_bit_depth << "\n";
  631|  8.94k|      sstr << indent << "tmap_icc_flag: " << m_tmap_icc_flag << "\n";
  632|  8.94k|      sstr << indent << "tmap_explicit_cicp_flag: " << m_tmap_explicit_cicp_flag << "\n";
  633|  8.94k|      if (m_tmap_explicit_cicp_flag)
  ------------------
  |  Branch (633:11): [True: 2.33k, False: 6.60k]
  ------------------
  634|  2.33k|      {
  635|  2.33k|        sstr << "tmap_colour_primaries: " << (int)m_tmap_colour_primaries << "\n";
  636|  2.33k|        sstr << "tmap_transfer_characteristics: " << (int)m_tmap_transfer_characteristics << "\n";
  637|  2.33k|        sstr << "tmap_matrix_coefficients: " << (int)m_tmap_matrix_coefficients << "\n";
  638|  2.33k|        sstr << "tmap_full_range_flag: " << m_tmap_full_range_flag << "\n";
  639|  2.33k|      }
  640|  8.94k|    }
  641|       |
  642|  11.0k|    if (m_clli)
  ------------------
  |  Branch (642:9): [True: 3.17k, False: 7.83k]
  ------------------
  643|  3.17k|    {
  644|  3.17k|      sstr << indent << "ccli.max_content_light_level: " << m_clli->clli.max_content_light_level << "\n";
  645|  3.17k|      sstr << indent << "ccli.max_pic_average_light_level: " << m_clli->clli.max_pic_average_light_level << "\n";
  646|  3.17k|    }
  647|  7.83k|    else {
  648|  7.83k|      sstr << indent << "clli: ---\n";
  649|  7.83k|    }
  650|       |
  651|  11.0k|    if (m_mdcv)
  ------------------
  |  Branch (651:9): [True: 839, False: 10.1k]
  ------------------
  652|    839|    {
  653|    839|      sstr << indent << "mdcv.display_primaries (x,y): ";
  654|    839|      sstr << "(" << m_mdcv->mdcv.display_primaries_x[0] << ";" << m_mdcv->mdcv.display_primaries_y[0] << "), ";
  655|    839|      sstr << "(" << m_mdcv->mdcv.display_primaries_x[1] << ";" << m_mdcv->mdcv.display_primaries_y[1] << "), ";
  656|    839|      sstr << "(" << m_mdcv->mdcv.display_primaries_x[2] << ";" << m_mdcv->mdcv.display_primaries_y[2] << ")\n";
  657|       |
  658|    839|      sstr << indent << "mdcv.white point (x,y): (" << m_mdcv->mdcv.white_point_x << ";" << m_mdcv->mdcv.white_point_y << ")\n";
  659|    839|      sstr << indent << "mdcv.max display mastering luminance: " << m_mdcv->mdcv.max_display_mastering_luminance << "\n";
  660|    839|      sstr << indent << "mdcv.min display mastering luminance: " << m_mdcv->mdcv.min_display_mastering_luminance << "\n";
  661|    839|    }
  662|  10.1k|    else {
  663|  10.1k|      sstr << indent << "mdcv: ---\n";
  664|  10.1k|    }
  665|       |
  666|  11.0k|    if (m_cclv)
  ------------------
  |  Branch (666:9): [True: 2.65k, False: 8.36k]
  ------------------
  667|  2.65k|    {
  668|  2.65k|      sstr << indent << "cclv.ccv_primaries_present_flag: " << m_cclv->ccv_primaries_are_valid() << "\n";
  669|  2.65k|      sstr << indent << "cclv.ccv_min_luminance_value_present_flag: " << m_cclv->min_luminance_is_valid() << "\n";
  670|  2.65k|      sstr << indent << "cclv.ccv_max_luminance_value_present_flag: " << m_cclv->max_luminance_is_valid() << "\n";
  671|  2.65k|      sstr << indent << "cclv.ccv_avg_luminance_value_present_flag: " << m_cclv->avg_luminance_is_valid() << "\n";
  672|  2.65k|      if (m_cclv->ccv_primaries_are_valid())
  ------------------
  |  Branch (672:11): [True: 350, False: 2.30k]
  ------------------
  673|    350|      {
  674|    350|        sstr << indent << "cclv.ccv_primaries (x,y): ";
  675|    350|        sstr << "(" << m_cclv->get_ccv_primary_x0() << ";" << m_cclv->get_ccv_primary_y0() << "), ";
  676|    350|        sstr << "(" << m_cclv->get_ccv_primary_x1() << ";" << m_cclv->get_ccv_primary_y1() << "), ";
  677|    350|        sstr << "(" << m_cclv->get_ccv_primary_x2() << ";" << m_cclv->get_ccv_primary_y2() << ")\n";
  678|    350|      }
  679|  2.65k|      if (m_cclv->min_luminance_is_valid())
  ------------------
  |  Branch (679:11): [True: 351, False: 2.30k]
  ------------------
  680|    351|      {
  681|    351|        sstr << indent << "cclv.ccv_min_luminance_value: " << m_cclv->get_min_luminance() << "\n";
  682|    351|      }
  683|  2.65k|      if (m_cclv->max_luminance_is_valid())
  ------------------
  |  Branch (683:11): [True: 1.84k, False: 808]
  ------------------
  684|  1.84k|      {
  685|  1.84k|        sstr << indent << "cclv.ccv_max_luminance_value: " << m_cclv->get_max_luminance() << "\n";
  686|  1.84k|      }
  687|  2.65k|      if (m_cclv->avg_luminance_is_valid())
  ------------------
  |  Branch (687:11): [True: 419, False: 2.23k]
  ------------------
  688|    419|      {
  689|    419|        sstr << indent << "cclv.ccv_avg_luminance_value: " << m_cclv->get_avg_luminance() << "\n";
  690|    419|      }
  691|  2.65k|    }
  692|  8.36k|    else {
  693|  8.36k|      sstr << indent << "cclv: ---\n";
  694|  8.36k|    }
  695|       |
  696|  11.0k|    if (m_amve)
  ------------------
  |  Branch (696:9): [True: 499, False: 10.5k]
  ------------------
  697|    499|    {
  698|    499|      sstr << indent << "amve.ambient_illumination: " << m_amve->amve.ambient_illumination << "\n";
  699|    499|      sstr << indent << "amve.ambient_light_x: " << m_amve->amve.ambient_light_x << "\n";
  700|    499|      sstr << indent << "amve.ambient_light_y: " << m_amve->amve.ambient_light_y << "\n";
  701|    499|    }
  702|  10.5k|    else {
  703|  10.5k|      sstr << indent << "amve: ---\n";
  704|  10.5k|    }
  705|       |
  706|  11.0k|    sstr << indent << "reve_flag: " << m_reve_flag << "\n";
  707|       |
  708|  11.0k|    if (m_reve_flag)
  ------------------
  |  Branch (708:9): [True: 2.09k, False: 8.91k]
  ------------------
  709|  2.09k|    {
  710|       |      // TODO - this isn't published yet
  711|  2.09k|    }
  712|  11.0k|    if (m_ndwt)
  ------------------
  |  Branch (712:9): [True: 3.46k, False: 7.54k]
  ------------------
  713|  3.46k|    {
  714|  3.46k|      sstr << indent << "ndwt.diffuse_white_luminance: " << m_ndwt->get_diffuse_white_luminance() << "\n";
  715|  3.46k|    }
  716|  7.54k|    else {
  717|  7.54k|      sstr << indent << "ndwt: ---\n";
  718|  7.54k|    }
  719|       |
  720|  11.0k|    if (m_gainmap_flag)
  ------------------
  |  Branch (720:9): [True: 8.94k, False: 2.06k]
  ------------------
  721|  8.94k|    {
  722|  8.94k|      if (m_tmap_clli)
  ------------------
  |  Branch (722:11): [True: 3.87k, False: 5.07k]
  ------------------
  723|  3.87k|      {
  724|  3.87k|        sstr << indent << "tmap_clli.max_content_light_level: " << m_tmap_clli->clli.max_content_light_level << "\n";
  725|  3.87k|        sstr << indent << "tmap_clli.max_pic_average_light_level: " << m_tmap_clli->clli.max_pic_average_light_level << "\n";
  726|  3.87k|      }
  727|  5.07k|      else {
  728|  5.07k|        sstr << indent << "tmap_clli: ---\n";
  729|  5.07k|      }
  730|       |
  731|  8.94k|      if (m_tmap_mdcv)
  ------------------
  |  Branch (731:11): [True: 2.25k, False: 6.68k]
  ------------------
  732|  2.25k|      {
  733|  2.25k|        sstr << indent << "tmap_mdcv.display_primaries (x,y): ";
  734|  2.25k|        sstr << "(" << m_tmap_mdcv->mdcv.display_primaries_x[0] << ";" << m_tmap_mdcv->mdcv.display_primaries_y[0] << "), ";
  735|  2.25k|        sstr << "(" << m_tmap_mdcv->mdcv.display_primaries_x[1] << ";" << m_tmap_mdcv->mdcv.display_primaries_y[1] << "), ";
  736|  2.25k|        sstr << "(" << m_tmap_mdcv->mdcv.display_primaries_x[2] << ";" << m_tmap_mdcv->mdcv.display_primaries_y[2] << ")\n";
  737|       |
  738|  2.25k|        sstr << indent << "tmap_mdcv.white point (x,y): (" << m_tmap_mdcv->mdcv.white_point_x << ";" << m_tmap_mdcv->mdcv.white_point_y << ")\n";
  739|  2.25k|        sstr << indent << "tmap_mdcv.max display mastering luminance: " << m_tmap_mdcv->mdcv.max_display_mastering_luminance << "\n";
  740|  2.25k|        sstr << indent << "tmap_mdcv.min display mastering luminance: " << m_tmap_mdcv->mdcv.min_display_mastering_luminance << "\n";
  741|  2.25k|      }
  742|  6.68k|      else {
  743|  6.68k|        sstr << indent << "tmap_mdcv: ---\n";
  744|  6.68k|      }
  745|       |
  746|  8.94k|      if (m_tmap_cclv)
  ------------------
  |  Branch (746:11): [True: 4.12k, False: 4.82k]
  ------------------
  747|  4.12k|      {
  748|  4.12k|        sstr << indent << "tmap_cclv.ccv_primaries_present_flag: " << m_tmap_cclv->ccv_primaries_are_valid() << "\n";
  749|  4.12k|        sstr << indent << "tmap_cclv.ccv_min_luminance_value_present_flag: " << m_tmap_cclv->min_luminance_is_valid() << "\n";
  750|  4.12k|        sstr << indent << "tmap_cclv.ccv_max_luminance_value_present_flag: " << m_tmap_cclv->max_luminance_is_valid() << "\n";
  751|  4.12k|        sstr << indent << "tmap_cclv.ccv_avg_luminance_value_present_flag: " << m_tmap_cclv->avg_luminance_is_valid() << "\n";
  752|  4.12k|        if (m_tmap_cclv->ccv_primaries_are_valid())
  ------------------
  |  Branch (752:13): [True: 303, False: 3.82k]
  ------------------
  753|    303|        {
  754|    303|          sstr << indent << "tmap_cclv.ccv_primaries (x,y): ";
  755|    303|          sstr << "(" << m_tmap_cclv->get_ccv_primary_x0() << ";" << m_tmap_cclv->get_ccv_primary_y0() << "), ";
  756|    303|          sstr << "(" << m_tmap_cclv->get_ccv_primary_x1() << ";" << m_tmap_cclv->get_ccv_primary_y1() << "), ";
  757|    303|          sstr << "(" << m_tmap_cclv->get_ccv_primary_x2() << ";" << m_tmap_cclv->get_ccv_primary_y2() << ")\n";
  758|    303|        }
  759|  4.12k|        if (m_tmap_cclv->min_luminance_is_valid())
  ------------------
  |  Branch (759:13): [True: 522, False: 3.60k]
  ------------------
  760|    522|        {
  761|    522|          sstr << indent << "tmap_cclv.ccv_min_luminance_value: " << m_tmap_cclv->get_min_luminance() << "\n";
  762|    522|        }
  763|  4.12k|        if (m_tmap_cclv->max_luminance_is_valid())
  ------------------
  |  Branch (763:13): [True: 565, False: 3.56k]
  ------------------
  764|    565|        {
  765|    565|          sstr << indent << "tmap_cclv.ccv_max_luminance_value: " << m_tmap_cclv->get_max_luminance() << "\n";
  766|    565|        }
  767|  4.12k|        if (m_tmap_cclv->avg_luminance_is_valid())
  ------------------
  |  Branch (767:13): [True: 494, False: 3.63k]
  ------------------
  768|    494|        {
  769|    494|          sstr << indent << "tmap_cclv.ccv_avg_luminance_value: " << m_tmap_cclv->get_avg_luminance() << "\n";
  770|    494|        }
  771|  4.12k|      }
  772|  4.82k|      else {
  773|  4.82k|        sstr << indent << "tmap_cclv: ---\n";
  774|  4.82k|      }
  775|       |
  776|  8.94k|      if (m_tmap_amve)
  ------------------
  |  Branch (776:11): [True: 3.17k, False: 5.77k]
  ------------------
  777|  3.17k|      {
  778|  3.17k|        sstr << indent << "tmap_amve.ambient_illumination: " << m_tmap_amve->amve.ambient_illumination << "\n";
  779|  3.17k|        sstr << indent << "tmap_amve.ambient_light_x: " << m_tmap_amve->amve.ambient_light_x << "\n";
  780|  3.17k|        sstr << indent << "tmap_amve.ambient_light_y: " << m_tmap_amve->amve.ambient_light_y << "\n";
  781|  3.17k|      }
  782|  5.77k|      else {
  783|  5.77k|        sstr << indent << "tmap_amve: ---\n";
  784|  5.77k|      }
  785|       |
  786|  8.94k|      sstr << indent << "tmap_reve_flag: " << m_tmap_reve_flag << "\n";
  787|       |
  788|  8.94k|      if (m_tmap_reve_flag)
  ------------------
  |  Branch (788:11): [True: 827, False: 8.11k]
  ------------------
  789|    827|      {
  790|       |        // TODO - this isn't published yet
  791|    827|      }
  792|  8.94k|      if (m_tmap_ndwt)
  ------------------
  |  Branch (792:11): [True: 1.62k, False: 7.31k]
  ------------------
  793|  1.62k|      {
  794|  1.62k|        sstr << indent << "tmap_ndwt.diffuse_white_luminance: " << m_tmap_ndwt->get_diffuse_white_luminance() << "\n";
  795|  1.62k|      }
  796|  7.31k|      else {
  797|  7.31k|        sstr << indent << "tmap_ndwt: ---\n";
  798|  7.31k|      }
  799|  8.94k|    }
  800|  11.0k|  }
  801|       |
  802|  12.1k|  if (m_alpha_flag && (m_alpha_item_data_size > 0) && (m_alpha_item_codec_config.size() > 0))
  ------------------
  |  Branch (802:7): [True: 4.31k, False: 7.84k]
  |  Branch (802:23): [True: 256, False: 4.06k]
  |  Branch (802:55): [True: 118, False: 138]
  ------------------
  803|    118|  {
  804|    118|    sstr << "alpha_item_code_config size: " << m_alpha_item_codec_config.size() << "\n";
  805|    118|  }
  806|  12.1k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_codec_config.size() > 0)
  ------------------
  |  Branch (806:7): [True: 11.0k, False: 1.14k]
  |  Branch (806:21): [True: 8.94k, False: 2.06k]
  |  Branch (806:39): [True: 926, False: 8.01k]
  ------------------
  807|    926|  {
  808|    926|    sstr << "gainmap_item_codec_config size: " << m_gainmap_item_codec_config.size() << "\n";
  809|    926|  }
  810|  12.1k|  if (m_main_item_codec_config.size() > 0)
  ------------------
  |  Branch (810:7): [True: 552, False: 11.6k]
  ------------------
  811|    552|  {
  812|    552|    sstr << "main_item_code_config size: " << m_main_item_codec_config.size() << "\n";
  813|    552|  }
  814|       |
  815|  12.1k|  if (m_icc_flag)
  ------------------
  |  Branch (815:7): [True: 3.50k, False: 8.66k]
  ------------------
  816|  3.50k|  {
  817|  3.50k|    sstr << "icc_data size: " << m_icc_data.size() << "\n";
  818|  3.50k|  }
  819|  12.1k|  if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag)
  ------------------
  |  Branch (819:7): [True: 11.0k, False: 1.14k]
  |  Branch (819:21): [True: 8.94k, False: 2.06k]
  |  Branch (819:39): [True: 964, False: 7.98k]
  ------------------
  820|    964|  {
  821|    964|    sstr << "tmap_icc_data size: " << m_tmap_icc_data.size() << "\n";
  822|    964|  }
  823|  12.1k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_metadata.size() > 0)
  ------------------
  |  Branch (823:7): [True: 11.0k, False: 1.14k]
  |  Branch (823:21): [True: 8.94k, False: 2.06k]
  |  Branch (823:39): [True: 162, False: 8.78k]
  ------------------
  824|    162|  {
  825|    162|    sstr << "gainmap_metadata size: " << m_gainmap_metadata.size() << "\n";
  826|    162|  }
  827|       |
  828|  12.1k|  if (m_alpha_flag && (m_alpha_item_data_size > 0))
  ------------------
  |  Branch (828:7): [True: 4.31k, False: 7.84k]
  |  Branch (828:23): [True: 256, False: 4.06k]
  ------------------
  829|    256|  {
  830|    256|    sstr << "alpha_item_data offset: " << m_alpha_item_data_offset << ", size: " << m_alpha_item_data_size << "\n";
  831|    256|  }
  832|  12.1k|  if (m_hdr_flag && m_gainmap_flag && (m_gainmap_item_data_size > 0))
  ------------------
  |  Branch (832:7): [True: 11.0k, False: 1.14k]
  |  Branch (832:21): [True: 8.94k, False: 2.06k]
  |  Branch (832:39): [True: 1.31k, False: 7.63k]
  ------------------
  833|  1.31k|  {
  834|  1.31k|    sstr << "gainmap_item_data offset: " << m_gainmap_item_data_offset << ", size: " << m_gainmap_item_data_size << "\n";
  835|  1.31k|  }
  836|       |
  837|  12.1k|  sstr << "main_item_data offset: " << m_main_item_data_offset << ", size: " << m_main_item_data_size << "\n";
  838|       |
  839|  12.1k|  if (m_exif_flag)
  ------------------
  |  Branch (839:7): [True: 4.00k, False: 8.15k]
  ------------------
  840|  4.00k|  {
  841|  4.00k|    sstr << "exif_data offset: " << m_exif_item_data_offset << ", size: " << m_exif_data_size << "\n";
  842|  4.00k|  }
  843|  12.1k|  if (m_xmp_flag)
  ------------------
  |  Branch (843:7): [True: 6.31k, False: 5.84k]
  ------------------
  844|  6.31k|  {
  845|  6.31k|    sstr << "xmp_data offset: " << m_xmp_item_data_offset << ", size: " << m_xmp_data_size << "\n";
  846|  6.31k|  }
  847|  12.1k|  return;
  848|  12.1k|}

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

_ZN18color_profile_nclx5parseER14BitstreamRange:
  223|    106|{
  224|    106|  StreamReader::grow_status status;
  225|    106|  status = range.wait_for_available_bytes(7);
  226|    106|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (226:7): [True: 4, False: 102]
  ------------------
  227|       |    // TODO: return recoverable error at timeout
  228|      4|    return Error(heif_error_Invalid_input,
  229|      4|                 heif_suberror_End_of_data);
  230|      4|  }
  231|       |
  232|    102|  m_profile.m_colour_primaries = range.read16();
  233|    102|  m_profile.m_transfer_characteristics = range.read16();
  234|    102|  m_profile.m_matrix_coefficients = range.read16();
  235|    102|  m_profile.m_full_range_flag = (range.read8() & 0x80 ? true : false);
  ------------------
  |  Branch (235:34): [True: 1, False: 101]
  ------------------
  236|       |
  237|    102|  return Error::Ok;
  238|    106|}
_ZN18color_profile_nclx10parse_nclcER14BitstreamRange:
  241|    176|{
  242|    176|  StreamReader::grow_status status;
  243|    176|  status = range.wait_for_available_bytes(6);
  244|    176|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (244:7): [True: 2, False: 174]
  ------------------
  245|       |    // TODO: return recoverable error at timeout
  246|      2|    return Error(heif_error_Invalid_input,
  247|      2|                 heif_suberror_End_of_data);
  248|      2|  }
  249|       |
  250|    174|  m_profile.m_colour_primaries = range.read16();
  251|    174|  m_profile.m_transfer_characteristics = range.read16();
  252|    174|  m_profile.m_matrix_coefficients = range.read16();
  253|       |
  254|       |  // use full range for RGB, limited range otherwise
  255|    174|  m_profile.m_full_range_flag = (m_profile.m_matrix_coefficients == 0);
  256|       |
  257|    174|  return Error::Ok;
  258|    176|}
_ZN12nclx_profile17set_sRGB_defaultsEv:
  315|    282|{
  316|       |  // sRGB defaults
  317|    282|  m_colour_primaries = 1;
  318|    282|  m_transfer_characteristics = 13;
  319|    282|  m_matrix_coefficients = 6;
  320|    282|  m_full_range_flag = true;
  321|    282|}
_ZN8Box_colr5parseER14BitstreamRangePK20heif_security_limits:
  385|  5.35k|{
  386|  5.35k|  StreamReader::grow_status status;
  387|  5.35k|  uint32_t colour_type = range.read32();
  388|       |
  389|  5.35k|  if (colour_type == fourcc("nclx")) {
  ------------------
  |  Branch (389:7): [True: 106, False: 5.24k]
  ------------------
  390|    106|    auto color_profile = std::make_shared<color_profile_nclx>();
  391|    106|    m_color_profile = color_profile;
  392|    106|    Error err = color_profile->parse(range);
  393|    106|    if (err) {
  ------------------
  |  Branch (393:9): [True: 4, False: 102]
  ------------------
  394|      4|      return err;
  395|      4|    }
  396|    106|  }
  397|  5.24k|  else if (colour_type == fourcc("nclc")) {
  ------------------
  |  Branch (397:12): [True: 176, False: 5.07k]
  ------------------
  398|    176|    auto color_profile = std::make_shared<color_profile_nclx>();
  399|    176|    m_color_profile = color_profile;
  400|    176|    Error err = color_profile->parse_nclc(range);
  401|    176|    if (err) {
  ------------------
  |  Branch (401:9): [True: 2, False: 174]
  ------------------
  402|      2|      return err;
  403|      2|    }
  404|    176|  }
  405|  5.07k|  else if (colour_type == fourcc("prof") ||
  ------------------
  |  Branch (405:12): [True: 1.30k, False: 3.76k]
  ------------------
  406|  4.96k|           colour_type == fourcc("rICC")) {
  ------------------
  |  Branch (406:12): [True: 3.65k, False: 105]
  ------------------
  407|  4.96k|    if (!has_fixed_box_size()) {
  ------------------
  |  Branch (407:9): [True: 2, False: 4.96k]
  ------------------
  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.96k|    uint64_t profile_size_64 = get_box_size() - get_header_size() - 4;
  412|  4.96k|    if (limits->max_color_profile_size && profile_size_64 > limits->max_color_profile_size) {
  ------------------
  |  Branch (412:9): [True: 4.96k, False: 0]
  |  Branch (412:43): [True: 0, False: 4.96k]
  ------------------
  413|      0|      return Error(heif_error_Invalid_input, heif_suberror_Security_limit_exceeded, "Color profile exceeds maximum supported size");
  414|      0|    }
  415|       |
  416|  4.96k|    size_t profile_size = static_cast<size_t>(profile_size_64);
  417|       |
  418|  4.96k|    status = range.wait_for_available_bytes(profile_size);
  419|  4.96k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (419:9): [True: 0, False: 4.96k]
  ------------------
  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.96k|    std::vector<uint8_t> rawData(profile_size);
  426|  72.0k|    for (size_t i = 0; i < profile_size; i++) {
  ------------------
  |  Branch (426:24): [True: 67.1k, False: 4.96k]
  ------------------
  427|  67.1k|      rawData[i] = range.read8();
  428|  67.1k|    }
  429|       |
  430|  4.96k|    m_color_profile = std::make_shared<color_profile_raw>(colour_type, rawData);
  431|  4.96k|  }
  432|    105|  else {
  433|    105|    return Error(heif_error_Invalid_input,
  434|    105|                 heif_suberror_Unknown_color_profile_type);
  435|    105|  }
  436|       |
  437|  5.24k|  return range.get_error();
  438|  5.35k|}
_ZNK8Box_colr4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  442|  3.22k|{
  443|  3.22k|  Box::dump(sstr, indent, full_log);
  444|       |
  445|  3.22k|  if (m_color_profile) {
  ------------------
  |  Branch (445:7): [True: 3.22k, False: 0]
  ------------------
  446|  3.22k|    sstr << indent << "colour_type: " << fourcc_to_string(get_color_profile_type()) << "\n";
  447|  3.22k|    m_color_profile->dump(sstr, indent, full_log);
  448|  3.22k|  }
  449|      0|  else {
  450|      0|    sstr << indent << "colour_type: ---\n";
  451|      0|    sstr << "no color profile\n";
  452|      0|  }
  453|       |
  454|  3.22k|  return;
  455|  3.22k|}
_ZNK17color_profile_raw4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  459|  2.99k|{
  460|  2.99k|  sstr << indent << "profile size: " << m_data.size() << "\n";
  461|  2.99k|  return;
  462|  2.99k|}
_ZNK18color_profile_nclx4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  466|    231|{
  467|    231|  sstr << indent << "colour_primaries: " << m_profile.m_colour_primaries << "\n"
  468|    231|       << indent << "transfer_characteristics: " << m_profile.m_transfer_characteristics << "\n"
  469|    231|       << indent << "matrix_coefficients: " << m_profile.m_matrix_coefficients << "\n"
  470|    231|       << indent << "full_range_flag: " << m_profile.m_full_range_flag << "\n";
  471|    231|  return;
  472|    231|}

_ZN17color_profile_rawC2EjRKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  105|  4.96k|      : m_type(type), m_data(data) {}
_ZNK17color_profile_raw8get_typeEv:
  107|  2.99k|  uint32_t get_type() const override { return m_type; }
_ZN18color_profile_nclxC2Ev:
  175|    282|  color_profile_nclx() { m_profile.set_sRGB_defaults(); }
_ZNK18color_profile_nclx8get_typeEv:
  184|    231|  uint32_t get_type() const override { return fourcc("nclx"); }
_ZN8Box_colrC2Ev:
  205|  5.35k|  {
  206|  5.35k|    set_short_type(fourcc("colr"));
  207|  5.35k|  }
_ZNK8Box_colr22get_color_profile_typeEv:
  211|  3.22k|  uint32_t get_color_profile_type() const { return m_color_profile->get_type(); }
_ZN13color_profileD2Ev:
   92|  5.24k|  virtual ~color_profile() = default;

_ZN8Box_prfr5parseER14BitstreamRangePK20heif_security_limits:
   29|    878|{
   30|    878|  parse_full_box_header(range);
   31|       |
   32|    878|  if (get_version() > 0) {
  ------------------
  |  Branch (32:7): [True: 98, False: 780]
  ------------------
   33|     98|    return unsupported_version_error("prfr");
   34|     98|  }
   35|       |
   36|    780|  uint8_t projection_type = (range.read8() & 0x1F);
   37|    780|  m_projection = static_cast<heif_omaf_image_projection>(projection_type);
   38|    780|  return range.get_error();
   39|    878|}
_ZNK8Box_prfr4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
   42|    755|{
   43|    755|  Box::dump(sstr, indent, full_log);
   44|    755|  sstr << indent << "projection_type: ";
   45|    755|  switch (m_projection) {
   46|     81|    case heif_omaf_image_projection_equirectangular:
  ------------------
  |  Branch (46:5): [True: 81, False: 674]
  ------------------
   47|     81|      sstr << "equirectangular\n";
   48|     81|      break;
   49|    346|    case heif_omaf_image_projection_cube_map:
  ------------------
  |  Branch (49:5): [True: 346, False: 409]
  ------------------
   50|    346|      sstr << "cube-map\n";
   51|    346|      break;
   52|    328|    default:
  ------------------
  |  Branch (52:5): [True: 328, False: 427]
  ------------------
   53|    328|      sstr << "unknown (" << m_projection << ")\n";
   54|    328|      break;
   55|    755|  }
   56|    755|  return;
   57|    755|}

_ZN8Box_prfrC2Ev:
   37|    881|  {
   38|    881|    set_short_type(fourcc("prfr"));
   39|    881|  }
_ZNK8Box_prfr14debug_box_nameEv:
   47|    755|  const char* debug_box_name() const override { return "Projection Format"; }
_ZNK8Box_prfr24get_parse_error_fatalityEv:
   49|    110|  [[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:
  687|      2|{
  688|      2|  return &decoder_openjpeg;
  689|      2|}
decoder_openjpeg.cc:_ZL20openjpeg_init_pluginv:
   62|      2|{
   63|      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:
  168|  73.2k|{
  169|  73.2k|  static std::mutex sMutex;
  170|  73.2k|  return sMutex;
  171|  73.2k|}
_ZN18TotalMemoryTrackerC2EPK20heif_security_limits:
  176|  15.0k|{
  177|  15.0k|  std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  178|       |
  179|  15.0k|  sMemoryUsage[limits] = {};
  180|  15.0k|  m_limits_context = limits;
  181|  15.0k|}
_ZN18TotalMemoryTrackerD2Ev:
  184|  15.0k|{
  185|  15.0k|  std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  186|  15.0k|  sMemoryUsage.erase(m_limits_context);
  187|  15.0k|}
_ZN12MemoryHandle5allocEmmPK20heif_security_limitsPKc:
  208|  7.56k|{
  209|  7.56k|  if (element_size != 0 && count > SIZE_MAX / element_size) {
  ------------------
  |  Branch (209:7): [True: 7.56k, False: 0]
  |  Branch (209:28): [True: 0, False: 7.56k]
  ------------------
  210|      0|    std::stringstream sstr;
  211|      0|    if (reason_description) {
  ------------------
  |  Branch (211:9): [True: 0, False: 0]
  ------------------
  212|      0|      sstr << "Allocation size overflow computing " << count << " * " << element_size
  213|      0|           << " for " << reason_description;
  214|      0|    }
  215|      0|    else {
  216|      0|      sstr << "Allocation size overflow computing " << count << " * " << element_size;
  217|      0|    }
  218|      0|    return {heif_error_Memory_allocation_error,
  219|      0|            heif_suberror_Security_limit_exceeded,
  220|      0|            sstr.str()};
  221|      0|  }
  222|  7.56k|  return alloc(count * element_size, limits_context, reason_description);
  223|  7.56k|}
_ZN12MemoryHandle5allocEmPK20heif_security_limitsPKc:
  228|  21.6k|{
  229|       |  // --- check whether limits are exceeded
  230|       |
  231|  21.6k|  if (!limits_context) {
  ------------------
  |  Branch (231:7): [True: 0, False: 21.6k]
  ------------------
  232|      0|    return Error::Ok;
  233|      0|  }
  234|       |
  235|       |  // check against maximum memory block size
  236|       |
  237|  21.6k|  if (limits_context->max_memory_block_size != 0 &&
  ------------------
  |  Branch (237:7): [True: 21.6k, False: 0]
  ------------------
  238|  21.6k|      memory_amount > limits_context->max_memory_block_size) {
  ------------------
  |  Branch (238:7): [True: 17, False: 21.6k]
  ------------------
  239|     17|    std::stringstream sstr;
  240|       |
  241|     17|    if (reason_description) {
  ------------------
  |  Branch (241:9): [True: 17, False: 0]
  ------------------
  242|     17|      sstr << "Allocating " << memory_amount << " bytes for " << reason_description <<" exceeds the security limit of "
  243|     17|           << limits_context->max_memory_block_size << " bytes";
  244|     17|    }
  245|      0|    else {
  246|      0|      sstr << "Allocating " << memory_amount << " bytes exceeds the security limit of "
  247|      0|           << limits_context->max_memory_block_size << " bytes";
  248|      0|    }
  249|       |
  250|     17|    return {heif_error_Memory_allocation_error,
  251|     17|            heif_suberror_Security_limit_exceeded,
  252|     17|            sstr.str()};
  253|     17|  }
  254|       |
  255|       |  // Resolve to the registered (root) context for total-memory accounting.
  256|       |  // The passed-in limits may be a stack-local derived copy (e.g. tightened for
  257|       |  // ispe) whose `parent` points back to the registered context.
  258|  21.6k|  const heif_security_limits* root_limits = limits_context;
  259|  21.6k|  while (root_limits->version >= 4 && root_limits->parent) {
  ------------------
  |  Branch (259:10): [True: 21.6k, False: 0]
  |  Branch (259:39): [True: 0, False: 21.6k]
  ------------------
  260|      0|    root_limits = root_limits->parent;
  261|      0|  }
  262|       |
  263|       |  // we allow several allocations on the same handle, but they have to be for the same registered context
  264|  21.6k|  if (m_limits_context) {
  ------------------
  |  Branch (264:7): [True: 0, False: 21.6k]
  ------------------
  265|      0|    assert(m_limits_context == root_limits);
  ------------------
  |  Branch (265:5): [True: 0, False: 0]
  ------------------
  266|      0|  }
  267|       |
  268|  21.6k|  if (root_limits == &global_security_limits ||
  ------------------
  |  Branch (268:7): [True: 0, False: 21.6k]
  ------------------
  269|  21.6k|      root_limits == &disabled_security_limits) {
  ------------------
  |  Branch (269:7): [True: 0, False: 21.6k]
  ------------------
  270|      0|    return Error::Ok;
  271|      0|  }
  272|       |
  273|  21.6k|  std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  274|  21.6k|  auto it = sMemoryUsage.find(root_limits);
  275|  21.6k|  if (it == sMemoryUsage.end()) {
  ------------------
  |  Branch (275:7): [True: 0, False: 21.6k]
  ------------------
  276|       |    // Unregistered limits context with no resolvable parent — total-memory
  277|       |    // tracking is not available, but the per-block check above still applies.
  278|      0|    return Error::Ok;
  279|      0|  }
  280|       |
  281|       |  // check against maximum total memory usage
  282|       |
  283|  21.6k|  if (limits_context->max_total_memory != 0 &&
  ------------------
  |  Branch (283:7): [True: 21.6k, False: 0]
  ------------------
  284|  21.6k|      it->second.total_memory_usage + memory_amount > limits_context->max_total_memory) {
  ------------------
  |  Branch (284:7): [True: 32, False: 21.5k]
  ------------------
  285|     32|    std::stringstream sstr;
  286|       |
  287|     32|    if (reason_description) {
  ------------------
  |  Branch (287:9): [True: 32, False: 0]
  ------------------
  288|     32|      sstr << "Memory usage of " << it->second.total_memory_usage + memory_amount
  289|     32|           << " bytes for " << reason_description << " exceeds the security limit of "
  290|     32|           << limits_context->max_total_memory << " bytes of total memory usage";
  291|     32|    }
  292|      0|    else {
  293|      0|      sstr << "Memory usage of " << it->second.total_memory_usage + memory_amount
  294|      0|           << " bytes exceeds the security limit of "
  295|      0|           << limits_context->max_total_memory << " bytes of total memory usage";
  296|      0|    }
  297|       |
  298|     32|    return {heif_error_Memory_allocation_error,
  299|     32|            heif_suberror_Security_limit_exceeded,
  300|     32|            sstr.str()};
  301|     32|  }
  302|       |
  303|       |
  304|       |  // --- register memory usage
  305|       |
  306|  21.5k|  m_limits_context = root_limits;
  307|  21.5k|  m_memory_amount += memory_amount;
  308|       |
  309|  21.5k|  it->second.total_memory_usage += memory_amount;
  310|       |
  311|       |  // remember maximum memory usage (for informational purpose)
  312|  21.5k|  if (it->second.total_memory_usage > it->second.max_memory_usage) {
  ------------------
  |  Branch (312:7): [True: 3.50k, False: 18.0k]
  ------------------
  313|  3.50k|    it->second.max_memory_usage = it->second.total_memory_usage;
  314|  3.50k|  }
  315|       |
  316|  21.5k|  return Error::Ok;
  317|  21.6k|}
_ZN12MemoryHandle4freeEv:
  321|  23.2k|{
  322|  23.2k|  if (m_limits_context) {
  ------------------
  |  Branch (322:7): [True: 21.5k, False: 1.67k]
  ------------------
  323|  21.5k|    std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  324|       |
  325|  21.5k|    auto it = sMemoryUsage.find(m_limits_context);
  326|  21.5k|    if (it != sMemoryUsage.end()) {
  ------------------
  |  Branch (326:9): [True: 21.5k, False: 0]
  ------------------
  327|  21.5k|      it->second.total_memory_usage -= m_memory_amount;
  328|  21.5k|    }
  329|       |
  330|  21.5k|    m_limits_context = nullptr;
  331|  21.5k|    m_memory_amount = 0;
  332|  21.5k|  }
  333|  23.2k|}

_ZN12MemoryHandleD2Ev:
  159|  23.2k|  ~MemoryHandle() { free(); }
_ZN12MemoryHandleC2Ev:
  158|  23.2k|  MemoryHandle() = default;

_ZN13Box_container5parseER14BitstreamRangePK20heif_security_limits:
   30|  2.28k|{
   31|  2.28k|  return read_children(range, READ_CHILDREN_ALL, limits);
   32|  2.28k|}
_ZNK13Box_container4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
   36|  1.90k|{
   37|  1.90k|  Box::dump(sstr, indent, full_log);
   38|  1.90k|  dump_children(sstr, indent, full_log);
   39|       |
   40|  1.90k|  return;
   41|  1.90k|}
_ZNK8Box_mvhd18get_matrix_elementEi:
   45|  8.68k|{
   46|  8.68k|  if (idx == 8) {
  ------------------
  |  Branch (46:7): [True: 965, False: 7.72k]
  ------------------
   47|    965|    return 1.0;
   48|    965|  }
   49|       |
   50|  7.72k|  return m_matrix[idx] / double(0x10000);
   51|  8.68k|}
_ZN8Box_mvhd5parseER14BitstreamRangePK20heif_security_limits:
   55|  1.46k|{
   56|  1.46k|  parse_full_box_header(range);
   57|       |
   58|  1.46k|  if (get_version() > 1) {
  ------------------
  |  Branch (58:7): [True: 1, False: 1.46k]
  ------------------
   59|      1|    return unsupported_version_error("mvhd");
   60|      1|  }
   61|       |
   62|  1.46k|  if (get_version() == 1) {
  ------------------
  |  Branch (62:7): [True: 79, False: 1.38k]
  ------------------
   63|     79|    m_creation_time = range.read64();
   64|     79|    m_modification_time = range.read64();
   65|     79|    m_timescale = range.read32();
   66|     79|    m_duration = range.read64();
   67|     79|  }
   68|  1.38k|  else {
   69|       |    // version==0
   70|  1.38k|    m_creation_time = range.read32();
   71|  1.38k|    m_modification_time = range.read32();
   72|  1.38k|    m_timescale = range.read32();
   73|  1.38k|    m_duration = range.read32();
   74|  1.38k|  }
   75|       |
   76|  1.46k|  m_rate = range.read32();
   77|  1.46k|  m_volume = range.read16();
   78|  1.46k|  range.skip(2);
   79|  1.46k|  range.skip(8);
   80|  13.1k|  for (uint32_t& m : m_matrix) {
  ------------------
  |  Branch (80:20): [True: 13.1k, False: 1.46k]
  ------------------
   81|  13.1k|    m = range.read32();
   82|  13.1k|  }
   83|  10.2k|  for (int i = 0; i < 6; i++) {
  ------------------
  |  Branch (83:19): [True: 8.79k, False: 1.46k]
  ------------------
   84|  8.79k|    range.skip(4);
   85|  8.79k|  }
   86|       |
   87|  1.46k|  m_next_track_ID = range.read32();
   88|       |
   89|  1.46k|  return range.get_error();
   90|  1.46k|}
_ZNK8Box_mvhd4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
   94|    965|{
   95|    965|  FullBox::dump(sstr, indent, full_log);
   96|    965|  sstr << indent << "creation time:     " << m_creation_time << "\n"
   97|    965|      << indent << "modification time: " << m_modification_time << "\n"
   98|    965|      << indent << "timescale: " << m_timescale << "\n"
   99|    965|      << indent << "duration: " << m_duration << "\n";
  100|    965|  sstr << indent << "rate: " << get_rate() << "\n"
  101|    965|      << indent << "volume: " << get_volume() << "\n"
  102|    965|      << indent << "matrix:\n";
  103|  3.86k|  for (int y = 0; y < 3; y++) {
  ------------------
  |  Branch (103:19): [True: 2.89k, False: 965]
  ------------------
  104|  2.89k|    sstr << indent << "  ";
  105|  11.5k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (105:21): [True: 8.68k, False: 2.89k]
  ------------------
  106|  8.68k|      sstr << get_matrix_element(i + 3 * y) << " ";
  107|  8.68k|    }
  108|  2.89k|    sstr << "\n";
  109|  2.89k|  }
  110|    965|  sstr << indent << "next_track_ID: " << m_next_track_ID << "\n";
  111|       |
  112|    965|  return;
  113|    965|}
_ZNK8Box_tkhd18get_matrix_elementEi:
  168|  10.2k|{
  169|  10.2k|  if (idx == 8) {
  ------------------
  |  Branch (169:7): [True: 1.14k, False: 9.15k]
  ------------------
  170|  1.14k|    return 1.0;
  171|  1.14k|  }
  172|       |
  173|  9.15k|  return m_matrix[idx] / double(0x10000);
  174|  10.2k|}
_ZN8Box_tkhd5parseER14BitstreamRangePK20heif_security_limits:
  178|  1.24k|{
  179|  1.24k|  parse_full_box_header(range);
  180|       |
  181|  1.24k|  if (get_version() > 1) {
  ------------------
  |  Branch (181:7): [True: 1, False: 1.24k]
  ------------------
  182|      1|    return unsupported_version_error("tkhd");
  183|      1|  }
  184|       |
  185|  1.24k|  if (get_version() == 1) {
  ------------------
  |  Branch (185:7): [True: 86, False: 1.15k]
  ------------------
  186|     86|    m_creation_time = range.read64();
  187|     86|    m_modification_time = range.read64();
  188|     86|    m_track_id = range.read32();
  189|     86|    range.skip(4);
  190|     86|    m_duration = range.read64();
  191|     86|  }
  192|  1.15k|  else {
  193|       |    // version==0
  194|  1.15k|    m_creation_time = range.read32();
  195|  1.15k|    m_modification_time = range.read32();
  196|  1.15k|    m_track_id = range.read32();
  197|  1.15k|    range.skip(4);
  198|  1.15k|    m_duration = range.read32();
  199|  1.15k|  }
  200|       |
  201|  1.24k|  range.skip(8);
  202|  1.24k|  m_layer = range.read16();
  203|  1.24k|  m_alternate_group = range.read16();
  204|  1.24k|  m_volume = range.read16();
  205|  1.24k|  range.skip(2);
  206|  11.2k|  for (uint32_t& m : m_matrix) {
  ------------------
  |  Branch (206:20): [True: 11.2k, False: 1.24k]
  ------------------
  207|  11.2k|    m = range.read32();
  208|  11.2k|  }
  209|       |
  210|  1.24k|  m_width = range.read32();
  211|  1.24k|  m_height = range.read32();
  212|       |
  213|  1.24k|  return range.get_error();
  214|  1.24k|}
_ZNK8Box_tkhd4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  218|  1.14k|{
  219|  1.14k|  FullBox::dump(sstr, indent, full_log);
  220|  1.14k|  sstr << indent << "track enabled: " << ((get_flags() & Track_enabled) ? "yes" : "no") << "\n"
  ------------------
  |  Branch (220:43): [True: 279, False: 865]
  ------------------
  221|  1.14k|       << indent << "track in movie: " << ((get_flags() & Track_in_movie) ? "yes" : "no") << "\n"
  ------------------
  |  Branch (221:44): [True: 289, False: 855]
  ------------------
  222|  1.14k|       << indent << "track in preview: " << ((get_flags() & Track_in_preview) ? "yes" : "no") << "\n"
  ------------------
  |  Branch (222:46): [True: 290, False: 854]
  ------------------
  223|  1.14k|       << indent << "track size is aspect ratio: " << ((get_flags() & Track_size_is_aspect_ratio) ? "yes" : "no") << "\n";
  ------------------
  |  Branch (223:56): [True: 274, False: 870]
  ------------------
  224|  1.14k|  sstr << indent << "creation time:     " << m_creation_time << "\n"
  225|  1.14k|      << indent << "modification time: " << m_modification_time << "\n"
  226|  1.14k|      << indent << "track ID: " << m_track_id << "\n"
  227|  1.14k|      << indent << "duration: " << m_duration << "\n";
  228|  1.14k|  sstr << indent << "layer: " << m_layer << "\n"
  229|  1.14k|      << indent << "alternate_group: " << m_alternate_group << "\n"
  230|  1.14k|      << indent << "volume: " << get_volume() << "\n"
  231|  1.14k|      << indent << "matrix:\n";
  232|  4.57k|  for (int y = 0; y < 3; y++) {
  ------------------
  |  Branch (232:19): [True: 3.43k, False: 1.14k]
  ------------------
  233|  3.43k|    sstr << indent << "  ";
  234|  13.7k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (234:21): [True: 10.2k, False: 3.43k]
  ------------------
  235|  10.2k|      sstr << get_matrix_element(i + 3 * y) << " ";
  236|  10.2k|    }
  237|  3.43k|    sstr << "\n";
  238|  3.43k|  }
  239|       |
  240|  1.14k|  sstr << indent << "width: " << get_width() << "\n"
  241|  1.14k|      << indent << "height: " << get_height() << "\n";
  242|       |
  243|  1.14k|  return;
  244|  1.14k|}
_ZN8Box_mdhd5parseER14BitstreamRangePK20heif_security_limits:
  299|    474|{
  300|    474|  parse_full_box_header(range);
  301|       |
  302|    474|  if (get_version() > 1) {
  ------------------
  |  Branch (302:7): [True: 5, False: 469]
  ------------------
  303|      5|    return unsupported_version_error("mdhd");
  304|      5|  }
  305|       |
  306|    469|  if (get_version() == 1) {
  ------------------
  |  Branch (306:7): [True: 67, False: 402]
  ------------------
  307|     67|    m_creation_time = range.read64();
  308|     67|    m_modification_time = range.read64();
  309|     67|    m_timescale = range.read32();
  310|     67|    m_duration = range.read64();
  311|     67|  }
  312|    402|  else {
  313|       |    // version==0
  314|    402|    m_creation_time = range.read32();
  315|    402|    m_modification_time = range.read32();
  316|    402|    m_timescale = range.read32();
  317|    402|    m_duration = range.read32();
  318|    402|  }
  319|       |
  320|    469|  uint16_t language_packed = range.read16();
  321|    469|  m_language[0] = ((language_packed >> 10) & 0x1F) + 0x60;
  322|    469|  m_language[1] = ((language_packed >> 5) & 0x1F) + 0x60;
  323|    469|  m_language[2] = ((language_packed >> 0) & 0x1F) + 0x60;
  324|    469|  m_language[3] = 0;
  325|       |
  326|    469|  range.skip(2);
  327|       |
  328|    469|  return range.get_error();
  329|    474|}
_ZNK8Box_mdhd4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  333|    412|{
  334|    412|  FullBox::dump(sstr, indent, full_log);
  335|    412|  sstr << indent << "creation time:     " << m_creation_time << "\n"
  336|    412|      << indent << "modification time: " << m_modification_time << "\n"
  337|    412|      << indent << "timescale: " << m_timescale << "\n"
  338|    412|      << indent << "duration: " << m_duration << "\n";
  339|    412|  sstr << indent << "language: " << m_language << "\n";
  340|       |
  341|    412|  return;
  342|    412|}
_ZN8Box_vmhd5parseER14BitstreamRangePK20heif_security_limits:
  390|    496|{
  391|    496|  parse_full_box_header(range);
  392|       |
  393|    496|  if (get_version() > 0) {
  ------------------
  |  Branch (393:7): [True: 1, False: 495]
  ------------------
  394|      1|    return unsupported_version_error("vmhd");
  395|      1|  }
  396|       |
  397|    495|  m_graphics_mode = range.read16();
  398|  1.48k|  for (uint16_t& c : m_op_color) {
  ------------------
  |  Branch (398:20): [True: 1.48k, False: 495]
  ------------------
  399|  1.48k|    c = range.read16();
  400|  1.48k|  }
  401|       |
  402|    495|  return range.get_error();
  403|    496|}
_ZNK8Box_vmhd4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  407|    467|{
  408|    467|  FullBox::dump(sstr, indent, full_log);
  409|    467|  sstr << indent << "graphics mode: " << m_graphics_mode;
  410|    467|  if (m_graphics_mode == 0) {
  ------------------
  |  Branch (410:7): [True: 190, False: 277]
  ------------------
  411|    190|    sstr << " (copy)";
  412|    190|  }
  413|    467|  sstr << "\n"
  414|    467|       << indent << "op color: " << m_op_color[0] << "; " << m_op_color[1] << "; " << m_op_color[2] << "\n";
  415|       |
  416|    467|  return;
  417|    467|}
_ZN8Box_nmhd5parseER14BitstreamRangePK20heif_security_limits:
  436|    352|{
  437|    352|  parse_full_box_header(range);
  438|       |
  439|    352|  if (get_version() > 0) {
  ------------------
  |  Branch (439:7): [True: 1, False: 351]
  ------------------
  440|      1|    return unsupported_version_error("nmhd");
  441|      1|  }
  442|       |
  443|    351|  return range.get_error();
  444|    352|}
_ZNK8Box_nmhd4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  448|    205|{
  449|    205|  FullBox::dump(sstr, indent, full_log);
  450|       |
  451|    205|  return;
  452|    205|}
_ZN8Box_stsd5parseER14BitstreamRangePK20heif_security_limits:
  466|  1.58k|{
  467|  1.58k|  parse_full_box_header(range);
  468|       |
  469|  1.58k|  if (get_version() > 0) {
  ------------------
  |  Branch (469:7): [True: 8, False: 1.58k]
  ------------------
  470|      8|    return unsupported_version_error("stsd");
  471|      8|  }
  472|       |
  473|  1.58k|  uint32_t entry_count = range.read32();
  474|       |
  475|  1.58k|  if (limits->max_sample_description_box_entries &&
  ------------------
  |  Branch (475:7): [True: 1.58k, False: 0]
  ------------------
  476|  1.58k|      entry_count > limits->max_sample_description_box_entries) {
  ------------------
  |  Branch (476:7): [True: 47, False: 1.53k]
  ------------------
  477|     47|    std::stringstream sstr;
  478|     47|    sstr << "Allocating " << static_cast<uint64_t>(entry_count) << " sample description items exceeds the security limit of "
  479|     47|         << limits->max_sample_description_box_entries << " items";
  480|       |
  481|     47|    return {heif_error_Memory_allocation_error,
  482|     47|            heif_suberror_Security_limit_exceeded,
  483|     47|            sstr.str()};
  484|       |
  485|     47|  }
  486|       |
  487|  4.38k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (487:24): [True: 2.97k, False: 1.40k]
  ------------------
  488|  2.97k|    std::shared_ptr<Box> entrybox;
  489|  2.97k|    Error err = Box::read(range, &entrybox, limits);
  490|  2.97k|    if (err) {
  ------------------
  |  Branch (490:9): [True: 131, False: 2.84k]
  ------------------
  491|    131|      return err;
  492|    131|    }
  493|       |
  494|       |#if 0
  495|       |    auto visualSampleEntry_box = std::dynamic_pointer_cast<Box_VisualSampleEntry>(entrybox);
  496|       |    if (!visualSampleEntry_box) {
  497|       |      return Error{heif_error_Invalid_input,
  498|       |                   heif_suberror_Unspecified,
  499|       |                   "Invalid or unknown VisualSampleEntry in stsd box."};
  500|       |    }
  501|       |#endif
  502|       |
  503|  2.84k|    m_sample_entries.push_back(entrybox);
  504|  2.84k|  }
  505|       |
  506|  1.40k|  return range.get_error();
  507|  1.53k|}
_ZNK8Box_stsd4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  511|  1.13k|{
  512|  1.13k|  FullBox::dump(sstr, indent, full_log);
  513|  2.27k|  for (size_t i = 0; i < m_sample_entries.size(); i++) {
  ------------------
  |  Branch (513:22): [True: 1.14k, False: 1.13k]
  ------------------
  514|  1.14k|    sstr << indent << "[" << i << "]\n";
  515|  1.14k|    indent++;
  516|  1.14k|    m_sample_entries[i]->dump(sstr, indent, full_log);
  517|  1.14k|    indent--;
  518|  1.14k|  }
  519|       |
  520|  1.13k|  return;
  521|  1.13k|}
_ZN8Box_stts5parseER14BitstreamRangePK20heif_security_limits:
  540|    569|{
  541|    569|  parse_full_box_header(range);
  542|       |
  543|    569|  if (get_version() > 0) {
  ------------------
  |  Branch (543:7): [True: 4, False: 565]
  ------------------
  544|      4|    return unsupported_version_error("stts");
  545|      4|  }
  546|       |
  547|    565|  uint32_t entry_count = range.read32();
  548|       |
  549|    565|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (549:7): [True: 565, False: 0]
  |  Branch (549:42): [True: 15, False: 550]
  ------------------
  550|     15|    return {
  551|     15|      heif_error_Memory_allocation_error,
  552|     15|      heif_suberror_Security_limit_exceeded,
  553|     15|      "Security limit for maximum number of sequence frames exceeded"
  554|     15|    };
  555|     15|  }
  556|       |
  557|    550|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(TimeToSample),
  ------------------
  |  Branch (557:12): [True: 0, False: 550]
  ------------------
  558|    550|                                       limits, "the 'stts' table")) {
  559|      0|    return err;
  560|      0|  }
  561|       |
  562|    550|  m_entries.resize(entry_count);
  563|       |
  564|   498k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (564:24): [True: 498k, False: 497]
  ------------------
  565|   498k|    if (range.eof()) {
  ------------------
  |  Branch (565:9): [True: 53, False: 498k]
  ------------------
  566|     53|      std::stringstream sstr;
  567|     53|      sstr << "stts box should contain " << entry_count << " entries, but box only contained "
  568|     53|          << i << " entries";
  569|       |
  570|     53|      return {
  571|     53|        heif_error_Invalid_input,
  572|     53|        heif_suberror_End_of_data,
  573|     53|        sstr.str()
  574|     53|      };
  575|     53|    }
  576|       |
  577|   498k|    TimeToSample entry{};
  578|   498k|    entry.sample_count = range.read32();
  579|   498k|    entry.sample_delta = range.read32();
  580|   498k|    m_entries[i] = entry;
  581|   498k|  }
  582|       |
  583|       |  // The run-lengths describe the samples of the track, so their sum is the track's
  584|       |  // sample count: a 32-bit quantity that 'stsz' caps at max_sequence_frames. Nothing
  585|       |  // above bounds the sum, so an oversized table would wrap get_number_of_samples()
  586|       |  // and could thereby slip past the consistency check against 'stsz'.
  587|    497|  {
  588|    497|    uint64_t total_samples = 0;
  589|   470k|    for (const auto& entry : m_entries) {
  ------------------
  |  Branch (589:28): [True: 470k, False: 497]
  ------------------
  590|   470k|      total_samples += entry.sample_count;
  591|   470k|    }
  592|       |
  593|    497|    uint64_t max_samples = (limits->max_sequence_frames > 0
  ------------------
  |  Branch (593:29): [True: 497, False: 0]
  ------------------
  594|    497|                            ? limits->max_sequence_frames
  595|    497|                            : uint64_t{0xFFFFFFFF});
  596|       |
  597|    497|    if (total_samples > max_samples) {
  ------------------
  |  Branch (597:9): [True: 80, False: 417]
  ------------------
  598|     80|      return {
  599|     80|        heif_error_Memory_allocation_error,
  600|     80|        heif_suberror_Security_limit_exceeded,
  601|     80|        "Security limit for maximum number of sequence frames exceeded"
  602|     80|      };
  603|     80|    }
  604|    497|  }
  605|       |
  606|       |  // Precompute the prefix sum of sample_count for O(log entries) lookups in
  607|       |  // get_sample_duration(). Safe as uint32 because the total was just checked to
  608|       |  // be <= max_samples <= 0xFFFFFFFF.
  609|    417|  {
  610|    417|    uint32_t running = 0;
  611|    567|    for (auto& entry : m_entries) {
  ------------------
  |  Branch (611:22): [True: 567, False: 417]
  ------------------
  612|    567|      running += entry.sample_count;
  613|    567|      entry.cumulative_sample_count = running;
  614|    567|    }
  615|    417|  }
  616|       |
  617|    417|  return range.get_error();
  618|    497|}
_ZNK8Box_stts4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  622|    327|{
  623|    327|  FullBox::dump(sstr, indent, full_log);
  624|    693|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (624:22): [True: 367, False: 326]
  ------------------
  625|    367|    if (dump_reached_entry_limit(sstr, indent, full_log, i, m_entries.size())) break;
  ------------------
  |  Branch (625:9): [True: 1, False: 366]
  ------------------
  626|    366|    sstr << indent << "[" << i << "] : cnt=" << m_entries[i].sample_count << ", delta=" << m_entries[i].sample_delta << "\n";
  627|    366|  }
  628|       |
  629|    327|  return;
  630|    327|}
_ZN8Box_ctts5parseER14BitstreamRangePK20heif_security_limits:
  719|    965|{
  720|    965|  parse_full_box_header(range);
  721|       |
  722|    965|  uint8_t version = get_version();
  723|       |
  724|    965|  if (version > 1) {
  ------------------
  |  Branch (724:7): [True: 5, False: 960]
  ------------------
  725|      5|    return unsupported_version_error("ctts");
  726|      5|  }
  727|       |
  728|    960|  uint32_t entry_count = range.read32();
  729|       |
  730|    960|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (730:7): [True: 960, False: 0]
  |  Branch (730:42): [True: 24, False: 936]
  ------------------
  731|     24|    return {
  732|     24|      heif_error_Memory_allocation_error,
  733|     24|      heif_suberror_Security_limit_exceeded,
  734|     24|      "Security limit for maximum number of sequence frames exceeded"
  735|     24|    };
  736|     24|  }
  737|       |
  738|    936|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(OffsetToSample),
  ------------------
  |  Branch (738:12): [True: 0, False: 936]
  ------------------
  739|    936|                                       limits, "the 'ctts' table")) {
  740|      0|    return err;
  741|      0|  }
  742|       |
  743|    936|  m_entries.resize(entry_count);
  744|       |
  745|   500k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (745:24): [True: 499k, False: 890]
  ------------------
  746|   499k|    if (range.eof()) {
  ------------------
  |  Branch (746:9): [True: 46, False: 499k]
  ------------------
  747|     46|      std::stringstream sstr;
  748|     46|      sstr << "ctts box should contain " << entry_count << " entries, but box only contained "
  749|     46|          << i << " entries";
  750|       |
  751|     46|      return {
  752|     46|        heif_error_Invalid_input,
  753|     46|        heif_suberror_End_of_data,
  754|     46|        sstr.str()
  755|     46|      };
  756|     46|    }
  757|       |
  758|   499k|    OffsetToSample entry{};
  759|   499k|    entry.sample_count = range.read32();
  760|   499k|    if (version == 0) {
  ------------------
  |  Branch (760:9): [True: 493k, False: 6.28k]
  ------------------
  761|   493k|      uint32_t offset = range.read32();
  762|       |#if 0
  763|       |      // TODO: I disabled this because I found several files that seem to
  764|       |      //       have wrong data. Since we are not using the 'ctts' data anyway,
  765|       |      //       let's not care about it now.
  766|       |
  767|       |      if (offset > INT32_MAX) {
  768|       |        return {
  769|       |          heif_error_Unsupported_feature,
  770|       |          heif_suberror_Unsupported_parameter,
  771|       |          "We don't support offsets > 0x7fff in 'ctts' box."
  772|       |        };
  773|       |      }
  774|       |#endif
  775|       |
  776|   493k|      entry.sample_offset = static_cast<int32_t>(offset);
  777|   493k|    }
  778|  6.28k|    else if (version == 1) {
  ------------------
  |  Branch (778:14): [True: 6.28k, False: 0]
  ------------------
  779|  6.28k|      entry.sample_offset = range.read32s();
  780|  6.28k|    }
  781|      0|    else {
  782|      0|      assert(false);
  ------------------
  |  Branch (782:7): [Folded, False: 0]
  ------------------
  783|      0|    }
  784|       |
  785|   499k|    m_entries[i] = entry;
  786|   499k|  }
  787|       |
  788|       |  // The run-lengths describe the samples of the track, so their sum is the track's
  789|       |  // sample count: a 32-bit quantity that 'stsz' caps at max_sequence_frames. Nothing
  790|       |  // above bounds the sum, so an oversized table would wrap get_number_of_samples()
  791|       |  // and could thereby slip past the consistency check against 'stsz'.
  792|    890|  {
  793|    890|    uint64_t total_samples = 0;
  794|   485k|    for (const auto& entry : m_entries) {
  ------------------
  |  Branch (794:28): [True: 485k, False: 890]
  ------------------
  795|   485k|      total_samples += entry.sample_count;
  796|   485k|    }
  797|       |
  798|    890|    uint64_t max_samples = (limits->max_sequence_frames > 0
  ------------------
  |  Branch (798:29): [True: 890, False: 0]
  ------------------
  799|    890|                            ? limits->max_sequence_frames
  800|    890|                            : uint64_t{0xFFFFFFFF});
  801|       |
  802|    890|    if (total_samples > max_samples) {
  ------------------
  |  Branch (802:9): [True: 79, False: 811]
  ------------------
  803|     79|      return {
  804|     79|        heif_error_Memory_allocation_error,
  805|     79|        heif_suberror_Security_limit_exceeded,
  806|     79|        "Security limit for maximum number of sequence frames exceeded"
  807|     79|      };
  808|     79|    }
  809|    890|  }
  810|       |
  811|    811|  return range.get_error();
  812|    890|}
_ZNK8Box_ctts4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  816|    801|{
  817|    801|  FullBox::dump(sstr, indent, full_log);
  818|  1.66k|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (818:22): [True: 868, False: 799]
  ------------------
  819|    868|    if (dump_reached_entry_limit(sstr, indent, full_log, i, m_entries.size())) break;
  ------------------
  |  Branch (819:9): [True: 2, False: 866]
  ------------------
  820|    866|    sstr << indent << "[" << i << "] : cnt=" << m_entries[i].sample_count << ", offset=" << m_entries[i].sample_offset << "\n";
  821|    866|  }
  822|       |
  823|    801|  return;
  824|    801|}
_ZN8Box_stsc5parseER14BitstreamRangePK20heif_security_limits:
  920|    367|{
  921|    367|  parse_full_box_header(range);
  922|       |
  923|    367|  if (get_version() > 0) {
  ------------------
  |  Branch (923:7): [True: 2, False: 365]
  ------------------
  924|      2|    return unsupported_version_error("stsc");
  925|      2|  }
  926|       |
  927|    365|  uint32_t entry_count = range.read32();
  928|    365|  if (entry_count == 0) {
  ------------------
  |  Branch (928:7): [True: 4, False: 361]
  ------------------
  929|      4|    return {
  930|      4|      heif_error_Invalid_input,
  931|      4|      heif_suberror_Unspecified,
  932|      4|      "'stsc' box with zero entries."};
  933|      4|  }
  934|       |
  935|       |  // Note: test against maximum number of frames (upper limit) since we have no limit on maximum number of chunks
  936|    361|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (936:7): [True: 361, False: 0]
  |  Branch (936:42): [True: 62, False: 299]
  ------------------
  937|     62|    return {
  938|     62|      heif_error_Invalid_input,
  939|     62|      heif_suberror_Unspecified,
  940|     62|      "Number of chunks in `stsc` box exceeds security limits of maximum number of frames."};
  941|     62|  }
  942|       |
  943|       |
  944|    299|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(SampleToChunk),
  ------------------
  |  Branch (944:12): [True: 0, False: 299]
  ------------------
  945|    299|                                       limits, "the 'stsc' table")) {
  946|      0|    return err;
  947|      0|  }
  948|       |
  949|    299|  m_entries.resize(entry_count);
  950|       |
  951|    952|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (951:24): [True: 784, False: 168]
  ------------------
  952|    784|    SampleToChunk entry{};
  953|    784|    entry.first_chunk = range.read32();
  954|    784|    entry.samples_per_chunk = range.read32();
  955|    784|    entry.sample_description_index = range.read32();
  956|       |
  957|    784|    if (entry.samples_per_chunk == 0) {
  ------------------
  |  Branch (957:9): [True: 53, False: 731]
  ------------------
  958|     53|      return {
  959|     53|        heif_error_Invalid_input,
  960|     53|        heif_suberror_Unspecified,
  961|     53|        "'stsc' box with zero samples per chunk entry."};
  962|     53|    }
  963|       |
  964|    731|    if (entry.sample_description_index == 0) {
  ------------------
  |  Branch (964:9): [True: 45, False: 686]
  ------------------
  965|     45|      return {
  966|     45|      heif_error_Invalid_input,
  967|     45|      heif_suberror_Unspecified,
  968|     45|      "'sample_description_index' in 'stsc' must not be 0."};
  969|     45|    }
  970|       |
  971|    686|    if (limits->max_sequence_frames > 0 && entry.samples_per_chunk > limits->max_sequence_frames) {
  ------------------
  |  Branch (971:9): [True: 686, False: 0]
  |  Branch (971:44): [True: 33, False: 653]
  ------------------
  972|     33|      return {
  973|     33|        heif_error_Invalid_input,
  974|     33|        heif_suberror_Unspecified,
  975|     33|        "Number of chunk samples in `stsc` box exceeds security limits of maximum number of frames."};
  976|     33|    }
  977|       |
  978|    653|    m_entries[i] = entry;
  979|    653|  }
  980|       |
  981|    168|  return range.get_error();
  982|    299|}
_ZNK8Box_stsc4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
  986|    121|{
  987|    121|  FullBox::dump(sstr, indent, full_log);
  988|    490|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (988:22): [True: 370, False: 120]
  ------------------
  989|    370|    if (dump_reached_entry_limit(sstr, indent, full_log, i, m_entries.size())) break;
  ------------------
  |  Branch (989:9): [True: 1, False: 369]
  ------------------
  990|    369|    sstr << indent << "[" << i << "]\n"
  991|    369|        << indent << "  first chunk: " << m_entries[i].first_chunk << "\n"
  992|    369|        << indent << "  samples per chunk: " << m_entries[i].samples_per_chunk << "\n"
  993|    369|        << indent << "  sample description index: " << m_entries[i].sample_description_index << "\n";
  994|    369|  }
  995|       |
  996|    121|  return;
  997|    121|}
_ZN8Box_stco5parseER14BitstreamRangePK20heif_security_limits:
 1049|    374|{
 1050|    374|  parse_full_box_header(range);
 1051|       |
 1052|    374|  if (get_version() > 0) {
  ------------------
  |  Branch (1052:7): [True: 1, False: 373]
  ------------------
 1053|      1|    return unsupported_version_error("stco");
 1054|      1|  }
 1055|       |
 1056|    373|  uint32_t entry_count = range.read32();
 1057|       |
 1058|       |  // Note: test against maximum number of frames (upper limit) since we have no limit on maximum number of chunks
 1059|    373|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (1059:7): [True: 373, False: 0]
  |  Branch (1059:42): [True: 31, False: 342]
  ------------------
 1060|     31|    return {
 1061|     31|      heif_error_Invalid_input,
 1062|     31|      heif_suberror_Unspecified,
 1063|     31|      "Number of chunks in 'stco' box exceeds security limits of maximum number of frames."
 1064|     31|    };
 1065|     31|  }
 1066|       |
 1067|       |  // check required memory
 1068|       |
 1069|    342|  uint64_t mem_size = static_cast<uint64_t>(entry_count) * sizeof(uint32_t);
 1070|    342|  if (auto err = m_memory_handle.alloc(mem_size,
  ------------------
  |  Branch (1070:12): [True: 0, False: 342]
  ------------------
 1071|    342|                                       limits, "the 'stco' table")) {
 1072|      0|    return err;
 1073|      0|  }
 1074|       |
 1075|  34.1k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (1075:24): [True: 33.8k, False: 307]
  ------------------
 1076|  33.8k|    m_offsets.push_back(range.read32());
 1077|       |
 1078|  33.8k|    if (range.error()) {
  ------------------
  |  Branch (1078:9): [True: 35, False: 33.7k]
  ------------------
 1079|     35|      return range.get_error();
 1080|     35|    }
 1081|  33.8k|  }
 1082|       |
 1083|    307|  return range.get_error();
 1084|    342|}
_ZNK8Box_stco4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1088|    296|{
 1089|    296|  FullBox::dump(sstr, indent, full_log);
 1090|    825|  for (size_t i = 0; i < m_offsets.size(); i++) {
  ------------------
  |  Branch (1090:22): [True: 530, False: 295]
  ------------------
 1091|    530|    if (dump_reached_entry_limit(sstr, indent, full_log, i, m_offsets.size())) break;
  ------------------
  |  Branch (1091:9): [True: 1, False: 529]
  ------------------
 1092|    529|    sstr << indent << "[" << i << "] : 0x" << std::hex << m_offsets[i] << std::dec << "\n";
 1093|    529|  }
 1094|       |
 1095|    296|  return;
 1096|    296|}
_ZN8Box_stsz5parseER14BitstreamRangePK20heif_security_limits:
 1138|    982|{
 1139|    982|  parse_full_box_header(range);
 1140|       |
 1141|    982|  if (get_version() > 0) {
  ------------------
  |  Branch (1141:7): [True: 1, False: 981]
  ------------------
 1142|      1|    return unsupported_version_error("stsz");
 1143|      1|  }
 1144|       |
 1145|    981|  m_fixed_sample_size = range.read32();
 1146|    981|  m_sample_count = range.read32();
 1147|       |
 1148|    981|  if (limits->max_sequence_frames > 0 && m_sample_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (1148:7): [True: 981, False: 0]
  |  Branch (1148:42): [True: 27, False: 954]
  ------------------
 1149|     27|    return {
 1150|     27|      heif_error_Memory_allocation_error,
 1151|     27|      heif_suberror_Security_limit_exceeded,
 1152|     27|      "Security limit for maximum number of sequence frames exceeded"
 1153|     27|    };
 1154|     27|  }
 1155|       |
 1156|    954|  if (m_fixed_sample_size == 0) {
  ------------------
  |  Branch (1156:7): [True: 603, False: 351]
  ------------------
 1157|       |    // check required memory
 1158|       |
 1159|    603|    if (auto err = m_memory_handle.alloc(m_sample_count, sizeof(uint32_t),
  ------------------
  |  Branch (1159:14): [True: 0, False: 603]
  ------------------
 1160|    603|                                         limits, "the 'stsz' table")) {
 1161|      0|      return err;
 1162|      0|    }
 1163|       |
 1164|   159k|    for (uint32_t i = 0; i < m_sample_count; i++) {
  ------------------
  |  Branch (1164:26): [True: 158k, False: 559]
  ------------------
 1165|   158k|      if (range.eof()) {
  ------------------
  |  Branch (1165:11): [True: 26, False: 158k]
  ------------------
 1166|     26|        std::stringstream sstr;
 1167|     26|        sstr << "stsz box should contain " << m_sample_count << " entries, but box only contained "
 1168|     26|            << i << " entries";
 1169|       |
 1170|     26|        return {
 1171|     26|          heif_error_Invalid_input,
 1172|     26|          heif_suberror_End_of_data,
 1173|     26|          sstr.str()
 1174|     26|        };
 1175|     26|      }
 1176|       |
 1177|   158k|      m_sample_sizes.push_back(range.read32());
 1178|       |
 1179|   158k|      if (range.error()) {
  ------------------
  |  Branch (1179:11): [True: 18, False: 158k]
  ------------------
 1180|     18|        return range.get_error();
 1181|     18|      }
 1182|   158k|    }
 1183|    603|  }
 1184|       |
 1185|    910|  return range.get_error();
 1186|    954|}
_ZNK8Box_stsz4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1190|    863|{
 1191|    863|  FullBox::dump(sstr, indent, full_log);
 1192|    863|  sstr << indent << "sample count: " << m_sample_count << "\n";
 1193|    863|  if (m_fixed_sample_size == 0) {
  ------------------
  |  Branch (1193:7): [True: 551, False: 312]
  ------------------
 1194|  1.00k|    for (size_t i = 0; i < m_sample_sizes.size(); i++) {
  ------------------
  |  Branch (1194:24): [True: 454, False: 550]
  ------------------
 1195|    454|      if (dump_reached_entry_limit(sstr, indent, full_log, i, m_sample_sizes.size())) break;
  ------------------
  |  Branch (1195:11): [True: 1, False: 453]
  ------------------
 1196|    453|      sstr << indent << "[" << i << "] : " << m_sample_sizes[i] << "\n";
 1197|    453|    }
 1198|    551|  }
 1199|    312|  else {
 1200|    312|    sstr << indent << "fixed sample size: " << m_fixed_sample_size << "\n";
 1201|    312|  }
 1202|       |
 1203|    863|  return;
 1204|    863|}
_ZN8Box_stss5parseER14BitstreamRangePK20heif_security_limits:
 1256|    465|{
 1257|    465|  parse_full_box_header(range);
 1258|       |
 1259|    465|  if (get_version() > 0) {
  ------------------
  |  Branch (1259:7): [True: 1, False: 464]
  ------------------
 1260|      1|    return unsupported_version_error("stss");
 1261|      1|  }
 1262|       |
 1263|    464|  uint32_t sample_count = range.read32();
 1264|       |
 1265|       |  // check required memory
 1266|       |
 1267|    464|  if (auto err = m_memory_handle.alloc(sample_count, sizeof(uint32_t),
  ------------------
  |  Branch (1267:12): [True: 38, False: 426]
  ------------------
 1268|    464|                                       limits, "the 'stss' table")) {
 1269|     38|    return err;
 1270|     38|  }
 1271|       |
 1272|  71.9k|  for (uint32_t i = 0; i < sample_count; i++) {
  ------------------
  |  Branch (1272:24): [True: 71.5k, False: 378]
  ------------------
 1273|  71.5k|    m_sync_samples.push_back(range.read32());
 1274|       |
 1275|  71.5k|    if (range.error()) {
  ------------------
  |  Branch (1275:9): [True: 48, False: 71.5k]
  ------------------
 1276|     48|      return range.get_error();
 1277|     48|    }
 1278|  71.5k|  }
 1279|       |
 1280|    378|  return range.get_error();
 1281|    426|}
_ZNK8Box_stss4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1285|    322|{
 1286|    322|  FullBox::dump(sstr, indent, full_log);
 1287|    747|  for (size_t i = 0; i < m_sync_samples.size(); i++) {
  ------------------
  |  Branch (1287:22): [True: 426, False: 321]
  ------------------
 1288|    426|    if (dump_reached_entry_limit(sstr, indent, full_log, i, m_sync_samples.size())) break;
  ------------------
  |  Branch (1288:9): [True: 1, False: 425]
  ------------------
 1289|    425|    sstr << indent << "[" << i << "] : " << m_sync_samples[i] << "\n";
 1290|    425|  }
 1291|       |
 1292|    322|  return;
 1293|    322|}
_ZN17VisualSampleEntry5parseER14BitstreamRangePK20heif_security_limits:
 1323|  1.04k|{
 1324|  1.04k|  (void)limits;
 1325|       |
 1326|  1.04k|  range.skip(6);
 1327|  1.04k|  data_reference_index = range.read16();
 1328|       |
 1329|  1.04k|  pre_defined = range.read16();
 1330|  1.04k|  range.skip(2);
 1331|  3.12k|  for (uint32_t& p : pre_defined2) {
  ------------------
  |  Branch (1331:20): [True: 3.12k, False: 1.04k]
  ------------------
 1332|  3.12k|    p = range.read32();
 1333|  3.12k|  }
 1334|  1.04k|  width = range.read16();
 1335|  1.04k|  height = range.read16();
 1336|  1.04k|  horizresolution = range.read32();
 1337|  1.04k|  vertresolution = range.read32();
 1338|  1.04k|  range.skip(4);
 1339|  1.04k|  frame_count = range.read16();
 1340|  1.04k|  compressorname = range.read_fixed_string(32);
 1341|  1.04k|  depth = range.read16();
 1342|  1.04k|  pre_defined3 = range.read16s();
 1343|       |
 1344|       |  // other boxes from derived specifications
 1345|       |  //std::shared_ptr<Box_clap> clap; // optional // TODO
 1346|       |  //std::shared_ptr<Box_pixi> pixi; // optional // TODO
 1347|       |
 1348|  1.04k|  return Error::Ok;
 1349|  1.04k|}
_ZNK17VisualSampleEntry4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1379|    555|{
 1380|    555|  sstr << indent << "data reference index: " << data_reference_index << "\n"
 1381|    555|       << indent << "width: " << width << "\n"
 1382|    555|       << indent << "height: " << height << "\n"
 1383|    555|       << indent << "horiz. resolution: " << get_horizontal_resolution() << "\n"
 1384|    555|       << indent << "vert. resolution: " << get_vertical_resolution() << "\n"
 1385|    555|       << indent << "frame count: " << frame_count << "\n"
 1386|    555|       << indent << "compressorname: " << compressorname << "\n"
 1387|    555|       << indent << "depth: " << depth << "\n";
 1388|       |
 1389|    555|  return;
 1390|    555|}
_ZNK22Box_URIMetaSampleEntry4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1410|    517|{
 1411|    517|  Box::dump(sstr, indent, full_log);
 1412|    517|  sstr << indent << "data reference index: " << data_reference_index << "\n";
 1413|    517|  dump_children(sstr, indent, full_log);
 1414|    517|  return;
 1415|    517|}
_ZN22Box_URIMetaSampleEntry5parseER14BitstreamRangePK20heif_security_limits:
 1419|    627|{
 1420|    627|  range.skip(6);
 1421|    627|  data_reference_index = range.read16();
 1422|       |
 1423|    627|  Error err = read_children(range, READ_CHILDREN_ALL, limits);
 1424|    627|  if (err) {
  ------------------
  |  Branch (1424:7): [True: 81, False: 546]
  ------------------
 1425|     81|    return err;
 1426|     81|  }
 1427|       |
 1428|    546|  return Error::Ok;
 1429|    627|}
_ZN7Box_uri5parseER14BitstreamRangePK20heif_security_limits:
 1433|  1.09k|{
 1434|  1.09k|  parse_full_box_header(range);
 1435|       |
 1436|  1.09k|  if (get_version() > 0) {
  ------------------
  |  Branch (1436:7): [True: 3, False: 1.08k]
  ------------------
 1437|      3|    return unsupported_version_error("uri ");
 1438|      3|  }
 1439|       |
 1440|  1.08k|  m_uri = range.read_string();
 1441|       |
 1442|  1.08k|  return range.get_error();
 1443|  1.09k|}
_ZNK7Box_uri4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1447|  1.07k|{
 1448|  1.07k|  FullBox::dump(sstr, indent, full_log);
 1449|  1.07k|  sstr << indent << "uri: " << m_uri << "\n";
 1450|       |
 1451|  1.07k|  return;
 1452|  1.07k|}
_ZN8Box_ccst5parseER14BitstreamRangePK20heif_security_limits:
 1469|    406|{
 1470|    406|  parse_full_box_header(range);
 1471|       |
 1472|    406|  if (get_version() > 0) {
  ------------------
  |  Branch (1472:7): [True: 7, False: 399]
  ------------------
 1473|      7|    return unsupported_version_error("ccst");
 1474|      7|  }
 1475|       |
 1476|    399|  uint32_t bits = range.read32();
 1477|       |
 1478|    399|  auto& constraints = m_codingConstraints;
 1479|       |
 1480|    399|  constraints.all_ref_pics_intra = (bits & 0x80000000) != 0;
 1481|    399|  constraints.intra_pred_used = (bits & 0x40000000) != 0;
 1482|    399|  constraints.max_ref_per_pic = (bits >> 26) & 0x0F;
 1483|       |
 1484|    399|  return range.get_error();
 1485|    406|}
_ZNK8Box_ccst4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1489|    396|{
 1490|    396|  const auto& constraints = m_codingConstraints;
 1491|       |
 1492|    396|  FullBox::dump(sstr, indent, full_log);
 1493|    396|  sstr << indent << "all ref pics intra: " << std::boolalpha <<constraints.all_ref_pics_intra << "\n"
 1494|    396|       << indent << "intra pred used: " << constraints.intra_pred_used << "\n"
 1495|    396|       << indent << "max ref per pic: " << ((int) constraints.max_ref_per_pic) << "\n";
 1496|       |
 1497|    396|  return;
 1498|    396|}
_ZN8Box_auxi5parseER14BitstreamRangePK20heif_security_limits:
 1528|    952|{
 1529|    952|  parse_full_box_header(range);
 1530|       |
 1531|    952|  if (get_version() > 0) {
  ------------------
  |  Branch (1531:7): [True: 1, False: 951]
  ------------------
 1532|      1|    return unsupported_version_error("auxi");
 1533|      1|  }
 1534|       |
 1535|    951|  m_aux_track_type = range.read_string();
 1536|       |
 1537|    951|  return range.get_error();
 1538|    952|}
_ZNK8Box_auxi4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1542|    934|{
 1543|    934|  FullBox::dump(sstr, indent, full_log);
 1544|    934|  sstr << indent << "aux track info type: " << m_aux_track_type << "\n";
 1545|       |
 1546|    934|  return;
 1547|    934|}
_ZNK21Box_VisualSampleEntry4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1580|    555|{
 1581|    555|  Box::dump(sstr, indent, full_log);
 1582|    555|  m_visualSampleEntry.dump(sstr, indent, full_log);
 1583|    555|  dump_children(sstr, indent, full_log);
 1584|    555|  return;
 1585|    555|}
_ZN21Box_VisualSampleEntry5parseER14BitstreamRangePK20heif_security_limits:
 1589|  1.04k|{
 1590|  1.04k|  auto err = m_visualSampleEntry.parse(range, limits);
 1591|  1.04k|  if (err) {
  ------------------
  |  Branch (1591:7): [True: 0, False: 1.04k]
  ------------------
 1592|      0|    return err;
 1593|      0|  }
 1594|       |
 1595|  1.04k|  err = read_children(range, READ_CHILDREN_ALL, limits);
 1596|  1.04k|  if (err) {
  ------------------
  |  Branch (1596:7): [True: 472, False: 570]
  ------------------
 1597|    472|    return err;
 1598|    472|  }
 1599|       |
 1600|    570|  return Error::Ok;
 1601|  1.04k|}
_ZNK8Box_sbgp4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1605|    489|{
 1606|    489|  FullBox::dump(sstr, indent, full_log);
 1607|    489|  sstr << indent << "grouping_type: " << fourcc_to_string(m_grouping_type) << "\n";
 1608|       |
 1609|    489|  if (m_grouping_type_parameter) {
  ------------------
  |  Branch (1609:7): [True: 286, False: 203]
  ------------------
 1610|    286|    sstr << indent << "grouping_type_parameter: " << *m_grouping_type_parameter << "\n";
 1611|    286|  }
 1612|       |
 1613|    489|  uint32_t total_samples = 0;
 1614|   295k|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (1614:22): [True: 295k, False: 489]
  ------------------
 1615|   295k|    if (full_log || i < MAX_DUMP_ENTRIES) {
  ------------------
  |  Branch (1615:9): [True: 0, False: 295k]
  |  Branch (1615:21): [True: 2.61k, False: 292k]
  ------------------
 1616|  2.61k|      sstr << indent << "[" << std::setw(2) << (i + 1) << "] : " << std::setw(3) << m_entries[i].sample_count << "x " << m_entries[i].group_description_index << "\n";
 1617|  2.61k|    }
 1618|   295k|    total_samples += m_entries[i].sample_count;
 1619|   295k|  }
 1620|    489|  if (!full_log && m_entries.size() > MAX_DUMP_ENTRIES) {
  ------------------
  |  Branch (1620:7): [True: 489, False: 0]
  |  Branch (1620:20): [True: 17, False: 472]
  ------------------
 1621|     17|    sstr << indent << "... (" << (m_entries.size() - MAX_DUMP_ENTRIES) << " more)\n";
 1622|     17|  }
 1623|    489|  sstr << indent << "total samples: " << total_samples << "\n";
 1624|       |
 1625|    489|  return;
 1626|    489|}
_ZN8Box_sbgp5parseER14BitstreamRangePK20heif_security_limits:
 1668|    566|{
 1669|    566|  parse_full_box_header(range);
 1670|       |
 1671|    566|  if (get_version() > 1) {
  ------------------
  |  Branch (1671:7): [True: 7, False: 559]
  ------------------
 1672|      7|    return unsupported_version_error("sbgp");
 1673|      7|  }
 1674|       |
 1675|    559|  m_grouping_type = range.read32();
 1676|       |
 1677|    559|  if (get_version() == 1) {
  ------------------
  |  Branch (1677:7): [True: 302, False: 257]
  ------------------
 1678|    302|    m_grouping_type_parameter = range.read32();
 1679|    302|  }
 1680|       |
 1681|    559|  uint32_t count = range.read32();
 1682|    559|  if (auto err = m_memory_handle.alloc(count, sizeof(Entry),
  ------------------
  |  Branch (1682:12): [True: 5, False: 554]
  ------------------
 1683|    559|                                       limits, "the 'sample to group' table")) {
 1684|      5|    return err;
 1685|      5|  }
 1686|       |
 1687|   300k|  for (uint32_t i = 0; i < count; i++) {
  ------------------
  |  Branch (1687:24): [True: 299k, False: 509]
  ------------------
 1688|   299k|    Entry e{};
 1689|   299k|    e.sample_count = range.read32();
 1690|   299k|    e.group_description_index = range.read32();
 1691|   299k|    m_entries.push_back(e);
 1692|   299k|    if (range.error()) {
  ------------------
  |  Branch (1692:9): [True: 45, False: 299k]
  ------------------
 1693|     45|      return range.get_error();
 1694|     45|    }
 1695|   299k|  }
 1696|       |
 1697|    509|  return range.get_error();
 1698|    554|}
_ZNK21SampleGroupEntry_refs4dumpEv:
 1702|  25.4k|{
 1703|  25.4k|  std::stringstream sstr;
 1704|  25.4k|  if (m_sample_id==0) {
  ------------------
  |  Branch (1704:7): [True: 24.6k, False: 874]
  ------------------
 1705|  24.6k|    sstr << "0 (non-ref) refs =";
 1706|  24.6k|  }
 1707|    874|  else {
 1708|    874|    sstr << m_sample_id << " refs =";
 1709|    874|  }
 1710|  40.9k|  for (uint32_t ref : m_direct_reference_sample_id) {
  ------------------
  |  Branch (1710:21): [True: 40.9k, False: 25.4k]
  ------------------
 1711|  40.9k|    sstr << ' ' << ref;
 1712|  40.9k|  }
 1713|       |
 1714|  25.4k|  return sstr.str();
 1715|  25.4k|}
_ZN21SampleGroupEntry_refs5parseER14BitstreamRangePK20heif_security_limits:
 1723|  71.2k|{
 1724|  71.2k|  m_sample_id = range.read32();
 1725|  71.2k|  uint8_t cnt = range.read8();
 1726|   112k|  for (uint8_t i = 0; i < cnt; i++) {
  ------------------
  |  Branch (1726:23): [True: 40.9k, False: 71.2k]
  ------------------
 1727|  40.9k|    m_direct_reference_sample_id.push_back(range.read32());
 1728|  40.9k|  }
 1729|       |
 1730|  71.2k|  return Error::Ok;
 1731|  71.2k|}
_ZNK8Box_sgpd4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1752|  1.57k|{
 1753|  1.57k|  FullBox::dump(sstr, indent, full_log);
 1754|       |
 1755|  1.57k|  sstr << indent << "grouping_type: " << fourcc_to_string(m_grouping_type) << "\n";
 1756|  1.57k|  if (m_default_length) {
  ------------------
  |  Branch (1756:7): [True: 486, False: 1.08k]
  ------------------
 1757|    486|    sstr << indent << "default_length: " << *m_default_length << "\n";
 1758|    486|  }
 1759|  1.57k|  if (m_default_sample_description_index) {
  ------------------
  |  Branch (1759:7): [True: 579, False: 995]
  ------------------
 1760|    579|    sstr << indent << "default_sample_description_index: " << *m_default_sample_description_index << "\n";
 1761|    579|  }
 1762|       |
 1763|  27.0k|  for (size_t i=0; i<m_entries.size(); i++) {
  ------------------
  |  Branch (1763:20): [True: 25.7k, False: 1.34k]
  ------------------
 1764|  25.7k|    if (dump_reached_entry_limit(sstr, indent, full_log, i, m_entries.size())) break;
  ------------------
  |  Branch (1764:9): [True: 230, False: 25.4k]
  ------------------
 1765|  25.4k|    sstr << indent << "[" << (i+1) << "] : ";
 1766|  25.4k|    if (m_entries[i].sample_group_entry) {
  ------------------
  |  Branch (1766:9): [True: 25.4k, False: 0]
  ------------------
 1767|  25.4k|      sstr << m_entries[i].sample_group_entry->dump() << "\n";
 1768|  25.4k|    }
 1769|      0|    else {
 1770|      0|      sstr << "empty (description_length=" << m_entries[i].description_length << ")\n";
 1771|      0|    }
 1772|  25.4k|  }
 1773|       |
 1774|  1.57k|  return;
 1775|  1.57k|}
_ZN8Box_sgpd5parseER14BitstreamRangePK20heif_security_limits:
 1785|  1.70k|{
 1786|  1.70k|  parse_full_box_header(range);
 1787|       |
 1788|  1.70k|  m_grouping_type = range.read32();
 1789|       |
 1790|       |  // Readers are expected to ignore sgpd boxes with grouping_types they don't
 1791|       |  // understand. Skip parsing of unknown types to avoid allocating Entry objects
 1792|       |  // for entries whose payload we wouldn't read anyway (and which, with
 1793|       |  // version==1 + default_length!=0 or version>=2, would consume zero bytes per
 1794|       |  // iteration and allow unbounded allocation from a tiny box).
 1795|  1.70k|  if (m_grouping_type != fourcc("refs")) {
  ------------------
  |  Branch (1795:7): [True: 455, False: 1.25k]
  ------------------
 1796|    455|    return Error::Ok;
 1797|    455|  }
 1798|       |
 1799|  1.25k|  if (get_version() == 1) {
  ------------------
  |  Branch (1799:7): [True: 492, False: 761]
  ------------------
 1800|    492|    m_default_length = range.read32();
 1801|    492|  }
 1802|       |
 1803|  1.25k|  if (get_version() >= 2) {
  ------------------
  |  Branch (1803:7): [True: 678, False: 575]
  ------------------
 1804|    678|    m_default_sample_description_index = range.read32();
 1805|    678|  }
 1806|       |
 1807|  1.25k|  uint32_t entry_count = range.read32();
 1808|       |
 1809|  1.25k|  if (limits->max_sample_group_description_box_entries &&
  ------------------
  |  Branch (1809:7): [True: 1.25k, False: 0]
  ------------------
 1810|  1.25k|      entry_count > limits->max_sample_group_description_box_entries) {
  ------------------
  |  Branch (1810:7): [True: 37, False: 1.21k]
  ------------------
 1811|     37|    std::stringstream sstr;
 1812|     37|    sstr << "Allocating " << static_cast<uint64_t>(entry_count) << " sample group description items exceeds the security limit of "
 1813|     37|         << limits->max_sample_group_description_box_entries << " items";
 1814|       |
 1815|     37|    return {heif_error_Memory_allocation_error,
 1816|     37|            heif_suberror_Security_limit_exceeded,
 1817|     37|            sstr.str()};
 1818|       |
 1819|     37|  }
 1820|       |
 1821|  1.21k|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(Entry),
  ------------------
  |  Branch (1821:12): [True: 0, False: 1.21k]
  ------------------
 1822|  1.21k|                                       limits, "the 'sgpd' table")) {
 1823|      0|    return err;
 1824|      0|  }
 1825|       |
 1826|  72.5k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (1826:24): [True: 71.2k, False: 1.21k]
  ------------------
 1827|  71.2k|    Entry entry;
 1828|       |
 1829|  71.2k|    if (get_version() == 1) {
  ------------------
  |  Branch (1829:9): [True: 45.8k, False: 25.4k]
  ------------------
 1830|  45.8k|      if (*m_default_length == 0) {
  ------------------
  |  Branch (1830:11): [True: 1.55k, False: 44.3k]
  ------------------
 1831|  1.55k|        entry.description_length = range.read32();
 1832|  1.55k|      }
 1833|  45.8k|    }
 1834|       |
 1835|  71.2k|    switch (m_grouping_type) {
 1836|  71.2k|      case fourcc("refs"): {
  ------------------
  |  Branch (1836:7): [True: 71.2k, False: 0]
  ------------------
 1837|  71.2k|        entry.sample_group_entry = std::make_shared<SampleGroupEntry_refs>();
 1838|  71.2k|        Error err = entry.sample_group_entry->parse(range, limits);
 1839|  71.2k|        if (err) {
  ------------------
  |  Branch (1839:13): [True: 0, False: 71.2k]
  ------------------
 1840|      0|          return err;
 1841|      0|        }
 1842|       |
 1843|  71.2k|        break;
 1844|  71.2k|      }
 1845|       |
 1846|  71.2k|      default:
  ------------------
  |  Branch (1846:7): [True: 0, False: 71.2k]
  ------------------
 1847|      0|        break;
 1848|  71.2k|    }
 1849|       |
 1850|  71.2k|    m_entries.emplace_back(std::move(entry));
 1851|  71.2k|  }
 1852|       |
 1853|  1.21k|  return Error::Ok;
 1854|  1.21k|}
_ZNK8Box_btrt4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1858|    483|{
 1859|    483|  FullBox::dump(sstr, indent, full_log);
 1860|       |
 1861|    483|  sstr << indent << "bufferSizeDB: " << m_bufferSizeDB << " bytes\n";
 1862|    483|  sstr << indent << "max bitrate: " << m_maxBitrate << " bits/sec\n";
 1863|    483|  sstr << indent << "avg bitrate: " << m_avgBitrate << " bits/sec\n";
 1864|       |
 1865|    483|  return;
 1866|    483|}
_ZN8Box_btrt5parseER14BitstreamRangePK20heif_security_limits:
 1884|    483|{
 1885|    483|  m_bufferSizeDB = range.read32();
 1886|    483|  m_maxBitrate = range.read32();
 1887|    483|  m_avgBitrate = range.read32();
 1888|       |
 1889|    483|  return Error::Ok;
 1890|    483|}
_ZNK8Box_saiz4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 1955|    772|{
 1956|    772|  FullBox::dump(sstr, indent, full_log);
 1957|       |
 1958|    772|  sstr << indent << "aux_info_type: ";
 1959|    772|  if (m_aux_info_type == 0) {
  ------------------
  |  Branch (1959:7): [True: 329, False: 443]
  ------------------
 1960|    329|    sstr << "0\n";
 1961|    329|  }
 1962|    443|  else {
 1963|    443|    sstr << fourcc_to_string(m_aux_info_type) << "\n";
 1964|    443|  }
 1965|       |
 1966|    772|  sstr << indent << "aux_info_type_parameter: ";
 1967|    772|  if (m_aux_info_type_parameter == 0) {
  ------------------
  |  Branch (1967:7): [True: 329, False: 443]
  ------------------
 1968|    329|    sstr << "0\n";
 1969|    329|  }
 1970|    443|  else {
 1971|    443|    sstr << fourcc_to_string(m_aux_info_type_parameter) << "\n";
 1972|    443|  }
 1973|       |
 1974|    772|  sstr << indent << "default sample size: ";
 1975|    772|  if (m_default_sample_info_size == 0) {
  ------------------
  |  Branch (1975:7): [True: 522, False: 250]
  ------------------
 1976|    522|    sstr << "0 (variable)\n";
 1977|    522|  }
 1978|    250|  else {
 1979|    250|    sstr << ((int)m_default_sample_info_size) << "\n";
 1980|    250|  }
 1981|       |
 1982|    772|  if (m_default_sample_info_size == 0) {
  ------------------
  |  Branch (1982:7): [True: 522, False: 250]
  ------------------
 1983|  1.58k|    for (size_t i = 0; i < m_sample_sizes.size(); i++) {
  ------------------
  |  Branch (1983:24): [True: 1.07k, False: 515]
  ------------------
 1984|  1.07k|      if (dump_reached_entry_limit(sstr, indent, full_log, i, m_sample_sizes.size())) break;
  ------------------
  |  Branch (1984:11): [True: 7, False: 1.06k]
  ------------------
 1985|  1.06k|      sstr << indent << "[" << i << "] : " << ((int) m_sample_sizes[i]) << "\n";
 1986|  1.06k|    }
 1987|    522|  }
 1988|       |
 1989|    772|  return;
 1990|    772|}
_ZN8Box_saiz5parseER14BitstreamRangePK20heif_security_limits:
 2029|    869|{
 2030|    869|  parse_full_box_header(range);
 2031|       |
 2032|    869|  if (get_flags() & 1) {
  ------------------
  |  Branch (2032:7): [True: 450, False: 419]
  ------------------
 2033|    450|    m_aux_info_type = range.read32();
 2034|    450|    m_aux_info_type_parameter = range.read32();
 2035|    450|  }
 2036|       |
 2037|    869|  m_default_sample_info_size = range.read8();
 2038|    869|  m_num_samples = range.read32();
 2039|       |
 2040|    869|  if (limits && limits->max_sequence_frames > 0 && m_num_samples > limits->max_sequence_frames) {
  ------------------
  |  Branch (2040:7): [True: 869, False: 0]
  |  Branch (2040:17): [True: 869, False: 0]
  |  Branch (2040:52): [True: 43, False: 826]
  ------------------
 2041|     43|    return {
 2042|     43|      heif_error_Memory_allocation_error,
 2043|     43|      heif_suberror_Security_limit_exceeded,
 2044|     43|      "Number of 'saiz' samples exceeds the maximum number of sequence frames."
 2045|     43|    };
 2046|     43|  }
 2047|       |
 2048|    826|  if (m_default_sample_info_size == 0) {
  ------------------
  |  Branch (2048:7): [True: 570, False: 256]
  ------------------
 2049|       |    // check required memory
 2050|       |
 2051|    570|    uint64_t mem_size = m_num_samples;
 2052|    570|    if (auto err = m_memory_handle.alloc(mem_size, limits, "the 'sample aux info sizes' (saiz) table")) {
  ------------------
  |  Branch (2052:14): [True: 0, False: 570]
  ------------------
 2053|      0|      return err;
 2054|      0|    }
 2055|       |
 2056|       |    // read whole table at once
 2057|       |
 2058|    570|    m_sample_sizes.resize(m_num_samples);
 2059|    570|    range.read(m_sample_sizes.data(), m_num_samples);
 2060|    570|  }
 2061|       |
 2062|    826|  return range.get_error();
 2063|    826|}
_ZNK8Box_saio4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2100|  1.34k|{
 2101|  1.34k|  FullBox::dump(sstr, indent, full_log);
 2102|       |
 2103|  1.34k|  sstr << indent << "aux_info_type: ";
 2104|  1.34k|  if (m_aux_info_type == 0) {
  ------------------
  |  Branch (2104:7): [True: 803, False: 542]
  ------------------
 2105|    803|    sstr << "0\n";
 2106|    803|  }
 2107|    542|  else {
 2108|    542|    sstr << fourcc_to_string(m_aux_info_type) << "\n";
 2109|    542|  }
 2110|       |
 2111|  1.34k|  sstr << indent << "aux_info_type_parameter: ";
 2112|  1.34k|  if (m_aux_info_type_parameter == 0) {
  ------------------
  |  Branch (2112:7): [True: 720, False: 625]
  ------------------
 2113|    720|    sstr << "0\n";
 2114|    720|  }
 2115|    625|  else {
 2116|    625|    sstr << fourcc_to_string(m_aux_info_type_parameter) << "\n";
 2117|    625|  }
 2118|       |
 2119|  2.04k|  for (size_t i = 0; i < m_chunk_offset.size(); i++) {
  ------------------
  |  Branch (2119:22): [True: 705, False: 1.34k]
  ------------------
 2120|    705|    if (dump_reached_entry_limit(sstr, indent, full_log, i, m_chunk_offset.size())) break;
  ------------------
  |  Branch (2120:9): [True: 1, False: 704]
  ------------------
 2121|    704|    sstr << indent << "[" << i << "] : 0x" << std::hex << m_chunk_offset[i] << "\n";
 2122|    704|  }
 2123|       |
 2124|  1.34k|  return;
 2125|  1.34k|}
_ZN8Box_saio5parseER14BitstreamRangePK20heif_security_limits:
 2181|  1.49k|{
 2182|  1.49k|  parse_full_box_header(range);
 2183|       |
 2184|  1.49k|  if (get_flags() & 1) {
  ------------------
  |  Branch (2184:7): [True: 723, False: 775]
  ------------------
 2185|    723|    m_aux_info_type = range.read32();
 2186|    723|    m_aux_info_type_parameter = range.read32();
 2187|    723|  }
 2188|       |
 2189|  1.49k|  uint32_t num_chunks = range.read32();
 2190|       |
 2191|       |  // We have no explicit maximum on the number of chunks.
 2192|       |  // Use the maximum number of frames as an upper limit.
 2193|  1.49k|  if (limits && limits->max_sequence_frames > 0 && num_chunks > limits->max_sequence_frames) {
  ------------------
  |  Branch (2193:7): [True: 1.49k, False: 0]
  |  Branch (2193:17): [True: 1.49k, False: 0]
  |  Branch (2193:52): [True: 21, False: 1.47k]
  ------------------
 2194|     21|    return {
 2195|     21|      heif_error_Memory_allocation_error,
 2196|     21|      heif_suberror_Security_limit_exceeded,
 2197|     21|      "Number of 'saio' chunks exceeds the maximum number of sequence frames."
 2198|     21|    };
 2199|     21|  }
 2200|       |
 2201|  1.47k|  if (auto err = m_memory_handle.alloc(num_chunks, sizeof(uint64_t),
  ------------------
  |  Branch (2201:12): [True: 0, False: 1.47k]
  ------------------
 2202|  1.47k|                                       limits, "the 'saio' table")) {
 2203|      0|    return err;
 2204|      0|  }
 2205|       |
 2206|  1.47k|  m_chunk_offset.resize(num_chunks);
 2207|       |
 2208|  2.93k|  for (uint32_t i = 0; i < num_chunks; i++) {
  ------------------
  |  Branch (2208:24): [True: 1.50k, False: 1.42k]
  ------------------
 2209|  1.50k|    uint64_t offset;
 2210|  1.50k|    if (get_version() == 1) {
  ------------------
  |  Branch (2210:9): [True: 393, False: 1.10k]
  ------------------
 2211|    393|      offset = range.read64();
 2212|    393|    }
 2213|  1.10k|    else {
 2214|  1.10k|      offset = range.read32();
 2215|  1.10k|    }
 2216|       |
 2217|  1.50k|    m_chunk_offset[i] = offset;
 2218|       |
 2219|  1.50k|    if (range.error()) {
  ------------------
  |  Branch (2219:9): [True: 48, False: 1.45k]
  ------------------
 2220|     48|      return range.get_error();
 2221|     48|    }
 2222|  1.50k|  }
 2223|       |
 2224|  1.42k|  return Error::Ok;
 2225|  1.47k|}
_ZNK8Box_sdtp4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2229|    265|{
 2230|    265|  FullBox::dump(sstr, indent, full_log);
 2231|       |
 2232|    265|  assert(m_sample_information.size() <= UINT32_MAX);
  ------------------
  |  Branch (2232:3): [True: 265, False: 0]
  ------------------
 2233|       |
 2234|  6.98k|  for (uint32_t i = 0; i < static_cast<uint32_t>(m_sample_information.size()); i++) {
  ------------------
  |  Branch (2234:24): [True: 6.77k, False: 208]
  ------------------
 2235|       |
 2236|  6.77k|    if (dump_reached_entry_limit(sstr, indent, full_log, i, m_sample_information.size())) break;
  ------------------
  |  Branch (2236:9): [True: 57, False: 6.71k]
  ------------------
 2237|       |
 2238|  6.71k|    const char* spaces = "            ";
 2239|  6.71k|    int nSpaces = 6;
 2240|  6.71k|    int k = i;
 2241|  12.4k|    while (k >= 10 && nSpaces < 12) {
  ------------------
  |  Branch (2241:12): [True: 5.72k, False: 6.71k]
  |  Branch (2241:23): [True: 5.72k, False: 0]
  ------------------
 2242|  5.72k|      k /= 10;
 2243|  5.72k|      nSpaces++;
 2244|  5.72k|    }
 2245|       |
 2246|  6.71k|    spaces = spaces + 12 - nSpaces;
 2247|       |
 2248|  6.71k|    sstr << indent << "[" << i << "] : is_leading=" << (int) get_is_leading(i) << "\n"
 2249|  6.71k|        << indent << spaces << "depends_on=" << (int) get_depends_on(i) << "\n"
 2250|  6.71k|        << indent << spaces << "is_depended_on=" << (int) get_is_depended_on(i) << "\n"
 2251|  6.71k|        << indent << spaces << "has_redundancy=" << (int) get_has_redundancy(i) << "\n";
 2252|  6.71k|  }
 2253|       |
 2254|    265|  return;
 2255|    265|}
_ZN8Box_sdtp5parseER14BitstreamRangePK20heif_security_limits:
 2259|    269|{
 2260|    269|  parse_full_box_header(range);
 2261|       |
 2262|       |  // We have no easy way to get the number of samples from 'saiz' or 'stz2' as specified
 2263|       |  // in the standard. Instead, we read until the end of the box.
 2264|    269|  size_t nSamples = range.get_remaining_bytes();
 2265|       |
 2266|    269|  if (limits && limits->max_sequence_frames > 0 && nSamples > limits->max_sequence_frames) {
  ------------------
  |  Branch (2266:7): [True: 269, False: 0]
  |  Branch (2266:17): [True: 269, False: 0]
  |  Branch (2266:52): [True: 0, False: 269]
  ------------------
 2267|      0|    return {
 2268|      0|      heif_error_Memory_allocation_error,
 2269|      0|      heif_suberror_Security_limit_exceeded,
 2270|      0|      "Number of 'sdtp' samples exceeds the maximum number of sequence frames."
 2271|      0|    };
 2272|      0|  }
 2273|       |
 2274|    269|  if (auto err = m_memory_handle.alloc(nSamples, limits, "the 'sdtp' table")) {
  ------------------
  |  Branch (2274:12): [True: 0, False: 269]
  ------------------
 2275|      0|    return err;
 2276|      0|  }
 2277|       |
 2278|    269|  m_sample_information.resize(nSamples);
 2279|    269|  range.read(m_sample_information.data(), nSamples);
 2280|       |
 2281|    269|  return range.get_error();
 2282|    269|}
_ZN8Box_tref5parseER14BitstreamRangePK20heif_security_limits:
 2286|    750|{
 2287|  2.36k|  while (!range.eof()) {
  ------------------
  |  Branch (2287:10): [True: 1.79k, False: 575]
  ------------------
 2288|  1.79k|    BoxHeader header;
 2289|  1.79k|    Error err = header.parse_header(range);
 2290|  1.79k|    if (err != Error::Ok) {
  ------------------
  |  Branch (2290:9): [True: 8, False: 1.78k]
  ------------------
 2291|      8|      return err;
 2292|      8|    }
 2293|       |
 2294|  1.78k|    if (header.get_box_size() < header.get_header_size()) {
  ------------------
  |  Branch (2294:9): [True: 2, False: 1.78k]
  ------------------
 2295|      2|      return {heif_error_Invalid_input,
 2296|      2|              heif_suberror_Unspecified,
 2297|      2|              "Invalid box size (smaller than header)"};
 2298|      2|    }
 2299|       |
 2300|  1.78k|    uint64_t dataSize = (header.get_box_size() - header.get_header_size());
 2301|       |
 2302|  1.78k|    if (dataSize % 4 != 0 || dataSize < 4) {
  ------------------
  |  Branch (2302:9): [True: 30, False: 1.75k]
  |  Branch (2302:30): [True: 1, False: 1.75k]
  ------------------
 2303|     31|      return {heif_error_Invalid_input,
 2304|     31|              heif_suberror_Unspecified,
 2305|     31|              "Input file has a 'tref' TrackReferenceTypeBox with invalid size."};
 2306|     31|    }
 2307|       |
 2308|  1.75k|    uint64_t nRefs = dataSize / 4;
 2309|       |
 2310|  1.75k|    if (limits->max_items && nRefs > limits->max_items) {
  ------------------
  |  Branch (2310:9): [True: 1.75k, False: 0]
  |  Branch (2310:30): [True: 97, False: 1.65k]
  ------------------
 2311|     97|      std::stringstream sstr;
 2312|     97|      sstr << "Number of references in tref box (" << nRefs << ") exceeds the security limits of " << limits->max_items << " references.";
 2313|       |
 2314|     97|      return {heif_error_Invalid_input,
 2315|     97|              heif_suberror_Security_limit_exceeded,
 2316|     97|              sstr.str()};
 2317|     97|    }
 2318|       |
 2319|  1.65k|    Reference ref;
 2320|  1.65k|    ref.reference_type = header.get_short_type();
 2321|       |
 2322|  7.54k|    for (uint64_t i = 0; i < nRefs; i++) {
  ------------------
  |  Branch (2322:26): [True: 5.92k, False: 1.61k]
  ------------------
 2323|  5.92k|      if (range.eof()) {
  ------------------
  |  Branch (2323:11): [True: 37, False: 5.89k]
  ------------------
 2324|     37|        std::stringstream sstr;
 2325|     37|        sstr << "tref box should contain " << nRefs << " references, but we can only read " << i << " references.";
 2326|       |
 2327|     37|        return {heif_error_Invalid_input,
 2328|     37|                heif_suberror_End_of_data,
 2329|     37|                sstr.str()};
 2330|     37|      }
 2331|       |
 2332|  5.89k|      ref.to_track_id.push_back(static_cast<uint32_t>(range.read32()));
 2333|  5.89k|    }
 2334|       |
 2335|  1.61k|    m_references.push_back(ref);
 2336|  1.61k|  }
 2337|       |
 2338|       |  // Note: a track ID may appear several times within one reference type box.
 2339|       |  // ISO/IEC 14496-12 does not forbid it and no consumer depends on uniqueness,
 2340|       |  // so a redundant entry is tolerated instead of rejecting the whole file.
 2341|       |
 2342|    575|  return range.get_error();
 2343|    750|}
_ZNK8Box_tref4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2369|    461|{
 2370|    461|  Box::dump(sstr, indent, full_log);
 2371|       |
 2372|  1.00k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (2372:24): [True: 1.00k, False: 461]
  ------------------
 2373|  1.00k|    sstr << indent << "reference with type '" << fourcc_to_string(ref.reference_type) << "'"
 2374|  1.00k|         << " to track IDs: ";
 2375|  1.26k|    for (uint32_t id : ref.to_track_id) {
  ------------------
  |  Branch (2375:22): [True: 1.26k, False: 1.00k]
  ------------------
 2376|  1.26k|      sstr << id << " ";
 2377|  1.26k|    }
 2378|  1.00k|    sstr << "\n";
 2379|  1.00k|  }
 2380|       |
 2381|    461|  return;
 2382|    461|}
_ZN8Box_elst5parseER14BitstreamRangePK20heif_security_limits:
 2439|    719|{
 2440|    719|  Error err = parse_full_box_header(range);
 2441|    719|  if (err != Error::Ok) {
  ------------------
  |  Branch (2441:7): [True: 2, False: 717]
  ------------------
 2442|      2|    return err;
 2443|      2|  }
 2444|       |
 2445|    717|  if (get_version() > 1) {
  ------------------
  |  Branch (2445:7): [True: 7, False: 710]
  ------------------
 2446|      7|    return unsupported_version_error("edts");
 2447|      7|  }
 2448|       |
 2449|    710|  uint32_t nEntries = range.read32();
 2450|    710|  m_entries.clear();
 2451|       |
 2452|  2.34k|  for (uint64_t i = 0; i < nEntries; i++) {
  ------------------
  |  Branch (2452:24): [True: 1.68k, False: 657]
  ------------------
 2453|  1.68k|    if (range.eof()) {
  ------------------
  |  Branch (2453:9): [True: 53, False: 1.63k]
  ------------------
 2454|     53|      std::stringstream sstr;
 2455|     53|      sstr << "edts box should contain " << nEntries << " entries, but we can only read " << i << " entries.";
 2456|       |
 2457|     53|      return {heif_error_Invalid_input,
 2458|     53|              heif_suberror_End_of_data,
 2459|     53|              sstr.str()};
 2460|     53|    }
 2461|       |
 2462|  1.63k|    Entry entry{};
 2463|  1.63k|    if (get_version() == 1) {
  ------------------
  |  Branch (2463:9): [True: 199, False: 1.43k]
  ------------------
 2464|    199|      entry.segment_duration = range.read64();
 2465|    199|      entry.media_time = range.read64s();
 2466|    199|    }
 2467|  1.43k|    else {
 2468|  1.43k|      entry.segment_duration = range.read32();
 2469|  1.43k|      entry.media_time = range.read32s();
 2470|  1.43k|    }
 2471|       |
 2472|  1.63k|    entry.media_rate_integer = range.read16s();
 2473|  1.63k|    entry.media_rate_fraction = range.read16s();
 2474|       |
 2475|  1.63k|    m_entries.push_back(entry);
 2476|  1.63k|  }
 2477|       |
 2478|    657|  return range.get_error();
 2479|    710|}
_ZNK8Box_elst4dumpERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEER6Indentb:
 2519|    496|{
 2520|    496|  FullBox::dump(sstr, indent, full_log);
 2521|       |
 2522|    496|  sstr << indent << "repeat list: " << ((get_flags() & Flags::Repeat_EditList) ? "yes" : "no") << "\n";
  ------------------
  |  Branch (2522:41): [True: 199, False: 297]
  ------------------
 2523|       |
 2524|  1.17k|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (2524:22): [True: 684, False: 495]
  ------------------
 2525|    684|    if (dump_reached_entry_limit(sstr, indent, full_log, i, m_entries.size())) break;
  ------------------
  |  Branch (2525:9): [True: 1, False: 683]
  ------------------
 2526|    683|    const auto& entry = m_entries[i];
 2527|    683|    sstr << indent << "segment duration: " << entry.segment_duration << "\n";
 2528|    683|    sstr << indent << "media time: " << entry.media_time << "\n";
 2529|    683|    sstr << indent << "media rate integer: " << entry.media_rate_integer << "\n";
 2530|    683|    sstr << indent << "media rate fraction: " << entry.media_rate_fraction << "\n";
 2531|    683|  }
 2532|       |
 2533|    496|  return;
 2534|    496|}

_ZN13Box_containerC2EPKc:
   37|  2.29k|  {
   38|  2.29k|    set_short_type(fourcc(type));
   39|  2.29k|  }
_ZN8Box_moovC2Ev:
   51|    214|  Box_moov() : Box_container("moov") {}
_ZNK8Box_moov14debug_box_nameEv:
   53|    212|  const char* debug_box_name() const override { return "Movie"; }
_ZN8Box_mvhdC2Ev:
   61|  1.46k|  {
   62|  1.46k|    set_short_type(fourcc("mvhd"));
   63|  1.46k|  }
_ZNK8Box_mvhd14debug_box_nameEv:
   67|    965|  const char* debug_box_name() const override { return "Movie Header"; }
_ZNK8Box_mvhd8get_rateEv:
   73|    965|  double get_rate() const { return m_rate / double(0x10000); }
_ZNK8Box_mvhd10get_volumeEv:
   75|    965|  float get_volume() const { return float(m_volume) / float(0x100); }
_ZN8Box_trakC2Ev:
  121|    401|  Box_trak() : Box_container("trak") {}
_ZNK8Box_trak14debug_box_nameEv:
  123|    200|  const char* debug_box_name() const override { return "Track"; }
_ZN8Box_tkhdC2Ev:
  131|  1.24k|  {
  132|  1.24k|    set_short_type(fourcc("tkhd"));
  133|       |
  134|       |    // set default flags according to ISO 14496-12
  135|  1.24k|    set_flags(Track_enabled | Track_in_movie | Track_in_preview);
  136|  1.24k|  }
_ZNK8Box_tkhd14debug_box_nameEv:
  147|  1.14k|  const char* debug_box_name() const override { return "Track Header"; }
_ZNK8Box_tkhd10get_volumeEv:
  153|  1.14k|  float get_volume() const { return float(m_volume) / float(0x100); }
_ZNK8Box_tkhd9get_widthEv:
  157|  1.14k|  double get_width() const { return float(m_width) / double(0x10000); }
_ZNK8Box_tkhd10get_heightEv:
  159|  1.14k|  double get_height() const { return float(m_height) / double(0x10000); }
_ZN8Box_mdiaC2Ev:
  198|     78|  Box_mdia() : Box_container("mdia") {}
_ZNK8Box_mdia14debug_box_nameEv:
  200|     74|  const char* debug_box_name() const override { return "Media"; }
_ZN8Box_mdhdC2Ev:
  208|    475|  {
  209|    475|    set_short_type(fourcc("mdhd"));
  210|    475|  }
_ZNK8Box_mdhd14debug_box_nameEv:
  214|    412|  const char* debug_box_name() const override { return "Media Header"; }
_ZN8Box_minfC2Ev:
  246|    321|  Box_minf() : Box_container("minf") {}
_ZNK8Box_minf14debug_box_nameEv:
  248|    287|  const char* debug_box_name() const override { return "Media Information"; }
_ZN8Box_vmhdC2Ev:
  256|    500|  {
  257|    500|    set_short_type(fourcc("vmhd"));
  258|    500|    set_flags(1);
  259|    500|  }
_ZNK8Box_vmhd14debug_box_nameEv:
  263|    467|  const char* debug_box_name() const override { return "Video Media Header"; }
_ZN8Box_nmhdC2Ev:
  280|    354|  {
  281|    354|    set_short_type(fourcc("nmhd"));
  282|    354|    set_flags(1);
  283|    354|  }
_ZNK8Box_nmhd14debug_box_nameEv:
  287|    205|  const char* debug_box_name() const override { return "Null Media Header"; }
_ZN8Box_stblC2Ev:
  299|    502|  Box_stbl() : Box_container("stbl") {}
_ZNK8Box_stbl14debug_box_nameEv:
  301|    490|  const char* debug_box_name() const override { return "Sample Table"; }
_ZN8Box_stsdC2Ev:
  309|  1.59k|  {
  310|  1.59k|    set_short_type(fourcc("stsd"));
  311|  1.59k|  }
_ZNK8Box_stsd14debug_box_nameEv:
  315|  1.13k|  const char* debug_box_name() const override { return "Sample Description"; }
_ZN8Box_sttsC2Ev:
  347|    574|  {
  348|    574|    set_short_type(fourcc("stts"));
  349|    574|  }
_ZNK8Box_stts14debug_box_nameEv:
  353|    327|  const char* debug_box_name() const override { return "Decoding Time to Sample"; }
_ZN8Box_cttsC2Ev:
  393|    967|  {
  394|    967|    set_short_type(fourcc("ctts"));
  395|    967|  }
_ZNK8Box_ctts14debug_box_nameEv:
  399|    801|  const char* debug_box_name() const override { return "Composition Time to Sample"; }
_ZN8Box_stscC2Ev:
  433|    369|  {
  434|    369|    set_short_type(fourcc("stsc"));
  435|    369|  }
_ZNK8Box_stsc14debug_box_nameEv:
  439|    121|  const char* debug_box_name() const override { return "Sample to Chunk"; }
_ZN8Box_stcoC2Ev:
  477|    379|  {
  478|    379|    set_short_type(fourcc("stco"));
  479|    379|  }
_ZNK8Box_stco14debug_box_nameEv:
  483|    296|  const char* debug_box_name() const override { return "Sample Offset"; }
_ZN8Box_stszC2Ev:
  510|    984|  {
  511|    984|    set_short_type(fourcc("stsz"));
  512|    984|  }
_ZNK8Box_stsz14debug_box_nameEv:
  516|    863|  const char* debug_box_name() const override { return "Sample Size"; }
_ZN8Box_stssC2Ev:
  545|    468|  {
  546|    468|    set_short_type(fourcc("stss"));
  547|    468|  }
_ZNK8Box_stss14debug_box_nameEv:
  551|    322|  const char* debug_box_name() const override { return "Sync Sample"; }
_ZN8Box_ccstC2Ev:
  584|    408|  {
  585|    408|    set_short_type(fourcc("ccst"));
  586|    408|  }
_ZNK8Box_ccst14debug_box_nameEv:
  590|    396|  const char* debug_box_name() const override { return "Coding Constraints"; }
_ZN8Box_auxiC2Ev:
  609|    954|  {
  610|    954|    set_short_type(fourcc("auxi"));
  611|    954|  }
_ZNK8Box_auxi14debug_box_nameEv:
  615|    934|  const char* debug_box_name() const override { return "Auxiliary Info Type"; }
_ZNK17VisualSampleEntry25get_horizontal_resolutionEv:
  654|    555|  double get_horizontal_resolution() const { return horizresolution / double(0x10000); }
_ZNK17VisualSampleEntry23get_vertical_resolutionEv:
  656|    555|  double get_vertical_resolution() const { return vertresolution / double(0x10000); }
_ZN22Box_URIMetaSampleEntryC2Ev:
  687|    628|  {
  688|    628|    set_short_type(fourcc("urim"));
  689|    628|  }
_ZNK22Box_URIMetaSampleEntry14debug_box_nameEv:
  695|    517|  const char* debug_box_name() const override { return "URI Meta Sample Entry"; }
_ZN7Box_uriC2Ev:
  710|  1.09k|  {
  711|  1.09k|    set_short_type(fourcc("uri "));
  712|  1.09k|  }
_ZNK7Box_uri14debug_box_nameEv:
  722|  1.07k|  const char* debug_box_name() const override { return "URI"; }
_ZN8Box_sbgpC2Ev:
  736|    571|  {
  737|    571|    set_short_type(fourcc("sbgp"));
  738|    571|  }
_ZNK8Box_sbgp14debug_box_nameEv:
  744|    489|  const char* debug_box_name() const override { return "Sample to Group"; }
_ZN8Box_sgpdC2Ev:
  797|  1.70k|  {
  798|  1.70k|    set_short_type(fourcc("sgpd"));
  799|  1.70k|  }
_ZNK8Box_sgpd14debug_box_nameEv:
  805|  1.57k|  const char* debug_box_name() const override { return "Sample Group Description"; }
_ZN8Box_btrtC2Ev:
  830|    484|  {
  831|    484|    set_short_type(fourcc("btrt"));
  832|    484|  }
_ZNK8Box_btrt14debug_box_nameEv:
  836|    483|  const char* debug_box_name() const override { return "Bitrate"; }
_ZN8Box_saizC2Ev:
  853|    875|  {
  854|    875|    set_short_type(fourcc("saiz"));
  855|    875|  }
_ZNK8Box_saiz14debug_box_nameEv:
  875|    772|  const char* debug_box_name() const override { return "Sample Auxiliary Information Sizes"; }
_ZN8Box_saioC2Ev:
  896|  1.49k|  {
  897|  1.49k|    set_short_type(fourcc("saio"));
  898|  1.49k|  }
_ZNK8Box_saio14debug_box_nameEv:
  915|  1.34k|  const char* debug_box_name() const override { return "Sample Auxiliary Information Offsets"; }
_ZN8Box_sdtpC2Ev:
  941|    272|  {
  942|    272|    set_short_type(fourcc("sdtp"));
  943|    272|  }
_ZNK8Box_sdtp14debug_box_nameEv:
  947|    265|  const char* debug_box_name() const override { return "Independent and Disposable Samples"; }
_ZNK8Box_sdtp14get_is_leadingEj:
  951|  6.71k|  uint8_t get_is_leading(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 6) & 3; }
_ZNK8Box_sdtp14get_depends_onEj:
  953|  6.71k|  uint8_t get_depends_on(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 4) & 3; }
_ZNK8Box_sdtp18get_is_depended_onEj:
  955|  6.71k|  uint8_t get_is_depended_on(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 2) & 3; }
_ZNK8Box_sdtp18get_has_redundancyEj:
  957|  6.71k|  uint8_t get_has_redundancy(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx]) & 3; }
_ZN8Box_trefC2Ev:
  972|    752|  {
  973|    752|    set_short_type(fourcc("tref"));
  974|    752|  }
_ZNK8Box_tref14debug_box_nameEv:
  983|    461|  const char* debug_box_name() const override { return "Track Reference"; }
_ZN8Box_edtsC2Ev:
 1008|    774|  Box_edts() : Box_container("edts") {}
_ZNK8Box_edts14debug_box_nameEv:
 1010|    641|  const char* debug_box_name() const override { return "Edit List Container"; }
_ZN8Box_elstC2Ev:
 1018|    722|  {
 1019|    722|    set_short_type(fourcc("elst"));
 1020|    722|  }
_ZNK8Box_elst14debug_box_nameEv:
 1028|    496|  const char* debug_box_name() const override { return "Edit List"; }
_ZN16SampleGroupEntryD2Ev:
  768|  71.2k|  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_:
  572|   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)  {}

