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

heif_polarization_angle_is_no_filter:
  581|  11.7k|{
  582|  11.7k|  uint32_t bits;
  583|  11.7k|  memcpy(&bits, &angle, sizeof(bits));
  584|  11.7k|  return bits == 0xFFFFFFFF;
  585|  11.7k|}

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

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

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

_ZN8FractionC2Eii:
   64|  18.0k|{
   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|  18.0k|  numerator = num;
   70|  18.0k|  denominator = den;
   71|       |
   72|   145k|  while (denominator > MAX_FRACTION_VALUE || denominator < -MAX_FRACTION_VALUE) {
  ------------------
  |  Branch (72:10): [True: 127k, False: 18.0k]
  |  Branch (72:46): [True: 0, False: 18.0k]
  ------------------
   73|   127k|    numerator /= 2;
   74|   127k|    denominator /= 2;
   75|   127k|  }
   76|       |
   77|  42.0k|  while (denominator > 1 && (numerator > MAX_FRACTION_VALUE || numerator < -MAX_FRACTION_VALUE)) {
  ------------------
  |  Branch (77:10): [True: 35.1k, False: 6.85k]
  |  Branch (77:30): [True: 23.7k, False: 11.3k]
  |  Branch (77:64): [True: 194, False: 11.1k]
  ------------------
   78|  23.9k|    numerator /= 2;
   79|  23.9k|    denominator /= 2;
   80|  23.9k|  }
   81|  18.0k|}
_ZN8Fraction11from_signedEll:
   84|  18.7k|{
   85|  18.7k|  if (num < std::numeric_limits<int32_t>::min() || num > std::numeric_limits<int32_t>::max() ||
  ------------------
  |  Branch (85:7): [True: 0, False: 18.7k]
  |  Branch (85:52): [True: 340, False: 18.3k]
  ------------------
   86|  18.3k|      den < std::numeric_limits<int32_t>::min() || den > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (86:7): [True: 0, False: 18.3k]
  |  Branch (86:52): [True: 348, False: 18.0k]
  ------------------
   87|    688|    return Error(heif_error_Invalid_input,
   88|    688|                 heif_suberror_Invalid_fractional_number,
   89|    688|                 "Fraction value exceeds the supported range");
   90|    688|  }
   91|       |
   92|  18.0k|  Fraction f(static_cast<int32_t>(num), static_cast<int32_t>(den));
   93|  18.0k|  if (!f.is_valid()) {
  ------------------
  |  Branch (93:7): [True: 6.05k, False: 11.9k]
  ------------------
   94|  6.05k|    return Error(heif_error_Invalid_input,
   95|  6.05k|                 heif_suberror_Invalid_fractional_number,
   96|  6.05k|                 "Fraction with zero denominator");
   97|  6.05k|  }
   98|       |
   99|  11.9k|  return f;
  100|  18.0k|}
_ZN8Fraction13from_unsignedEjj:
  103|  9.35k|{
  104|  9.35k|  return from_signed(num, den);
  105|  9.35k|}
_ZNK8Fraction8is_validEv:
  178|  18.0k|{
  179|  18.0k|  return denominator != 0;
  180|  18.0k|}
_ZN9BoxHeaderC2Ev:
  183|  1.06M|BoxHeader::BoxHeader() = default;
_ZNK9BoxHeader8get_typeEv:
  187|   145k|{
  188|   145k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (188:7): [True: 4.93k, False: 140k]
  ------------------
  189|  4.93k|    return m_uuid_type;
  190|  4.93k|  }
  191|   140k|  else {
  192|   140k|    std::vector<uint8_t> type(4);
  193|   140k|    type[0] = static_cast<uint8_t>((m_type >> 24) & 0xFF);
  194|   140k|    type[1] = static_cast<uint8_t>((m_type >> 16) & 0xFF);
  195|   140k|    type[2] = static_cast<uint8_t>((m_type >> 8) & 0xFF);
  196|   140k|    type[3] = static_cast<uint8_t>((m_type >> 0) & 0xFF);
  197|   140k|    return type;
  198|   140k|  }
  199|   145k|}
_ZNK9BoxHeader15get_type_stringEv:
  203|   999k|{
  204|   999k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (204:7): [True: 30.9k, False: 968k]
  ------------------
  205|       |    // 8-4-4-4-12
  206|       |
  207|  30.9k|    std::ostringstream sstr;
  208|  30.9k|    sstr << std::hex;
  209|  30.9k|    sstr << std::setfill('0');
  210|       |
  211|   525k|    for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (211:21): [True: 494k, False: 30.9k]
  ------------------
  212|   494k|      if (i == 4 || i == 6 || i == 8 || i == 10) {
  ------------------
  |  Branch (212:11): [True: 30.9k, False: 463k]
  |  Branch (212:21): [True: 30.9k, False: 432k]
  |  Branch (212:31): [True: 30.9k, False: 402k]
  |  Branch (212:41): [True: 30.9k, False: 371k]
  ------------------
  213|   123k|        sstr << '-';
  214|   123k|      }
  215|       |
  216|   494k|      sstr << std::setw(2);
  217|   494k|      sstr << ((int) m_uuid_type[i]);
  218|   494k|    }
  219|       |
  220|  30.9k|    return sstr.str();
  221|  30.9k|  }
  222|   968k|  else {
  223|   968k|    return fourcc_to_string(m_type);
  224|   968k|  }
  225|   999k|}
_ZNK9BoxHeader13get_uuid_typeEv:
  229|  40.7k|{
  230|  40.7k|  if (m_type != fourcc("uuid")) {
  ------------------
  |  Branch (230:7): [True: 0, False: 40.7k]
  ------------------
  231|      0|    return {};
  232|      0|  }
  233|       |
  234|  40.7k|  return m_uuid_type;
  235|  40.7k|}
_ZN9BoxHeader13set_uuid_typeERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  239|  2.54k|{
  240|  2.54k|  m_type = fourcc("uuid");
  241|  2.54k|  m_uuid_type = type;
  242|  2.54k|}
_ZN9BoxHeader12parse_headerER14BitstreamRange:
  246|   494k|{
  247|   494k|  StreamReader::grow_status status;
  248|   494k|  status = range.wait_for_available_bytes(8);
  249|   494k|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (249:7): [True: 7.86k, False: 486k]
  ------------------
  250|       |    // TODO: return recoverable error at timeout
  251|  7.86k|    return Error(heif_error_Invalid_input,
  252|  7.86k|                 heif_suberror_End_of_data);
  253|  7.86k|  }
  254|       |
  255|   486k|  m_size = range.read32();
  256|   486k|  m_type = range.read32();
  257|       |
  258|   486k|  m_header_size = 8;
  259|       |
  260|   486k|  if (m_size == 1) {
  ------------------
  |  Branch (260:7): [True: 214, False: 486k]
  ------------------
  261|    214|    status = range.wait_for_available_bytes(8);
  262|    214|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (262:9): [True: 2, False: 212]
  ------------------
  263|       |      // TODO: return recoverable error at timeout
  264|      2|      return Error(heif_error_Invalid_input,
  265|      2|                   heif_suberror_End_of_data);
  266|      2|    }
  267|       |
  268|    212|    uint64_t high = range.read32();
  269|    212|    uint64_t low = range.read32();
  270|       |
  271|    212|    m_size = (high << 32) | low;
  272|    212|    m_header_size += 8;
  273|       |
  274|    212|    std::stringstream sstr;
  275|    212|    sstr << "Box size " << m_size << " exceeds security limit.";
  276|       |
  277|    212|    if (m_size > MAX_LARGE_BOX_SIZE) {
  ------------------
  |  Branch (277:9): [True: 11, False: 201]
  ------------------
  278|     11|      return Error(heif_error_Memory_allocation_error,
  279|     11|                   heif_suberror_Security_limit_exceeded,
  280|     11|                   sstr.str());
  281|     11|    }
  282|    212|  }
  283|       |
  284|   486k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (284:7): [True: 14.8k, False: 471k]
  ------------------
  285|  14.8k|    status = range.wait_for_available_bytes(16);
  286|  14.8k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (286:9): [True: 4, False: 14.8k]
  ------------------
  287|       |      // TODO: return recoverable error at timeout
  288|      4|      return Error(heif_error_Invalid_input,
  289|      4|                   heif_suberror_End_of_data);
  290|      4|    }
  291|       |
  292|  14.8k|    if (range.prepare_read(16)) {
  ------------------
  |  Branch (292:9): [True: 14.8k, False: 1]
  ------------------
  293|  14.8k|      m_uuid_type.resize(16);
  294|  14.8k|      bool success = range.get_istream()->read((char*) m_uuid_type.data(), 16);
  295|  14.8k|      assert(success);
  ------------------
  |  Branch (295:7): [True: 14.8k, False: 0]
  ------------------
  296|  14.8k|      (void) success;
  297|  14.8k|    }
  298|       |
  299|  14.8k|    m_header_size += 16;
  300|  14.8k|  }
  301|       |
  302|   486k|  return range.get_error();
  303|   486k|}
_ZNK9BoxHeader4dumpER6Indent:
  408|   373k|{
  409|   373k|  std::ostringstream sstr;
  410|   373k|  sstr << indent << "Box: " << get_type_string();
  411|   373k|  const char* debug_name = debug_box_name();
  412|   373k|  if (debug_name) {
  ------------------
  |  Branch (412:7): [True: 180k, False: 193k]
  ------------------
  413|   180k|    sstr << " ----- (" << debug_name << ")\n";
  414|   180k|  }
  415|   193k|  else {
  416|   193k|    sstr << " -----\n";
  417|   193k|  }
  418|       |
  419|   373k|  sstr << indent << "size: " << get_box_size() << "   (header size: " << get_header_size() << ")\n";
  420|       |
  421|   373k|  return sstr.str();
  422|   373k|}
_ZN3Box5parseER14BitstreamRangePK20heif_security_limits:
  426|  2.12k|{
  427|       |  // skip box
  428|       |
  429|  2.12k|  if (get_box_size() == size_until_end_of_file) {
  ------------------
  |  Branch (429:7): [True: 8, False: 2.11k]
  ------------------
  430|      8|    range.skip_to_end_of_file();
  431|      8|  }
  432|  2.11k|  else {
  433|  2.11k|    uint64_t content_size = get_box_size() - get_header_size();
  434|       |
  435|  2.11k|    assert(MAX_BOX_SIZE <= SIZE_MAX);
  ------------------
  |  Branch (435:5): [True: 2.11k, Folded]
  ------------------
  436|       |
  437|  2.11k|    if (content_size > MAX_BOX_SIZE) {
  ------------------
  |  Branch (437:9): [True: 0, False: 2.11k]
  ------------------
  438|      0|      return Error(heif_error_Invalid_input,
  439|      0|                   heif_suberror_Invalid_box_size);
  440|      0|    }
  441|       |
  442|  2.11k|    if (range.prepare_read(static_cast<size_t>(content_size))) {
  ------------------
  |  Branch (442:9): [True: 2.11k, False: 0]
  ------------------
  443|  2.11k|      range.get_istream()->seek_cur(get_box_size() - get_header_size());
  444|  2.11k|    }
  445|  2.11k|  }
  446|       |
  447|       |  // Note: seekg() clears the eof flag and it will not be set again afterwards,
  448|       |  // hence we have to test for the fail flag.
  449|       |
  450|  2.12k|  return range.get_error();
  451|  2.12k|}
_ZN7FullBox21parse_full_box_headerER14BitstreamRange:
  455|   103k|{
  456|   103k|  uint32_t data = range.read32();
  457|   103k|  m_version = static_cast<uint8_t>(data >> 24);
  458|   103k|  m_flags = data & 0x00FFFFFF;
  459|       |  //m_is_full_box = true;
  460|       |
  461|   103k|  m_header_size += 4;
  462|       |
  463|   103k|  return range.get_error();
  464|   103k|}
_ZN3Box4readER14BitstreamRangePNSt3__110shared_ptrIS_EEPK20heif_security_limits:
  468|   477k|{
  469|   477k|  BoxHeader hdr;
  470|   477k|  Error err = hdr.parse_header(range);
  471|   477k|  if (err) {
  ------------------
  |  Branch (471:7): [True: 7.91k, False: 469k]
  ------------------
  472|  7.91k|    return err;
  473|  7.91k|  }
  474|       |
  475|   469k|  if (range.error()) {
  ------------------
  |  Branch (475:7): [True: 0, False: 469k]
  ------------------
  476|      0|    return range.get_error();
  477|      0|  }
  478|       |
  479|   469k|  result->reset();
  480|       |
  481|   469k|  std::shared_ptr<Box> box;
  482|       |
  483|   469k|  switch (hdr.get_short_type()) {
  484|  10.8k|    case fourcc("ftyp"):
  ------------------
  |  Branch (484:5): [True: 10.8k, False: 458k]
  ------------------
  485|  10.8k|      box = std::make_shared<Box_ftyp>();
  486|  10.8k|      break;
  487|       |
  488|    554|    case fourcc("free"):
  ------------------
  |  Branch (488:5): [True: 554, False: 468k]
  ------------------
  489|    821|    case fourcc("skip"):
  ------------------
  |  Branch (489:5): [True: 267, False: 469k]
  ------------------
  490|    821|      box = std::make_shared<Box_free>();
  491|    821|      break;
  492|       |
  493|  2.91k|    case fourcc("meta"):
  ------------------
  |  Branch (493:5): [True: 2.91k, False: 466k]
  ------------------
  494|  2.91k|      box = std::make_shared<Box_meta>();
  495|  2.91k|      break;
  496|       |
  497|  3.72k|    case fourcc("hdlr"):
  ------------------
  |  Branch (497:5): [True: 3.72k, False: 465k]
  ------------------
  498|  3.72k|      box = std::make_shared<Box_hdlr>();
  499|  3.72k|      break;
  500|       |
  501|  3.48k|    case fourcc("pitm"):
  ------------------
  |  Branch (501:5): [True: 3.48k, False: 465k]
  ------------------
  502|  3.48k|      box = std::make_shared<Box_pitm>();
  503|  3.48k|      break;
  504|       |
  505|  2.25k|    case fourcc("iloc"):
  ------------------
  |  Branch (505:5): [True: 2.25k, False: 467k]
  ------------------
  506|  2.25k|      box = std::make_shared<Box_iloc>();
  507|  2.25k|      break;
  508|       |
  509|  3.99k|    case fourcc("iinf"):
  ------------------
  |  Branch (509:5): [True: 3.99k, False: 465k]
  ------------------
  510|  3.99k|      box = std::make_shared<Box_iinf>();
  511|  3.99k|      break;
  512|       |
  513|  4.61k|    case fourcc("infe"):
  ------------------
  |  Branch (513:5): [True: 4.61k, False: 464k]
  ------------------
  514|  4.61k|      box = std::make_shared<Box_infe>();
  515|  4.61k|      break;
  516|       |
  517|  32.1k|    case fourcc("iprp"):
  ------------------
  |  Branch (517:5): [True: 32.1k, False: 437k]
  ------------------
  518|  32.1k|      box = std::make_shared<Box_iprp>();
  519|  32.1k|      break;
  520|       |
  521|  11.4k|    case fourcc("ipco"):
  ------------------
  |  Branch (521:5): [True: 11.4k, False: 457k]
  ------------------
  522|  11.4k|      box = std::make_shared<Box_ipco>();
  523|  11.4k|      break;
  524|       |
  525|  2.90k|    case fourcc("ipma"):
  ------------------
  |  Branch (525:5): [True: 2.90k, False: 466k]
  ------------------
  526|  2.90k|      box = std::make_shared<Box_ipma>();
  527|  2.90k|      break;
  528|       |
  529|  2.62k|    case fourcc("ispe"):
  ------------------
  |  Branch (529:5): [True: 2.62k, False: 466k]
  ------------------
  530|  2.62k|      box = std::make_shared<Box_ispe>();
  531|  2.62k|      break;
  532|       |
  533|  1.00k|    case fourcc("auxC"):
  ------------------
  |  Branch (533:5): [True: 1.00k, False: 468k]
  ------------------
  534|  1.00k|      box = std::make_shared<Box_auxC>();
  535|  1.00k|      break;
  536|       |
  537|  10.7k|    case fourcc("irot"):
  ------------------
  |  Branch (537:5): [True: 10.7k, False: 458k]
  ------------------
  538|  10.7k|      box = std::make_shared<Box_irot>();
  539|  10.7k|      break;
  540|       |
  541|  2.70k|    case fourcc("imir"):
  ------------------
  |  Branch (541:5): [True: 2.70k, False: 466k]
  ------------------
  542|  2.70k|      box = std::make_shared<Box_imir>();
  543|  2.70k|      break;
  544|       |
  545|  4.68k|    case fourcc("clap"):
  ------------------
  |  Branch (545:5): [True: 4.68k, False: 464k]
  ------------------
  546|  4.68k|      box = std::make_shared<Box_clap>();
  547|  4.68k|      break;
  548|       |
  549|    677|    case fourcc("iscl"):
  ------------------
  |  Branch (549:5): [True: 677, False: 468k]
  ------------------
  550|    677|      box = std::make_shared<Box_iscl>();
  551|    677|      break;
  552|       |
  553|  14.2k|    case fourcc("iref"):
  ------------------
  |  Branch (553:5): [True: 14.2k, False: 455k]
  ------------------
  554|  14.2k|      box = std::make_shared<Box_iref>();
  555|  14.2k|      break;
  556|       |
  557|    783|    case fourcc("rref"):
  ------------------
  |  Branch (557:5): [True: 783, False: 468k]
  ------------------
  558|    783|      box = std::make_shared<Box_rref>();
  559|    783|      break;
  560|       |
  561|  4.60k|    case fourcc("hvcC"):
  ------------------
  |  Branch (561:5): [True: 4.60k, False: 464k]
  ------------------
  562|  4.60k|      box = std::make_shared<Box_hvcC>();
  563|  4.60k|      break;
  564|       |
  565|    164|    case fourcc("hvc1"):
  ------------------
  |  Branch (565:5): [True: 164, False: 469k]
  ------------------
  566|    164|      box = std::make_shared<Box_hvc1>();
  567|    164|      break;
  568|       |
  569|  3.59k|    case fourcc("av1C"):
  ------------------
  |  Branch (569:5): [True: 3.59k, False: 465k]
  ------------------
  570|  3.59k|      box = std::make_shared<Box_av1C>();
  571|  3.59k|      break;
  572|       |
  573|    232|    case fourcc("av01"):
  ------------------
  |  Branch (573:5): [True: 232, False: 469k]
  ------------------
  574|    232|      box = std::make_shared<Box_av01>();
  575|    232|      break;
  576|       |
  577|  2.47k|    case fourcc("vvcC"):
  ------------------
  |  Branch (577:5): [True: 2.47k, False: 466k]
  ------------------
  578|  2.47k|      box = std::make_shared<Box_vvcC>();
  579|  2.47k|      break;
  580|       |
  581|     86|    case fourcc("vvc1"):
  ------------------
  |  Branch (581:5): [True: 86, False: 469k]
  ------------------
  582|     86|      box = std::make_shared<Box_vvc1>();
  583|     86|      break;
  584|       |
  585|  7.09k|    case fourcc("idat"):
  ------------------
  |  Branch (585:5): [True: 7.09k, False: 462k]
  ------------------
  586|  7.09k|      box = std::make_shared<Box_idat>();
  587|  7.09k|      break;
  588|       |
  589|  1.64k|    case fourcc("grpl"):
  ------------------
  |  Branch (589:5): [True: 1.64k, False: 467k]
  ------------------
  590|  1.64k|      box = std::make_shared<Box_grpl>();
  591|  1.64k|      break;
  592|       |
  593|  1.54k|    case fourcc("pymd"):
  ------------------
  |  Branch (593:5): [True: 1.54k, False: 467k]
  ------------------
  594|  1.54k|      box = std::make_shared<Box_pymd>();
  595|  1.54k|      break;
  596|       |
  597|    112|    case fourcc("altr"):
  ------------------
  |  Branch (597:5): [True: 112, False: 469k]
  ------------------
  598|    112|      box = std::make_shared<Box_EntityToGroup>();
  599|    112|      break;
  600|       |
  601|    516|    case fourcc("ster"):
  ------------------
  |  Branch (601:5): [True: 516, False: 468k]
  ------------------
  602|    516|      box = std::make_shared<Box_ster>();
  603|    516|      break;
  604|       |
  605|  7.28k|    case fourcc("dinf"):
  ------------------
  |  Branch (605:5): [True: 7.28k, False: 462k]
  ------------------
  606|  7.28k|      box = std::make_shared<Box_dinf>();
  607|  7.28k|      break;
  608|       |
  609|  1.72k|    case fourcc("dref"):
  ------------------
  |  Branch (609:5): [True: 1.72k, False: 467k]
  ------------------
  610|  1.72k|      box = std::make_shared<Box_dref>();
  611|  1.72k|      break;
  612|       |
  613|  2.58k|    case fourcc("url "):
  ------------------
  |  Branch (613:5): [True: 2.58k, False: 466k]
  ------------------
  614|  2.58k|      box = std::make_shared<Box_url>();
  615|  2.58k|      break;
  616|       |
  617|  10.0k|    case fourcc("colr"):
  ------------------
  |  Branch (617:5): [True: 10.0k, False: 459k]
  ------------------
  618|  10.0k|      box = std::make_shared<Box_colr>();
  619|  10.0k|      break;
  620|       |
  621|  3.46k|    case fourcc("pixi"):
  ------------------
  |  Branch (621:5): [True: 3.46k, False: 465k]
  ------------------
  622|  3.46k|      box = std::make_shared<Box_pixi>();
  623|  3.46k|      break;
  624|       |
  625|  14.9k|    case fourcc("pasp"):
  ------------------
  |  Branch (625:5): [True: 14.9k, False: 454k]
  ------------------
  626|  14.9k|      box = std::make_shared<Box_pasp>();
  627|  14.9k|      break;
  628|       |
  629|  7.05k|    case fourcc("lsel"):
  ------------------
  |  Branch (629:5): [True: 7.05k, False: 462k]
  ------------------
  630|  7.05k|      box = std::make_shared<Box_lsel>();
  631|  7.05k|      break;
  632|       |
  633|  17.1k|    case fourcc("a1op"):
  ------------------
  |  Branch (633:5): [True: 17.1k, False: 452k]
  ------------------
  634|  17.1k|      box = std::make_shared<Box_a1op>();
  635|  17.1k|      break;
  636|       |
  637|  6.83k|    case fourcc("a1lx"):
  ------------------
  |  Branch (637:5): [True: 6.83k, False: 462k]
  ------------------
  638|  6.83k|      box = std::make_shared<Box_a1lx>();
  639|  6.83k|      break;
  640|       |
  641|  1.46k|    case fourcc("clli"):
  ------------------
  |  Branch (641:5): [True: 1.46k, False: 467k]
  ------------------
  642|  1.46k|      box = std::make_shared<Box_clli>();
  643|  1.46k|      break;
  644|       |
  645|  6.24k|    case fourcc("mdcv"):
  ------------------
  |  Branch (645:5): [True: 6.24k, False: 463k]
  ------------------
  646|  6.24k|      box = std::make_shared<Box_mdcv>();
  647|  6.24k|      break;
  648|       |
  649|    732|    case fourcc("amve"):
  ------------------
  |  Branch (649:5): [True: 732, False: 468k]
  ------------------
  650|    732|      box = std::make_shared<Box_amve>();
  651|    732|      break;
  652|       |
  653|    611|    case fourcc("ndwt"):
  ------------------
  |  Branch (653:5): [True: 611, False: 468k]
  ------------------
  654|    611|      box = std::make_shared<Box_ndwt>();
  655|    611|      break;
  656|       |
  657|  1.73k|    case fourcc("cmin"):
  ------------------
  |  Branch (657:5): [True: 1.73k, False: 467k]
  ------------------
  658|  1.73k|      box = std::make_shared<Box_cmin>();
  659|  1.73k|      break;
  660|       |
  661|  2.28k|    case fourcc("cmex"):
  ------------------
  |  Branch (661:5): [True: 2.28k, False: 467k]
  ------------------
  662|  2.28k|      box = std::make_shared<Box_cmex>();
  663|  2.28k|      break;
  664|       |
  665|  1.84k|    case fourcc("udes"):
  ------------------
  |  Branch (665:5): [True: 1.84k, False: 467k]
  ------------------
  666|  1.84k|      box = std::make_shared<Box_udes>();
  667|  1.84k|      break;
  668|       |
  669|  8.26k|    case fourcc("jpgC"):
  ------------------
  |  Branch (669:5): [True: 8.26k, False: 461k]
  ------------------
  670|  8.26k|      box = std::make_shared<Box_jpgC>();
  671|  8.26k|      break;
  672|       |
  673|    122|    case fourcc("mjpg"):
  ------------------
  |  Branch (673:5): [True: 122, False: 469k]
  ------------------
  674|    122|      box = std::make_shared<Box_mjpg>();
  675|    122|      break;
  676|       |
  677|    648|    case fourcc("elng"):
  ------------------
  |  Branch (677:5): [True: 648, False: 468k]
  ------------------
  678|    648|      box = std::make_shared<Box_elng>();
  679|    648|      break;
  680|       |
  681|       |
  682|      0|#if WITH_UNCOMPRESSED_CODEC
  683|  1.14k|    case fourcc("cmpd"):
  ------------------
  |  Branch (683:5): [True: 1.14k, False: 468k]
  ------------------
  684|  1.14k|      box = std::make_shared<Box_cmpd>();
  685|  1.14k|      break;
  686|       |
  687|  4.22k|    case fourcc("uncC"):
  ------------------
  |  Branch (687:5): [True: 4.22k, False: 465k]
  ------------------
  688|  4.22k|      box = std::make_shared<Box_uncC>();
  689|  4.22k|      break;
  690|       |
  691|    640|    case fourcc("cmpC"):
  ------------------
  |  Branch (691:5): [True: 640, False: 468k]
  ------------------
  692|    640|      box = std::make_shared<Box_cmpC>();
  693|    640|      break;
  694|       |
  695|    987|    case fourcc("icef"):
  ------------------
  |  Branch (695:5): [True: 987, False: 468k]
  ------------------
  696|    987|      box = std::make_shared<Box_icef>();
  697|    987|      break;
  698|       |
  699|    878|    case fourcc("cpat"):
  ------------------
  |  Branch (699:5): [True: 878, False: 468k]
  ------------------
  700|    878|      box = std::make_shared<Box_cpat>();
  701|    878|      break;
  702|       |
  703|    470|    case fourcc("splz"):
  ------------------
  |  Branch (703:5): [True: 470, False: 468k]
  ------------------
  704|    470|      box = std::make_shared<Box_splz>();
  705|    470|      break;
  706|       |
  707|    572|    case fourcc("sbpm"):
  ------------------
  |  Branch (707:5): [True: 572, False: 468k]
  ------------------
  708|    572|      box = std::make_shared<Box_sbpm>();
  709|    572|      break;
  710|       |
  711|    391|    case fourcc("snuc"):
  ------------------
  |  Branch (711:5): [True: 391, False: 469k]
  ------------------
  712|    391|      box = std::make_shared<Box_snuc>();
  713|    391|      break;
  714|       |
  715|    186|    case fourcc("cloc"):
  ------------------
  |  Branch (715:5): [True: 186, False: 469k]
  ------------------
  716|    186|      box = std::make_shared<Box_cloc>();
  717|    186|      break;
  718|       |
  719|    455|    case fourcc("uncv"):
  ------------------
  |  Branch (719:5): [True: 455, False: 468k]
  ------------------
  720|    455|      box = std::make_shared<Box_uncv>();
  721|    455|      break;
  722|      0|#endif
  723|       |
  724|       |    // --- JPEG 2000
  725|       |
  726|  7.58k|    case fourcc("j2kH"):
  ------------------
  |  Branch (726:5): [True: 7.58k, False: 461k]
  ------------------
  727|  7.58k|      box = std::make_shared<Box_j2kH>();
  728|  7.58k|      break;
  729|       |
  730|  8.97k|    case fourcc("cdef"):
  ------------------
  |  Branch (730:5): [True: 8.97k, False: 460k]
  ------------------
  731|  8.97k|      box = std::make_shared<Box_cdef>();
  732|  8.97k|      break;
  733|       |
  734|  5.87k|    case fourcc("cmap"):
  ------------------
  |  Branch (734:5): [True: 5.87k, False: 463k]
  ------------------
  735|  5.87k|      box = std::make_shared<Box_cmap>();
  736|  5.87k|      break;
  737|       |
  738|  1.29k|    case fourcc("pclr"):
  ------------------
  |  Branch (738:5): [True: 1.29k, False: 468k]
  ------------------
  739|  1.29k|      box = std::make_shared<Box_pclr>();
  740|  1.29k|      break;
  741|       |
  742|    926|    case fourcc("j2kL"):
  ------------------
  |  Branch (742:5): [True: 926, False: 468k]
  ------------------
  743|    926|      box = std::make_shared<Box_j2kL>();
  744|    926|      break;
  745|       |
  746|     78|    case fourcc("j2ki"):
  ------------------
  |  Branch (746:5): [True: 78, False: 469k]
  ------------------
  747|     78|      box = std::make_shared<Box_j2ki>();
  748|     78|      break;
  749|       |
  750|       |
  751|       |    // --- mski
  752|       |
  753|    605|    case fourcc("mskC"):
  ------------------
  |  Branch (753:5): [True: 605, False: 468k]
  ------------------
  754|    605|      box = std::make_shared<Box_mskC>();
  755|    605|      break;
  756|       |
  757|       |    // --- TAI timestamps
  758|       |
  759|    526|    case fourcc("itai"):
  ------------------
  |  Branch (759:5): [True: 526, False: 468k]
  ------------------
  760|    526|      box = std::make_shared<Box_itai>();
  761|    526|      break;
  762|       |
  763|  1.47k|    case fourcc("taic"):
  ------------------
  |  Branch (763:5): [True: 1.47k, False: 467k]
  ------------------
  764|  1.47k|      box = std::make_shared<Box_taic>();
  765|  1.47k|      break;
  766|       |
  767|       |    // --- AVC (H.264)
  768|       |
  769|  4.55k|    case fourcc("avcC"):
  ------------------
  |  Branch (769:5): [True: 4.55k, False: 464k]
  ------------------
  770|  4.55k|      box = std::make_shared<Box_avcC>();
  771|  4.55k|      break;
  772|       |
  773|     70|    case fourcc("avc1"):
  ------------------
  |  Branch (773:5): [True: 70, False: 469k]
  ------------------
  774|     70|      box = std::make_shared<Box_avc1>();
  775|     70|      break;
  776|       |
  777|      0|#if HEIF_ENABLE_EXPERIMENTAL_FEATURES
  778|  1.85k|    case fourcc("tilC"):
  ------------------
  |  Branch (778:5): [True: 1.85k, False: 467k]
  ------------------
  779|  1.85k|      box = std::make_shared<Box_tilC>();
  780|  1.85k|      break;
  781|      0|#endif
  782|       |
  783|  13.8k|    case fourcc("mini"):
  ------------------
  |  Branch (783:5): [True: 13.8k, False: 455k]
  ------------------
  784|  13.8k|      box = std::make_shared<Box_mini>();
  785|  13.8k|      break;
  786|       |
  787|  2.12k|    case fourcc("mdat"):
  ------------------
  |  Branch (787:5): [True: 2.12k, False: 467k]
  ------------------
  788|       |      // avoid generating a 'Box_other'
  789|  2.12k|      box = std::make_shared<Box>();
  790|  2.12k|      break;
  791|       |
  792|  14.4k|    case fourcc("uuid"):
  ------------------
  |  Branch (792:5): [True: 14.4k, False: 454k]
  ------------------
  793|  14.4k|      if (hdr.get_uuid_type() == std::vector<uint8_t>{0x22, 0xcc, 0x04, 0xc7, 0xd6, 0xd9, 0x4e, 0x07, 0x9d, 0x90, 0x4e, 0xb6, 0xec, 0xba, 0xf3, 0xa3}) {
  ------------------
  |  Branch (793:11): [True: 2.38k, False: 12.0k]
  ------------------
  794|  2.38k|        box = std::make_shared<Box_cmin>();
  795|  2.38k|      }
  796|  12.0k|      else if (hdr.get_uuid_type() == std::vector<uint8_t>{0x43, 0x63, 0xe9, 0x14, 0x5b, 0x7d, 0x4a, 0xab, 0x97, 0xae, 0xbe, 0xa6, 0x98, 0x03, 0xb4, 0x34}) {
  ------------------
  |  Branch (796:16): [True: 3.87k, False: 8.14k]
  ------------------
  797|  3.87k|        box = std::make_shared<Box_cmex>();
  798|  3.87k|      }
  799|  8.14k|      else if (hdr.get_uuid_type() == std::vector<uint8_t>{0x26, 0x1e, 0xf3, 0x74, 0x1d, 0x97, 0x5b, 0xba, 0xac, 0xbd, 0x9d, 0x2c, 0x8e, 0xa7, 0x35, 0x22}) {
  ------------------
  |  Branch (799:16): [True: 1.98k, False: 6.15k]
  ------------------
  800|  1.98k|        box = std::make_shared<Box_gimi_content_id>();
  801|  1.98k|      }
  802|  6.15k|#if WITH_UNCOMPRESSED_CODEC
  803|  6.15k|      else if (hdr.get_uuid_type() == std::vector<uint8_t>{0x9d, 0xb9, 0xdd, 0x6e, 0x37, 0x3c, 0x5a, 0x4e, 0x81, 0x10, 0x21, 0xfc, 0x83, 0xa9, 0x11, 0xfd}) {
  ------------------
  |  Branch (803:16): [True: 557, False: 5.60k]
  ------------------
  804|    557|        box = std::make_shared<Box_gimi_component_content_ids>();
  805|    557|      }
  806|  5.60k|#endif
  807|  5.60k|      else {
  808|  5.60k|        box = std::make_shared<Box_other>(hdr.get_short_type());
  809|  5.60k|      }
  810|  14.4k|      break;
  811|       |
  812|       |    // --- sequences
  813|       |
  814|    409|    case fourcc("moov"):
  ------------------
  |  Branch (814:5): [True: 409, False: 468k]
  ------------------
  815|    409|      box = std::make_shared<Box_moov>();
  816|    409|      break;
  817|       |
  818|  1.75k|    case fourcc("mvhd"):
  ------------------
  |  Branch (818:5): [True: 1.75k, False: 467k]
  ------------------
  819|  1.75k|      box = std::make_shared<Box_mvhd>();
  820|  1.75k|      break;
  821|       |
  822|    357|    case fourcc("trak"):
  ------------------
  |  Branch (822:5): [True: 357, False: 469k]
  ------------------
  823|    357|      box = std::make_shared<Box_trak>();
  824|    357|      break;
  825|       |
  826|  1.33k|    case fourcc("tkhd"):
  ------------------
  |  Branch (826:5): [True: 1.33k, False: 468k]
  ------------------
  827|  1.33k|      box = std::make_shared<Box_tkhd>();
  828|  1.33k|      break;
  829|       |
  830|     72|    case fourcc("mdia"):
  ------------------
  |  Branch (830:5): [True: 72, False: 469k]
  ------------------
  831|     72|      box = std::make_shared<Box_mdia>();
  832|     72|      break;
  833|       |
  834|    657|    case fourcc("mdhd"):
  ------------------
  |  Branch (834:5): [True: 657, False: 468k]
  ------------------
  835|    657|      box = std::make_shared<Box_mdhd>();
  836|    657|      break;
  837|       |
  838|    532|    case fourcc("minf"):
  ------------------
  |  Branch (838:5): [True: 532, False: 468k]
  ------------------
  839|    532|      box = std::make_shared<Box_minf>();
  840|    532|      break;
  841|       |
  842|    564|    case fourcc("vmhd"):
  ------------------
  |  Branch (842:5): [True: 564, False: 468k]
  ------------------
  843|    564|      box = std::make_shared<Box_vmhd>();
  844|    564|      break;
  845|       |
  846|    638|    case fourcc("stbl"):
  ------------------
  |  Branch (846:5): [True: 638, False: 468k]
  ------------------
  847|    638|      box = std::make_shared<Box_stbl>();
  848|    638|      break;
  849|       |
  850|  1.36k|    case fourcc("stsd"):
  ------------------
  |  Branch (850:5): [True: 1.36k, False: 468k]
  ------------------
  851|  1.36k|      box = std::make_shared<Box_stsd>();
  852|  1.36k|      break;
  853|       |
  854|    398|    case fourcc("stts"):
  ------------------
  |  Branch (854:5): [True: 398, False: 468k]
  ------------------
  855|    398|      box = std::make_shared<Box_stts>();
  856|    398|      break;
  857|       |
  858|  1.00k|    case fourcc("ctts"):
  ------------------
  |  Branch (858:5): [True: 1.00k, False: 468k]
  ------------------
  859|  1.00k|      box = std::make_shared<Box_ctts>();
  860|  1.00k|      break;
  861|       |
  862|    386|    case fourcc("stsc"):
  ------------------
  |  Branch (862:5): [True: 386, False: 469k]
  ------------------
  863|    386|      box = std::make_shared<Box_stsc>();
  864|    386|      break;
  865|       |
  866|    829|    case fourcc("stco"):
  ------------------
  |  Branch (866:5): [True: 829, False: 468k]
  ------------------
  867|    829|      box = std::make_shared<Box_stco>();
  868|    829|      break;
  869|       |
  870|  1.21k|    case fourcc("stsz"):
  ------------------
  |  Branch (870:5): [True: 1.21k, False: 468k]
  ------------------
  871|  1.21k|      box = std::make_shared<Box_stsz>();
  872|  1.21k|      break;
  873|       |
  874|    430|    case fourcc("stss"):
  ------------------
  |  Branch (874:5): [True: 430, False: 468k]
  ------------------
  875|    430|      box = std::make_shared<Box_stss>();
  876|    430|      break;
  877|       |
  878|    598|    case fourcc("ccst"):
  ------------------
  |  Branch (878:5): [True: 598, False: 468k]
  ------------------
  879|    598|      box = std::make_shared<Box_ccst>();
  880|    598|      break;
  881|       |
  882|  1.94k|    case fourcc("auxi"):
  ------------------
  |  Branch (882:5): [True: 1.94k, False: 467k]
  ------------------
  883|  1.94k|      box = std::make_shared<Box_auxi>();
  884|  1.94k|      break;
  885|       |
  886|    595|    case fourcc("edts"):
  ------------------
  |  Branch (886:5): [True: 595, False: 468k]
  ------------------
  887|    595|      box = std::make_shared<Box_edts>();
  888|    595|      break;
  889|       |
  890|  1.21k|    case fourcc("elst"):
  ------------------
  |  Branch (890:5): [True: 1.21k, False: 468k]
  ------------------
  891|  1.21k|      box = std::make_shared<Box_elst>();
  892|  1.21k|      break;
  893|       |
  894|    785|    case fourcc("sbgp"):
  ------------------
  |  Branch (894:5): [True: 785, False: 468k]
  ------------------
  895|    785|      box = std::make_shared<Box_sbgp>();
  896|    785|      break;
  897|       |
  898|  1.34k|    case fourcc("sgpd"):
  ------------------
  |  Branch (898:5): [True: 1.34k, False: 468k]
  ------------------
  899|  1.34k|      box = std::make_shared<Box_sgpd>();
  900|  1.34k|      break;
  901|       |
  902|    647|    case fourcc("btrt"):
  ------------------
  |  Branch (902:5): [True: 647, False: 468k]
  ------------------
  903|    647|      box = std::make_shared<Box_btrt>();
  904|    647|      break;
  905|       |
  906|  1.01k|    case fourcc("saiz"):
  ------------------
  |  Branch (906:5): [True: 1.01k, False: 468k]
  ------------------
  907|  1.01k|      box = std::make_shared<Box_saiz>();
  908|  1.01k|      break;
  909|       |
  910|  1.68k|    case fourcc("saio"):
  ------------------
  |  Branch (910:5): [True: 1.68k, False: 467k]
  ------------------
  911|  1.68k|      box = std::make_shared<Box_saio>();
  912|  1.68k|      break;
  913|       |
  914|  1.20k|    case fourcc("urim"):
  ------------------
  |  Branch (914:5): [True: 1.20k, False: 468k]
  ------------------
  915|  1.20k|      box = std::make_shared<Box_URIMetaSampleEntry>();
  916|  1.20k|      break;
  917|       |
  918|    807|    case fourcc("uri "):
  ------------------
  |  Branch (918:5): [True: 807, False: 468k]
  ------------------
  919|    807|      box = std::make_shared<Box_uri>();
  920|    807|      break;
  921|       |
  922|    542|    case fourcc("nmhd"):
  ------------------
  |  Branch (922:5): [True: 542, False: 468k]
  ------------------
  923|    542|      box = std::make_shared<Box_nmhd>();
  924|    542|      break;
  925|       |
  926|  1.01k|    case fourcc("tref"):
  ------------------
  |  Branch (926:5): [True: 1.01k, False: 468k]
  ------------------
  927|  1.01k|      box = std::make_shared<Box_tref>();
  928|  1.01k|      break;
  929|       |
  930|    785|    case fourcc("sdtp"):
  ------------------
  |  Branch (930:5): [True: 785, False: 468k]
  ------------------
  931|    785|      box = std::make_shared<Box_sdtp>();
  932|    785|      break;
  933|       |
  934|       |    // OMAF
  935|  1.05k|    case fourcc("prfr"):
  ------------------
  |  Branch (935:5): [True: 1.05k, False: 468k]
  ------------------
  936|  1.05k|      box = std::make_shared<Box_prfr>();
  937|  1.05k|      break;
  938|       |
  939|   134k|    default:
  ------------------
  |  Branch (939:5): [True: 134k, False: 335k]
  ------------------
  940|   134k|      box = std::make_shared<Box_other>(hdr.get_short_type());
  941|   134k|      break;
  942|   469k|  }
  943|       |
  944|   469k|  box->set_short_header(hdr);
  945|       |
  946|   469k|  box->m_debug_box_type = hdr.get_type_string(); // only for debugging
  947|       |
  948|       |
  949|   469k|  if (range.get_nesting_level() > MAX_BOX_NESTING_LEVEL) {
  ------------------
  |  Branch (949:7): [True: 2, False: 469k]
  ------------------
  950|      2|    return Error(heif_error_Memory_allocation_error,
  951|      2|                 heif_suberror_Security_limit_exceeded,
  952|      2|                 "Security limit for maximum nesting of boxes has been exceeded");
  953|      2|  }
  954|       |
  955|   469k|  if (hdr.has_fixed_box_size()) {
  ------------------
  |  Branch (955:7): [True: 412k, False: 57.1k]
  ------------------
  956|       |    // Sanity checks
  957|   412k|    if (hdr.get_box_size() < hdr.get_header_size()) {
  ------------------
  |  Branch (957:9): [True: 28, False: 412k]
  ------------------
  958|     28|      std::stringstream sstr;
  959|     28|      sstr << "Box size (" << hdr.get_box_size() << " bytes) smaller than header size ("
  960|     28|           << hdr.get_header_size() << " bytes)";
  961|       |
  962|     28|      return {heif_error_Invalid_input,
  963|     28|              heif_suberror_Invalid_box_size,
  964|     28|              sstr.str()};
  965|     28|    }
  966|       |
  967|       |    // this is >= 0 because of above condition
  968|   412k|    auto nBytes = static_cast<uint64_t>(hdr.get_box_size() - hdr.get_header_size());
  969|   412k|    if (nBytes > SIZE_MAX) {
  ------------------
  |  Branch (969:9): [True: 0, False: 412k]
  ------------------
  970|      0|      return {heif_error_Memory_allocation_error,
  971|      0|              heif_suberror_Invalid_box_size,
  972|      0|              "Box size too large"};
  973|      0|    }
  974|       |
  975|       |    // Security check: make sure that box size does not exceed int64 size.
  976|       |
  977|   412k|    if (hdr.get_box_size() > (uint64_t) std::numeric_limits<int64_t>::max()) {
  ------------------
  |  Branch (977:9): [True: 0, False: 412k]
  ------------------
  978|      0|      return {heif_error_Invalid_input,
  979|      0|              heif_suberror_Invalid_box_size};
  980|      0|    }
  981|       |
  982|       |    // --- wait for data to arrive
  983|       |
  984|   412k|    auto status = range.wait_for_available_bytes(static_cast<size_t>(nBytes));
  985|   412k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (985:9): [True: 3.31k, False: 408k]
  ------------------
  986|       |      // TODO: return recoverable error at timeout
  987|  3.31k|      return {heif_error_Invalid_input,
  988|  3.31k|              heif_suberror_End_of_data};
  989|  3.31k|    }
  990|   412k|  }
  991|       |
  992|   466k|  auto box_size = static_cast<int64_t>(hdr.get_box_size());
  993|   466k|  int64_t box_size_without_header = hdr.has_fixed_box_size() ? (box_size - hdr.get_header_size()) : (int64_t)range.get_remaining_bytes();
  ------------------
  |  Branch (993:37): [True: 408k, False: 57.1k]
  ------------------
  994|       |
  995|       |  // Box size may not be larger than remaining bytes in parent box.
  996|       |
  997|   466k|  if ((int64_t)range.get_remaining_bytes() < box_size_without_header) {
  ------------------
  |  Branch (997:7): [True: 2, False: 466k]
  ------------------
  998|      2|    return {heif_error_Invalid_input,
  999|      2|            heif_suberror_Invalid_box_size};
 1000|      2|  }
 1001|       |
 1002|       |
 1003|       |  // Create child bitstream range and read box from that range.
 1004|       |
 1005|   466k|  BitstreamRange boxrange(range.get_istream(),
 1006|   466k|                          box_size_without_header,
 1007|   466k|                          &range);
 1008|       |
 1009|   466k|  err = box->parse(boxrange, limits);
 1010|   466k|  boxrange.skip_to_end_of_box();
 1011|       |
 1012|   466k|  if (err == Error::Ok) {
  ------------------
  |  Branch (1012:7): [True: 447k, False: 18.7k]
  ------------------
 1013|   447k|    *result = std::move(box);
 1014|   447k|  }
 1015|  18.7k|  else {
 1016|  18.7k|    parse_error_fatality fatality = box->get_parse_error_fatality();
 1017|       |
 1018|  18.7k|    box = std::make_shared<Box_Error>(box->get_short_type(), err, fatality);
 1019|       |
 1020|       |    // We return a Box_Error that represents the parse error.
 1021|  18.7k|    *result = std::move(box);
 1022|  18.7k|  }
 1023|       |
 1024|   466k|  return err;
 1025|   466k|}
_ZNK3Box4dumpER6Indent:
 1029|   252k|{
 1030|   252k|  std::ostringstream sstr;
 1031|       |
 1032|   252k|  sstr << BoxHeader::dump(indent);
 1033|       |
 1034|   252k|  return sstr.str();
 1035|   252k|}
_ZNK7FullBox4dumpER6Indent:
 1039|  22.1k|{
 1040|  22.1k|  std::ostringstream sstr;
 1041|       |
 1042|  22.1k|  sstr << Box::dump(indent);
 1043|       |
 1044|  22.1k|  sstr << indent << "version: " << ((int) m_version) << "\n"
 1045|  22.1k|       << indent << "flags: " << std::hex << m_flags << "\n";
 1046|       |
 1047|  22.1k|  return sstr.str();
 1048|  22.1k|}
_ZN3Box13read_childrenER14BitstreamRangejPK20heif_security_limits:
 1109|  73.6k|{
 1110|  73.6k|  uint32_t count = 0;
 1111|       |
 1112|   379k|  while (!range.eof() && !range.error()) {
  ------------------
  |  Branch (1112:10): [True: 311k, False: 68.2k]
  |  Branch (1112:26): [True: 311k, False: 0]
  ------------------
 1113|   311k|    std::shared_ptr<Box> box;
 1114|   311k|    Error error = Box::read(range, &box, limits);
 1115|   311k|    if (error != Error::Ok && (!box || box->get_parse_error_fatality() == parse_error_fatality::fatal)) {
  ------------------
  |  Branch (1115:9): [True: 13.5k, False: 298k]
  |  Branch (1115:32): [True: 320, False: 13.2k]
  |  Branch (1115:40): [True: 2.10k, False: 11.1k]
  ------------------
 1116|  2.42k|      return error;
 1117|  2.42k|    }
 1118|       |
 1119|   309k|    if (max_number == READ_CHILDREN_ALL) {
  ------------------
  |  Branch (1119:9): [True: 126k, False: 182k]
  ------------------
 1120|   126k|      uint32_t max_children;
 1121|   126k|      if (get_short_type() == fourcc("iinf")) {
  ------------------
  |  Branch (1121:11): [True: 3.05k, False: 123k]
  ------------------
 1122|  3.05k|        max_children = limits->max_items;
 1123|  3.05k|      }
 1124|   123k|      else {
 1125|   123k|        max_children = limits->max_children_per_box;
 1126|   123k|      }
 1127|       |
 1128|   126k|      if (max_children && m_children.size() > max_children) {
  ------------------
  |  Branch (1128:11): [True: 126k, False: 0]
  |  Branch (1128:27): [True: 58, False: 126k]
  ------------------
 1129|     58|        std::stringstream sstr;
 1130|     58|        sstr << "Maximum number of child boxes (" << max_children << ") in '" << get_type_string() << "' box exceeded.";
 1131|       |
 1132|       |        // Sanity check.
 1133|     58|        return Error(heif_error_Memory_allocation_error,
 1134|     58|                     heif_suberror_Security_limit_exceeded,
 1135|     58|                     sstr.str());
 1136|     58|      }
 1137|   126k|    }
 1138|       |
 1139|   309k|    m_children.push_back(std::move(box));
 1140|       |
 1141|       |
 1142|       |    // count the new child and end reading new children when we reached the expected number
 1143|       |
 1144|   309k|    count++;
 1145|       |
 1146|   309k|    if (max_number != READ_CHILDREN_ALL &&
  ------------------
  |  Branch (1146:9): [True: 182k, False: 126k]
  ------------------
 1147|   182k|        count == max_number) {
  ------------------
  |  Branch (1147:9): [True: 2.90k, False: 179k]
  ------------------
 1148|  2.90k|      break;
 1149|  2.90k|    }
 1150|   309k|  }
 1151|       |
 1152|  71.1k|  return range.get_error();
 1153|  73.6k|}
_ZNK3Box13dump_childrenER6Indentb:
 1170|  68.0k|{
 1171|  68.0k|  std::ostringstream sstr;
 1172|       |
 1173|  68.0k|  bool first = true;
 1174|  68.0k|  int idx=1;
 1175|       |
 1176|  68.0k|  indent++;
 1177|   232k|  for (const auto& childBox : m_children) {
  ------------------
  |  Branch (1177:29): [True: 232k, False: 68.0k]
  ------------------
 1178|   232k|    if (first) {
  ------------------
  |  Branch (1178:9): [True: 56.2k, False: 175k]
  ------------------
 1179|  56.2k|      first = false;
 1180|  56.2k|    }
 1181|   175k|    else {
 1182|   175k|      sstr << indent << "\n";
 1183|   175k|    }
 1184|       |
 1185|   232k|    if (with_index) {
  ------------------
  |  Branch (1185:9): [True: 29.3k, False: 202k]
  ------------------
 1186|  29.3k|      sstr << indent << "index: " << idx << "\n";
 1187|  29.3k|      idx++;
 1188|  29.3k|    }
 1189|       |
 1190|   232k|    sstr << childBox->dump(indent);
 1191|   232k|  }
 1192|  68.0k|  indent--;
 1193|       |
 1194|  68.0k|  return sstr.str();
 1195|  68.0k|}
_ZN9Box_other5parseER14BitstreamRangePK20heif_security_limits:
 1219|   136k|{
 1220|   136k|  if (has_fixed_box_size()) {
  ------------------
  |  Branch (1220:7): [True: 130k, False: 5.98k]
  ------------------
 1221|   130k|    size_t len;
 1222|   130k|    if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (1222:9): [True: 130k, False: 0]
  ------------------
 1223|   130k|      auto len64 = get_box_size() - get_header_size();
 1224|   130k|      if (len64 > MAX_BOX_SIZE) {
  ------------------
  |  Branch (1224:11): [True: 0, False: 130k]
  ------------------
 1225|      0|        return {heif_error_Invalid_input,
 1226|      0|                heif_suberror_Security_limit_exceeded,
 1227|      0|                "Box size too large"};
 1228|      0|      }
 1229|       |
 1230|   130k|      len = static_cast<size_t>(len64);
 1231|       |
 1232|   130k|      m_data.resize(len);
 1233|   130k|      range.read(m_data.data(), len);
 1234|   130k|    }
 1235|      0|    else {
 1236|      0|      return {heif_error_Invalid_input,
 1237|      0|              heif_suberror_Invalid_box_size};
 1238|      0|    }
 1239|   130k|  }
 1240|  5.98k|  else {
 1241|       |    // TODO: boxes until end of file (we will probably never need this)
 1242|  5.98k|  }
 1243|       |
 1244|   136k|  return range.get_error();
 1245|   136k|}
_ZNK9Box_other4dumpER6Indent:
 1265|   110k|{
 1266|   110k|  std::ostringstream sstr;
 1267|       |
 1268|   110k|  sstr << BoxHeader::dump(indent);
 1269|       |
 1270|       |  // --- show raw box content
 1271|       |
 1272|   110k|  size_t len = 0;
 1273|   110k|  if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (1273:7): [True: 105k, False: 5.20k]
  ------------------
 1274|       |    // We can cast because if it does not fit, it would fail during parsing.
 1275|   105k|    len = static_cast<size_t>(get_box_size() - get_header_size());
 1276|   105k|  }
 1277|  5.20k|  else {
 1278|  5.20k|    sstr << indent << "invalid box size " << get_box_size() << " (smaller than header)\n";
 1279|  5.20k|    return sstr.str();
 1280|  5.20k|  }
 1281|       |
 1282|   105k|  sstr << write_raw_data_as_hex(m_data.data(), len,
 1283|   105k|                                indent.get_string() + "data: ",
 1284|   105k|                                indent.get_string() + "      ");
 1285|       |
 1286|   105k|  return sstr.str();
 1287|   110k|}
_ZNK9Box_Error4dumpER6Indent:
 1291|  5.87k|{
 1292|  5.87k|  std::ostringstream sstr;
 1293|  5.87k|  sstr << indent << '\'' << fourcc_to_string(m_box_type_with_parse_error) << "' parse error: " << m_error.message << "\n";
 1294|  5.87k|  sstr << indent << "fatality: ";
 1295|  5.87k|  switch (m_fatality) {
  ------------------
  |  Branch (1295:11): [True: 5.87k, False: 0]
  ------------------
 1296|      0|    case parse_error_fatality::fatal: sstr << "fatal\n"; break;
  ------------------
  |  Branch (1296:5): [True: 0, False: 5.87k]
  ------------------
 1297|  2.37k|    case parse_error_fatality::ignorable: sstr << "ignorable\n"; break;
  ------------------
  |  Branch (1297:5): [True: 2.37k, False: 3.49k]
  ------------------
 1298|  3.49k|    case parse_error_fatality::optional: sstr << "optional\n"; break;
  ------------------
  |  Branch (1298:5): [True: 3.49k, False: 2.37k]
  ------------------
 1299|  5.87k|  }
 1300|       |
 1301|  5.87k|  return sstr.str();
 1302|  5.87k|}
_ZNK9Box_Error24get_parse_error_fatalityEv:
 1305|  13.2k|{
 1306|  13.2k|  return m_fatality;
 1307|  13.2k|}
_ZN8Box_ftyp5parseER14BitstreamRangePK20heif_security_limits:
 1311|  10.8k|{
 1312|  10.8k|  m_major_brand = range.read32();
 1313|  10.8k|  m_minor_version = range.read32();
 1314|       |
 1315|  10.8k|  uint64_t box_size = get_box_size();
 1316|  10.8k|  if (box_size < 8 || box_size - 8 < get_header_size()) {
  ------------------
  |  Branch (1316:7): [True: 4, False: 10.8k]
  |  Branch (1316:23): [True: 6, False: 10.8k]
  ------------------
 1317|       |    // Sanity check.
 1318|     10|    return Error(heif_error_Invalid_input,
 1319|     10|                 heif_suberror_Invalid_box_size,
 1320|     10|                 "ftyp box too small (less than 8 bytes)");
 1321|     10|  }
 1322|       |
 1323|  10.8k|  uint64_t n_minor_brands = (get_box_size() - get_header_size() - 8) / 4;
 1324|       |
 1325|  10.8k|  if (limits->max_number_of_file_brands && n_minor_brands > limits->max_number_of_file_brands) {
  ------------------
  |  Branch (1325:7): [True: 10.8k, False: 0]
  |  Branch (1325:44): [True: 8, False: 10.8k]
  ------------------
 1326|      8|    return {
 1327|      8|      heif_error_Memory_allocation_error,
 1328|      8|      heif_suberror_Security_limit_exceeded,
 1329|      8|      "Number of minor brands in file exceeds security limit"
 1330|      8|    };
 1331|      8|  }
 1332|       |
 1333|  48.1k|  for (uint64_t i = 0; i < n_minor_brands && !range.error(); i++) {
  ------------------
  |  Branch (1333:24): [True: 37.3k, False: 10.8k]
  |  Branch (1333:46): [True: 37.3k, False: 0]
  ------------------
 1334|  37.3k|    m_compatible_brands.push_back(range.read32());
 1335|  37.3k|  }
 1336|       |
 1337|  10.8k|  return range.get_error();
 1338|  10.8k|}
_ZNK8Box_ftyp4dumpER6Indent:
 1351|  9.09k|{
 1352|  9.09k|  std::ostringstream sstr;
 1353|       |
 1354|  9.09k|  sstr << BoxHeader::dump(indent);
 1355|       |
 1356|  9.09k|  sstr << indent << "major brand: " << fourcc_to_string(m_major_brand) << "\n"
 1357|  9.09k|       << indent << "minor version: ";
 1358|  9.09k|  if (m_minor_version < ('A' << 24)) {
  ------------------
  |  Branch (1358:7): [True: 7.64k, False: 1.45k]
  ------------------
 1359|       |    // This is probably a version number
 1360|  7.64k|    sstr << m_minor_version;
 1361|  7.64k|  } else {
 1362|       |    // probably a 4CC, as used for mif3
 1363|  1.45k|    sstr << fourcc_to_string(m_minor_version);
 1364|  1.45k|  }
 1365|  9.09k|  sstr << "\n" << indent << "compatible brands: ";
 1366|       |
 1367|  9.09k|  bool first = true;
 1368|  31.0k|  for (uint32_t brand : m_compatible_brands) {
  ------------------
  |  Branch (1368:23): [True: 31.0k, False: 9.09k]
  ------------------
 1369|  31.0k|    if (first) { first = false; }
  ------------------
  |  Branch (1369:9): [True: 8.72k, False: 22.3k]
  ------------------
 1370|  22.3k|    else { sstr << ','; }
 1371|       |
 1372|  31.0k|    sstr << fourcc_to_string(brand);
 1373|  31.0k|  }
 1374|  9.09k|  sstr << "\n";
 1375|       |
 1376|  9.09k|  return sstr.str();
 1377|  9.09k|}
_ZN8Box_free5parseER14BitstreamRangePK20heif_security_limits:
 1406|    818|{
 1407|    818|  range.skip_to_end_of_box();
 1408|    818|  return range.get_error();
 1409|    818|}
_ZNK8Box_free4dumpER6Indent:
 1413|    664|{
 1414|    664|  std::ostringstream sstr;
 1415|    664|  sstr << BoxHeader::dump(indent);
 1416|    664|  return sstr.str();
 1417|    664|}
_ZN8Box_meta5parseER14BitstreamRangePK20heif_security_limits:
 1429|  2.91k|{
 1430|  2.91k|  parse_full_box_header(range);
 1431|       |
 1432|  2.91k|  if (get_version() != 0) {
  ------------------
  |  Branch (1432:7): [True: 4, False: 2.90k]
  ------------------
 1433|      4|    return unsupported_version_error("meta");
 1434|      4|  }
 1435|       |
 1436|       |  /*
 1437|       |  uint64_t boxSizeLimit;
 1438|       |  if (get_box_size() == BoxHeader::size_until_end_of_file) {
 1439|       |    boxSizeLimit = sizeLimit;
 1440|       |  }
 1441|       |  else {
 1442|       |    boxSizeLimit = get_box_size() - get_header_size();
 1443|       |  }
 1444|       |  */
 1445|       |
 1446|  2.90k|  return read_children(range, READ_CHILDREN_ALL, limits);
 1447|  2.91k|}
_ZNK8Box_meta4dumpER6Indent:
 1451|  2.57k|{
 1452|  2.57k|  std::ostringstream sstr;
 1453|  2.57k|  sstr << Box::dump(indent);
 1454|  2.57k|  sstr << dump_children(indent);
 1455|       |
 1456|  2.57k|  return sstr.str();
 1457|  2.57k|}
_ZNK7FullBox25unsupported_version_errorEPKc:
 1461|  1.86k|{
 1462|  1.86k|  std::stringstream sstr;
 1463|  1.86k|  sstr << box << " box data version " << ((int) m_version) << " is not implemented yet";
 1464|       |
 1465|  1.86k|  return {heif_error_Unsupported_feature,
 1466|  1.86k|          heif_suberror_Unsupported_data_version,
 1467|  1.86k|          sstr.str()};
 1468|  1.86k|}
_ZN8Box_hdlr5parseER14BitstreamRangePK20heif_security_limits:
 1472|  3.72k|{
 1473|  3.72k|  parse_full_box_header(range);
 1474|       |
 1475|  3.72k|  if (get_version() != 0) {
  ------------------
  |  Branch (1475:7): [True: 3, False: 3.71k]
  ------------------
 1476|      3|    return unsupported_version_error("hdlr");
 1477|      3|  }
 1478|       |
 1479|  3.71k|  m_pre_defined = range.read32();
 1480|  3.71k|  m_handler_type = range.read32();
 1481|       |
 1482|  14.8k|  for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (1482:19): [True: 11.1k, False: 3.71k]
  ------------------
 1483|  11.1k|    m_reserved[i] = range.read32();
 1484|  11.1k|  }
 1485|       |
 1486|  3.71k|  m_name = range.read_string();
 1487|       |
 1488|  3.71k|  return range.get_error();
 1489|  3.72k|}
_ZNK8Box_hdlr4dumpER6Indent:
 1493|  2.56k|{
 1494|  2.56k|  std::ostringstream sstr;
 1495|  2.56k|  sstr << Box::dump(indent);
 1496|  2.56k|  sstr << indent << "pre_defined: " << m_pre_defined << "\n"
 1497|  2.56k|       << indent << "handler_type: " << fourcc_to_string(m_handler_type) << "\n"
 1498|  2.56k|       << indent << "name: " << m_name << "\n";
 1499|       |
 1500|  2.56k|  return sstr.str();
 1501|  2.56k|}
_ZN8Box_pitm5parseER14BitstreamRangePK20heif_security_limits:
 1524|  3.48k|{
 1525|  3.48k|  parse_full_box_header(range);
 1526|       |
 1527|  3.48k|  if (get_version() > 1) {
  ------------------
  |  Branch (1527:7): [True: 1, False: 3.48k]
  ------------------
 1528|      1|    return unsupported_version_error("pitm");
 1529|      1|  }
 1530|       |
 1531|       |
 1532|  3.48k|  if (get_version() == 0) {
  ------------------
  |  Branch (1532:7): [True: 3.21k, False: 266]
  ------------------
 1533|  3.21k|    m_item_ID = range.read16();
 1534|  3.21k|  }
 1535|    266|  else {
 1536|    266|    m_item_ID = range.read32();
 1537|    266|  }
 1538|       |
 1539|  3.48k|  return range.get_error();
 1540|  3.48k|}
_ZNK8Box_pitm4dumpER6Indent:
 1544|  3.12k|{
 1545|  3.12k|  std::ostringstream sstr;
 1546|  3.12k|  sstr << Box::dump(indent);
 1547|  3.12k|  sstr << indent << "item_ID: " << m_item_ID << "\n";
 1548|       |
 1549|  3.12k|  return sstr.str();
 1550|  3.12k|}
_ZN8Box_iloc5parseER14BitstreamRangePK20heif_security_limits:
 1583|  2.24k|{
 1584|  2.24k|  parse_full_box_header(range);
 1585|       |
 1586|  2.24k|  if (get_version() > 2) {
  ------------------
  |  Branch (1586:7): [True: 1, False: 2.24k]
  ------------------
 1587|      1|    return unsupported_version_error("iloc");
 1588|      1|  }
 1589|       |
 1590|  2.24k|  const int version = get_version();
 1591|       |
 1592|  2.24k|  uint16_t values4 = range.read16();
 1593|       |
 1594|  2.24k|  int offset_size = (values4 >> 12) & 0xF;
 1595|  2.24k|  int length_size = (values4 >> 8) & 0xF;
 1596|  2.24k|  int base_offset_size = (values4 >> 4) & 0xF;
 1597|  2.24k|  int index_size = 0;
 1598|       |
 1599|  2.24k|  if (version == 1 || version == 2) {
  ------------------
  |  Branch (1599:7): [True: 253, False: 1.99k]
  |  Branch (1599:23): [True: 279, False: 1.71k]
  ------------------
 1600|    532|    index_size = (values4 & 0xF);
 1601|    532|  }
 1602|       |
 1603|  2.24k|  uint32_t item_count = 0;
 1604|  2.24k|  if (version < 2) {
  ------------------
  |  Branch (1604:7): [True: 1.96k, False: 279]
  ------------------
 1605|  1.96k|    item_count = range.read16();
 1606|  1.96k|  }
 1607|    279|  else if (version == 2) {
  ------------------
  |  Branch (1607:12): [True: 279, False: 0]
  ------------------
 1608|    279|    item_count = range.read32();
 1609|    279|  }
 1610|       |
 1611|       |  // Sanity check. (This might be obsolete now as we check for range.error() below).
 1612|  2.24k|  if (limits->max_items && item_count > limits->max_items) {
  ------------------
  |  Branch (1612:7): [True: 2.24k, False: 0]
  |  Branch (1612:28): [True: 55, False: 2.19k]
  ------------------
 1613|     55|    std::stringstream sstr;
 1614|     55|    sstr << "iloc box contains " << item_count << " items, which exceeds the security limit of "
 1615|     55|         << limits->max_items << " items.";
 1616|       |
 1617|     55|    return Error(heif_error_Memory_allocation_error,
 1618|     55|                 heif_suberror_Security_limit_exceeded,
 1619|     55|                 sstr.str());
 1620|     55|  }
 1621|       |
 1622|  8.28k|  for (uint32_t i = 0; i < item_count; i++) {
  ------------------
  |  Branch (1622:24): [True: 6.25k, False: 2.03k]
  ------------------
 1623|  6.25k|    Item item;
 1624|       |
 1625|  6.25k|    if (range.eof()) {
  ------------------
  |  Branch (1625:9): [True: 94, False: 6.16k]
  ------------------
 1626|     94|      std::stringstream sstr;
 1627|     94|      sstr << "iloc box should contain " << item_count << " items, but we can only read " << i << " items.";
 1628|       |
 1629|     94|      return {heif_error_Invalid_input,
 1630|     94|              heif_suberror_End_of_data,
 1631|     94|              sstr.str()};
 1632|     94|    }
 1633|       |
 1634|  6.16k|    if (version < 2) {
  ------------------
  |  Branch (1634:9): [True: 5.90k, False: 253]
  ------------------
 1635|  5.90k|      item.item_ID = range.read16();
 1636|  5.90k|    }
 1637|    253|    else if (version == 2) {
  ------------------
  |  Branch (1637:14): [True: 253, False: 0]
  ------------------
 1638|    253|      item.item_ID = range.read32();
 1639|    253|    }
 1640|       |
 1641|  6.16k|    if (version >= 1) {
  ------------------
  |  Branch (1641:9): [True: 892, False: 5.26k]
  ------------------
 1642|    892|      values4 = range.read16();
 1643|    892|      item.construction_method = (values4 & 0xF);
 1644|    892|    }
 1645|       |
 1646|  6.16k|    item.data_reference_index = range.read16();
 1647|       |
 1648|  6.16k|    item.base_offset = 0;
 1649|  6.16k|    if (base_offset_size == 4) {
  ------------------
  |  Branch (1649:9): [True: 1.25k, False: 4.90k]
  ------------------
 1650|  1.25k|      item.base_offset = range.read32();
 1651|  1.25k|    }
 1652|  4.90k|    else if (base_offset_size == 8) {
  ------------------
  |  Branch (1652:14): [True: 205, False: 4.70k]
  ------------------
 1653|    205|      item.base_offset = ((uint64_t) range.read32()) << 32;
 1654|    205|      item.base_offset |= range.read32();
 1655|    205|    }
 1656|       |
 1657|  6.16k|    uint16_t extent_count = range.read16();
 1658|       |
 1659|       |    // Sanity check.
 1660|  6.16k|    auto max_iloc_extents = limits->max_iloc_extents_per_item;
 1661|  6.16k|    if (max_iloc_extents && extent_count > max_iloc_extents) {
  ------------------
  |  Branch (1661:9): [True: 6.16k, False: 0]
  |  Branch (1661:29): [True: 27, False: 6.13k]
  ------------------
 1662|     27|      std::stringstream sstr;
 1663|     27|      sstr << "Number of extents in iloc box (" << extent_count << ") exceeds security limit ("
 1664|     27|           << max_iloc_extents << ")\n";
 1665|       |
 1666|     27|      return Error(heif_error_Memory_allocation_error,
 1667|     27|                   heif_suberror_Security_limit_exceeded,
 1668|     27|                   sstr.str());
 1669|     27|    }
 1670|       |
 1671|  21.5k|    for (int e = 0; e < extent_count; e++) {
  ------------------
  |  Branch (1671:21): [True: 15.4k, False: 6.09k]
  ------------------
 1672|  15.4k|      Extent extent;
 1673|       |
 1674|  15.4k|      if (range.eof()) {
  ------------------
  |  Branch (1674:11): [True: 41, False: 15.4k]
  ------------------
 1675|     41|        std::stringstream sstr;
 1676|     41|        sstr << "iloc item should contain " << extent_count << " extents, but we can only read " << e << " extents.";
 1677|       |
 1678|     41|        return {heif_error_Invalid_input,
 1679|     41|                heif_suberror_End_of_data,
 1680|     41|                sstr.str()};
 1681|     41|      }
 1682|       |
 1683|  15.4k|      if ((version == 1 || version == 2) && index_size > 0) {
  ------------------
  |  Branch (1683:12): [True: 1.96k, False: 13.4k]
  |  Branch (1683:28): [True: 375, False: 13.0k]
  |  Branch (1683:45): [True: 1.70k, False: 629]
  ------------------
 1684|  1.70k|        if (index_size == 4) {
  ------------------
  |  Branch (1684:13): [True: 419, False: 1.28k]
  ------------------
 1685|    419|          extent.index = range.read32();
 1686|    419|        }
 1687|  1.28k|        else if (index_size == 8) {
  ------------------
  |  Branch (1687:18): [True: 385, False: 904]
  ------------------
 1688|    385|          extent.index = ((uint64_t) range.read32()) << 32;
 1689|    385|          extent.index |= range.read32();
 1690|    385|        }
 1691|  1.70k|      }
 1692|       |
 1693|  15.4k|      extent.offset = 0;
 1694|  15.4k|      if (offset_size == 4) {
  ------------------
  |  Branch (1694:11): [True: 1.25k, False: 14.1k]
  ------------------
 1695|  1.25k|        extent.offset = range.read32();
 1696|  1.25k|      }
 1697|  14.1k|      else if (offset_size == 8) {
  ------------------
  |  Branch (1697:16): [True: 233, False: 13.9k]
  ------------------
 1698|    233|        extent.offset = ((uint64_t) range.read32()) << 32;
 1699|    233|        extent.offset |= range.read32();
 1700|    233|      }
 1701|       |
 1702|       |
 1703|  15.4k|      extent.length = 0;
 1704|  15.4k|      if (length_size == 4) {
  ------------------
  |  Branch (1704:11): [True: 1.31k, False: 14.1k]
  ------------------
 1705|  1.31k|        extent.length = range.read32();
 1706|  1.31k|      }
 1707|  14.1k|      else if (length_size == 8) {
  ------------------
  |  Branch (1707:16): [True: 294, False: 13.8k]
  ------------------
 1708|    294|        extent.length = ((uint64_t) range.read32()) << 32;
 1709|    294|        extent.length |= range.read32();
 1710|    294|      }
 1711|       |
 1712|  15.4k|      item.extents.push_back(extent);
 1713|  15.4k|    }
 1714|       |
 1715|  6.09k|    if (!range.error()) {
  ------------------
  |  Branch (1715:9): [True: 6.00k, False: 87]
  ------------------
 1716|  6.00k|      m_items.push_back(item);
 1717|  6.00k|    }
 1718|  6.09k|  }
 1719|       |
 1720|  2.03k|  return range.get_error();
 1721|  2.19k|}
_ZN8Box_ilocC2Ev:
 1725|  2.25k|{
 1726|  2.25k|  set_short_type(fourcc("iloc"));
 1727|       |
 1728|  2.25k|  set_use_tmp_file(false);
 1729|  2.25k|}
_ZN8Box_ilocD2Ev:
 1733|  2.25k|{
 1734|  2.25k|  if (m_use_tmpfile) {
  ------------------
  |  Branch (1734:7): [True: 0, False: 2.25k]
  ------------------
 1735|      0|    unlink(m_tmp_filename);
 1736|      0|  }
 1737|  2.25k|}
_ZN8Box_iloc16set_use_tmp_fileEb:
 1741|  2.25k|{
 1742|  2.25k|  m_use_tmpfile = flag;
 1743|  2.25k|  if (flag) {
  ------------------
  |  Branch (1743:7): [True: 0, False: 2.25k]
  ------------------
 1744|      0|#if !defined(_WIN32)
 1745|      0|    strcpy(m_tmp_filename, "/tmp/libheif-XXXXXX");
 1746|      0|    m_tmpfile_fd = mkstemp(m_tmp_filename);
 1747|       |#else
 1748|       |    // TODO Currently unused code. Implement when needed.
 1749|       |    assert(false);
 1750|       |#  if 0
 1751|       |    char tmpname[L_tmpnam_s];
 1752|       |    // TODO: check return value (errno_t)
 1753|       |    tmpnam_s(tmpname, L_tmpnam_s);
 1754|       |    _sopen_s(&m_tmpfile_fd, tmpname, _O_CREAT | _O_TEMPORARY | _O_TRUNC | _O_RDWR, _SH_DENYRW, _S_IREAD | _S_IWRITE);
 1755|       |#  endif
 1756|       |#endif
 1757|      0|  }
 1758|  2.25k|}
_ZNK8Box_iloc4dumpER6Indent:
 1762|  1.98k|{
 1763|  1.98k|  std::ostringstream sstr;
 1764|  1.98k|  sstr << Box::dump(indent);
 1765|       |
 1766|  3.29k|  for (const Item& item : m_items) {
  ------------------
  |  Branch (1766:25): [True: 3.29k, False: 1.98k]
  ------------------
 1767|  3.29k|    sstr << indent << "item ID: " << item.item_ID << "\n"
 1768|  3.29k|         << indent << "  construction method: " << ((int) item.construction_method) << "\n"
 1769|  3.29k|         << indent << "  data_reference_index: " << std::hex
 1770|  3.29k|         << item.data_reference_index << std::dec << "\n"
 1771|  3.29k|         << indent << "  base_offset: " << item.base_offset << "\n";
 1772|       |
 1773|  3.29k|    sstr << indent << "  extents: ";
 1774|  9.17k|    for (const Extent& extent : item.extents) {
  ------------------
  |  Branch (1774:31): [True: 9.17k, False: 3.29k]
  ------------------
 1775|  9.17k|      sstr << extent.offset << "," << extent.length;
 1776|  9.17k|      if (extent.index != 0) {
  ------------------
  |  Branch (1776:11): [True: 402, False: 8.77k]
  ------------------
 1777|    402|        sstr << ";index=" << extent.index;
 1778|    402|      }
 1779|  9.17k|      sstr << " ";
 1780|  9.17k|    }
 1781|  3.29k|    sstr << "\n";
 1782|  3.29k|  }
 1783|       |
 1784|  1.98k|  return sstr.str();
 1785|  1.98k|}
_ZN8Box_infe5parseER14BitstreamRangePK20heif_security_limits:
 2445|  4.60k|{
 2446|  4.60k|  parse_full_box_header(range);
 2447|       |
 2448|       |  // only versions 2,3 are required by HEIF
 2449|  4.60k|  if (get_version() > 3) {
  ------------------
  |  Branch (2449:7): [True: 5, False: 4.59k]
  ------------------
 2450|      5|    return unsupported_version_error("infe");
 2451|      5|  }
 2452|       |
 2453|  4.59k|  if (get_version() <= 1) {
  ------------------
  |  Branch (2453:7): [True: 314, False: 4.28k]
  ------------------
 2454|    314|    m_item_ID = range.read16();
 2455|    314|    m_item_protection_index = range.read16();
 2456|       |
 2457|    314|    m_item_name = range.read_string();
 2458|    314|    m_content_type = range.read_string();
 2459|    314|    m_content_encoding = range.read_string();
 2460|    314|  }
 2461|       |
 2462|  4.59k|  m_item_type_4cc = 0;
 2463|       |
 2464|  4.59k|  if (get_version() >= 2) {
  ------------------
  |  Branch (2464:7): [True: 4.28k, False: 314]
  ------------------
 2465|  4.28k|    m_hidden_item = (get_flags() & 1);
 2466|       |
 2467|  4.28k|    if (get_version() == 2) {
  ------------------
  |  Branch (2467:9): [True: 3.87k, False: 409]
  ------------------
 2468|  3.87k|      m_item_ID = range.read16();
 2469|  3.87k|    }
 2470|    409|    else {
 2471|    409|      m_item_ID = range.read32();
 2472|    409|    }
 2473|       |
 2474|  4.28k|    m_item_protection_index = range.read16();
 2475|  4.28k|    m_item_type_4cc = range.read32();
 2476|       |
 2477|  4.28k|    m_item_name = range.read_string();
 2478|  4.28k|    if (m_item_type_4cc == fourcc("mime")) {
  ------------------
  |  Branch (2478:9): [True: 393, False: 3.89k]
  ------------------
 2479|    393|      m_content_type = range.read_string();
 2480|    393|      m_content_encoding = range.read_string();
 2481|    393|    }
 2482|  3.89k|    else if (m_item_type_4cc == fourcc("uri ")) {
  ------------------
  |  Branch (2482:14): [True: 732, False: 3.16k]
  ------------------
 2483|    732|      m_item_uri_type = range.read_string();
 2484|    732|    }
 2485|  4.28k|  }
 2486|       |
 2487|  4.59k|  return range.get_error();
 2488|  4.60k|}
_ZNK8Box_infe4dumpER6Indent:
 2566|  3.97k|{
 2567|  3.97k|  std::ostringstream sstr;
 2568|  3.97k|  sstr << Box::dump(indent);
 2569|       |
 2570|  3.97k|  sstr << indent << "item_ID: " << m_item_ID << "\n"
 2571|  3.97k|       << indent << "item_protection_index: " << m_item_protection_index << "\n"
 2572|  3.97k|       << indent << "item_type: " << fourcc_to_string(m_item_type_4cc) << "\n"
 2573|  3.97k|       << indent << "item_name: " << m_item_name << "\n";
 2574|       |
 2575|  3.97k|  if (m_item_type_4cc == fourcc("mime")) {
  ------------------
  |  Branch (2575:7): [True: 260, False: 3.71k]
  ------------------
 2576|    260|    sstr << indent << "content_type: " << m_content_type << "\n"
 2577|    260|         << indent << "content_encoding: " << m_content_encoding << "\n";
 2578|    260|  }
 2579|       |
 2580|  3.97k|  if (m_item_type_4cc == fourcc("uri ")) {
  ------------------
  |  Branch (2580:7): [True: 621, False: 3.35k]
  ------------------
 2581|    621|    sstr << indent << "item uri type: " << m_item_uri_type << "\n";
 2582|    621|  }
 2583|       |
 2584|  3.97k|  sstr << indent << "hidden item: " << std::boolalpha << m_hidden_item << "\n";
 2585|       |
 2586|  3.97k|  return sstr.str();
 2587|  3.97k|}
_ZN8Box_iinf5parseER14BitstreamRangePK20heif_security_limits:
 2591|  3.99k|{
 2592|  3.99k|  parse_full_box_header(range);
 2593|       |
 2594|       |  // TODO: there are several images in circulation that have an iinf version=2. We should not enforce this with a hard error.
 2595|  3.99k|  if (false && get_version() > 1) {
  ------------------
  |  Branch (2595:7): [Folded, False: 3.99k]
  |  Branch (2595:16): [True: 0, False: 0]
  ------------------
 2596|      0|    return unsupported_version_error("iinf");
 2597|      0|  }
 2598|       |
 2599|  3.99k|  int nEntries_size = (get_version() > 0) ? 4 : 2;
  ------------------
  |  Branch (2599:23): [True: 897, False: 3.09k]
  ------------------
 2600|       |
 2601|  3.99k|  uint32_t item_count;
 2602|  3.99k|  if (nEntries_size == 2) {
  ------------------
  |  Branch (2602:7): [True: 3.09k, False: 897]
  ------------------
 2603|  3.09k|    item_count = range.read16();
 2604|  3.09k|  }
 2605|    897|  else {
 2606|    897|    item_count = range.read32();
 2607|    897|  }
 2608|       |
 2609|  3.99k|  if (item_count == 0) {
  ------------------
  |  Branch (2609:7): [True: 451, False: 3.54k]
  ------------------
 2610|    451|    return Error::Ok;
 2611|    451|  }
 2612|       |
 2613|  3.54k|  return read_children(range, item_count, limits);
 2614|  3.99k|}
_ZNK8Box_iinf4dumpER6Indent:
 2618|  3.58k|{
 2619|  3.58k|  std::ostringstream sstr;
 2620|  3.58k|  sstr << Box::dump(indent);
 2621|       |
 2622|  3.58k|  sstr << dump_children(indent);
 2623|       |
 2624|  3.58k|  return sstr.str();
 2625|  3.58k|}
_ZN8Box_iprp5parseER14BitstreamRangePK20heif_security_limits:
 2629|  32.1k|{
 2630|       |  //parse_full_box_header(range);
 2631|       |
 2632|  32.1k|  return read_children(range, READ_CHILDREN_ALL, limits);
 2633|  32.1k|}
_ZNK8Box_iprp4dumpER6Indent:
 2665|  30.3k|{
 2666|  30.3k|  std::ostringstream sstr;
 2667|  30.3k|  sstr << Box::dump(indent);
 2668|       |
 2669|  30.3k|  sstr << dump_children(indent);
 2670|       |
 2671|  30.3k|  return sstr.str();
 2672|  30.3k|}
_ZN8Box_ipco5parseER14BitstreamRangePK20heif_security_limits:
 2687|  11.4k|{
 2688|       |  //parse_full_box_header(range);
 2689|       |
 2690|  11.4k|  return read_children(range, READ_CHILDREN_ALL, limits);
 2691|  11.4k|}
_ZNK8Box_ipco4dumpER6Indent:
 2695|  10.0k|{
 2696|  10.0k|  std::ostringstream sstr;
 2697|  10.0k|  sstr << Box::dump(indent);
 2698|       |
 2699|  10.0k|  sstr << dump_children(indent, true);
 2700|       |
 2701|  10.0k|  return sstr.str();
 2702|  10.0k|}
_ZN8Box_pixi5parseER14BitstreamRangePK20heif_security_limits:
 2706|  3.46k|{
 2707|  3.46k|  parse_full_box_header(range);
 2708|       |
 2709|  3.46k|  if (get_version() != 0) {
  ------------------
  |  Branch (2709:7): [True: 242, False: 3.22k]
  ------------------
 2710|    242|    return unsupported_version_error("pixi");
 2711|    242|  }
 2712|       |
 2713|  3.22k|  StreamReader::grow_status status;
 2714|  3.22k|  uint8_t num_channels = range.read8();
 2715|  3.22k|  status = range.wait_for_available_bytes(num_channels);
 2716|  3.22k|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (2716:7): [True: 28, False: 3.19k]
  ------------------
 2717|       |    // TODO: return recoverable error at timeout
 2718|     28|    return Error(heif_error_Invalid_input,
 2719|     28|                 heif_suberror_End_of_data);
 2720|     28|  }
 2721|       |
 2722|  3.19k|  m_bits_per_channel.resize(num_channels);
 2723|  20.3k|  for (int i = 0; i < num_channels; i++) {
  ------------------
  |  Branch (2723:19): [True: 17.1k, False: 3.19k]
  ------------------
 2724|  17.1k|    m_bits_per_channel[i] = range.read8();
 2725|  17.1k|  }
 2726|       |
 2727|  3.19k|  return range.get_error();
 2728|  3.22k|}
_ZNK8Box_pixi4dumpER6Indent:
 2732|  2.14k|{
 2733|  2.14k|  std::ostringstream sstr;
 2734|  2.14k|  sstr << Box::dump(indent);
 2735|       |
 2736|  2.14k|  sstr << indent << "bits_per_channel: ";
 2737|       |
 2738|  8.14k|  for (size_t i = 0; i < m_bits_per_channel.size(); i++) {
  ------------------
  |  Branch (2738:22): [True: 6.00k, False: 2.14k]
  ------------------
 2739|  6.00k|    if (i > 0) sstr << ",";
  ------------------
  |  Branch (2739:9): [True: 4.16k, False: 1.84k]
  ------------------
 2740|  6.00k|    sstr << ((int) m_bits_per_channel[i]);
 2741|  6.00k|  }
 2742|       |
 2743|  2.14k|  sstr << "\n";
 2744|       |
 2745|  2.14k|  return sstr.str();
 2746|  2.14k|}
_ZN8Box_pasp5parseER14BitstreamRangePK20heif_security_limits:
 2771|  14.9k|{
 2772|       |  //parse_full_box_header(range);
 2773|       |
 2774|  14.9k|  hSpacing = range.read32();
 2775|  14.9k|  vSpacing = range.read32();
 2776|       |
 2777|  14.9k|  return range.get_error();
 2778|  14.9k|}
_ZNK8Box_pasp4dumpER6Indent:
 2782|  11.4k|{
 2783|  11.4k|  std::ostringstream sstr;
 2784|  11.4k|  sstr << Box::dump(indent);
 2785|       |
 2786|  11.4k|  sstr << indent << "hSpacing: " << hSpacing << "\n";
 2787|  11.4k|  sstr << indent << "vSpacing: " << vSpacing << "\n";
 2788|       |
 2789|  11.4k|  return sstr.str();
 2790|  11.4k|}
_ZN8Box_lsel5parseER14BitstreamRangePK20heif_security_limits:
 2807|  7.05k|{
 2808|  7.05k|  layer_id = range.read16();
 2809|       |
 2810|  7.05k|  return range.get_error();
 2811|  7.05k|}
_ZNK8Box_lsel4dumpER6Indent:
 2815|  5.70k|{
 2816|  5.70k|  std::ostringstream sstr;
 2817|  5.70k|  sstr << Box::dump(indent);
 2818|       |
 2819|  5.70k|  sstr << indent << "layer_id: " << layer_id << "\n";
 2820|       |
 2821|  5.70k|  return sstr.str();
 2822|  5.70k|}
_ZN8Box_clli5parseER14BitstreamRangePK20heif_security_limits:
 2838|  1.46k|{
 2839|       |  //parse_full_box_header(range);
 2840|       |
 2841|  1.46k|  clli.max_content_light_level = range.read16();
 2842|  1.46k|  clli.max_pic_average_light_level = range.read16();
 2843|       |
 2844|  1.46k|  return range.get_error();
 2845|  1.46k|}
_ZNK8Box_clli4dumpER6Indent:
 2849|  1.26k|{
 2850|  1.26k|  std::ostringstream sstr;
 2851|  1.26k|  sstr << Box::dump(indent);
 2852|       |
 2853|  1.26k|  sstr << indent << "max_content_light_level: " << clli.max_content_light_level << "\n";
 2854|  1.26k|  sstr << indent << "max_pic_average_light_level: " << clli.max_pic_average_light_level << "\n";
 2855|       |
 2856|  1.26k|  return sstr.str();
 2857|  1.26k|}
_ZN8Box_mdcvC2Ev:
 2874|  12.0k|{
 2875|  12.0k|  set_short_type(fourcc("mdcv"));
 2876|       |
 2877|  12.0k|  memset(&mdcv, 0, sizeof(heif_mastering_display_colour_volume));
 2878|  12.0k|}
_ZN8Box_mdcv5parseER14BitstreamRangePK20heif_security_limits:
 2882|  6.24k|{
 2883|       |  //parse_full_box_header(range);
 2884|       |
 2885|  24.9k|  for (int c = 0; c < 3; c++) {
  ------------------
  |  Branch (2885:19): [True: 18.7k, False: 6.24k]
  ------------------
 2886|  18.7k|    mdcv.display_primaries_x[c] = range.read16();
 2887|  18.7k|    mdcv.display_primaries_y[c] = range.read16();
 2888|  18.7k|  }
 2889|       |
 2890|  6.24k|  mdcv.white_point_x = range.read16();
 2891|  6.24k|  mdcv.white_point_y = range.read16();
 2892|  6.24k|  mdcv.max_display_mastering_luminance = range.read32();
 2893|  6.24k|  mdcv.min_display_mastering_luminance = range.read32();
 2894|       |
 2895|  6.24k|  return range.get_error();
 2896|  6.24k|}
_ZNK8Box_mdcv4dumpER6Indent:
 2900|  5.70k|{
 2901|  5.70k|  std::ostringstream sstr;
 2902|  5.70k|  sstr << Box::dump(indent);
 2903|       |
 2904|  5.70k|  sstr << indent << "display_primaries (x,y): ";
 2905|  5.70k|  sstr << "(" << mdcv.display_primaries_x[0] << ";" << mdcv.display_primaries_y[0] << "), ";
 2906|  5.70k|  sstr << "(" << mdcv.display_primaries_x[1] << ";" << mdcv.display_primaries_y[1] << "), ";
 2907|  5.70k|  sstr << "(" << mdcv.display_primaries_x[2] << ";" << mdcv.display_primaries_y[2] << ")\n";
 2908|       |
 2909|  5.70k|  sstr << indent << "white point (x,y): (" << mdcv.white_point_x << ";" << mdcv.white_point_y << ")\n";
 2910|  5.70k|  sstr << indent << "max display mastering luminance: " << mdcv.max_display_mastering_luminance << "\n";
 2911|  5.70k|  sstr << indent << "min display mastering luminance: " << mdcv.min_display_mastering_luminance << "\n";
 2912|       |
 2913|  5.70k|  return sstr.str();
 2914|  5.70k|}
_ZN8Box_amveC2Ev:
 2938|  7.31k|{
 2939|  7.31k|  set_short_type(fourcc("amve"));
 2940|       |
 2941|       |  // These values are not valid.
 2942|  7.31k|  amve.ambient_illumination = 0;
 2943|  7.31k|  amve.ambient_light_x = 0;
 2944|  7.31k|  amve.ambient_light_y = 0;
 2945|  7.31k|}
_ZN8Box_amve5parseER14BitstreamRangePK20heif_security_limits:
 2948|    731|{
 2949|    731|  amve.ambient_illumination = range.read32();
 2950|    731|  amve.ambient_light_x = range.read16();
 2951|    731|  amve.ambient_light_y = range.read16();
 2952|       |
 2953|    731|  return range.get_error();
 2954|    731|}
_ZNK8Box_amve4dumpER6Indent:
 2958|    217|{
 2959|    217|  std::ostringstream sstr;
 2960|    217|  sstr << Box::dump(indent);
 2961|       |
 2962|    217|  sstr << indent << "ambient_illumination: " << amve.ambient_illumination << "\n";
 2963|    217|  sstr << indent << "ambient_light_x: " << amve.ambient_light_x << "\n";
 2964|    217|  sstr << indent << "ambient_light_y: " << amve.ambient_light_y << "\n";
 2965|       |
 2966|    217|  return sstr.str();
 2967|    217|}
_ZN8Box_ndwt5parseER14BitstreamRangePK20heif_security_limits:
 2985|    606|{
 2986|    606|  parse_full_box_header(range);
 2987|       |
 2988|    606|  if (get_version() != 0) {
  ------------------
  |  Branch (2988:7): [True: 70, False: 536]
  ------------------
 2989|     70|    return unsupported_version_error("ndwt");
 2990|     70|  }
 2991|       |
 2992|    536|  m_diffuse_white_luminance = range.read32();
 2993|       |
 2994|    536|  return range.get_error();
 2995|    606|}
_ZNK8Box_ndwt4dumpER6Indent:
 2999|    533|{
 3000|    533|  std::ostringstream sstr;
 3001|    533|  sstr << Box::dump(indent);
 3002|       |
 3003|    533|  sstr << indent << "diffuse_white_luminance: " << m_diffuse_white_luminance << "\n";
 3004|       |
 3005|    533|  return sstr.str();
 3006|    533|}
_ZN8Box_cclvC2Ev:
 3022|  10.3k|{
 3023|  10.3k|  set_short_type(fourcc("cclv"));
 3024|       |
 3025|  10.3k|  m_ccv_primaries_valid = false;
 3026|  10.3k|}
_ZN8Box_cclv13set_primariesEiiiiii:
 3030|  1.10k|{
 3031|  1.10k|  m_ccv_primaries_valid = true;
 3032|  1.10k|  m_ccv_primaries_x[0] = x0;
 3033|  1.10k|  m_ccv_primaries_y[0] = y0;
 3034|  1.10k|  m_ccv_primaries_x[1] = x1;
 3035|  1.10k|  m_ccv_primaries_y[1] = y1;
 3036|  1.10k|  m_ccv_primaries_x[2] = x2;
 3037|  1.10k|  m_ccv_primaries_y[2] = y2;
 3038|  1.10k|}
_ZN8Box_ispe5parseER14BitstreamRangePK20heif_security_limits:
 3222|  2.62k|{
 3223|  2.62k|  parse_full_box_header(range);
 3224|       |
 3225|  2.62k|  if (get_version() != 0) {
  ------------------
  |  Branch (3225:7): [True: 6, False: 2.61k]
  ------------------
 3226|      6|    return unsupported_version_error("ispe");
 3227|      6|  }
 3228|       |
 3229|  2.61k|  m_image_width = range.read32();
 3230|  2.61k|  m_image_height = range.read32();
 3231|       |
 3232|  2.61k|  return range.get_error();
 3233|  2.62k|}
_ZNK8Box_ispe4dumpER6Indent:
 3237|  2.19k|{
 3238|  2.19k|  std::ostringstream sstr;
 3239|  2.19k|  sstr << Box::dump(indent);
 3240|       |
 3241|  2.19k|  sstr << indent << "image width: " << m_image_width << "\n"
 3242|  2.19k|       << indent << "image height: " << m_image_height << "\n";
 3243|       |
 3244|  2.19k|  return sstr.str();
 3245|  2.19k|}
_ZN8Box_ipma5parseER14BitstreamRangePK20heif_security_limits:
 3274|  2.90k|{
 3275|  2.90k|  parse_full_box_header(range);
 3276|       |
 3277|       |  // TODO: is there any specification of allowed values for the ipma version in the HEIF standards?
 3278|       |
 3279|  2.90k|  if (get_version() > 1) {
  ------------------
  |  Branch (3279:7): [True: 1, False: 2.89k]
  ------------------
 3280|      1|    return unsupported_version_error("ipma");
 3281|      1|  }
 3282|       |
 3283|  2.89k|  uint32_t entry_cnt = range.read32();
 3284|       |
 3285|  2.89k|  if (limits->max_items && entry_cnt > limits->max_items) {
  ------------------
  |  Branch (3285:7): [True: 2.89k, False: 0]
  |  Branch (3285:28): [True: 28, False: 2.87k]
  ------------------
 3286|     28|    std::stringstream sstr;
 3287|     28|    sstr << "ipma box wants to define properties for " << entry_cnt
 3288|     28|         << " items, but the security limit has been set to " << limits->max_items << " items";
 3289|     28|    return {heif_error_Invalid_input,
 3290|     28|            heif_suberror_Security_limit_exceeded,
 3291|     28|            sstr.str()};
 3292|     28|  }
 3293|       |
 3294|  15.8k|  for (uint32_t i = 0; i < entry_cnt && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (3294:24): [True: 13.3k, False: 2.56k]
  |  Branch (3294:41): [True: 13.2k, False: 55]
  |  Branch (3294:59): [True: 13.0k, False: 251]
  ------------------
 3295|  13.0k|    Entry entry;
 3296|  13.0k|    if (get_version() < 1) {
  ------------------
  |  Branch (3296:9): [True: 10.5k, False: 2.42k]
  ------------------
 3297|  10.5k|      entry.item_ID = range.read16();
 3298|  10.5k|    }
 3299|  2.42k|    else {
 3300|  2.42k|      entry.item_ID = range.read32();
 3301|  2.42k|    }
 3302|       |
 3303|  13.0k|    int assoc_cnt = range.read8();
 3304|   667k|    for (int k = 0; k < assoc_cnt; k++) {
  ------------------
  |  Branch (3304:21): [True: 654k, False: 13.0k]
  ------------------
 3305|   654k|      PropertyAssociation association{};
 3306|       |
 3307|   654k|      uint16_t index;
 3308|   654k|      if (get_flags() & 1) {
  ------------------
  |  Branch (3308:11): [True: 1.03k, False: 653k]
  ------------------
 3309|  1.03k|        index = range.read16();
 3310|  1.03k|        association.essential = !!(index & 0x8000);
 3311|  1.03k|        association.property_index = (index & 0x7fff);
 3312|  1.03k|      }
 3313|   653k|      else {
 3314|   653k|        index = range.read8();
 3315|   653k|        association.essential = !!(index & 0x80);
 3316|   653k|        association.property_index = (index & 0x7f);
 3317|   653k|      }
 3318|       |
 3319|   654k|      entry.associations.push_back(association);
 3320|   654k|    }
 3321|       |
 3322|  13.0k|    m_entries.push_back(entry);
 3323|  13.0k|  }
 3324|       |
 3325|  2.87k|  return range.get_error();
 3326|  2.89k|}
_ZNK8Box_ipma4dumpER6Indent:
 3390|  2.46k|{
 3391|  2.46k|  std::ostringstream sstr;
 3392|  2.46k|  sstr << Box::dump(indent);
 3393|       |
 3394|  11.6k|  for (const Entry& entry : m_entries) {
  ------------------
  |  Branch (3394:27): [True: 11.6k, False: 2.46k]
  ------------------
 3395|  11.6k|    sstr << indent << "associations for item ID: " << entry.item_ID << "\n";
 3396|  11.6k|    indent++;
 3397|   649k|    for (const auto& assoc : entry.associations) {
  ------------------
  |  Branch (3397:28): [True: 649k, False: 11.6k]
  ------------------
 3398|   649k|      sstr << indent << "property index: " << assoc.property_index
 3399|   649k|           << " (essential: " << std::boolalpha << assoc.essential << ")\n";
 3400|   649k|    }
 3401|  11.6k|    indent--;
 3402|  11.6k|  }
 3403|       |
 3404|  2.46k|  return sstr.str();
 3405|  2.46k|}
_ZN8Box_auxC5parseER14BitstreamRangePK20heif_security_limits:
 3500|  1.00k|{
 3501|  1.00k|  parse_full_box_header(range);
 3502|       |
 3503|  1.00k|  if (get_version() != 0) {
  ------------------
  |  Branch (3503:7): [True: 6, False: 999]
  ------------------
 3504|      6|    return unsupported_version_error("auxC");
 3505|      6|  }
 3506|       |
 3507|    999|  m_aux_type = range.read_string();
 3508|       |
 3509|  4.91M|  while (!range.eof()) {
  ------------------
  |  Branch (3509:10): [True: 4.91M, False: 999]
  ------------------
 3510|  4.91M|    m_aux_subtypes.push_back(range.read8());
 3511|  4.91M|  }
 3512|       |
 3513|    999|  return range.get_error();
 3514|  1.00k|}
_ZNK8Box_auxC4dumpER6Indent:
 3534|    753|{
 3535|    753|  std::ostringstream sstr;
 3536|    753|  sstr << Box::dump(indent);
 3537|       |
 3538|    753|  sstr << indent << "aux type: " << m_aux_type << "\n"
 3539|    753|       << indent << "aux subtypes: ";
 3540|  4.91M|  for (uint8_t subtype : m_aux_subtypes) {
  ------------------
  |  Branch (3540:24): [True: 4.91M, False: 753]
  ------------------
 3541|  4.91M|    sstr << std::hex << std::setw(2) << std::setfill('0') << ((int) subtype) << " ";
 3542|  4.91M|  }
 3543|       |
 3544|    753|  sstr << "\n";
 3545|       |
 3546|    753|  return sstr.str();
 3547|    753|}
_ZN8Box_irot5parseER14BitstreamRangePK20heif_security_limits:
 3551|  10.7k|{
 3552|       |  //parse_full_box_header(range);
 3553|       |
 3554|  10.7k|  uint16_t rotation = range.read8();
 3555|  10.7k|  rotation &= 0x03;
 3556|       |
 3557|  10.7k|  m_rotation = rotation * 90;
 3558|       |
 3559|  10.7k|  return range.get_error();
 3560|  10.7k|}
_ZNK8Box_irot4dumpER6Indent:
 3576|  7.18k|{
 3577|  7.18k|  std::ostringstream sstr;
 3578|  7.18k|  sstr << Box::dump(indent);
 3579|       |
 3580|  7.18k|  sstr << indent << "rotation: " << m_rotation << " degrees (CCW)\n";
 3581|       |
 3582|  7.18k|  return sstr.str();
 3583|  7.18k|}
_ZN8Box_imir5parseER14BitstreamRangePK20heif_security_limits:
 3587|  2.70k|{
 3588|       |  //parse_full_box_header(range);
 3589|       |
 3590|  2.70k|  uint8_t axis = range.read8();
 3591|  2.70k|  if (axis & 1) {
  ------------------
  |  Branch (3591:7): [True: 123, False: 2.58k]
  ------------------
 3592|    123|    m_axis = heif_transform_mirror_direction_horizontal;
 3593|    123|  }
 3594|  2.58k|  else {
 3595|  2.58k|    m_axis = heif_transform_mirror_direction_vertical;
 3596|  2.58k|  }
 3597|       |
 3598|  2.70k|  return range.get_error();
 3599|  2.70k|}
_ZNK8Box_imir4dumpER6Indent:
 3615|  1.76k|{
 3616|  1.76k|  std::ostringstream sstr;
 3617|  1.76k|  sstr << Box::dump(indent);
 3618|       |
 3619|  1.76k|  sstr << indent << "mirror direction: ";
 3620|  1.76k|  switch (m_axis) {
  ------------------
  |  Branch (3620:11): [True: 1.76k, False: 0]
  ------------------
 3621|  1.63k|    case heif_transform_mirror_direction_vertical:
  ------------------
  |  Branch (3621:5): [True: 1.63k, False: 123]
  ------------------
 3622|  1.63k|      sstr << "vertical\n";
 3623|  1.63k|      break;
 3624|    123|    case heif_transform_mirror_direction_horizontal:
  ------------------
  |  Branch (3624:5): [True: 123, False: 1.63k]
  ------------------
 3625|    123|      sstr << "horizontal\n";
 3626|    123|      break;
 3627|      0|    case heif_transform_mirror_direction_invalid:
  ------------------
  |  Branch (3627:5): [True: 0, False: 1.76k]
  ------------------
 3628|      0|      sstr << "invalid\n";
 3629|      0|      break;
 3630|  1.76k|  }
 3631|       |
 3632|  1.76k|  return sstr.str();
 3633|  1.76k|}
_ZN8Box_iscl5parseER14BitstreamRangePK20heif_security_limits:
 3637|    671|{
 3638|    671|  parse_full_box_header(range);
 3639|       |
 3640|    671|  if (get_version() != 0) {
  ------------------
  |  Branch (3640:7): [True: 77, False: 594]
  ------------------
 3641|     77|    return unsupported_version_error("iscl");
 3642|     77|  }
 3643|       |
 3644|    594|  m_target_width_numerator = range.read16();
 3645|    594|  m_target_width_denominator = range.read16();
 3646|    594|  m_target_height_numerator = range.read16();
 3647|    594|  m_target_height_denominator = range.read16();
 3648|       |
 3649|    594|  if (m_target_width_numerator == 0 || m_target_width_denominator == 0 ||
  ------------------
  |  Branch (3649:7): [True: 48, False: 546]
  |  Branch (3649:40): [True: 86, False: 460]
  ------------------
 3650|    460|      m_target_height_numerator == 0 || m_target_height_denominator == 0) {
  ------------------
  |  Branch (3650:7): [True: 47, False: 413]
  |  Branch (3650:41): [True: 34, False: 379]
  ------------------
 3651|    215|    return {heif_error_Invalid_input,
 3652|    215|            heif_suberror_Invalid_fractional_number,
 3653|    215|            "iscl property has zero numerator or denominator"};
 3654|    215|  }
 3655|       |
 3656|    379|  return range.get_error();
 3657|    594|}
_ZNK8Box_iscl4dumpER6Indent:
 3676|    338|{
 3677|    338|  std::ostringstream sstr;
 3678|    338|  sstr << FullBox::dump(indent);
 3679|       |
 3680|    338|  sstr << indent << "horizontal scaling factor: " << m_target_width_numerator << " / " << m_target_width_denominator << "\n";
 3681|    338|  sstr << indent << "vertical scaling factor:   " << m_target_height_numerator << " / " << m_target_height_denominator << "\n";
 3682|       |
 3683|    338|  return sstr.str();
 3684|    338|}
_ZN8Box_clap5parseER14BitstreamRangePK20heif_security_limits:
 3688|  4.67k|{
 3689|       |  //parse_full_box_header(range);
 3690|       |
 3691|  4.67k|  uint32_t clean_aperture_width_num = range.read32();
 3692|  4.67k|  uint32_t clean_aperture_width_den = range.read32();
 3693|  4.67k|  uint32_t clean_aperture_height_num = range.read32();
 3694|  4.67k|  uint32_t clean_aperture_height_den = range.read32();
 3695|       |
 3696|       |  // Note: in the standard document 14496-12(2015), it says that the offset values should also be unsigned integers,
 3697|       |  // but this is obviously an error. Even the accompanying standard text says that offsets may be negative.
 3698|  4.67k|  int32_t horizontal_offset_num = (int32_t) range.read32();
 3699|  4.67k|  uint32_t horizontal_offset_den = (uint32_t) range.read32();
 3700|  4.67k|  int32_t vertical_offset_num = (int32_t) range.read32();
 3701|  4.67k|  uint32_t vertical_offset_den = (uint32_t) range.read32();
 3702|       |
 3703|       |  // The checked Fraction construction rejects values outside the int32_t range and
 3704|       |  // zero denominators.
 3705|  4.67k|  auto clean_aperture_width = Fraction::from_unsigned(clean_aperture_width_num, clean_aperture_width_den);
 3706|  4.67k|  auto clean_aperture_height = Fraction::from_unsigned(clean_aperture_height_num, clean_aperture_height_den);
 3707|  4.67k|  auto horizontal_offset = Fraction::from_signed(horizontal_offset_num, horizontal_offset_den);
 3708|  4.67k|  auto vertical_offset = Fraction::from_signed(vertical_offset_num, vertical_offset_den);
 3709|       |
 3710|  4.67k|  for (const Result<Fraction>* f : {&clean_aperture_width, &clean_aperture_height,
  ------------------
  |  Branch (3710:34): [True: 15.3k, False: 550]
  ------------------
 3711|  15.3k|                                    &horizontal_offset, &vertical_offset}) {
 3712|  15.3k|    if (!*f) {
  ------------------
  |  Branch (3712:9): [True: 4.12k, False: 11.1k]
  ------------------
 3713|  4.12k|      return f->error();
 3714|  4.12k|    }
 3715|  15.3k|  }
 3716|       |
 3717|    550|  m_clean_aperture_width = *clean_aperture_width;
 3718|    550|  m_clean_aperture_height = *clean_aperture_height;
 3719|    550|  m_horizontal_offset = *horizontal_offset;
 3720|    550|  m_vertical_offset = *vertical_offset;
 3721|       |
 3722|    550|  return range.get_error();
 3723|  4.67k|}
_ZNK8Box_clap4dumpER6Indent:
 3746|    379|{
 3747|    379|  std::ostringstream sstr;
 3748|    379|  sstr << Box::dump(indent);
 3749|       |
 3750|    379|  sstr << indent << "clean_aperture: " << m_clean_aperture_width.numerator
 3751|    379|       << "/" << m_clean_aperture_width.denominator << " x "
 3752|    379|       << m_clean_aperture_height.numerator << "/"
 3753|    379|       << m_clean_aperture_height.denominator << "\n";
 3754|    379|  sstr << indent << "offset: " << m_horizontal_offset.numerator << "/"
 3755|    379|       << m_horizontal_offset.denominator << " ; "
 3756|    379|       << m_vertical_offset.numerator << "/"
 3757|    379|       << m_vertical_offset.denominator << "\n";
 3758|       |
 3759|    379|  return sstr.str();
 3760|    379|}
_ZN8Box_iref5parseER14BitstreamRangePK20heif_security_limits:
 3859|  14.2k|{
 3860|  14.2k|  parse_full_box_header(range);
 3861|       |
 3862|  14.2k|  if (get_version() > 1) {
  ------------------
  |  Branch (3862:7): [True: 6, False: 14.2k]
  ------------------
 3863|      6|    return unsupported_version_error("iref");
 3864|      6|  }
 3865|       |
 3866|  29.0k|  while (!range.eof()) {
  ------------------
  |  Branch (3866:10): [True: 14.7k, False: 14.2k]
  ------------------
 3867|  14.7k|    Reference ref;
 3868|       |
 3869|  14.7k|    Error err = ref.header.parse_header(range);
 3870|  14.7k|    if (err != Error::Ok) {
  ------------------
  |  Branch (3870:9): [True: 8, False: 14.7k]
  ------------------
 3871|      8|      return err;
 3872|      8|    }
 3873|       |
 3874|  14.7k|    int read_len = (get_version() == 0) ? 16 : 32;
  ------------------
  |  Branch (3874:20): [True: 14.5k, False: 207]
  ------------------
 3875|       |
 3876|  14.7k|    ref.from_item_ID = static_cast<uint32_t>(range.read_uint(read_len));
 3877|  14.7k|    uint16_t nRefs = range.read16();
 3878|       |
 3879|  14.7k|    if (nRefs==0) {
  ------------------
  |  Branch (3879:9): [True: 4, False: 14.7k]
  ------------------
 3880|      4|      return {heif_error_Invalid_input,
 3881|      4|              heif_suberror_Unspecified,
 3882|      4|              "Input file has an 'iref' box with no references."};
 3883|      4|    }
 3884|       |
 3885|  14.7k|    if (limits->max_items && nRefs > limits->max_items) {
  ------------------
  |  Branch (3885:9): [True: 14.7k, False: 0]
  |  Branch (3885:30): [True: 11, False: 14.7k]
  ------------------
 3886|     11|      std::stringstream sstr;
 3887|     11|      sstr << "Number of references in iref box (" << nRefs << ") exceeds the security limits of " << limits->max_items << " references.";
 3888|       |
 3889|     11|      return {heif_error_Invalid_input,
 3890|     11|              heif_suberror_Security_limit_exceeded,
 3891|     11|              sstr.str()};
 3892|     11|    }
 3893|       |
 3894|   115k|    for (int i = 0; i < nRefs; i++) {
  ------------------
  |  Branch (3894:21): [True: 100k, False: 14.7k]
  ------------------
 3895|   100k|      if (range.eof()) {
  ------------------
  |  Branch (3895:11): [True: 31, False: 100k]
  ------------------
 3896|     31|        std::stringstream sstr;
 3897|     31|        sstr << "iref box should contain " << nRefs << " references, but we can only read " << i << " references.";
 3898|       |
 3899|     31|        return {heif_error_Invalid_input,
 3900|     31|                heif_suberror_End_of_data,
 3901|     31|                sstr.str()};
 3902|     31|      }
 3903|       |
 3904|   100k|      ref.to_item_ID.push_back(static_cast<uint32_t>(range.read_uint(read_len)));
 3905|   100k|    }
 3906|       |
 3907|  14.7k|    m_references.push_back(ref);
 3908|  14.7k|  }
 3909|       |
 3910|       |
 3911|       |  // --- check for duplicate references
 3912|       |
 3913|  14.2k|  if (auto error = check_for_double_references()) {
  ------------------
  |  Branch (3913:12): [True: 49, False: 14.1k]
  ------------------
 3914|     49|    return error;
 3915|     49|  }
 3916|       |
 3917|       |
 3918|       |#if 0
 3919|       |  // Note: This input sanity check first did not work as expected.
 3920|       |  // Its idea was to prevent infinite recursions while decoding when the input file
 3921|       |  // contains cyclic references. However, apparently there are cases where cyclic
 3922|       |  // references are actually allowed, like with images that have premultiplied alpha channels:
 3923|       |  // | Box: iref -----
 3924|       |  // | size: 40   (header size: 12)
 3925|       |  // | reference with type 'auxl' from ID: 2 to IDs: 1
 3926|       |  // | reference with type 'prem' from ID: 1 to IDs: 2
 3927|       |  //
 3928|       |  // We now test for cyclic references during the image decoding.
 3929|       |  // We pass down the item IDs that have already been seen during the decoding process.
 3930|       |  // If we try to decode an image IDs that has already been seen previously, we throw an error.
 3931|       |  // The advantage is that the error only occurs when we are trying to decode the faulty image.
 3932|       |
 3933|       |  // --- check for cyclic references
 3934|       |
 3935|       |  for (const auto& ref : m_references) {
 3936|       |    if (ref.header.get_short_type() != fourcc("dimg") &&
 3937|       |        ref.header.get_short_type() != fourcc("auxl")) {
 3938|       |      continue;
 3939|       |    }
 3940|       |
 3941|       |    std::set<heif_item_id> reached_ids; // IDs that we have already reached in the DAG
 3942|       |    std::set<heif_item_id> todo;    // IDs that still need to be followed
 3943|       |
 3944|       |    bool reverse = (ref.header.get_short_type() != fourcc("auxl"));
 3945|       |
 3946|       |    if (!reverse) {
 3947|       |      todo.insert(ref.from_item_ID);  // start at base item
 3948|       |    }
 3949|       |    else {
 3950|       |      if (ref.to_item_ID.empty()) {
 3951|       |        continue;
 3952|       |      }
 3953|       |
 3954|       |      // TODO: what if aux image is assigned to multiple images?
 3955|       |      todo.insert(ref.to_item_ID[0]);  // start at base item
 3956|       |    }
 3957|       |
 3958|       |    while (!todo.empty()) {
 3959|       |      // transfer ID into set of reached IDs
 3960|       |      auto id = *todo.begin();
 3961|       |      todo.erase(id);
 3962|       |      reached_ids.insert(id);
 3963|       |
 3964|       |      // if this ID refers to another 'iref', follow it
 3965|       |
 3966|       |      for (const auto& succ_ref : m_references) {
 3967|       |        if (succ_ref.header.get_short_type() != fourcc("dimg") &&
 3968|       |            succ_ref.header.get_short_type() != fourcc("auxl")) {
 3969|       |          continue;
 3970|       |        }
 3971|       |
 3972|       |        heif_item_id from;
 3973|       |        std::vector<heif_item_id> to;
 3974|       |
 3975|       |        if (succ_ref.header.get_short_type() == fourcc("auxl")) {
 3976|       |          if (succ_ref.to_item_ID.empty()) {
 3977|       |            continue;
 3978|       |          }
 3979|       |
 3980|       |          from = succ_ref.to_item_ID[0];
 3981|       |          to = {succ_ref.from_item_ID};
 3982|       |        }
 3983|       |        else {
 3984|       |          from = succ_ref.from_item_ID;
 3985|       |          to = succ_ref.to_item_ID;
 3986|       |        }
 3987|       |
 3988|       |        if (from == id) {
 3989|       |
 3990|       |          // Check whether any successor IDs has been visited yet, which would be an error.
 3991|       |          // Otherwise, put that ID into the 'todo' set.
 3992|       |
 3993|       |          for (const auto& succ_ref_id : to) {
 3994|       |            if (reached_ids.find(succ_ref_id) != reached_ids.end()) {
 3995|       |              return Error(heif_error_Invalid_input,
 3996|       |                           heif_suberror_Unspecified,
 3997|       |                           "'iref' has cyclic references");
 3998|       |            }
 3999|       |
 4000|       |            todo.insert(succ_ref_id);
 4001|       |          }
 4002|       |        }
 4003|       |      }
 4004|       |    }
 4005|       |  }
 4006|       |#endif
 4007|       |
 4008|  14.1k|  return range.get_error();
 4009|  14.2k|}
_ZNK8Box_iref27check_for_double_referencesEv:
 4013|  14.2k|{
 4014|  14.2k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (4014:24): [True: 14.2k, False: 14.1k]
  ------------------
 4015|  14.2k|    std::set<heif_item_id> to_ids;
 4016|  62.3k|    for (const auto to_id : ref.to_item_ID) {
  ------------------
  |  Branch (4016:27): [True: 62.3k, False: 14.1k]
  ------------------
 4017|  62.3k|      if (to_ids.find(to_id) == to_ids.end()) {
  ------------------
  |  Branch (4017:11): [True: 62.2k, False: 49]
  ------------------
 4018|  62.2k|        to_ids.insert(to_id);
 4019|  62.2k|      }
 4020|     49|      else {
 4021|     49|        return {heif_error_Invalid_input,
 4022|     49|                heif_suberror_Unspecified,
 4023|     49|                "'iref' has double references"};
 4024|     49|      }
 4025|  62.3k|    }
 4026|  14.2k|  }
 4027|       |
 4028|  14.1k|  return Error::Ok;
 4029|  14.2k|}
_ZNK8Box_iref4dumpER6Indent:
 4086|  11.1k|{
 4087|  11.1k|  std::ostringstream sstr;
 4088|  11.1k|  sstr << Box::dump(indent);
 4089|       |
 4090|  11.1k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (4090:24): [True: 11.1k, False: 11.1k]
  ------------------
 4091|  11.1k|    sstr << indent << "reference with type '" << ref.header.get_type_string() << "'"
 4092|  11.1k|         << " from ID: " << ref.from_item_ID
 4093|  11.1k|         << " to IDs: ";
 4094|  43.8k|    for (uint32_t id : ref.to_item_ID) {
  ------------------
  |  Branch (4094:22): [True: 43.8k, False: 11.1k]
  ------------------
 4095|  43.8k|      sstr << id << " ";
 4096|  43.8k|    }
 4097|  11.1k|    sstr << "\n";
 4098|  11.1k|  }
 4099|       |
 4100|  11.1k|  return sstr.str();
 4101|  11.1k|}
_ZN8Box_rref5parseER14BitstreamRangePK20heif_security_limits:
 4172|    779|{
 4173|    779|  parse_full_box_header(range);
 4174|       |
 4175|    779|  if (get_version() > 1) {
  ------------------
  |  Branch (4175:7): [True: 6, False: 773]
  ------------------
 4176|      6|    return unsupported_version_error("rref");
 4177|      6|  }
 4178|       |
 4179|    773|  size_t remainingBytes = range.get_remaining_bytes();
 4180|       |
 4181|       |  // The number of reference types should be stored in uint(8), but the
 4182|       |  // common test images C043, C044 store them as uint(32).
 4183|       |  // Let us detect this case by the number of data bytes in this box.
 4184|    773|  bool cnt_as_uint32 = (remainingBytes > 0 && remainingBytes % 4 == 0);
  ------------------
  |  Branch (4184:25): [True: 770, False: 3]
  |  Branch (4184:47): [True: 515, False: 255]
  ------------------
 4185|       |
 4186|    773|  uint8_t nRefTypes;
 4187|    773|  if (cnt_as_uint32) {
  ------------------
  |  Branch (4187:7): [True: 515, False: 258]
  ------------------
 4188|       |    // fix broken C043, C044 files
 4189|       |    // TODO: remove me when the files have been corrected as the above check can misfire when there is extra padding
 4190|    515|    nRefTypes = (uint8_t)range.read32();
 4191|    515|  }
 4192|    258|  else {
 4193|    258|    nRefTypes = range.read8();
 4194|    258|  }
 4195|       |
 4196|  3.77k|  for (uint8_t i = 0; i < nRefTypes; i++) {
  ------------------
  |  Branch (4196:23): [True: 3.02k, False: 747]
  ------------------
 4197|  3.02k|    uint32_t refType = range.read32();
 4198|       |
 4199|  3.02k|    if (range.error()) {
  ------------------
  |  Branch (4199:9): [True: 26, False: 3.00k]
  ------------------
 4200|     26|      std::stringstream sstr;
 4201|     26|      sstr << "rref box should contain " << ((int)nRefTypes) << " reference types, but we can only read " << m_reference_types.size() << " reference types.";
 4202|       |
 4203|     26|      return {
 4204|     26|        heif_error_Invalid_input,
 4205|     26|        heif_suberror_End_of_data,
 4206|     26|        sstr.str()
 4207|     26|      };
 4208|     26|    }
 4209|       |
 4210|  3.00k|    m_reference_types.push_back(refType);
 4211|  3.00k|  }
 4212|       |
 4213|    747|  return range.get_error();
 4214|    773|}
_ZNK8Box_rref4dumpER6Indent:
 4299|    742|{
 4300|    742|  std::ostringstream sstr;
 4301|    742|  sstr << Box::dump(indent);
 4302|       |
 4303|    742|  sstr << indent << "reference types: ";
 4304|  2.85k|  for (size_t i = 0; i < m_reference_types.size(); i++) {
  ------------------
  |  Branch (4304:22): [True: 2.10k, False: 742]
  ------------------
 4305|  2.10k|    if (i > 0) sstr << ", ";
  ------------------
  |  Branch (4305:9): [True: 1.88k, False: 220]
  ------------------
 4306|  2.10k|    sstr << fourcc_to_string(m_reference_types[i]);
 4307|  2.10k|  }
 4308|    742|  sstr << "\n";
 4309|       |
 4310|    742|  return sstr.str();
 4311|    742|}
_ZN8Box_idat5parseER14BitstreamRangePK20heif_security_limits:
 4315|  7.09k|{
 4316|       |  //parse_full_box_header(range);
 4317|       |
 4318|  7.09k|  m_data_start_pos = range.get_istream()->get_position();
 4319|       |
 4320|  7.09k|  return range.get_error();
 4321|  7.09k|}
_ZNK8Box_idat4dumpER6Indent:
 4337|  5.78k|{
 4338|  5.78k|  std::ostringstream sstr;
 4339|  5.78k|  sstr << Box::dump(indent);
 4340|       |
 4341|  5.78k|  if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (4341:7): [True: 5.17k, False: 613]
  ------------------
 4342|  5.17k|    sstr << indent << "number of data bytes: " << get_box_size() - get_header_size() << "\n";
 4343|  5.17k|  } else {
 4344|    613|     sstr << indent << "number of data bytes is invalid\n";
 4345|    613|  }
 4346|       |
 4347|  5.78k|  return sstr.str();
 4348|  5.78k|}
_ZN8Box_grpl5parseER14BitstreamRangePK20heif_security_limits:
 4411|  1.64k|{
 4412|       |  //parse_full_box_header(range);
 4413|       |
 4414|  1.64k|  return read_children(range, READ_CHILDREN_ALL, limits); // should we pass the parsing context 'grpl' or are the box types unique?
 4415|  1.64k|}
_ZNK8Box_grpl4dumpER6Indent:
 4419|  1.33k|{
 4420|  1.33k|  std::ostringstream sstr;
 4421|  1.33k|  sstr << Box::dump(indent);
 4422|  1.33k|  sstr << dump_children(indent);
 4423|  1.33k|  return sstr.str();
 4424|  1.33k|}
_ZN17Box_EntityToGroup5parseER14BitstreamRangePK20heif_security_limits:
 4428|  2.15k|{
 4429|  2.15k|  Error err = parse_full_box_header(range);
 4430|  2.15k|  if (err != Error::Ok) {
  ------------------
  |  Branch (4430:7): [True: 132, False: 2.02k]
  ------------------
 4431|    132|    return err;
 4432|    132|  }
 4433|       |
 4434|  2.02k|  group_id = range.read32();
 4435|  2.02k|  uint32_t nEntities = range.read32();
 4436|       |
 4437|  2.02k|  if (nEntities > range.get_remaining_bytes() / 4) {
  ------------------
  |  Branch (4437:7): [True: 89, False: 1.93k]
  ------------------
 4438|     89|    std::stringstream sstr;
 4439|     89|    size_t maxEntries = range.get_remaining_bytes() / 4;
 4440|     89|    sstr << "entity group box should contain " << nEntities << " entities, but we can only read " << maxEntries << " entities.";
 4441|       |
 4442|     89|    return {heif_error_Invalid_input,
 4443|     89|            heif_suberror_End_of_data,
 4444|     89|            sstr.str()};
 4445|     89|  }
 4446|       |
 4447|  1.93k|  if (limits->max_size_entity_group && nEntities > limits->max_size_entity_group) {
  ------------------
  |  Branch (4447:7): [True: 1.93k, False: 0]
  |  Branch (4447:40): [True: 38, False: 1.89k]
  ------------------
 4448|     38|    std::stringstream sstr;
 4449|     38|    sstr << "entity group box contains " << nEntities << " entities, but the security limit is set to " << limits->max_size_entity_group << " entities.";
 4450|       |
 4451|     38|    return {heif_error_Invalid_input,
 4452|     38|            heif_suberror_Security_limit_exceeded,
 4453|     38|            sstr.str()};
 4454|     38|  }
 4455|       |
 4456|  1.89k|  entity_ids.resize(nEntities);
 4457|  5.01k|  for (uint32_t i = 0; i < nEntities; i++) {
  ------------------
  |  Branch (4457:24): [True: 3.11k, False: 1.89k]
  ------------------
 4458|  3.11k|    entity_ids[i] = range.read32();
 4459|  3.11k|  }
 4460|       |
 4461|  1.89k|  return Error::Ok;
 4462|  1.93k|}
_ZNK17Box_EntityToGroup4dumpER6Indent:
 4491|  1.22k|{
 4492|  1.22k|  std::ostringstream sstr;
 4493|  1.22k|  sstr << Box::dump(indent);
 4494|       |
 4495|  1.22k|  sstr << indent << "group id: " << group_id << "\n"
 4496|  1.22k|       << indent << "entity IDs: ";
 4497|       |
 4498|  1.22k|  bool first = true;
 4499|  1.88k|  for (uint32_t id : entity_ids) {
  ------------------
  |  Branch (4499:20): [True: 1.88k, False: 1.22k]
  ------------------
 4500|  1.88k|    if (first) {
  ------------------
  |  Branch (4500:9): [True: 512, False: 1.37k]
  ------------------
 4501|    512|      first = false;
 4502|    512|    }
 4503|  1.37k|    else {
 4504|  1.37k|      sstr << ' ';
 4505|  1.37k|    }
 4506|       |
 4507|  1.88k|    sstr << id;
 4508|  1.88k|  }
 4509|       |
 4510|  1.22k|  sstr << "\n";
 4511|       |
 4512|  1.22k|  return sstr.str();
 4513|  1.22k|}
_ZN8Box_ster5parseER14BitstreamRangePK20heif_security_limits:
 4517|    513|{
 4518|    513|  Error err = Box_EntityToGroup::parse(range, limits);
 4519|    513|  if (err) {
  ------------------
  |  Branch (4519:7): [True: 9, False: 504]
  ------------------
 4520|      9|    return err;
 4521|      9|  }
 4522|       |
 4523|    504|  if (entity_ids.size() != 2) {
  ------------------
  |  Branch (4523:7): [True: 2, False: 502]
  ------------------
 4524|      2|    return {heif_error_Invalid_input,
 4525|      2|            heif_suberror_Invalid_box_size,
 4526|      2|            "'ster' entity group does not exists of exactly two images"};
 4527|      2|  }
 4528|       |
 4529|    502|  return Error::Ok;
 4530|    504|}
_ZNK8Box_ster4dumpER6Indent:
 4534|    476|{
 4535|    476|  std::ostringstream sstr;
 4536|    476|  sstr << Box::dump(indent);
 4537|       |
 4538|    476|  sstr << indent << "group id: " << group_id << "\n"
 4539|    476|       << indent << "left image ID: " << entity_ids[0] << "\n"
 4540|    476|       << indent << "right image ID: " << entity_ids[1] << "\n";
 4541|       |
 4542|    476|  return sstr.str();
 4543|    476|}
_ZN8Box_pymd5parseER14BitstreamRangePK20heif_security_limits:
 4548|  1.53k|{
 4549|  1.53k|  Error err = Box_EntityToGroup::parse(range, limits);
 4550|  1.53k|  if (err) {
  ------------------
  |  Branch (4550:7): [True: 245, False: 1.29k]
  ------------------
 4551|    245|    return err;
 4552|    245|  }
 4553|       |
 4554|  1.29k|  tile_size_x = range.read16();
 4555|  1.29k|  tile_size_y = range.read16();
 4556|       |
 4557|  3.31k|  for (size_t i = 0; i < entity_ids.size(); i++) {
  ------------------
  |  Branch (4557:22): [True: 2.02k, False: 1.29k]
  ------------------
 4558|  2.02k|    LayerInfo layer{};
 4559|  2.02k|    layer.layer_binning = range.read16();
 4560|  2.02k|    layer.tiles_in_layer_row_minus1 = range.read16();
 4561|  2.02k|    layer.tiles_in_layer_column_minus1 = range.read16();
 4562|       |
 4563|  2.02k|    m_layer_infos.push_back(layer);
 4564|  2.02k|  }
 4565|       |
 4566|  1.29k|  return Error::Ok;
 4567|  1.53k|}
_ZNK8Box_pymd4dumpER6Indent:
 4594|  1.16k|{
 4595|  1.16k|  std::ostringstream sstr;
 4596|  1.16k|  sstr << Box_EntityToGroup::dump(indent);
 4597|       |
 4598|  1.16k|  sstr << indent << "tile size: " << tile_size_x << "x" << tile_size_y << "\n";
 4599|       |
 4600|  1.16k|  int layerNr = 0;
 4601|  1.83k|  for (const auto& layer : m_layer_infos) {
  ------------------
  |  Branch (4601:26): [True: 1.83k, False: 1.16k]
  ------------------
 4602|  1.83k|    sstr << indent << "layer " << layerNr << ":\n"
 4603|  1.83k|         << indent << "| binning: " << layer.layer_binning << "\n"
 4604|  1.83k|         << indent << "| tiles: " << (layer.tiles_in_layer_row_minus1 + 1) << "x" << (layer.tiles_in_layer_column_minus1 + 1) << "\n";
 4605|       |
 4606|  1.83k|    layerNr++;
 4607|  1.83k|  }
 4608|       |
 4609|  1.16k|  return sstr.str();
 4610|  1.16k|}
_ZN8Box_dinf5parseER14BitstreamRangePK20heif_security_limits:
 4614|  7.28k|{
 4615|       |  //parse_full_box_header(range);
 4616|       |
 4617|  7.28k|  return read_children(range, READ_CHILDREN_ALL, limits);
 4618|  7.28k|}
_ZNK8Box_dinf4dumpER6Indent:
 4622|  6.47k|{
 4623|  6.47k|  std::ostringstream sstr;
 4624|  6.47k|  sstr << Box::dump(indent);
 4625|  6.47k|  sstr << dump_children(indent);
 4626|       |
 4627|  6.47k|  return sstr.str();
 4628|  6.47k|}
_ZN8Box_dref5parseER14BitstreamRangePK20heif_security_limits:
 4632|  1.72k|{
 4633|  1.72k|  parse_full_box_header(range);
 4634|       |
 4635|  1.72k|  if (get_version() != 0) {
  ------------------
  |  Branch (4635:7): [True: 5, False: 1.72k]
  ------------------
 4636|      5|    return unsupported_version_error("dref");
 4637|      5|  }
 4638|       |
 4639|  1.72k|  uint32_t nEntities = range.read32();
 4640|       |
 4641|       |  /*
 4642|       |  for (int i=0;i<nEntities;i++) {
 4643|       |    if (range.eof()) {
 4644|       |      break;
 4645|       |    }
 4646|       |  }
 4647|       |  */
 4648|       |
 4649|  1.72k|  if (nEntities > (uint32_t)std::numeric_limits<int>::max()) {
  ------------------
  |  Branch (4649:7): [True: 11, False: 1.70k]
  ------------------
 4650|     11|    return Error(heif_error_Memory_allocation_error,
 4651|     11|                 heif_suberror_Security_limit_exceeded,
 4652|     11|                 "Too many entities in dref box.");
 4653|     11|  }
 4654|       |
 4655|  1.70k|  Error err = read_children(range, (int)nEntities, limits);
 4656|  1.70k|  if (err) {
  ------------------
  |  Branch (4656:7): [True: 73, False: 1.63k]
  ------------------
 4657|     73|    return err;
 4658|     73|  }
 4659|       |
 4660|  1.63k|  if (m_children.size() != nEntities) {
  ------------------
  |  Branch (4660:7): [True: 1.35k, False: 281]
  ------------------
 4661|       |    // TODO return Error(
 4662|  1.35k|  }
 4663|       |
 4664|  1.63k|  return err;
 4665|  1.70k|}
_ZNK8Box_dref4dumpER6Indent:
 4689|  1.63k|{
 4690|  1.63k|  std::ostringstream sstr;
 4691|  1.63k|  sstr << Box::dump(indent);
 4692|  1.63k|  sstr << dump_children(indent);
 4693|       |
 4694|  1.63k|  return sstr.str();
 4695|  1.63k|}
_ZN7Box_url5parseER14BitstreamRangePK20heif_security_limits:
 4699|  2.58k|{
 4700|  2.58k|  parse_full_box_header(range);
 4701|       |
 4702|  2.58k|  if (get_version() > 0) {
  ------------------
  |  Branch (4702:7): [True: 5, False: 2.57k]
  ------------------
 4703|      5|    return unsupported_version_error("url");
 4704|      5|  }
 4705|       |
 4706|  2.57k|  if (get_flags() & 1) {
  ------------------
  |  Branch (4706:7): [True: 1.87k, False: 703]
  ------------------
 4707|       |    // data in same file
 4708|  1.87k|    m_location.clear();
 4709|  1.87k|  }
 4710|    703|  else {
 4711|    703|    m_location = range.read_string();
 4712|    703|  }
 4713|       |
 4714|  2.57k|  return range.get_error();
 4715|  2.58k|}
_ZNK7Box_url4dumpER6Indent:
 4736|  2.50k|{
 4737|  2.50k|  std::ostringstream sstr;
 4738|  2.50k|  sstr << Box::dump(indent);
 4739|       |  //sstr << dump_children(indent);
 4740|       |
 4741|  2.50k|  sstr << indent << "location: " << m_location << "\n";
 4742|       |
 4743|  2.50k|  return sstr.str();
 4744|  2.50k|}
_ZN8Box_udes5parseER14BitstreamRangePK20heif_security_limits:
 4748|  1.84k|{
 4749|  1.84k|  parse_full_box_header(range);
 4750|       |
 4751|  1.84k|  if (get_version() > 0) {
  ------------------
  |  Branch (4751:7): [True: 112, False: 1.73k]
  ------------------
 4752|    112|    return unsupported_version_error("udes");
 4753|    112|  }
 4754|       |
 4755|  1.73k|  m_lang = range.read_string();
 4756|  1.73k|  m_name = range.read_string();
 4757|  1.73k|  m_description = range.read_string();
 4758|  1.73k|  m_tags = range.read_string();
 4759|  1.73k|  return range.get_error();
 4760|  1.84k|}
_ZNK8Box_udes4dumpER6Indent:
 4763|  1.56k|{
 4764|  1.56k|  std::ostringstream sstr;
 4765|  1.56k|  sstr << Box::dump(indent);
 4766|  1.56k|  sstr << indent << "lang: " << m_lang << "\n";
 4767|  1.56k|  sstr << indent << "name: " << m_name << "\n";
 4768|  1.56k|  sstr << indent << "description: " << m_description << "\n";
 4769|  1.56k|  sstr << indent << "tags: " << m_tags << "\n";
 4770|  1.56k|  return sstr.str();
 4771|  1.56k|}
_ZNK8Box_cmin4dumpER6Indent:
 4819|  2.43k|{
 4820|  2.43k|  std::ostringstream sstr;
 4821|  2.43k|  sstr << Box::dump(indent);
 4822|  2.43k|  sstr << indent << "principal-point: " << m_matrix.principal_point_x << ", " << m_matrix.principal_point_y << "\n";
 4823|  2.43k|  if (m_matrix.is_anisotropic) {
  ------------------
  |  Branch (4823:7): [True: 419, False: 2.01k]
  ------------------
 4824|    419|    sstr << indent << "focal-length: " << m_matrix.focal_length_x << ", " << m_matrix.focal_length_y << "\n";
 4825|    419|    sstr << indent << "skew: " << m_matrix.skew << "\n";
 4826|    419|  }
 4827|  2.01k|  else {
 4828|  2.01k|    sstr << indent << "focal-length: " << m_matrix.focal_length_x << "\n";
 4829|  2.01k|    sstr << indent << "no skew\n";
 4830|  2.01k|  }
 4831|       |
 4832|  2.43k|  return sstr.str();
 4833|  2.43k|}
_ZN8Box_cmin5parseER14BitstreamRangePK20heif_security_limits:
 4837|  4.11k|{
 4838|  4.11k|  parse_full_box_header(range);
 4839|       |
 4840|  4.11k|  if (get_version() > 0) {
  ------------------
  |  Branch (4840:7): [True: 245, False: 3.86k]
  ------------------
 4841|    245|    return unsupported_version_error("cmin");
 4842|    245|  }
 4843|       |
 4844|  3.86k|  m_denominatorShift = (get_flags() & 0x1F00) >> 8;
 4845|  3.86k|  uint32_t denominator = (1U << m_denominatorShift);
 4846|       |
 4847|  3.86k|  m_matrix.focal_length_x = range.read32s() / (double)denominator;
 4848|  3.86k|  m_matrix.principal_point_x = range.read32s() / (double)denominator;
 4849|  3.86k|  m_matrix.principal_point_y = range.read32s() / (double)denominator;
 4850|       |
 4851|  3.86k|  if (get_flags() & 1) {
  ------------------
  |  Branch (4851:7): [True: 558, False: 3.30k]
  ------------------
 4852|    558|    m_skewDenominatorShift = ((get_flags()) & 0x1F0000) >> 16;
 4853|    558|    uint32_t skewDenominator = (1U << m_skewDenominatorShift);
 4854|       |
 4855|    558|    m_matrix.focal_length_y = range.read32s() / (double)denominator;
 4856|    558|    m_matrix.skew = range.read32s() / (double)skewDenominator;
 4857|       |
 4858|    558|    m_matrix.is_anisotropic = true;
 4859|    558|  }
 4860|  3.30k|  else {
 4861|  3.30k|    m_matrix.is_anisotropic = false;
 4862|  3.30k|    m_matrix.focal_length_y = 0;
 4863|  3.30k|    m_matrix.skew = 0;
 4864|  3.30k|  }
 4865|  3.86k|  return range.get_error();
 4866|  4.11k|}
_ZN8Box_cmex5parseER14BitstreamRangePK20heif_security_limits:
 5024|  6.15k|{
 5025|  6.15k|  parse_full_box_header(range);
 5026|       |
 5027|  6.15k|  if (get_version() > 0) {
  ------------------
  |  Branch (5027:7): [True: 914, False: 5.24k]
  ------------------
 5028|    914|    return unsupported_version_error("cmex");
 5029|    914|  }
 5030|       |
 5031|  5.24k|  m_matrix = ExtrinsicMatrix{};
 5032|       |
 5033|  5.24k|  if (get_flags() & pos_x_present) {
  ------------------
  |  Branch (5033:7): [True: 3.93k, False: 1.30k]
  ------------------
 5034|  3.93k|    m_has_pos_x = true;
 5035|  3.93k|    m_matrix.pos_x = range.read32s();
 5036|  3.93k|  }
 5037|       |
 5038|  5.24k|  if (get_flags() & pos_y_present) {
  ------------------
  |  Branch (5038:7): [True: 4.37k, False: 869]
  ------------------
 5039|  4.37k|    m_has_pos_y = true;
 5040|  4.37k|    m_matrix.pos_y = range.read32s();
 5041|  4.37k|  }
 5042|       |
 5043|  5.24k|  if (get_flags() & pos_z_present) {
  ------------------
  |  Branch (5043:7): [True: 717, False: 4.52k]
  ------------------
 5044|    717|    m_has_pos_z = true;
 5045|    717|    m_matrix.pos_z = range.read32s();
 5046|    717|  }
 5047|       |
 5048|  5.24k|  if (get_flags() & orientation_present) {
  ------------------
  |  Branch (5048:7): [True: 1.41k, False: 3.82k]
  ------------------
 5049|  1.41k|    m_has_orientation = true;
 5050|       |
 5051|  1.41k|    if (get_version() == 0) {
  ------------------
  |  Branch (5051:9): [True: 1.41k, False: 0]
  ------------------
 5052|  1.41k|      bool use32bit = (get_flags() & rot_large_field_size);
 5053|  1.41k|      int32_t quat_x = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (5053:24): [True: 544, False: 870]
  ------------------
 5054|  1.41k|      int32_t quat_y = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (5054:24): [True: 544, False: 870]
  ------------------
 5055|  1.41k|      int32_t quat_z = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (5055:24): [True: 544, False: 870]
  ------------------
 5056|       |
 5057|  1.41k|      uint32_t div = 1U << (14 + (use32bit ? 16 : 0));
  ------------------
  |  Branch (5057:35): [True: 544, False: 870]
  ------------------
 5058|       |
 5059|  1.41k|      m_matrix.rotation_as_quaternions = true;
 5060|  1.41k|      m_matrix.quaternion_x = quat_x / (double)div;
 5061|  1.41k|      m_matrix.quaternion_y = quat_y / (double)div;
 5062|  1.41k|      m_matrix.quaternion_z = quat_z / (double)div;
 5063|       |
 5064|  1.41k|      double q_sum = (m_matrix.quaternion_x * m_matrix.quaternion_x +
 5065|  1.41k|                      m_matrix.quaternion_y * m_matrix.quaternion_y +
 5066|  1.41k|                      m_matrix.quaternion_z * m_matrix.quaternion_z);
 5067|       |
 5068|  1.41k|      if (q_sum > 1.0) {
  ------------------
  |  Branch (5068:11): [True: 313, False: 1.10k]
  ------------------
 5069|    313|        return Error(heif_error_Invalid_input,
 5070|    313|                     heif_suberror_Unspecified,
 5071|    313|                     "Invalid quaternion in extrinsic rotation matrix");
 5072|    313|      }
 5073|       |
 5074|  1.10k|      m_matrix.quaternion_w = sqrt(1 - q_sum);
 5075|       |
 5076|  1.10k|    } else if (get_version() == 1) {
  ------------------
  |  Branch (5076:16): [True: 0, False: 0]
  ------------------
 5077|      0|      uint32_t div = 1<<16;
 5078|      0|      m_matrix.rotation_yaw = range.read32s() / (double)div;
 5079|      0|      m_matrix.rotation_pitch = range.read32s() / (double)div;
 5080|      0|      m_matrix.rotation_roll = range.read32s() / (double)div;
 5081|      0|    }
 5082|  1.41k|  }
 5083|       |
 5084|  4.92k|  if (get_flags() & id_present) {
  ------------------
  |  Branch (5084:7): [True: 3.94k, False: 981]
  ------------------
 5085|  3.94k|    m_has_world_coordinate_system_id = true;
 5086|  3.94k|    m_matrix.world_coordinate_system_id = range.read32();
 5087|  3.94k|  }
 5088|       |
 5089|  4.92k|  return range.get_error();
 5090|  5.24k|}
_ZNK8Box_cmex4dumpER6Indent:
 5094|  3.24k|{
 5095|  3.24k|  std::ostringstream sstr;
 5096|  3.24k|  sstr << Box::dump(indent);
 5097|  3.24k|  sstr << indent << "camera position (um): ";
 5098|  3.24k|  sstr << m_matrix.pos_x << " ; ";
 5099|  3.24k|  sstr << m_matrix.pos_y << " ; ";
 5100|  3.24k|  sstr << m_matrix.pos_z << "\n";
 5101|       |
 5102|  3.24k|  sstr << indent << "orientation ";
 5103|  3.24k|  if (m_matrix.rotation_as_quaternions) {
  ------------------
  |  Branch (5103:7): [True: 3.24k, False: 0]
  ------------------
 5104|  3.24k|    sstr << "(quaterion)\n";
 5105|  3.24k|    sstr << indent << "  q = ["
 5106|  3.24k|         << m_matrix.quaternion_x << ";"
 5107|  3.24k|         << m_matrix.quaternion_y << ";"
 5108|  3.24k|         << m_matrix.quaternion_z << ";"
 5109|  3.24k|         << m_matrix.quaternion_w << "]\n";
 5110|  3.24k|  }
 5111|      0|  else {
 5112|      0|    sstr << "(angles)\n";
 5113|      0|    sstr << indent << "  yaw:   " << m_matrix.rotation_yaw << "\n";
 5114|      0|    sstr << indent << "  pitch: " << m_matrix.rotation_pitch << "\n";
 5115|      0|    sstr << indent << "  roll:  " << m_matrix.rotation_roll << "\n";
 5116|      0|  }
 5117|       |
 5118|  3.24k|  sstr << indent << "world coordinate system id: " << m_matrix.world_coordinate_system_id << "\n";
 5119|       |
 5120|  3.24k|  return sstr.str();
 5121|  3.24k|}
_ZN8Box_taic4dumpERK19heif_tai_clock_infoR6Indent:
 5261|  1.36k|{
 5262|  1.36k|  std::ostringstream sstr;
 5263|  1.36k|  sstr << indent << "time_uncertainty: ";
 5264|  1.36k|  if (info.time_uncertainty == heif_tai_clock_info_time_uncertainty_unknown) {
  ------------------
  |  |   52|  1.36k|#define heif_tai_clock_info_time_uncertainty_unknown UINT64_C(0xFFFFFFFFFFFFFFFF)
  ------------------
  |  Branch (5264:7): [True: 351, False: 1.01k]
  ------------------
 5265|    351|    sstr << "unknown\n";
 5266|    351|  }
 5267|  1.01k|  else {
 5268|  1.01k|    sstr << info.time_uncertainty << "\n";
 5269|  1.01k|  }
 5270|  1.36k|  sstr << indent << "clock_resolution: " << info.clock_resolution << "\n";
 5271|  1.36k|  sstr << indent << "clock_drift_rate: ";
 5272|  1.36k|  if (info.clock_drift_rate == heif_tai_clock_info_clock_drift_rate_unknown) {
  ------------------
  |  |   53|  1.36k|#define heif_tai_clock_info_clock_drift_rate_unknown INT32_C(0x7FFFFFFF)
  ------------------
  |  Branch (5272:7): [True: 191, False: 1.17k]
  ------------------
 5273|    191|    sstr << "undefined\n";
 5274|    191|  }
 5275|  1.17k|  else {
 5276|  1.17k|    sstr << info.clock_drift_rate << "\n";
 5277|  1.17k|  }
 5278|       |
 5279|  1.36k|  sstr << indent << "clock_type: " << int(info.clock_type) << " ";
 5280|  1.36k|  switch (info.clock_type) {
 5281|    730|    case heif_tai_clock_info_clock_type_unknown: sstr << "(unknown)\n"; break;
  ------------------
  |  |   54|    730|#define heif_tai_clock_info_clock_type_unknown 0
  ------------------
  |  Branch (5281:5): [True: 730, False: 635]
  ------------------
 5282|     28|    case heif_tai_clock_info_clock_type_synchronized_to_atomic_source: sstr << "(synchronized to atomic source)\n"; break;
  ------------------
  |  |   56|     28|#define heif_tai_clock_info_clock_type_synchronized_to_atomic_source 2
  ------------------
  |  Branch (5282:5): [True: 28, False: 1.33k]
  ------------------
 5283|     43|    case heif_tai_clock_info_clock_type_not_synchronized_to_atomic_source: sstr << "(not synchronized to atomic source)\n"; break;
  ------------------
  |  |   55|     43|#define heif_tai_clock_info_clock_type_not_synchronized_to_atomic_source 1
  ------------------
  |  Branch (5283:5): [True: 43, False: 1.32k]
  ------------------
 5284|    564|    default: sstr << "(illegal value)\n"; break;;
  ------------------
  |  Branch (5284:5): [True: 564, False: 801]
  ------------------
 5285|  1.36k|  }
 5286|  1.36k|  return sstr.str();
 5287|  1.36k|}
_ZNK8Box_taic4dumpER6Indent:
 5290|  1.36k|std::string Box_taic::dump(Indent& indent) const {
 5291|  1.36k|  std::ostringstream sstr;
 5292|  1.36k|  sstr << Box::dump(indent);
 5293|  1.36k|  sstr << dump(m_info, indent);
 5294|       |
 5295|  1.36k|  return sstr.str();
 5296|  1.36k|}
_ZN8Box_taic5parseER14BitstreamRangePK20heif_security_limits:
 5310|  1.47k|Error Box_taic::parse(BitstreamRange& range, const heif_security_limits*) {
 5311|  1.47k|  parse_full_box_header(range);
 5312|       |
 5313|  1.47k|  m_info.time_uncertainty = range.read64();
 5314|  1.47k|  m_info.clock_resolution = range.read32();
 5315|       |
 5316|  1.47k|  m_info.clock_drift_rate = range.read32s();
 5317|  1.47k|  m_info.clock_type = range.read8() >> 6;
 5318|  1.47k|  return range.get_error();
 5319|  1.47k|}
_ZNK8Box_itai4dumpER6Indent:
 5343|    499|std::string Box_itai::dump(Indent& indent) const {
 5344|    499|  std::ostringstream sstr;
 5345|    499|  sstr << Box::dump(indent);
 5346|    499|  sstr << indent << "tai_timestamp: " << m_timestamp.tai_timestamp << "\n";
 5347|    499|  sstr << indent << "synchronization_state: " << int(m_timestamp.synchronization_state) << "\n";
 5348|    499|  sstr << indent << "timestamp_generation_failure: " << int(m_timestamp.timestamp_generation_failure) << "\n";
 5349|    499|  sstr << indent << "timestamp_is_modified: " << int(m_timestamp.timestamp_is_modified) << "\n";
 5350|    499|  return sstr.str();
 5351|    499|}
_ZN8Box_itai5parseER14BitstreamRangePK20heif_security_limits:
 5438|    523|Error Box_itai::parse(BitstreamRange& range, const heif_security_limits*) {
 5439|    523|  parse_full_box_header(range);
 5440|       |
 5441|    523|  m_timestamp.version = 1;
 5442|    523|  m_timestamp.tai_timestamp = range.read64();
 5443|       |
 5444|    523|  uint8_t status_bits = range.read8();
 5445|       |
 5446|    523|  m_timestamp.synchronization_state = !!(status_bits & 0x80);
 5447|    523|  m_timestamp.timestamp_generation_failure = !!(status_bits & 0x40);
 5448|    523|  m_timestamp.timestamp_is_modified = !!(status_bits & 0x20);
 5449|       |
 5450|    523|  return range.get_error();
 5451|    523|}
_ZN8Box_elng5parseER14BitstreamRangePK20heif_security_limits:
 5454|    647|{
 5455|    647|  parse_full_box_header(range);
 5456|       |
 5457|    647|  if (get_version() > 0) {
  ------------------
  |  Branch (5457:7): [True: 41, False: 606]
  ------------------
 5458|     41|    return unsupported_version_error("elng");
 5459|     41|  }
 5460|       |
 5461|    606|  m_lang = range.read_string();
 5462|    606|  return range.get_error();
 5463|    647|}
_ZNK8Box_elng4dumpER6Indent:
 5466|    567|{
 5467|    567|  std::ostringstream sstr;
 5468|    567|  sstr << Box::dump(indent);
 5469|    567|  sstr << indent << "extended_language: " << m_lang << "\n";
 5470|    567|  return sstr.str();
 5471|    567|}
_ZN19Box_gimi_content_id5parseER14BitstreamRangePK20heif_security_limits:
 5483|  1.98k|{
 5484|  1.98k|  m_content_id = range.read_string_until_eof();
 5485|       |
 5486|  1.98k|  return range.get_error();
 5487|  1.98k|}
_ZNK19Box_gimi_content_id4dumpER6Indent:
 5503|  1.95k|{
 5504|  1.95k|  std::ostringstream sstr;
 5505|  1.95k|  sstr << Box::dump(indent);
 5506|       |
 5507|  1.95k|  sstr << indent << "content ID: " << m_content_id << "\n";
 5508|       |
 5509|  1.95k|  return sstr.str();
 5510|  1.95k|}

_ZNK9BoxHeader12get_box_sizeEv:
  124|  2.61M|  uint64_t get_box_size() const { return m_size; }
_ZNK9BoxHeader18has_fixed_box_sizeEv:
  126|  1.09M|  bool has_fixed_box_size() const { return m_size != 0; }
_ZNK9BoxHeader15get_header_sizeEv:
  128|  2.13M|  uint32_t get_header_size() const { return m_header_size; }
_ZNK9BoxHeader14get_short_typeEv:
  130|   756k|  uint32_t get_short_type() const { return m_type; }
_ZNK9BoxHeader14debug_box_nameEv:
  136|   193k|  virtual const char* debug_box_name() const { return nullptr; }
_ZN9BoxHeader14set_short_typeEj:
  138|   554k|  void set_short_type(uint32_t type) { m_type = type; }
_ZN3Box16set_short_headerERK9BoxHeader:
  188|   469k|  {
  189|   469k|    *(BoxHeader*) this = hdr;
  190|   469k|  }
_ZN3Box19set_output_positionEm:
  267|  16.3k|  void set_output_position(uint64_t pos) { m_output_position = pos; }
_ZNK3Box24get_parse_error_fatalityEv:
  269|  7.27k|  virtual parse_error_fatality get_parse_error_fatality() const { return parse_error_fatality::fatal; }
_ZNK7FullBox11get_versionEv:
  327|   474k|  uint8_t get_version() const { return m_version; }
_ZNK7FullBox9get_flagsEv:
  331|   707k|  uint32_t get_flags() const { return m_flags; }
_ZN7FullBox9set_flagsEj:
  333|  5.02k|  void set_flags(uint32_t flags) { m_flags = flags; }
_ZN9Box_otherC2Ej:
  355|   139k|  {
  356|   139k|    set_short_type(short_type);
  357|   139k|  }
_ZN9Box_ErrorC2Ej5Error20parse_error_fatality:
  379|  18.7k|  {
  380|  18.7k|    set_short_type(fourcc("ERR "));
  381|       |
  382|  18.7k|    m_box_type_with_parse_error = box4cc;
  383|  18.7k|    m_error = std::move(err);
  384|  18.7k|    m_fatality = fatality;
  385|  18.7k|  }
_ZN8Box_ftypC2Ev:
  410|  43.5k|  {
  411|  43.5k|    set_short_type(fourcc("ftyp"));
  412|  43.5k|  }
_ZNK8Box_ftyp14debug_box_nameEv:
  416|  9.09k|  const char* debug_box_name() const override { return "File Type"; }
_ZN8Box_freeC2Ev:
  450|    821|  {
  451|    821|    set_short_type(fourcc("free"));
  452|    821|  }
_ZNK8Box_free14debug_box_nameEv:
  456|    664|  const char* debug_box_name() const override { return "Free Space"; }
_ZN8Box_metaC2Ev:
  469|  2.91k|  {
  470|  2.91k|    set_short_type(fourcc("meta"));
  471|  2.91k|  }
_ZNK8Box_meta14debug_box_nameEv:
  475|  2.57k|  const char* debug_box_name() const override { return "Metadata"; }
_ZN8Box_hdlrC2Ev:
  486|  3.72k|  {
  487|  3.72k|    set_short_type(fourcc("hdlr"));
  488|  3.72k|  }
_ZNK8Box_hdlr14debug_box_nameEv:
  492|  2.56k|  const char* debug_box_name() const override { return "Handler Reference"; }
_ZN8Box_pitmC2Ev:
  517|  3.48k|  {
  518|  3.48k|    set_short_type(fourcc("pitm"));
  519|  3.48k|  }
_ZNK8Box_pitm14debug_box_nameEv:
  523|  3.12k|  const char* debug_box_name() const override { return "Primary Item"; }
_ZNK8Box_iloc14debug_box_nameEv:
  552|  1.98k|  const char* debug_box_name() const override { return "Item Location"; }
_ZN8Box_infeC2Ev:
  647|  4.61k|  {
  648|  4.61k|    set_short_type(fourcc("infe"));
  649|  4.61k|  }
_ZNK8Box_infe14debug_box_nameEv:
  653|  3.97k|  const char* debug_box_name() const override { return "Item Info Entry"; }
_ZN8Box_iinfC2Ev:
  709|  3.99k|  {
  710|  3.99k|    set_short_type(fourcc("iinf"));
  711|  3.99k|  }
_ZNK8Box_iinf14debug_box_nameEv:
  715|  3.58k|  const char* debug_box_name() const override { return "Item Information"; }
_ZN8Box_iprpC2Ev:
  733|  32.1k|  {
  734|  32.1k|    set_short_type(fourcc("iprp"));
  735|  32.1k|  }
_ZNK8Box_iprp14debug_box_nameEv:
  739|  30.3k|  const char* debug_box_name() const override { return "Item Properties"; }
_ZN8Box_ipcoC2Ev:
  750|  11.4k|  {
  751|  11.4k|    set_short_type(fourcc("ipco"));
  752|  11.4k|  }
_ZNK8Box_ipco14debug_box_nameEv:
  770|  10.0k|  const char* debug_box_name() const override { return "Item Property Container"; }
_ZN8Box_ispeC2Ev:
  781|  2.62k|  {
  782|  2.62k|    set_short_type(fourcc("ispe"));
  783|  2.62k|  }
_ZNK8Box_ispe14debug_box_nameEv:
  797|  2.19k|  const char* debug_box_name() const override { return "Image Spatial Extents"; }
_ZN8Box_ipmaC2Ev:
  819|  2.90k|  {
  820|  2.90k|    set_short_type(fourcc("ipma"));
  821|  2.90k|  }
_ZNK8Box_ipma14debug_box_nameEv:
  825|  2.46k|  const char* debug_box_name() const override { return "Item Property Association"; }
_ZN8Box_auxCC2Ev:
  866|  1.00k|  {
  867|  1.00k|    set_short_type(fourcc("auxC"));
  868|  1.00k|  }
_ZNK8Box_auxC14debug_box_nameEv:
  880|    753|  const char* debug_box_name() const override { return "Image Properties for Auxiliary Images"; }
_ZN8Box_irotC2Ev:
  897|  10.7k|  {
  898|  10.7k|    set_short_type(fourcc("irot"));
  899|  10.7k|  }
_ZNK8Box_irot14debug_box_nameEv:
  907|  7.18k|  const char* debug_box_name() const override { return "Image Rotation"; }
_ZNK8Box_irot24get_parse_error_fatalityEv:
  914|     69|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_imirC2Ev:
  930|  2.70k|  {
  931|  2.70k|    set_short_type(fourcc("imir"));
  932|  2.70k|  }
_ZNK8Box_imir14debug_box_nameEv:
  944|  1.76k|  const char* debug_box_name() const override { return "Image Mirroring"; }
_ZNK8Box_imir24get_parse_error_fatalityEv:
  946|    663|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_isclC2Ev:
  962|    677|  {
  963|    677|    set_short_type(fourcc("iscl"));
  964|    677|  }
_ZNK8Box_iscl14debug_box_nameEv:
  985|    338|  const char* debug_box_name() const override { return "Image Scaling"; }
_ZNK8Box_iscl24get_parse_error_fatalityEv:
  987|    292|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_clapC2Ev:
 1006|  4.68k|  {
 1007|  4.68k|    set_short_type(fourcc("clap"));
 1008|  4.68k|  }
_ZNK8Box_clap14debug_box_nameEv:
 1016|    379|  const char* debug_box_name() const override { return "Clean Aperture"; }
_ZNK8Box_clap24get_parse_error_fatalityEv:
 1044|  4.12k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_irefC2Ev:
 1063|  14.2k|  {
 1064|  14.2k|    set_short_type(fourcc("iref"));
 1065|  14.2k|  }
_ZNK8Box_iref14debug_box_nameEv:
 1078|  11.1k|  const char* debug_box_name() const override { return "Item Reference"; }
_ZN8Box_rrefC2Ev:
 1108|    783|  {
 1109|    783|    set_short_type(fourcc("rref"));
 1110|    783|  }
_ZNK8Box_rref14debug_box_nameEv:
 1116|    742|  const char* debug_box_name() const override { return "Required Reference Types"; }
_ZNK8Box_idat14debug_box_nameEv:
 1141|  5.78k|  const char* debug_box_name() const override { return "Item Data"; }
_ZN8Box_grplC2Ev:
 1174|  1.64k|  {
 1175|  1.64k|    set_short_type(fourcc("grpl"));
 1176|  1.64k|  }
_ZNK8Box_grpl14debug_box_nameEv:
 1180|  1.33k|  const char* debug_box_name() const override { return "Groups List"; }
_ZN8Box_sterC2Ev:
 1216|    516|  {
 1217|    516|    set_short_type(fourcc("ster"));
 1218|    516|  }
_ZNK8Box_ster14debug_box_nameEv:
 1222|    476|  const char* debug_box_name() const override { return "Stereo pair"; }
_ZN8Box_pymdC2Ev:
 1237|  1.54k|  {
 1238|  1.54k|    set_short_type(fourcc("pymd"));
 1239|  1.54k|  }
_ZNK8Box_pymd14debug_box_nameEv:
 1243|  1.16k|  const char* debug_box_name() const override { return "Image pyramid group"; }
_ZNK8Box_pymd24get_parse_error_fatalityEv:
 1266|    245|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_dinfC2Ev:
 1284|  7.28k|  {
 1285|  7.28k|    set_short_type(fourcc("dinf"));
 1286|  7.28k|  }
_ZNK8Box_dinf14debug_box_nameEv:
 1290|  6.47k|  const char* debug_box_name() const override { return "Data Information"; }
_ZN8Box_drefC2Ev:
 1301|  1.72k|  {
 1302|  1.72k|    set_short_type(fourcc("dref"));
 1303|  1.72k|  }
_ZNK8Box_dref14debug_box_nameEv:
 1307|  1.63k|  const char* debug_box_name() const override { return "Data Reference"; }
_ZN7Box_urlC2Ev:
 1320|  2.58k|  {
 1321|  2.58k|    set_short_type(fourcc("url "));
 1322|  2.58k|    set_flags(1);
 1323|  2.58k|  }
_ZNK7Box_url14debug_box_nameEv:
 1327|  2.50k|  const char* debug_box_name() const override { return "Data Entry URL"; }
_ZN8Box_pixiC2Ev:
 1347|  3.46k|  {
 1348|  3.46k|    set_short_type(fourcc("pixi"));
 1349|  3.46k|  }
_ZNK8Box_pixi14debug_box_nameEv:
 1368|  2.14k|  const char* debug_box_name() const override { return "Pixel Information"; }
_ZNK8Box_pixi24get_parse_error_fatalityEv:
 1372|    717|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_paspC2Ev:
 1386|  14.9k|  {
 1387|  14.9k|    set_short_type(fourcc("pasp"));
 1388|  14.9k|  }
_ZNK8Box_pasp14debug_box_nameEv:
 1395|  11.4k|  const char* debug_box_name() const override { return "Pixel Aspect Ratio"; }
_ZNK8Box_pasp24get_parse_error_fatalityEv:
 1399|    510|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_lselC2Ev:
 1410|  7.05k|  {
 1411|  7.05k|    set_short_type(fourcc("lsel"));
 1412|  7.05k|  }
_ZNK8Box_lsel14debug_box_nameEv:
 1418|  5.70k|  const char* debug_box_name() const override { return "Layer Selection"; }
_ZNK8Box_lsel24get_parse_error_fatalityEv:
 1422|    224|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_clliC2Ev:
 1433|  14.9k|  {
 1434|  14.9k|    set_short_type(fourcc("clli"));
 1435|       |
 1436|  14.9k|    clli.max_content_light_level = 0;
 1437|  14.9k|    clli.max_pic_average_light_level = 0;
 1438|  14.9k|  }
_ZNK8Box_clli14debug_box_nameEv:
 1444|  1.26k|  const char* debug_box_name() const override { return "Content Light Level Information"; }
_ZNK8Box_clli24get_parse_error_fatalityEv:
 1448|    130|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_mdcv14debug_box_nameEv:
 1464|  5.70k|  const char* debug_box_name() const override { return "Master Display Colour Volume"; }
_ZNK8Box_mdcv24get_parse_error_fatalityEv:
 1468|    504|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_amve14debug_box_nameEv:
 1484|    217|  const char* debug_box_name() const override { return "Ambient Viewing Environment"; }
_ZNK8Box_amve24get_parse_error_fatalityEv:
 1488|    407|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_ndwtC2Ev:
 1499|  10.1k|  {
 1500|  10.1k|    set_short_type(fourcc("ndwt"));
 1501|  10.1k|  }
_ZNK8Box_ndwt27get_diffuse_white_luminanceEv:
 1505|  5.78k|  uint32_t get_diffuse_white_luminance() const { return m_diffuse_white_luminance; }
_ZN8Box_ndwt27set_diffuse_white_luminanceEj:
 1507|  9.54k|  void set_diffuse_white_luminance(uint32_t luminance) { m_diffuse_white_luminance = luminance; }
_ZNK8Box_ndwt14debug_box_nameEv:
 1511|    533|  const char* debug_box_name() const override { return "Nominal Diffuse White"; }
_ZNK8Box_ndwt24get_parse_error_fatalityEv:
 1515|     73|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_cclv23ccv_primaries_are_validEv:
 1530|  12.8k|  bool ccv_primaries_are_valid() const { return m_ccv_primaries_valid; }
_ZNK8Box_cclv18get_ccv_primary_x0Ev:
 1531|    780|  int32_t get_ccv_primary_x0() const { return m_ccv_primaries_x[0]; }
_ZNK8Box_cclv18get_ccv_primary_y0Ev:
 1532|    780|  int32_t get_ccv_primary_y0() const { return m_ccv_primaries_y[0]; }
_ZNK8Box_cclv18get_ccv_primary_x1Ev:
 1533|    780|  int32_t get_ccv_primary_x1() const { return m_ccv_primaries_x[1]; }
_ZNK8Box_cclv18get_ccv_primary_y1Ev:
 1534|    780|  int32_t get_ccv_primary_y1() const { return m_ccv_primaries_y[1]; }
_ZNK8Box_cclv18get_ccv_primary_x2Ev:
 1535|    780|  int32_t get_ccv_primary_x2() const { return m_ccv_primaries_x[2]; }
_ZNK8Box_cclv18get_ccv_primary_y2Ev:
 1536|    780|  int32_t get_ccv_primary_y2() const { return m_ccv_primaries_y[2]; }
_ZNK8Box_cclv22min_luminance_is_validEv:
 1539|  12.8k|  bool min_luminance_is_valid() const { return m_ccv_min_luminance_value.has_value(); }
_ZNK8Box_cclv17get_min_luminanceEv:
 1540|  1.09k|  uint32_t get_min_luminance() const { return *m_ccv_min_luminance_value; }
_ZN8Box_cclv17set_min_luminanceEj:
 1541|  1.41k|  void set_min_luminance(uint32_t luminance) { m_ccv_min_luminance_value = luminance; }
_ZNK8Box_cclv22max_luminance_is_validEv:
 1543|  12.8k|  bool max_luminance_is_valid() const { return m_ccv_max_luminance_value.has_value(); }
_ZNK8Box_cclv17get_max_luminanceEv:
 1544|  2.53k|  uint32_t get_max_luminance() const { return *m_ccv_max_luminance_value; }
_ZN8Box_cclv17set_max_luminanceEj:
 1545|  3.89k|  void set_max_luminance(uint32_t luminance) { m_ccv_max_luminance_value = luminance; }
_ZNK8Box_cclv22avg_luminance_is_validEv:
 1547|  12.8k|  bool avg_luminance_is_valid() const { return m_ccv_avg_luminance_value.has_value(); }
_ZNK8Box_cclv17get_avg_luminanceEv:
 1548|  1.07k|  uint32_t get_avg_luminance() const { return *m_ccv_avg_luminance_value; }
_ZN8Box_cclv17set_avg_luminanceEj:
 1549|  1.36k|  void set_avg_luminance(uint32_t luminance) { m_ccv_avg_luminance_value = luminance; }
_ZN8Box_cminC2Ev:
 1577|  4.11k|  {
 1578|  4.11k|    set_short_type(fourcc("cmin"));
 1579|  4.11k|  }
_ZNK8Box_cmin14debug_box_nameEv:
 1634|  2.43k|  const char* debug_box_name() const override { return "Camera Intrinsic Matrix"; }
_ZNK8Box_cmin24get_parse_error_fatalityEv:
 1640|  1.04k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_cmexC2Ev:
 1659|  6.16k|  {
 1660|  6.16k|    set_short_type(fourcc("cmex"));
 1661|  6.16k|  }
_ZNK8Box_cmex14debug_box_nameEv:
 1691|  3.24k|  const char* debug_box_name() const override { return "Camera Extrinsic Matrix"; }
_ZNK8Box_cmex24get_parse_error_fatalityEv:
 1697|  2.02k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_udesC2Ev:
 1739|  1.84k|  {
 1740|  1.84k|    set_short_type(fourcc("udes"));
 1741|  1.84k|  }
_ZNK8Box_udes14debug_box_nameEv:
 1745|  1.56k|  const char* debug_box_name() const override { return "User Description"; }
_ZNK8Box_udes24get_parse_error_fatalityEv:
 1811|    191|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_taicC2Ev:
 1832|  1.47k|  {
 1833|  1.47k|    set_short_type(fourcc("taic"));
 1834|  1.47k|    initialize_heif_tai_clock_info(&m_info);
 1835|  1.47k|  }
_ZNK8Box_taic14debug_box_nameEv:
 1841|  1.36k|  const char* debug_box_name() const override { return "TAI Clock Information"; }
_ZN8Box_itaiC2Ev:
 1912|    526|  {
 1913|    526|    set_short_type(fourcc("itai"));
 1914|    526|    initialize_heif_tai_timestamp_packet(&m_timestamp);
 1915|    526|  }
_ZNK8Box_itai14debug_box_nameEv:
 1919|    499|  const char* debug_box_name() const override { return "Item TAI Timestamp"; }
_ZN19Box_gimi_content_idC2Ev:
 1977|  1.98k|  {
 1978|  1.98k|    set_uuid_type(std::vector<uint8_t>{0x26, 0x1e, 0xf3, 0x74, 0x1d, 0x97, 0x5b, 0xba, 0xac, 0xbd, 0x9d, 0x2c, 0x8e, 0xa7, 0x35, 0x22});
 1979|  1.98k|  }
_ZNK19Box_gimi_content_id14debug_box_nameEv:
 1987|  1.95k|  const char* debug_box_name() const override { return "GIMI Content ID"; }
_ZN8Box_elngC2Ev:
 2020|    648|  {
 2021|    648|    set_short_type(fourcc("elng"));
 2022|    648|  }
_ZNK8Box_elng14debug_box_nameEv:
 2026|    567|  const char* debug_box_name() const override { return "Extended language"; }
_ZNK8Box_elng24get_parse_error_fatalityEv:
 2046|     44|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN9BoxHeaderD2Ev:
  120|  1.07M|  virtual ~BoxHeader() = default;
_ZN3BoxC2Ev:
  185|   566k|  Box() = default;
_ZN8FractionC2Ev:
   66|  18.7k|  Fraction() = default;

_ZN8Box_avcC5parseER14BitstreamRangePK20heif_security_limits:
   35|  4.55k|{
   36|  4.55k|  m_configuration.configuration_version = range.read8();
   37|  4.55k|  m_configuration.AVCProfileIndication = range.read8();
   38|  4.55k|  m_configuration.profile_compatibility = range.read8();
   39|  4.55k|  m_configuration.AVCLevelIndication = range.read8();
   40|  4.55k|  uint8_t lengthSizeMinusOneWithReserved = range.read8();
   41|  4.55k|  m_configuration.lengthSize =
   42|  4.55k|      (lengthSizeMinusOneWithReserved & 0b00000011) + 1;
   43|       |
   44|  4.55k|  uint8_t numOfSequenceParameterSets = (range.read8() & 0b00011111);
   45|  7.07k|  for (int i = 0; i < numOfSequenceParameterSets; i++) {
  ------------------
  |  Branch (45:19): [True: 2.52k, False: 4.55k]
  ------------------
   46|  2.52k|    uint16_t sequenceParameterSetLength = range.read16();
   47|  2.52k|    std::vector<uint8_t> sps(sequenceParameterSetLength);
   48|  2.52k|    range.read(sps.data(), sps.size());
   49|  2.52k|    m_sps.push_back(sps);
   50|  2.52k|  }
   51|       |
   52|  4.55k|  uint8_t numOfPictureParameterSets = range.read8();
   53|  9.07k|  for (int i = 0; i < numOfPictureParameterSets; i++) {
  ------------------
  |  Branch (53:19): [True: 4.52k, False: 4.55k]
  ------------------
   54|  4.52k|    uint16_t pictureParameterSetLength = range.read16();
   55|  4.52k|    std::vector<uint8_t> pps(pictureParameterSetLength);
   56|  4.52k|    range.read(pps.data(), pps.size());
   57|  4.52k|    m_pps.push_back(pps);
   58|  4.52k|  }
   59|       |
   60|       |  // See ISO/IEC 14496-15 2017 Section 5.3.3.1.2
   61|  4.55k|  if (range.get_remaining_bytes() > 0) {
  ------------------
  |  Branch (61:7): [True: 1.55k, False: 2.99k]
  ------------------
   62|  1.55k|    if ((m_configuration.AVCProfileIndication != 66) &&
  ------------------
  |  Branch (62:9): [True: 1.41k, False: 143]
  ------------------
   63|  1.41k|        (m_configuration.AVCProfileIndication != 77) &&
  ------------------
  |  Branch (63:9): [True: 1.23k, False: 184]
  ------------------
   64|  1.23k|        (m_configuration.AVCProfileIndication != 88)) {
  ------------------
  |  Branch (64:9): [True: 1.12k, False: 111]
  ------------------
   65|  1.12k|      m_configuration.chroma_format = (heif_chroma) (range.read8() & 0b00000011);
   66|  1.12k|      m_configuration.bit_depth_luma = 8 + (range.read8() & 0b00000111);
   67|  1.12k|      m_configuration.bit_depth_chroma = 8 + (range.read8() & 0b00000111);
   68|  1.12k|      uint8_t numOfSequenceParameterSetExt = range.read8();
   69|  6.86k|      for (int i = 0; i < numOfSequenceParameterSetExt; i++) {
  ------------------
  |  Branch (69:23): [True: 5.74k, False: 1.12k]
  ------------------
   70|  5.74k|        uint16_t sequenceParameterSetExtLength = range.read16();
   71|  5.74k|        std::vector<uint8_t> sps_ext(sequenceParameterSetExtLength);
   72|  5.74k|        range.read(sps_ext.data(), sps_ext.size());
   73|  5.74k|        m_sps_ext.push_back(sps_ext);
   74|  5.74k|      }
   75|  1.12k|    }
   76|  1.55k|  }
   77|       |
   78|  4.55k|  return range.get_error();
   79|  4.55k|}
_ZNK8Box_avcC4dumpER6Indent:
  170|  4.26k|{
  171|  4.26k|  std::ostringstream sstr;
  172|  4.26k|  sstr << Box::dump(indent);
  173|  4.26k|  sstr << indent << "configuration_version: " << ((int) m_configuration.configuration_version) << "\n"
  174|  4.26k|      << indent << "AVCProfileIndication: " << ((int) m_configuration.AVCProfileIndication) << " (" << profileIndicationAsText() << ")\n"
  175|  4.26k|      << indent << "profile_compatibility: " << ((int) m_configuration.profile_compatibility) << "\n"
  176|  4.26k|      << indent << "AVCLevelIndication: " << ((int) m_configuration.AVCLevelIndication) << "\n"
  177|  4.26k|      << indent << "Chroma format: ";
  178|       |
  179|  4.26k|  switch (m_configuration.chroma_format) {
  180|    960|    case heif_chroma_monochrome:
  ------------------
  |  |   75|    960|#define heif_chroma_monochrome heif_chroma_planar
  ------------------
  |  Branch (180:5): [True: 960, False: 3.30k]
  ------------------
  181|    960|      sstr << "4:0:0\n";
  182|    960|      break;
  183|  3.23k|    case heif_chroma_420:
  ------------------
  |  Branch (183:5): [True: 3.23k, False: 1.03k]
  ------------------
  184|  3.23k|      sstr << "4:2:0\n";
  185|  3.23k|      break;
  186|     29|    case heif_chroma_422:
  ------------------
  |  Branch (186:5): [True: 29, False: 4.23k]
  ------------------
  187|     29|      sstr << "4:2:2\n";
  188|     29|      break;
  189|     47|    case heif_chroma_444:
  ------------------
  |  Branch (189:5): [True: 47, False: 4.22k]
  ------------------
  190|     47|      sstr << "4:4:4\n";
  191|     47|      break;
  192|      0|    default:
  ------------------
  |  Branch (192:5): [True: 0, False: 4.26k]
  ------------------
  193|      0|      sstr << "unsupported\n";
  194|      0|      break;
  195|  4.26k|  }
  196|       |
  197|  4.26k|  sstr << indent << "Bit depth luma: " << ((int) m_configuration.bit_depth_luma) << "\n"
  198|  4.26k|      << indent << "Bit depth chroma: " << ((int) m_configuration.bit_depth_chroma) << "\n";
  199|       |
  200|  4.26k|  for (const auto& sps : m_sps) {
  ------------------
  |  Branch (200:24): [True: 1.92k, False: 4.26k]
  ------------------
  201|  1.92k|    sstr << indent << "SPS: ";
  202|   618k|    for (uint8_t b : sps) {
  ------------------
  |  Branch (202:20): [True: 618k, False: 1.92k]
  ------------------
  203|   618k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  204|   618k|    }
  205|  1.92k|    sstr << "\n";
  206|  1.92k|    sstr << std::dec;
  207|  1.92k|  }
  208|       |
  209|  4.26k|  for (const auto& spsext : m_sps_ext) {
  ------------------
  |  Branch (209:27): [True: 2.55k, False: 4.26k]
  ------------------
  210|  2.55k|    sstr << indent << "SPS-EXT: ";
  211|  5.73k|    for (uint8_t b : spsext) {
  ------------------
  |  Branch (211:20): [True: 5.73k, False: 2.55k]
  ------------------
  212|  5.73k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  213|  5.73k|    }
  214|  2.55k|    sstr << "\n";
  215|  2.55k|    sstr << std::dec;
  216|  2.55k|  }
  217|       |
  218|  4.26k|  for (const auto& pps : m_pps) {
  ------------------
  |  Branch (218:24): [True: 2.03k, False: 4.26k]
  ------------------
  219|  2.03k|    sstr << indent << "PPS: ";
  220|   301k|    for (uint8_t b : pps) {
  ------------------
  |  Branch (220:20): [True: 301k, False: 2.03k]
  ------------------
  221|   301k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  222|   301k|    }
  223|  2.03k|    sstr << "\n";
  224|  2.03k|    sstr << std::dec;
  225|  2.03k|  }
  226|       |
  227|  4.26k|  return sstr.str();
  228|  4.26k|}
_ZNK8Box_avcC23profileIndicationAsTextEv:
  231|  4.26k|{
  232|       |  // See ISO/IEC 14496-10:2022 Annex A
  233|  4.26k|  switch (m_configuration.AVCProfileIndication) {
  234|    483|    case 44:
  ------------------
  |  Branch (234:5): [True: 483, False: 3.78k]
  ------------------
  235|    483|      return "CALVC 4:4:4";
  236|    391|    case 66:
  ------------------
  |  Branch (236:5): [True: 391, False: 3.87k]
  ------------------
  237|    391|      return "Constrained Baseline";
  238|  2.03k|    case 77:
  ------------------
  |  Branch (238:5): [True: 2.03k, False: 2.23k]
  ------------------
  239|  2.03k|      return "Main";
  240|    422|    case 88:
  ------------------
  |  Branch (240:5): [True: 422, False: 3.84k]
  ------------------
  241|    422|      return "Extended";
  242|    121|    case 100:
  ------------------
  |  Branch (242:5): [True: 121, False: 4.14k]
  ------------------
  243|    121|      return "High variant";
  244|     71|    case 110:
  ------------------
  |  Branch (244:5): [True: 71, False: 4.19k]
  ------------------
  245|     71|      return "High 10";
  246|    201|    case 122:
  ------------------
  |  Branch (246:5): [True: 201, False: 4.06k]
  ------------------
  247|    201|      return "High 4:2:2";
  248|    211|    case 244:
  ------------------
  |  Branch (248:5): [True: 211, False: 4.05k]
  ------------------
  249|    211|      return "High 4:4:4";
  250|    333|    default:
  ------------------
  |  Branch (250:5): [True: 333, False: 3.93k]
  ------------------
  251|    333|      return "Unknown";
  252|  4.26k|  }
  253|  4.26k|}

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

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

_ZN8Box_av1CC2Ev:
   45|  3.59k|  {
   46|  3.59k|    set_short_type(fourcc("av1C"));
   47|  3.59k|  }
_ZN8Box_av01C2Ev:
  122|    232|  {
  123|    232|    set_short_type(fourcc("av01"));
  124|    232|  }
_ZN8Box_a1opC2Ev:
  131|  17.1k|  {
  132|  17.1k|    set_short_type(fourcc("a1op"));
  133|  17.1k|  }
_ZN8Box_a1lxC2Ev:
  150|  6.83k|  {
  151|  6.83k|    set_short_type(fourcc("a1lx"));
  152|  6.83k|  }

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

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

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

_ZN8Box_j2kHC2Ev:
  314|  7.58k|    Box_j2kH() { set_short_type(fourcc("j2kH")); }
_ZN8Box_cdefC2Ev:
   57|  8.97k|    Box_cdef() { set_short_type(fourcc("cdef")); }
_ZN8Box_cmapC2Ev:
  141|  5.87k|    Box_cmap() { set_short_type(fourcc("cmap")); }
_ZN8Box_pclrC2Ev:
  186|  1.29k|    {
  187|  1.29k|        set_short_type(fourcc("pclr"));
  188|  1.29k|    }
_ZN8Box_j2kLC2Ev:
  269|    926|    Box_j2kL() { set_short_type(fourcc("j2kL")); }
_ZN8Box_j2kiC2Ev:
  527|     78|  {
  528|     78|    set_short_type(fourcc("j2ki"));
  529|     78|  }
_ZNK8Box_pclr15get_num_columnsEv:
  227|  1.17k|    {
  228|  1.17k|        return (uint8_t)(m_bitDepths.size());
  229|  1.17k|    }

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

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

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

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

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

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

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

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

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

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

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

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

_ZN8HeifFileC2Ev:
   66|  16.3k|{
   67|  16.3k|  m_file_layout = std::make_shared<FileLayout>();
   68|  16.3k|}
_ZN8HeifFileD2Ev:
   70|  16.3k|HeifFile::~HeifFile() = default;
_ZN8HeifFile14new_empty_fileEv:
  167|  16.3k|{
  168|       |  //m_input_stream.reset();
  169|  16.3k|  m_top_level_boxes.clear();
  170|       |
  171|  16.3k|  m_ftyp_box = std::make_shared<Box_ftyp>();
  172|  16.3k|  m_top_level_boxes.push_back(m_ftyp_box);
  173|  16.3k|}

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

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

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

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

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

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

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

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

_ZN8Box_mini5parseER14BitstreamRangePK20heif_security_limits:
   42|  13.8k|{
   43|  13.8k|  uint64_t start_offset = range.get_istream()->get_position();
   44|  13.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|  13.8k|  MemoryHandle mini_data_handle;
   50|  13.8k|  if (auto err = mini_data_handle.alloc(length, limits, "MinimizedImageBox payload")) {
  ------------------
  |  Branch (50:12): [True: 0, False: 13.8k]
  ------------------
   51|      0|    return err;
   52|      0|  }
   53|       |
   54|  13.8k|  std::vector<uint8_t> mini_data(length);
   55|  13.8k|  if (!range.read(mini_data.data(), mini_data.size())) {
  ------------------
  |  Branch (55:7): [True: 0, False: 13.8k]
  ------------------
   56|      0|    return range.get_error();
   57|      0|  }
   58|       |
   59|  13.8k|  BitReader bits(mini_data.data(), mini_data.size());
   60|       |
   61|  13.8k|  m_version = bits.get_bits8(2);
   62|  13.8k|  m_explicit_codec_types_flag = bits.get_flag();
   63|  13.8k|  m_float_flag = bits.get_flag();
   64|  13.8k|  m_full_range_flag = bits.get_flag();
   65|  13.8k|  m_alpha_flag = bits.get_flag();
   66|  13.8k|  m_explicit_cicp_flag = bits.get_flag();
   67|  13.8k|  m_hdr_flag = bits.get_flag();
   68|  13.8k|  m_icc_flag = bits.get_flag();
   69|  13.8k|  m_exif_flag = bits.get_flag();
   70|  13.8k|  m_xmp_flag = bits.get_flag();
   71|  13.8k|  m_chroma_subsampling = bits.get_bits8(2);
   72|  13.8k|  m_orientation = bits.get_bits8(3) + 1;
   73|       |
   74|  13.8k|  bool large_dimensions_flag = bits.get_flag();
   75|       |  // large_dimensions_flag = !large_dimensions_flag;  // HACK to get old behavior
   76|  13.8k|  m_width = 1 + bits.get_bits32(large_dimensions_flag ? 15 : 7);
  ------------------
  |  Branch (76:33): [True: 5.75k, False: 8.13k]
  ------------------
   77|  13.8k|  m_height = 1 + bits.get_bits32(large_dimensions_flag ? 15 : 7);
  ------------------
  |  Branch (77:34): [True: 5.75k, False: 8.13k]
  ------------------
   78|       |
   79|  13.8k|  if ((m_chroma_subsampling == 1) || (m_chroma_subsampling == 2))
  ------------------
  |  Branch (79:7): [True: 401, False: 13.4k]
  |  Branch (79:38): [True: 8.62k, False: 4.86k]
  ------------------
   80|  9.02k|  {
   81|  9.02k|    m_chroma_is_horizontally_centered = bits.get_flag();
   82|  9.02k|  }
   83|  13.8k|  if (m_chroma_subsampling == 1)
  ------------------
  |  Branch (83:7): [True: 401, False: 13.4k]
  ------------------
   84|    401|  {
   85|    401|    m_chroma_is_vertically_centered = bits.get_flag();
   86|    401|  }
   87|       |
   88|  13.8k|  bool high_bit_depth_flag = false;
   89|  13.8k|  if (m_float_flag)
  ------------------
  |  Branch (89:7): [True: 1.41k, False: 12.4k]
  ------------------
   90|  1.41k|  {
   91|  1.41k|    uint8_t bit_depth_log2 = bits.get_bits8(2) + 4; // [4;6] (7 is reserved)
   92|  1.41k|    if (bit_depth_log2 > 6) {
  ------------------
  |  Branch (92:9): [True: 4, False: 1.41k]
  ------------------
   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|  1.41k|    m_bit_depth = (uint8_t)powl(2, (bit_depth_log2)); // [16,32,64]
   98|  1.41k|  }
   99|  12.4k|  else
  100|  12.4k|  {
  101|  12.4k|    high_bit_depth_flag = bits.get_flag();
  102|  12.4k|    if (high_bit_depth_flag)
  ------------------
  |  Branch (102:9): [True: 5.98k, False: 6.48k]
  ------------------
  103|  5.98k|    {
  104|  5.98k|      m_bit_depth = bits.get_bits8(3) + 9; // [9;16]
  105|  5.98k|    }
  106|  12.4k|  }
  107|       |
  108|  13.8k|  if (m_alpha_flag)
  ------------------
  |  Branch (108:7): [True: 3.30k, False: 10.5k]
  ------------------
  109|  3.30k|  {
  110|  3.30k|    m_alpha_is_premultiplied = bits.get_flag();
  111|  3.30k|  }
  112|       |
  113|  13.8k|  if (m_explicit_cicp_flag)
  ------------------
  |  Branch (113:7): [True: 5.61k, False: 8.26k]
  ------------------
  114|  5.61k|  {
  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.61k|    m_colour_primaries = bits.get_bits8(8);
  120|  5.61k|    m_transfer_characteristics = bits.get_bits8(8);
  121|  5.61k|    m_matrix_coefficients = bits.get_bits8(8);
  122|  5.61k|  }
  123|  8.26k|  else
  124|  8.26k|  {
  125|  8.26k|    m_colour_primaries = m_icc_flag ? 2 : 1;
  ------------------
  |  Branch (125:26): [True: 1.44k, False: 6.82k]
  ------------------
  126|  8.26k|    m_transfer_characteristics = m_icc_flag ? 2 : 13;
  ------------------
  |  Branch (126:34): [True: 1.44k, False: 6.82k]
  ------------------
  127|  8.26k|    m_matrix_coefficients = (m_chroma_subsampling == 0) ? 2 : 6;
  ------------------
  |  Branch (127:29): [True: 1.77k, False: 6.49k]
  ------------------
  128|  8.26k|  }
  129|       |
  130|  13.8k|  if (m_explicit_codec_types_flag)
  ------------------
  |  Branch (130:7): [True: 6.42k, False: 7.45k]
  ------------------
  131|  6.42k|  {
  132|  6.42k|    m_infe_type = bits.get_bits32(32);
  133|  6.42k|    m_codec_config_type = bits.get_bits32(32);
  134|  6.42k|  }
  135|       |
  136|  13.8k|  if (m_hdr_flag)
  ------------------
  |  Branch (136:7): [True: 12.9k, False: 954]
  ------------------
  137|  12.9k|  {
  138|  12.9k|    m_gainmap_flag = bits.get_flag();
  139|  12.9k|    if (m_gainmap_flag)
  ------------------
  |  Branch (139:9): [True: 10.4k, False: 2.51k]
  ------------------
  140|  10.4k|    {
  141|  10.4k|      bool gainmap_dimension_same_as_main_item_flag = bits.get_flag();
  142|  10.4k|      if (gainmap_dimension_same_as_main_item_flag) {
  ------------------
  |  Branch (142:11): [True: 5.07k, False: 5.33k]
  ------------------
  143|  5.07k|        m_gainmap_width = m_width;
  144|  5.07k|        m_gainmap_height = m_height;
  145|  5.07k|      }
  146|  5.33k|      else {
  147|  5.33k|        m_gainmap_width = bits.get_bits32(large_dimensions_flag ? 15 : 7) + 1;
  ------------------
  |  Branch (147:43): [True: 1.04k, False: 4.29k]
  ------------------
  148|  5.33k|        m_gainmap_height = bits.get_bits32(large_dimensions_flag ? 15 : 7) + 1;
  ------------------
  |  Branch (148:44): [True: 1.04k, False: 4.29k]
  ------------------
  149|  5.33k|      }
  150|       |
  151|  10.4k|      m_gainmap_matrix_coefficients = bits.get_bits8(8);
  152|  10.4k|      m_gainmap_full_range_flag = bits.get_flag();
  153|  10.4k|      m_gainmap_chroma_subsampling = bits.get_bits8(2);
  154|  10.4k|      if ((m_gainmap_chroma_subsampling == 1) || (m_gainmap_chroma_subsampling == 2))
  ------------------
  |  Branch (154:11): [True: 5.85k, False: 4.55k]
  |  Branch (154:50): [True: 3.41k, False: 1.14k]
  ------------------
  155|  9.26k|      {
  156|  9.26k|        m_gainmap_chroma_is_horizontally_centred = bits.get_flag();
  157|  9.26k|      }
  158|  10.4k|      if (m_gainmap_chroma_subsampling == 1)
  ------------------
  |  Branch (158:11): [True: 5.85k, False: 4.55k]
  ------------------
  159|  5.85k|      {
  160|  5.85k|        m_gainmap_chroma_is_vertically_centred = bits.get_flag();
  161|  5.85k|      }
  162|       |
  163|  10.4k|      m_gainmap_float_flag = bits.get_flag();
  164|       |
  165|  10.4k|      bool gainmap_high_bit_depth_flag = false;
  166|  10.4k|      if (m_gainmap_float_flag)
  ------------------
  |  Branch (166:11): [True: 2.06k, False: 8.35k]
  ------------------
  167|  2.06k|      {
  168|  2.06k|        uint8_t bit_depth_log2 = bits.get_bits8(2) + 4;
  169|  2.06k|        if (bit_depth_log2 > 6) {
  ------------------
  |  Branch (169:13): [True: 5, False: 2.06k]
  ------------------
  170|      5|          return {heif_error_Invalid_input,
  171|      5|                  heif_suberror_Invalid_mini_box,
  172|      5|                  "Reserved float gainmap bit_depth_log2 value 7 in MinimizedImageBox"};
  173|      5|        }
  174|  2.06k|        m_gainmap_bit_depth = (uint8_t)powl(2, (bit_depth_log2));
  175|  2.06k|      }
  176|  8.35k|      else
  177|  8.35k|      {
  178|  8.35k|        gainmap_high_bit_depth_flag = bits.get_flag();
  179|  8.35k|        if (gainmap_high_bit_depth_flag)
  ------------------
  |  Branch (179:13): [True: 466, False: 7.88k]
  ------------------
  180|    466|        {
  181|    466|          m_gainmap_bit_depth = 9 + bits.get_bits8(3);
  182|    466|        }
  183|  8.35k|      }
  184|       |
  185|  10.4k|      m_tmap_icc_flag = bits.get_flag();
  186|  10.4k|      m_tmap_explicit_cicp_flag = bits.get_flag();
  187|  10.4k|      if (m_tmap_explicit_cicp_flag)
  ------------------
  |  Branch (187:11): [True: 3.85k, False: 6.55k]
  ------------------
  188|  3.85k|      {
  189|  3.85k|        m_tmap_colour_primaries = bits.get_bits8(8);
  190|  3.85k|        m_tmap_transfer_characteristics = bits.get_bits8(8);
  191|  3.85k|        m_tmap_matrix_coefficients = bits.get_bits8(8);
  192|  3.85k|        m_tmap_full_range_flag = bits.get_flag();
  193|  3.85k|      }
  194|  6.55k|      else
  195|  6.55k|      {
  196|  6.55k|        m_tmap_colour_primaries = 1;
  197|  6.55k|        m_tmap_transfer_characteristics = 13;
  198|  6.55k|        m_tmap_matrix_coefficients = 6;
  199|  6.55k|        m_tmap_full_range_flag = true;
  200|  6.55k|      }
  201|  10.4k|    }
  202|       |
  203|  12.9k|    bool clli_flag = bits.get_flag();
  204|  12.9k|    bool mdcv_flag = bits.get_flag();
  205|  12.9k|    bool cclv_flag = bits.get_flag();
  206|  12.9k|    bool amve_flag = bits.get_flag();
  207|  12.9k|    m_reve_flag = bits.get_flag();
  208|  12.9k|    bool ndwt_flag = bits.get_flag();
  209|       |
  210|  12.9k|    if (clli_flag)
  ------------------
  |  Branch (210:9): [True: 6.38k, False: 6.54k]
  ------------------
  211|  6.38k|    {
  212|  6.38k|      m_clli = std::make_shared<Box_clli>();
  213|  6.38k|      m_clli->clli.max_content_light_level = bits.get_bits16(16);
  214|  6.38k|      m_clli->clli.max_pic_average_light_level = bits.get_bits16(16);
  215|  6.38k|    }
  216|       |
  217|  12.9k|    if (mdcv_flag)
  ------------------
  |  Branch (217:9): [True: 1.44k, False: 11.4k]
  ------------------
  218|  1.44k|    {
  219|  1.44k|      m_mdcv = std::make_shared<Box_mdcv>();
  220|  5.76k|      for (int c = 0; c < 3; c++)
  ------------------
  |  Branch (220:23): [True: 4.32k, False: 1.44k]
  ------------------
  221|  4.32k|      {
  222|  4.32k|        m_mdcv->mdcv.display_primaries_x[c] = bits.get_bits16(16);
  223|  4.32k|        m_mdcv->mdcv.display_primaries_y[c] = bits.get_bits16(16);
  224|  4.32k|      }
  225|       |
  226|  1.44k|      m_mdcv->mdcv.white_point_x = bits.get_bits16(16);
  227|  1.44k|      m_mdcv->mdcv.white_point_y = bits.get_bits16(16);
  228|  1.44k|      m_mdcv->mdcv.max_display_mastering_luminance = bits.get_bits32(32);
  229|  1.44k|      m_mdcv->mdcv.min_display_mastering_luminance = bits.get_bits32(32);
  230|  1.44k|    }
  231|       |
  232|  12.9k|    if (cclv_flag)
  ------------------
  |  Branch (232:9): [True: 3.61k, False: 9.31k]
  ------------------
  233|  3.61k|    {
  234|  3.61k|      m_cclv = std::make_shared<Box_cclv>();
  235|  3.61k|      bits.skip_bits(2);
  236|  3.61k|      bool ccv_primaries_present_flag = bits.get_flag();
  237|  3.61k|      bool ccv_min_luminance_value_present_flag = bits.get_flag();
  238|  3.61k|      bool ccv_max_luminance_value_present_flag = bits.get_flag();
  239|  3.61k|      bool ccv_avg_luminance_value_present_flag = bits.get_flag();
  240|  3.61k|      bits.skip_bits(2);
  241|  3.61k|      if (ccv_primaries_present_flag)
  ------------------
  |  Branch (241:11): [True: 529, False: 3.08k]
  ------------------
  242|    529|      {
  243|    529|        int32_t x0 = bits.get_bits32s();
  244|    529|        int32_t y0 = bits.get_bits32s();
  245|    529|        int32_t x1 = bits.get_bits32s();
  246|    529|        int32_t y1 = bits.get_bits32s();
  247|    529|        int32_t x2 = bits.get_bits32s();
  248|    529|        int32_t y2 = bits.get_bits32s();
  249|    529|        m_cclv->set_primaries(x0, y0, x1, y1, x2, y2);
  250|    529|      }
  251|  3.61k|      if (ccv_min_luminance_value_present_flag)
  ------------------
  |  Branch (251:11): [True: 576, False: 3.03k]
  ------------------
  252|    576|      {
  253|    576|        m_cclv->set_min_luminance(bits.get_bits32(32));
  254|    576|      }
  255|  3.61k|      if (ccv_max_luminance_value_present_flag)
  ------------------
  |  Branch (255:11): [True: 3.04k, False: 563]
  ------------------
  256|  3.04k|      {
  257|  3.04k|        m_cclv->set_max_luminance(bits.get_bits32(32));
  258|  3.04k|      }
  259|  3.61k|      if (ccv_avg_luminance_value_present_flag)
  ------------------
  |  Branch (259:11): [True: 536, False: 3.07k]
  ------------------
  260|    536|      {
  261|    536|        m_cclv->set_avg_luminance(bits.get_bits32(32));
  262|    536|      }
  263|  3.61k|    }
  264|       |
  265|  12.9k|    if (amve_flag)
  ------------------
  |  Branch (265:9): [True: 552, False: 12.3k]
  ------------------
  266|    552|    {
  267|    552|      m_amve = std::make_shared<Box_amve>();
  268|    552|      m_amve->amve.ambient_illumination = bits.get_bits32(32);
  269|    552|      m_amve->amve.ambient_light_x = bits.get_bits16(16);
  270|    552|      m_amve->amve.ambient_light_y = bits.get_bits16(16);
  271|    552|    }
  272|       |
  273|  12.9k|    if (m_reve_flag)
  ------------------
  |  Branch (273:9): [True: 3.63k, False: 9.29k]
  ------------------
  274|  3.63k|    {
  275|       |      // TODO: ReferenceViewingEnvironment isn't published yet
  276|  3.63k|      bits.skip_bits(32);
  277|  3.63k|      bits.skip_bits(16);
  278|  3.63k|      bits.skip_bits(16);
  279|  3.63k|      bits.skip_bits(32);
  280|  3.63k|      bits.skip_bits(16);
  281|  3.63k|      bits.skip_bits(16);
  282|  3.63k|    }
  283|       |
  284|  12.9k|    if (ndwt_flag)
  ------------------
  |  Branch (284:9): [True: 6.41k, False: 6.51k]
  ------------------
  285|  6.41k|    {
  286|  6.41k|      m_ndwt = std::make_shared<Box_ndwt>();
  287|  6.41k|      m_ndwt->set_diffuse_white_luminance(bits.get_bits32(32));
  288|  6.41k|    }
  289|       |
  290|  12.9k|    if (m_gainmap_flag)
  ------------------
  |  Branch (290:9): [True: 10.4k, False: 2.51k]
  ------------------
  291|  10.4k|    {
  292|  10.4k|      bool tmap_clli_flag = bits.get_flag();
  293|  10.4k|      bool tmap_mdcv_flag = bits.get_flag();
  294|  10.4k|      bool tmap_cclv_flag = bits.get_flag();
  295|  10.4k|      bool tmap_amve_flag = bits.get_flag();
  296|  10.4k|      m_tmap_reve_flag = bits.get_flag();
  297|  10.4k|      bool tmap_ndwt_flag = bits.get_flag();
  298|       |
  299|  10.4k|      if (tmap_clli_flag)
  ------------------
  |  Branch (299:11): [True: 7.06k, False: 3.34k]
  ------------------
  300|  7.06k|      {
  301|  7.06k|        m_tmap_clli = std::make_shared<Box_clli>();
  302|  7.06k|        m_tmap_clli->clli.max_content_light_level = (uint16_t)bits.get_bits32(16);
  303|  7.06k|        m_tmap_clli->clli.max_pic_average_light_level = (uint16_t)bits.get_bits32(16);
  304|  7.06k|      }
  305|       |
  306|  10.4k|      if (tmap_mdcv_flag)
  ------------------
  |  Branch (306:11): [True: 4.33k, False: 6.07k]
  ------------------
  307|  4.33k|      {
  308|  4.33k|        m_tmap_mdcv = std::make_shared<Box_mdcv>();
  309|  17.3k|        for (int c = 0; c < 3; c++)
  ------------------
  |  Branch (309:25): [True: 13.0k, False: 4.33k]
  ------------------
  310|  13.0k|        {
  311|  13.0k|          m_tmap_mdcv->mdcv.display_primaries_x[c] = bits.get_bits16(16);
  312|  13.0k|          m_tmap_mdcv->mdcv.display_primaries_y[c] = bits.get_bits16(16);
  313|  13.0k|        }
  314|       |
  315|  4.33k|        m_tmap_mdcv->mdcv.white_point_x = bits.get_bits16(16);
  316|  4.33k|        m_tmap_mdcv->mdcv.white_point_y = bits.get_bits16(16);
  317|  4.33k|        m_tmap_mdcv->mdcv.max_display_mastering_luminance = bits.get_bits32(32);
  318|  4.33k|        m_tmap_mdcv->mdcv.min_display_mastering_luminance = bits.get_bits32(32);
  319|  4.33k|      }
  320|       |
  321|  10.4k|      if (tmap_cclv_flag)
  ------------------
  |  Branch (321:11): [True: 6.72k, False: 3.68k]
  ------------------
  322|  6.72k|      {
  323|  6.72k|        m_tmap_cclv = std::make_shared<Box_cclv>();
  324|  6.72k|        bits.skip_bits(2); // skip ccv_cancel_flag and ccv_persistence_flag
  325|  6.72k|        bool ccv_primaries_present_flag = bits.get_flag();
  326|  6.72k|        bool ccv_min_luminance_value_present_flag = bits.get_flag();
  327|  6.72k|        bool ccv_max_luminance_value_present_flag = bits.get_flag();
  328|  6.72k|        bool ccv_avg_luminance_value_present_flag = bits.get_flag();
  329|  6.72k|        bits.skip_bits(2);
  330|  6.72k|        if (ccv_primaries_present_flag)
  ------------------
  |  Branch (330:13): [True: 578, False: 6.14k]
  ------------------
  331|    578|        {
  332|    578|          int32_t x0 = bits.get_bits32s();
  333|    578|          int32_t y0 = bits.get_bits32s();
  334|    578|          int32_t x1 = bits.get_bits32s();
  335|    578|          int32_t y1 = bits.get_bits32s();
  336|    578|          int32_t x2 = bits.get_bits32s();
  337|    578|          int32_t y2 = bits.get_bits32s();
  338|    578|          m_tmap_cclv->set_primaries(x0, y0, x1, y1, x2, y2);
  339|    578|        }
  340|  6.72k|        if (ccv_min_luminance_value_present_flag)
  ------------------
  |  Branch (340:13): [True: 835, False: 5.89k]
  ------------------
  341|    835|        {
  342|    835|          m_tmap_cclv->set_min_luminance(bits.get_bits32(32));
  343|    835|        }
  344|  6.72k|        if (ccv_max_luminance_value_present_flag)
  ------------------
  |  Branch (344:13): [True: 852, False: 5.87k]
  ------------------
  345|    852|        {
  346|    852|          m_tmap_cclv->set_max_luminance(bits.get_bits32(32));
  347|    852|        }
  348|  6.72k|        if (ccv_avg_luminance_value_present_flag)
  ------------------
  |  Branch (348:13): [True: 829, False: 5.89k]
  ------------------
  349|    829|        {
  350|    829|          m_tmap_cclv->set_avg_luminance(bits.get_bits32(32));
  351|    829|        }
  352|  6.72k|      }
  353|       |
  354|  10.4k|      if (tmap_amve_flag)
  ------------------
  |  Branch (354:11): [True: 6.02k, False: 4.38k]
  ------------------
  355|  6.02k|      {
  356|  6.02k|        m_tmap_amve = std::make_shared<Box_amve>();
  357|  6.02k|        m_tmap_amve->amve.ambient_illumination = bits.get_bits32(32);
  358|  6.02k|        m_tmap_amve->amve.ambient_light_x = bits.get_bits16(16);
  359|  6.02k|        m_tmap_amve->amve.ambient_light_y = bits.get_bits16(16);
  360|  6.02k|      }
  361|       |
  362|  10.4k|      if (m_tmap_reve_flag)
  ------------------
  |  Branch (362:11): [True: 1.47k, False: 8.93k]
  ------------------
  363|  1.47k|      {
  364|       |        // TODO: ReferenceViewingEnvironment isn't published yet
  365|  1.47k|        bits.skip_bits(32);
  366|  1.47k|        bits.skip_bits(16);
  367|  1.47k|        bits.skip_bits(16);
  368|  1.47k|        bits.skip_bits(32);
  369|  1.47k|        bits.skip_bits(16);
  370|  1.47k|        bits.skip_bits(16);
  371|  1.47k|      }
  372|       |
  373|  10.4k|      if (tmap_ndwt_flag)
  ------------------
  |  Branch (373:11): [True: 3.12k, False: 7.28k]
  ------------------
  374|  3.12k|      {
  375|  3.12k|        m_tmap_ndwt = std::make_shared<Box_ndwt>();
  376|  3.12k|        m_tmap_ndwt->set_diffuse_white_luminance(bits.get_bits32(32));
  377|  3.12k|      }
  378|  10.4k|    }
  379|  12.9k|  }
  380|       |
  381|       |  // Chunk sizes
  382|  13.8k|  bool large_metadata_flag = false;
  383|  13.8k|  if (m_icc_flag || m_exif_flag || m_xmp_flag || (m_hdr_flag && m_gainmap_flag))
  ------------------
  |  Branch (383:7): [True: 5.06k, False: 8.81k]
  |  Branch (383:21): [True: 1.00k, False: 7.80k]
  |  Branch (383:36): [True: 3.90k, False: 3.89k]
  |  Branch (383:51): [True: 3.34k, False: 558]
  |  Branch (383:65): [True: 2.36k, False: 972]
  ------------------
  384|  12.3k|  {
  385|  12.3k|    large_metadata_flag = bits.get_flag();
  386|  12.3k|  }
  387|       |
  388|  13.8k|  bool large_codec_config_flag = bits.get_flag();
  389|  13.8k|  bool large_item_data_flag = bits.get_flag();
  390|       |
  391|  13.8k|  uint32_t icc_data_size = 0;
  392|  13.8k|  if (m_icc_flag)
  ------------------
  |  Branch (392:7): [True: 5.06k, False: 8.81k]
  ------------------
  393|  5.06k|  {
  394|  5.06k|    icc_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (394:37): [True: 15, False: 5.05k]
  ------------------
  395|  5.06k|  }
  396|       |
  397|  13.8k|  uint32_t tmap_icc_data_size = 0;
  398|  13.8k|  if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag)
  ------------------
  |  Branch (398:7): [True: 12.9k, False: 954]
  |  Branch (398:21): [True: 10.4k, False: 2.51k]
  |  Branch (398:39): [True: 1.07k, False: 9.33k]
  ------------------
  399|  1.07k|  {
  400|  1.07k|    tmap_icc_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (400:42): [True: 501, False: 571]
  ------------------
  401|  1.07k|  }
  402|       |
  403|  13.8k|  uint32_t gainmap_metadata_size = 0;
  404|  13.8k|  if (m_hdr_flag && m_gainmap_flag)
  ------------------
  |  Branch (404:7): [True: 12.9k, False: 954]
  |  Branch (404:21): [True: 10.4k, False: 2.51k]
  ------------------
  405|  10.4k|  {
  406|  10.4k|    gainmap_metadata_size = bits.get_bits32(large_metadata_flag ? 20 : 10);
  ------------------
  |  Branch (406:45): [True: 513, False: 9.89k]
  ------------------
  407|  10.4k|  }
  408|       |
  409|  13.8k|  if (m_hdr_flag && m_gainmap_flag)
  ------------------
  |  Branch (409:7): [True: 12.9k, False: 954]
  |  Branch (409:21): [True: 10.4k, False: 2.51k]
  ------------------
  410|  10.4k|  {
  411|  10.4k|    m_gainmap_item_data_size = bits.get_bits32(large_item_data_flag ? 28 : 15);
  ------------------
  |  Branch (411:48): [True: 29, False: 10.3k]
  ------------------
  412|  10.4k|  }
  413|       |
  414|  13.8k|  uint32_t gainmap_item_codec_config_size = 0;
  415|  13.8k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0)
  ------------------
  |  Branch (415:7): [True: 12.9k, False: 954]
  |  Branch (415:21): [True: 10.4k, False: 2.51k]
  |  Branch (415:39): [True: 454, False: 9.95k]
  ------------------
  416|    454|  {
  417|    454|    gainmap_item_codec_config_size = bits.get_bits32(large_codec_config_flag ? 12 : 3);
  ------------------
  |  Branch (417:54): [True: 32, False: 422]
  ------------------
  418|    454|  }
  419|       |
  420|  13.8k|  uint32_t main_item_codec_config_size = bits.get_bits32(large_codec_config_flag ? 12 : 3);
  ------------------
  |  Branch (420:58): [True: 608, False: 13.2k]
  ------------------
  421|  13.8k|  m_main_item_data_size = bits.get_bits32(large_item_data_flag ? 28 : 15) + 1;
  ------------------
  |  Branch (421:43): [True: 92, False: 13.7k]
  ------------------
  422|       |
  423|  13.8k|  if (m_alpha_flag)
  ------------------
  |  Branch (423:7): [True: 3.29k, False: 10.5k]
  ------------------
  424|  3.29k|  {
  425|  3.29k|    m_alpha_item_data_size = bits.get_bits32(large_item_data_flag ? 28 : 15);
  ------------------
  |  Branch (425:46): [True: 37, False: 3.26k]
  ------------------
  426|  3.29k|  }
  427|       |
  428|  13.8k|  uint32_t alpha_item_codec_config_size = 0;
  429|  13.8k|  if (m_alpha_flag && m_alpha_item_data_size > 0)
  ------------------
  |  Branch (429:7): [True: 3.29k, False: 10.5k]
  |  Branch (429:23): [True: 331, False: 2.96k]
  ------------------
  430|    331|  {
  431|    331|    alpha_item_codec_config_size = bits.get_bits32(large_codec_config_flag ? 12 : 3);
  ------------------
  |  Branch (431:52): [True: 22, False: 309]
  ------------------
  432|    331|  }
  433|       |
  434|  13.8k|  if (m_exif_flag || m_xmp_flag)
  ------------------
  |  Branch (434:7): [True: 4.33k, False: 9.54k]
  |  Branch (434:22): [True: 4.52k, False: 5.01k]
  ------------------
  435|  8.86k|  {
  436|  8.86k|    m_exif_xmp_compressed_flag = bits.get_flag();
  437|  8.86k|  }
  438|       |
  439|  13.8k|  if (m_exif_flag)
  ------------------
  |  Branch (439:7): [True: 4.33k, False: 9.54k]
  ------------------
  440|  4.33k|  {
  441|  4.33k|    m_exif_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (441:40): [True: 9, False: 4.32k]
  ------------------
  442|  4.33k|  }
  443|  13.8k|  if (m_xmp_flag)
  ------------------
  |  Branch (443:7): [True: 8.63k, False: 5.24k]
  ------------------
  444|  8.63k|  {
  445|  8.63k|    m_xmp_data_size = bits.get_bits32(large_metadata_flag ? 20 : 10) + 1;
  ------------------
  |  Branch (445:39): [True: 510, False: 8.12k]
  ------------------
  446|  8.63k|  }
  447|       |
  448|  13.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|  13.8k|  {
  455|  13.8k|    uint64_t required_bytes = (uint64_t) main_item_codec_config_size + m_main_item_data_size;
  456|  13.8k|    if (m_alpha_flag && m_alpha_item_data_size > 0) {
  ------------------
  |  Branch (456:9): [True: 3.29k, False: 10.5k]
  |  Branch (456:25): [True: 331, False: 2.96k]
  ------------------
  457|    331|      required_bytes += alpha_item_codec_config_size;
  458|    331|      required_bytes += m_alpha_item_data_size;
  459|    331|    }
  460|  13.8k|    if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0) {
  ------------------
  |  Branch (460:9): [True: 12.9k, False: 954]
  |  Branch (460:23): [True: 10.4k, False: 2.51k]
  |  Branch (460:41): [True: 454, False: 9.95k]
  ------------------
  461|    454|      required_bytes += gainmap_item_codec_config_size;
  462|    454|      required_bytes += m_gainmap_item_data_size;
  463|    454|    }
  464|  13.8k|    if (m_icc_flag) required_bytes += icc_data_size;
  ------------------
  |  Branch (464:9): [True: 5.06k, False: 8.81k]
  ------------------
  465|  13.8k|    if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag) required_bytes += tmap_icc_data_size;
  ------------------
  |  Branch (465:9): [True: 12.9k, False: 954]
  |  Branch (465:23): [True: 10.4k, False: 2.51k]
  |  Branch (465:41): [True: 1.07k, False: 9.33k]
  ------------------
  466|  13.8k|    if (m_hdr_flag && m_gainmap_flag) required_bytes += gainmap_metadata_size;
  ------------------
  |  Branch (466:9): [True: 12.9k, False: 954]
  |  Branch (466:23): [True: 10.4k, False: 2.51k]
  ------------------
  467|  13.8k|    if (m_exif_flag) required_bytes += m_exif_data_size;
  ------------------
  |  Branch (467:9): [True: 4.33k, False: 9.54k]
  ------------------
  468|  13.8k|    if (m_xmp_flag) required_bytes += m_xmp_data_size;
  ------------------
  |  Branch (468:9): [True: 8.63k, False: 5.24k]
  ------------------
  469|       |
  470|  13.8k|    int64_t remaining_bits = bits.get_bits_remaining();
  471|  13.8k|    if (remaining_bits < 0 || required_bytes > (uint64_t) remaining_bits / 8) {
  ------------------
  |  Branch (471:9): [True: 267, False: 13.6k]
  |  Branch (471:31): [True: 111, False: 13.5k]
  ------------------
  472|    378|      return {heif_error_Invalid_input,
  473|    378|              heif_suberror_Invalid_mini_box,
  474|    378|              "Declared chunk sizes in MinimizedImageBox exceed available payload."};
  475|    378|    }
  476|  13.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|  13.5k|  if (limits && limits->max_color_profile_size) {
  ------------------
  |  Branch (480:7): [True: 13.5k, False: 0]
  |  Branch (480:17): [True: 13.5k, False: 0]
  ------------------
  481|  13.5k|    if (m_icc_flag && icc_data_size > limits->max_color_profile_size) {
  ------------------
  |  Branch (481:9): [True: 4.98k, False: 8.51k]
  |  Branch (481:23): [True: 0, False: 4.98k]
  ------------------
  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|  13.5k|    if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag &&
  ------------------
  |  Branch (486:9): [True: 12.6k, False: 876]
  |  Branch (486:23): [True: 10.2k, False: 2.36k]
  |  Branch (486:41): [True: 1.00k, False: 9.25k]
  ------------------
  487|  1.00k|        tmap_icc_data_size > limits->max_color_profile_size) {
  ------------------
  |  Branch (487:9): [True: 0, False: 1.00k]
  ------------------
  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|  13.5k|  }
  493|       |
  494|  13.5k|  if (main_item_codec_config_size > 0)
  ------------------
  |  Branch (494:7): [True: 286, False: 13.2k]
  ------------------
  495|    286|  {
  496|    286|    m_main_item_codec_config = bits.read_bytes(main_item_codec_config_size);
  497|    286|  }
  498|       |
  499|       |  // Chunks
  500|  13.5k|  if (m_alpha_flag && m_alpha_item_data_size > 0) {
  ------------------
  |  Branch (500:7): [True: 3.16k, False: 10.3k]
  |  Branch (500:23): [True: 282, False: 2.88k]
  ------------------
  501|    282|    if (alpha_item_codec_config_size == 0) {
  ------------------
  |  Branch (501:9): [True: 131, False: 151]
  ------------------
  502|    131|      m_alpha_item_codec_config = m_main_item_codec_config;
  503|    131|    }
  504|    151|    else {
  505|       |      // TODO: should we have a flag indicating that we have explicit config for alpha?
  506|    151|      m_alpha_item_codec_config = bits.read_bytes(alpha_item_codec_config_size);
  507|    151|    }
  508|    282|  }
  509|       |
  510|  13.5k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0)
  ------------------
  |  Branch (510:7): [True: 12.6k, False: 876]
  |  Branch (510:21): [True: 10.2k, False: 2.36k]
  |  Branch (510:39): [True: 400, False: 9.85k]
  ------------------
  511|    400|  {
  512|    400|    if (gainmap_item_codec_config_size == 0) {
  ------------------
  |  Branch (512:9): [True: 114, False: 286]
  ------------------
  513|    114|      m_gainmap_item_codec_config = m_main_item_codec_config;
  514|    114|    }
  515|    286|    else {
  516|       |      // TODO: should we have a flag indicating that we have explicit config for the gain map?
  517|    286|      m_gainmap_item_codec_config = bits.read_bytes(gainmap_item_codec_config_size);
  518|    286|    }
  519|    400|  }
  520|       |
  521|  13.5k|  if (m_icc_flag)
  ------------------
  |  Branch (521:7): [True: 4.98k, False: 8.51k]
  ------------------
  522|  4.98k|  {
  523|  4.98k|    m_icc_data = bits.read_bytes(icc_data_size);
  524|  4.98k|  }
  525|       |
  526|  13.5k|  if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag)
  ------------------
  |  Branch (526:7): [True: 12.6k, False: 876]
  |  Branch (526:21): [True: 10.2k, False: 2.36k]
  |  Branch (526:39): [True: 1.00k, False: 9.25k]
  ------------------
  527|  1.00k|  {
  528|  1.00k|    m_tmap_icc_data = bits.read_bytes(tmap_icc_data_size);
  529|  1.00k|  }
  530|       |
  531|  13.5k|  if (m_hdr_flag && m_gainmap_flag && gainmap_metadata_size > 0)
  ------------------
  |  Branch (531:7): [True: 12.6k, False: 876]
  |  Branch (531:21): [True: 10.2k, False: 2.36k]
  |  Branch (531:39): [True: 170, False: 10.0k]
  ------------------
  532|    170|  {
  533|    170|    m_gainmap_metadata = bits.read_bytes(gainmap_metadata_size);
  534|    170|  }
  535|       |
  536|  13.5k|  if (m_alpha_flag && m_alpha_item_data_size > 0)
  ------------------
  |  Branch (536:7): [True: 3.16k, False: 10.3k]
  |  Branch (536:23): [True: 282, False: 2.88k]
  ------------------
  537|    282|  {
  538|    282|    m_alpha_item_data_offset = bits.get_current_byte_index() + start_offset;
  539|    282|    bits.skip_bytes(m_alpha_item_data_size);
  540|    282|  }
  541|  13.5k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_data_size > 0)
  ------------------
  |  Branch (541:7): [True: 12.6k, False: 876]
  |  Branch (541:21): [True: 10.2k, False: 2.36k]
  |  Branch (541:39): [True: 400, False: 9.85k]
  ------------------
  542|    400|  {
  543|    400|    m_gainmap_item_data_offset = bits.get_current_byte_index() + start_offset;
  544|    400|    bits.skip_bytes(m_gainmap_item_data_size);
  545|    400|  }
  546|       |
  547|  13.5k|  m_main_item_data_offset = bits.get_current_byte_index() + start_offset;
  548|  13.5k|  bits.skip_bytes(m_main_item_data_size);
  549|       |
  550|  13.5k|  if (m_exif_flag)
  ------------------
  |  Branch (550:7): [True: 4.24k, False: 9.25k]
  ------------------
  551|  4.24k|  {
  552|  4.24k|    m_exif_item_data_offset = bits.get_current_byte_index() + start_offset;
  553|  4.24k|    bits.skip_bytes(m_exif_data_size);
  554|  4.24k|  }
  555|  13.5k|  if (m_xmp_flag)
  ------------------
  |  Branch (555:7): [True: 8.49k, False: 5.00k]
  ------------------
  556|  8.49k|  {
  557|  8.49k|    m_xmp_item_data_offset = bits.get_current_byte_index() + start_offset;
  558|  8.49k|    bits.skip_bytes(m_xmp_data_size);
  559|  8.49k|  }
  560|       |
  561|  13.5k|  return range.get_error();
  562|  13.5k|}
_ZNK8Box_mini4dumpER6Indent:
  565|  9.86k|{
  566|  9.86k|  std::ostringstream sstr;
  567|  9.86k|  sstr << Box::dump(indent);
  568|  9.86k|  sstr << indent << "version: " << (int)m_version << "\n";
  569|       |
  570|  9.86k|  sstr << indent << "explicit_codec_types_flag: " << m_explicit_codec_types_flag << "\n";
  571|  9.86k|  sstr << indent << "float_flag: " << m_float_flag << "\n";
  572|  9.86k|  sstr << indent << "full_range_flag: " << m_full_range_flag << "\n";
  573|  9.86k|  sstr << indent << "alpha_flag: " << m_alpha_flag << "\n";
  574|  9.86k|  sstr << indent << "explicit_cicp_flag: " << m_explicit_cicp_flag << "\n";
  575|  9.86k|  sstr << indent << "hdr_flag: " << m_hdr_flag << "\n";
  576|  9.86k|  sstr << indent << "icc_flag: " << m_icc_flag << "\n";
  577|  9.86k|  sstr << indent << "exif_flag: " << m_exif_flag << "\n";
  578|  9.86k|  sstr << indent << "xmp_flag: " << m_xmp_flag << "\n";
  579|       |
  580|  9.86k|  sstr << indent << "chroma_subsampling: " << (int)m_chroma_subsampling << "\n";
  581|  9.86k|  sstr << indent << "orientation: " << (int)m_orientation << "\n";
  582|       |
  583|  9.86k|  sstr << indent << "width: " << m_width << "\n";
  584|  9.86k|  sstr << indent << "height: " << m_height << "\n";
  585|       |
  586|  9.86k|  if ((m_chroma_subsampling == 1) || (m_chroma_subsampling == 2))
  ------------------
  |  Branch (586:7): [True: 349, False: 9.51k]
  |  Branch (586:38): [True: 5.71k, False: 3.80k]
  ------------------
  587|  6.06k|  {
  588|  6.06k|    sstr << indent << "chroma_is_horizontally_centered: " << m_chroma_is_horizontally_centered << "\n";
  589|  6.06k|  }
  590|  9.86k|  if (m_chroma_subsampling == 1)
  ------------------
  |  Branch (590:7): [True: 349, False: 9.51k]
  ------------------
  591|    349|  {
  592|    349|    sstr << indent << "chroma_is_vertically_centered: " << m_chroma_is_vertically_centered << "\n";
  593|    349|  }
  594|       |
  595|  9.86k|  sstr << "bit_depth: " << (int)m_bit_depth << "\n";
  596|       |
  597|  9.86k|  if (m_alpha_flag)
  ------------------
  |  Branch (597:7): [True: 3.05k, False: 6.81k]
  ------------------
  598|  3.05k|  {
  599|  3.05k|    sstr << "alpha_is_premultiplied: " << m_alpha_is_premultiplied << "\n";
  600|  3.05k|  }
  601|       |
  602|  9.86k|  sstr << "colour_primaries: " << (int)m_colour_primaries << "\n";
  603|  9.86k|  sstr << "transfer_characteristics: " << (int)m_transfer_characteristics << "\n";
  604|  9.86k|  sstr << "matrix_coefficients: " << (int)m_matrix_coefficients << "\n";
  605|       |
  606|  9.86k|  if (m_explicit_codec_types_flag)
  ------------------
  |  Branch (606:7): [True: 4.62k, False: 5.23k]
  ------------------
  607|  4.62k|  {
  608|  4.62k|    sstr << "infe_type: " << fourcc_to_string(m_infe_type) << " (" << m_infe_type << ")" << "\n";
  609|  4.62k|    sstr << "codec_config_type: " << fourcc_to_string(m_codec_config_type) << " (" << m_codec_config_type << ")" << "\n";
  610|  4.62k|  }
  611|       |
  612|  9.86k|  if (m_hdr_flag)
  ------------------
  |  Branch (612:7): [True: 8.98k, False: 876]
  ------------------
  613|  8.98k|  {
  614|  8.98k|    sstr << indent << "gainmap_flag: " << m_gainmap_flag << "\n";
  615|  8.98k|    if (m_gainmap_flag)
  ------------------
  |  Branch (615:9): [True: 6.95k, False: 2.03k]
  ------------------
  616|  6.95k|    {
  617|  6.95k|      sstr << indent << "gainmap_width: " << m_gainmap_width << "\n";
  618|  6.95k|      sstr << indent << "gainmap_height: " << m_gainmap_height << "\n";
  619|  6.95k|      sstr << indent << "gainmap_matrix_coefficients: " << (int)m_gainmap_matrix_coefficients << "\n";
  620|  6.95k|      sstr << indent << "gainmap_full_range_flag: " << m_gainmap_full_range_flag << "\n";
  621|  6.95k|      sstr << indent << "gainmap_chroma_subsampling: " << (int)m_gainmap_chroma_subsampling << "\n";
  622|  6.95k|      if ((m_gainmap_chroma_subsampling == 1) || (m_gainmap_chroma_subsampling == 2))
  ------------------
  |  Branch (622:11): [True: 3.73k, False: 3.21k]
  |  Branch (622:50): [True: 2.21k, False: 999]
  ------------------
  623|  5.95k|      {
  624|  5.95k|        sstr << indent << "gainmap_chroma_is_horizontally_centred: " << m_gainmap_chroma_is_horizontally_centred << "\n";
  625|  5.95k|      }
  626|  6.95k|      if (m_gainmap_chroma_subsampling == 1)
  ------------------
  |  Branch (626:11): [True: 3.73k, False: 3.21k]
  ------------------
  627|  3.73k|      {
  628|  3.73k|        sstr << indent << "gainmap_chroma_is_vertically_centred: " << m_gainmap_chroma_is_vertically_centred << "\n";
  629|  3.73k|      }
  630|  6.95k|      sstr << indent << "gainmap_float_flag: " << m_gainmap_float_flag << "\n";
  631|  6.95k|      sstr << "gainmap_bit_depth: " << (int)m_gainmap_bit_depth << "\n";
  632|  6.95k|      sstr << indent << "tmap_icc_flag: " << m_tmap_icc_flag << "\n";
  633|  6.95k|      sstr << indent << "tmap_explicit_cicp_flag: " << m_tmap_explicit_cicp_flag << "\n";
  634|  6.95k|      if (m_tmap_explicit_cicp_flag)
  ------------------
  |  Branch (634:11): [True: 2.36k, False: 4.59k]
  ------------------
  635|  2.36k|      {
  636|  2.36k|        sstr << "tmap_colour_primaries: " << (int)m_tmap_colour_primaries << "\n";
  637|  2.36k|        sstr << "tmap_transfer_characteristics: " << (int)m_tmap_transfer_characteristics << "\n";
  638|  2.36k|        sstr << "tmap_matrix_coefficients: " << (int)m_tmap_matrix_coefficients << "\n";
  639|  2.36k|        sstr << "tmap_full_range_flag: " << m_tmap_full_range_flag << "\n";
  640|  2.36k|      }
  641|  6.95k|    }
  642|       |
  643|  8.98k|    if (m_clli)
  ------------------
  |  Branch (643:9): [True: 4.04k, False: 4.94k]
  ------------------
  644|  4.04k|    {
  645|  4.04k|      sstr << indent << "ccli.max_content_light_level: " << m_clli->clli.max_content_light_level << "\n";
  646|  4.04k|      sstr << indent << "ccli.max_pic_average_light_level: " << m_clli->clli.max_pic_average_light_level << "\n";
  647|  4.04k|    }
  648|  4.94k|    else {
  649|  4.94k|      sstr << indent << "clli: ---\n";
  650|  4.94k|    }
  651|       |
  652|  8.98k|    if (m_mdcv)
  ------------------
  |  Branch (652:9): [True: 968, False: 8.02k]
  ------------------
  653|    968|    {
  654|    968|      sstr << indent << "mdcv.display_primaries (x,y): ";
  655|    968|      sstr << "(" << m_mdcv->mdcv.display_primaries_x[0] << ";" << m_mdcv->mdcv.display_primaries_y[0] << "), ";
  656|    968|      sstr << "(" << m_mdcv->mdcv.display_primaries_x[1] << ";" << m_mdcv->mdcv.display_primaries_y[1] << "), ";
  657|    968|      sstr << "(" << m_mdcv->mdcv.display_primaries_x[2] << ";" << m_mdcv->mdcv.display_primaries_y[2] << ")\n";
  658|       |
  659|    968|      sstr << indent << "mdcv.white point (x,y): (" << m_mdcv->mdcv.white_point_x << ";" << m_mdcv->mdcv.white_point_y << ")\n";
  660|    968|      sstr << indent << "mdcv.max display mastering luminance: " << m_mdcv->mdcv.max_display_mastering_luminance << "\n";
  661|    968|      sstr << indent << "mdcv.min display mastering luminance: " << m_mdcv->mdcv.min_display_mastering_luminance << "\n";
  662|    968|    }
  663|  8.02k|    else {
  664|  8.02k|      sstr << indent << "mdcv: ---\n";
  665|  8.02k|    }
  666|       |
  667|  8.98k|    if (m_cclv)
  ------------------
  |  Branch (667:9): [True: 2.27k, False: 6.71k]
  ------------------
  668|  2.27k|    {
  669|  2.27k|      sstr << indent << "cclv.ccv_primaries_present_flag: " << m_cclv->ccv_primaries_are_valid() << "\n";
  670|  2.27k|      sstr << indent << "cclv.ccv_min_luminance_value_present_flag: " << m_cclv->min_luminance_is_valid() << "\n";
  671|  2.27k|      sstr << indent << "cclv.ccv_max_luminance_value_present_flag: " << m_cclv->max_luminance_is_valid() << "\n";
  672|  2.27k|      sstr << indent << "cclv.ccv_avg_luminance_value_present_flag: " << m_cclv->avg_luminance_is_valid() << "\n";
  673|  2.27k|      if (m_cclv->ccv_primaries_are_valid())
  ------------------
  |  Branch (673:11): [True: 320, False: 1.95k]
  ------------------
  674|    320|      {
  675|    320|        sstr << indent << "cclv.ccv_primaries (x,y): ";
  676|    320|        sstr << "(" << m_cclv->get_ccv_primary_x0() << ";" << m_cclv->get_ccv_primary_y0() << "), ";
  677|    320|        sstr << "(" << m_cclv->get_ccv_primary_x1() << ";" << m_cclv->get_ccv_primary_y1() << "), ";
  678|    320|        sstr << "(" << m_cclv->get_ccv_primary_x2() << ";" << m_cclv->get_ccv_primary_y2() << ")\n";
  679|    320|      }
  680|  2.27k|      if (m_cclv->min_luminance_is_valid())
  ------------------
  |  Branch (680:11): [True: 385, False: 1.88k]
  ------------------
  681|    385|      {
  682|    385|        sstr << indent << "cclv.ccv_min_luminance_value: " << m_cclv->get_min_luminance() << "\n";
  683|    385|      }
  684|  2.27k|      if (m_cclv->max_luminance_is_valid())
  ------------------
  |  Branch (684:11): [True: 1.81k, False: 457]
  ------------------
  685|  1.81k|      {
  686|  1.81k|        sstr << indent << "cclv.ccv_max_luminance_value: " << m_cclv->get_max_luminance() << "\n";
  687|  1.81k|      }
  688|  2.27k|      if (m_cclv->avg_luminance_is_valid())
  ------------------
  |  Branch (688:11): [True: 369, False: 1.90k]
  ------------------
  689|    369|      {
  690|    369|        sstr << indent << "cclv.ccv_avg_luminance_value: " << m_cclv->get_avg_luminance() << "\n";
  691|    369|      }
  692|  2.27k|    }
  693|  6.71k|    else {
  694|  6.71k|      sstr << indent << "cclv: ---\n";
  695|  6.71k|    }
  696|       |
  697|  8.98k|    if (m_amve)
  ------------------
  |  Branch (697:9): [True: 354, False: 8.63k]
  ------------------
  698|    354|    {
  699|    354|      sstr << indent << "amve.ambient_illumination: " << m_amve->amve.ambient_illumination << "\n";
  700|    354|      sstr << indent << "amve.ambient_light_x: " << m_amve->amve.ambient_light_x << "\n";
  701|    354|      sstr << indent << "amve.ambient_light_y: " << m_amve->amve.ambient_light_y << "\n";
  702|    354|    }
  703|  8.63k|    else {
  704|  8.63k|      sstr << indent << "amve: ---\n";
  705|  8.63k|    }
  706|       |
  707|  8.98k|    sstr << indent << "reve_flag: " << m_reve_flag << "\n";
  708|       |
  709|  8.98k|    if (m_reve_flag)
  ------------------
  |  Branch (709:9): [True: 2.16k, False: 6.82k]
  ------------------
  710|  2.16k|    {
  711|       |      // TODO - this isn't published yet
  712|  2.16k|    }
  713|  8.98k|    if (m_ndwt)
  ------------------
  |  Branch (713:9): [True: 3.91k, False: 5.07k]
  ------------------
  714|  3.91k|    {
  715|  3.91k|      sstr << indent << "ndwt.diffuse_white_luminance: " << m_ndwt->get_diffuse_white_luminance() << "\n";
  716|  3.91k|    }
  717|  5.07k|    else {
  718|  5.07k|      sstr << indent << "ndwt: ---\n";
  719|  5.07k|    }
  720|       |
  721|  8.98k|    if (m_gainmap_flag)
  ------------------
  |  Branch (721:9): [True: 6.95k, False: 2.03k]
  ------------------
  722|  6.95k|    {
  723|  6.95k|      if (m_tmap_clli)
  ------------------
  |  Branch (723:11): [True: 4.10k, False: 2.84k]
  ------------------
  724|  4.10k|      {
  725|  4.10k|        sstr << indent << "tmap_clli.max_content_light_level: " << m_tmap_clli->clli.max_content_light_level << "\n";
  726|  4.10k|        sstr << indent << "tmap_clli.max_pic_average_light_level: " << m_tmap_clli->clli.max_pic_average_light_level << "\n";
  727|  4.10k|      }
  728|  2.84k|      else {
  729|  2.84k|        sstr << indent << "tmap_clli: ---\n";
  730|  2.84k|      }
  731|       |
  732|  6.95k|      if (m_tmap_mdcv)
  ------------------
  |  Branch (732:11): [True: 2.51k, False: 4.43k]
  ------------------
  733|  2.51k|      {
  734|  2.51k|        sstr << indent << "tmap_mdcv.display_primaries (x,y): ";
  735|  2.51k|        sstr << "(" << m_tmap_mdcv->mdcv.display_primaries_x[0] << ";" << m_tmap_mdcv->mdcv.display_primaries_y[0] << "), ";
  736|  2.51k|        sstr << "(" << m_tmap_mdcv->mdcv.display_primaries_x[1] << ";" << m_tmap_mdcv->mdcv.display_primaries_y[1] << "), ";
  737|  2.51k|        sstr << "(" << m_tmap_mdcv->mdcv.display_primaries_x[2] << ";" << m_tmap_mdcv->mdcv.display_primaries_y[2] << ")\n";
  738|       |
  739|  2.51k|        sstr << indent << "tmap_mdcv.white point (x,y): (" << m_tmap_mdcv->mdcv.white_point_x << ";" << m_tmap_mdcv->mdcv.white_point_y << ")\n";
  740|  2.51k|        sstr << indent << "tmap_mdcv.max display mastering luminance: " << m_tmap_mdcv->mdcv.max_display_mastering_luminance << "\n";
  741|  2.51k|        sstr << indent << "tmap_mdcv.min display mastering luminance: " << m_tmap_mdcv->mdcv.min_display_mastering_luminance << "\n";
  742|  2.51k|      }
  743|  4.43k|      else {
  744|  4.43k|        sstr << indent << "tmap_mdcv: ---\n";
  745|  4.43k|      }
  746|       |
  747|  6.95k|      if (m_tmap_cclv)
  ------------------
  |  Branch (747:11): [True: 4.16k, False: 2.78k]
  ------------------
  748|  4.16k|      {
  749|  4.16k|        sstr << indent << "tmap_cclv.ccv_primaries_present_flag: " << m_tmap_cclv->ccv_primaries_are_valid() << "\n";
  750|  4.16k|        sstr << indent << "tmap_cclv.ccv_min_luminance_value_present_flag: " << m_tmap_cclv->min_luminance_is_valid() << "\n";
  751|  4.16k|        sstr << indent << "tmap_cclv.ccv_max_luminance_value_present_flag: " << m_tmap_cclv->max_luminance_is_valid() << "\n";
  752|  4.16k|        sstr << indent << "tmap_cclv.ccv_avg_luminance_value_present_flag: " << m_tmap_cclv->avg_luminance_is_valid() << "\n";
  753|  4.16k|        if (m_tmap_cclv->ccv_primaries_are_valid())
  ------------------
  |  Branch (753:13): [True: 460, False: 3.70k]
  ------------------
  754|    460|        {
  755|    460|          sstr << indent << "tmap_cclv.ccv_primaries (x,y): ";
  756|    460|          sstr << "(" << m_tmap_cclv->get_ccv_primary_x0() << ";" << m_tmap_cclv->get_ccv_primary_y0() << "), ";
  757|    460|          sstr << "(" << m_tmap_cclv->get_ccv_primary_x1() << ";" << m_tmap_cclv->get_ccv_primary_y1() << "), ";
  758|    460|          sstr << "(" << m_tmap_cclv->get_ccv_primary_x2() << ";" << m_tmap_cclv->get_ccv_primary_y2() << ")\n";
  759|    460|        }
  760|  4.16k|        if (m_tmap_cclv->min_luminance_is_valid())
  ------------------
  |  Branch (760:13): [True: 714, False: 3.45k]
  ------------------
  761|    714|        {
  762|    714|          sstr << indent << "tmap_cclv.ccv_min_luminance_value: " << m_tmap_cclv->get_min_luminance() << "\n";
  763|    714|        }
  764|  4.16k|        if (m_tmap_cclv->max_luminance_is_valid())
  ------------------
  |  Branch (764:13): [True: 721, False: 3.44k]
  ------------------
  765|    721|        {
  766|    721|          sstr << indent << "tmap_cclv.ccv_max_luminance_value: " << m_tmap_cclv->get_max_luminance() << "\n";
  767|    721|        }
  768|  4.16k|        if (m_tmap_cclv->avg_luminance_is_valid())
  ------------------
  |  Branch (768:13): [True: 705, False: 3.46k]
  ------------------
  769|    705|        {
  770|    705|          sstr << indent << "tmap_cclv.ccv_avg_luminance_value: " << m_tmap_cclv->get_avg_luminance() << "\n";
  771|    705|        }
  772|  4.16k|      }
  773|  2.78k|      else {
  774|  2.78k|        sstr << indent << "tmap_cclv: ---\n";
  775|  2.78k|      }
  776|       |
  777|  6.95k|      if (m_tmap_amve)
  ------------------
  |  Branch (777:11): [True: 3.57k, False: 3.37k]
  ------------------
  778|  3.57k|      {
  779|  3.57k|        sstr << indent << "tmap_amve.ambient_illumination: " << m_tmap_amve->amve.ambient_illumination << "\n";
  780|  3.57k|        sstr << indent << "tmap_amve.ambient_light_x: " << m_tmap_amve->amve.ambient_light_x << "\n";
  781|  3.57k|        sstr << indent << "tmap_amve.ambient_light_y: " << m_tmap_amve->amve.ambient_light_y << "\n";
  782|  3.57k|      }
  783|  3.37k|      else {
  784|  3.37k|        sstr << indent << "tmap_amve: ---\n";
  785|  3.37k|      }
  786|       |
  787|  6.95k|      sstr << indent << "tmap_reve_flag: " << m_tmap_reve_flag << "\n";
  788|       |
  789|  6.95k|      if (m_tmap_reve_flag)
  ------------------
  |  Branch (789:11): [True: 870, False: 6.08k]
  ------------------
  790|    870|      {
  791|       |        // TODO - this isn't published yet
  792|    870|      }
  793|  6.95k|      if (m_tmap_ndwt)
  ------------------
  |  Branch (793:11): [True: 1.86k, False: 5.08k]
  ------------------
  794|  1.86k|      {
  795|  1.86k|        sstr << indent << "tmap_ndwt.diffuse_white_luminance: " << m_tmap_ndwt->get_diffuse_white_luminance() << "\n";
  796|  1.86k|      }
  797|  5.08k|      else {
  798|  5.08k|        sstr << indent << "tmap_ndwt: ---\n";
  799|  5.08k|      }
  800|  6.95k|    }
  801|  8.98k|  }
  802|       |
  803|  9.86k|  if (m_alpha_flag && (m_alpha_item_data_size > 0) && (m_alpha_item_codec_config.size() > 0))
  ------------------
  |  Branch (803:7): [True: 3.05k, False: 6.81k]
  |  Branch (803:23): [True: 280, False: 2.77k]
  |  Branch (803:55): [True: 164, False: 116]
  ------------------
  804|    164|  {
  805|    164|    sstr << "alpha_item_code_config size: " << m_alpha_item_codec_config.size() << "\n";
  806|    164|  }
  807|  9.86k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_item_codec_config.size() > 0)
  ------------------
  |  Branch (807:7): [True: 8.98k, False: 876]
  |  Branch (807:21): [True: 6.95k, False: 2.03k]
  |  Branch (807:39): [True: 279, False: 6.67k]
  ------------------
  808|    279|  {
  809|    279|    sstr << "gainmap_item_codec_config size: " << m_gainmap_item_codec_config.size() << "\n";
  810|    279|  }
  811|  9.86k|  if (m_main_item_codec_config.size() > 0)
  ------------------
  |  Branch (811:7): [True: 274, False: 9.59k]
  ------------------
  812|    274|  {
  813|    274|    sstr << "main_item_code_config size: " << m_main_item_codec_config.size() << "\n";
  814|    274|  }
  815|       |
  816|  9.86k|  if (m_icc_flag)
  ------------------
  |  Branch (816:7): [True: 3.58k, False: 6.28k]
  ------------------
  817|  3.58k|  {
  818|  3.58k|    sstr << "icc_data size: " << m_icc_data.size() << "\n";
  819|  3.58k|  }
  820|  9.86k|  if (m_hdr_flag && m_gainmap_flag && m_tmap_icc_flag)
  ------------------
  |  Branch (820:7): [True: 8.98k, False: 876]
  |  Branch (820:21): [True: 6.95k, False: 2.03k]
  |  Branch (820:39): [True: 786, False: 6.16k]
  ------------------
  821|    786|  {
  822|    786|    sstr << "tmap_icc_data size: " << m_tmap_icc_data.size() << "\n";
  823|    786|  }
  824|  9.86k|  if (m_hdr_flag && m_gainmap_flag && m_gainmap_metadata.size() > 0)
  ------------------
  |  Branch (824:7): [True: 8.98k, False: 876]
  |  Branch (824:21): [True: 6.95k, False: 2.03k]
  |  Branch (824:39): [True: 166, False: 6.78k]
  ------------------
  825|    166|  {
  826|    166|    sstr << "gainmap_metadata size: " << m_gainmap_metadata.size() << "\n";
  827|    166|  }
  828|       |
  829|  9.86k|  if (m_alpha_flag && (m_alpha_item_data_size > 0))
  ------------------
  |  Branch (829:7): [True: 3.05k, False: 6.81k]
  |  Branch (829:23): [True: 280, False: 2.77k]
  ------------------
  830|    280|  {
  831|    280|    sstr << "alpha_item_data offset: " << m_alpha_item_data_offset << ", size: " << m_alpha_item_data_size << "\n";
  832|    280|  }
  833|  9.86k|  if (m_hdr_flag && m_gainmap_flag && (m_gainmap_item_data_size > 0))
  ------------------
  |  Branch (833:7): [True: 8.98k, False: 876]
  |  Branch (833:21): [True: 6.95k, False: 2.03k]
  |  Branch (833:39): [True: 385, False: 6.56k]
  ------------------
  834|    385|  {
  835|    385|    sstr << "gainmap_item_data offset: " << m_gainmap_item_data_offset << ", size: " << m_gainmap_item_data_size << "\n";
  836|    385|  }
  837|       |
  838|  9.86k|  sstr << "main_item_data offset: " << m_main_item_data_offset << ", size: " << m_main_item_data_size << "\n";
  839|       |
  840|  9.86k|  if (m_exif_flag)
  ------------------
  |  Branch (840:7): [True: 3.09k, False: 6.77k]
  ------------------
  841|  3.09k|  {
  842|  3.09k|    sstr << "exif_data offset: " << m_exif_item_data_offset << ", size: " << m_exif_data_size << "\n";
  843|  3.09k|  }
  844|  9.86k|  if (m_xmp_flag)
  ------------------
  |  Branch (844:7): [True: 5.80k, False: 4.06k]
  ------------------
  845|  5.80k|  {
  846|  5.80k|    sstr << "xmp_data offset: " << m_xmp_item_data_offset << ", size: " << m_xmp_data_size << "\n";
  847|  5.80k|  }
  848|  9.86k|  return sstr.str();
  849|  9.86k|}

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

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

_ZN17color_profile_rawC2EjRKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  105|  9.26k|      : m_type(type), m_data(data) {}
_ZNK17color_profile_raw8get_typeEv:
  107|  7.14k|  uint32_t get_type() const override { return m_type; }
_ZN18color_profile_nclxC2Ev:
  175|    618|  color_profile_nclx() { m_profile.set_sRGB_defaults(); }
_ZNK18color_profile_nclx8get_typeEv:
  184|    496|  uint32_t get_type() const override { return fourcc("nclx"); }
_ZN8Box_colrC2Ev:
  205|  10.0k|  {
  206|  10.0k|    set_short_type(fourcc("colr"));
  207|  10.0k|  }
_ZNK8Box_colr22get_color_profile_typeEv:
  211|  7.64k|  uint32_t get_color_profile_type() const { return m_color_profile->get_type(); }
_ZN13color_profileD2Ev:
   92|  9.88k|  virtual ~color_profile() = default;

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

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

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

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

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

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

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

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

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

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

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

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

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

_Z23get_encoder_plugin_jpegv:
  522|      2|{
  523|      2|  return &encoder_plugin_jpeg;
  524|      2|}
encoder_jpeg.cc:_ZL16jpeg_init_pluginv:
  117|      2|{
  118|      2|  jpeg_init_parameters();
  119|      2|}
encoder_jpeg.cc:_ZL20jpeg_init_parametersv:
   79|      2|{
   80|      2|  heif_encoder_parameter* p = jpeg_encoder_params;
   81|      2|  const heif_encoder_parameter** d = jpeg_encoder_parameter_ptrs;
   82|      2|  int i = 0;
   83|       |
   84|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (84:3): [True: 2, False: 0]
  ------------------
   85|      2|  p->version = 2;
   86|      2|  p->name = heif_encoder_parameter_name_quality;
  ------------------
  |  |  317|      2|#define heif_encoder_parameter_name_quality  "quality"
  ------------------
   87|      2|  p->type = heif_encoder_parameter_type_integer;
   88|      2|  p->integer.default_value = 50;
   89|      2|  p->has_default = true;
   90|      2|  p->integer.have_minimum_maximum = true;
   91|      2|  p->integer.minimum = 0;
   92|      2|  p->integer.maximum = 100;
   93|      2|  p->integer.valid_values = NULL;
   94|      2|  p->integer.num_valid_values = 0;
   95|      2|  d[i++] = p++;
   96|       |
   97|       |  /*
   98|       |  assert(i < MAX_NPARAMETERS);
   99|       |  p->version = 2;
  100|       |  p->name = heif_encoder_parameter_name_lossless;
  101|       |  p->type = heif_encoder_parameter_type_boolean;
  102|       |  p->boolean.default_value = false;
  103|       |  p->has_default = true;
  104|       |  d[i++] = p++;
  105|       |*/
  106|       |
  107|      2|  d[i++] = nullptr;
  108|      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:
 1317|      2|{
 1318|      2|  return &encoder_plugin_svt;
 1319|      2|}
encoder_svt.cc:_ZL15svt_init_pluginv:
  332|      2|{
  333|      2|  svt_init_parameters();
  334|      2|}
encoder_svt.cc:_ZL19svt_init_parametersv:
  184|      2|{
  185|      2|  heif_encoder_parameter* p = svt_encoder_params;
  186|      2|  const heif_encoder_parameter** d = svt_encoder_parameter_ptrs;
  187|      2|  int i = 0;
  188|       |
  189|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (189:3): [True: 2, False: 0]
  ------------------
  190|      2|  p->version = 2;
  191|      2|  p->name = kParam_speed;
  192|      2|  p->type = heif_encoder_parameter_type_integer;
  193|      2|  p->integer.default_value = 12;
  194|      2|  p->has_default = true;
  195|      2|  p->integer.have_minimum_maximum = true;
  196|      2|  p->integer.minimum = 0;
  197|      2|  p->integer.maximum = 13;
  198|      2|  p->integer.valid_values = nullptr;
  199|      2|  p->integer.num_valid_values = 0;
  200|      2|  d[i++] = p++;
  201|       |
  202|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (202:3): [True: 2, False: 0]
  ------------------
  203|      2|  p->version = 2;
  204|      2|  p->name = kParam_threads;
  205|      2|  p->type = heif_encoder_parameter_type_integer;
  206|      2|  p->integer.default_value = 4;
  207|      2|  p->has_default = true;
  208|      2|  p->integer.have_minimum_maximum = true;
  209|      2|  p->integer.minimum = 1;
  210|      2|  p->integer.maximum = 16;
  211|      2|  p->integer.valid_values = nullptr;
  212|      2|  p->integer.num_valid_values = 0;
  213|      2|  d[i++] = p++;
  214|       |
  215|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (215:3): [True: 2, False: 0]
  ------------------
  216|      2|  p->version = 2;
  217|      2|  p->name = "tile-rows";
  218|      2|  p->type = heif_encoder_parameter_type_integer;
  219|      2|  p->integer.default_value = 4;
  220|      2|  p->has_default = true;
  221|      2|  p->integer.have_minimum_maximum = false;
  222|      2|  p->integer.valid_values = valid_tile_num_values;
  223|      2|  p->integer.num_valid_values = 7;
  224|      2|  d[i++] = p++;
  225|       |
  226|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (226:3): [True: 2, False: 0]
  ------------------
  227|      2|  p->version = 2;
  228|      2|  p->name = "tile-cols";
  229|      2|  p->type = heif_encoder_parameter_type_integer;
  230|      2|  p->integer.default_value = 4;
  231|      2|  p->has_default = true;
  232|      2|  p->integer.have_minimum_maximum = false;
  233|      2|  p->integer.valid_values = valid_tile_num_values;
  234|      2|  p->integer.num_valid_values = 7;
  235|      2|  d[i++] = p++;
  236|       |
  237|       |
  238|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (238:3): [True: 2, False: 0]
  ------------------
  239|      2|  p->version = 2;
  240|      2|  p->name = heif_encoder_parameter_name_quality;
  ------------------
  |  |  317|      2|#define heif_encoder_parameter_name_quality  "quality"
  ------------------
  241|      2|  p->type = heif_encoder_parameter_type_integer;
  242|      2|  p->integer.default_value = 50;
  243|      2|  p->has_default = true;
  244|      2|  p->integer.have_minimum_maximum = true;
  245|      2|  p->integer.minimum = 0;
  246|      2|  p->integer.maximum = 100;
  247|      2|  p->integer.valid_values = NULL;
  248|      2|  p->integer.num_valid_values = 0;
  249|      2|  d[i++] = p++;
  250|       |
  251|      2|#if SVT_AV1_CHECK_VERSION(3, 0, 0)
  252|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (252:3): [True: 2, False: 0]
  ------------------
  253|      2|  p->version = 2;
  254|      2|  p->name = heif_encoder_parameter_name_lossless;
  ------------------
  |  |  318|      2|#define heif_encoder_parameter_name_lossless "lossless"
  ------------------
  255|      2|  p->type = heif_encoder_parameter_type_boolean;
  256|      2|  p->boolean.default_value = false;
  257|      2|  p->has_default = true;
  258|      2|  d[i++] = p++;
  259|      2|#endif
  260|       |
  261|       |#if 0
  262|       |  assert(i < MAX_NPARAMETERS);
  263|       |  p->version = 2;
  264|       |  p->name = kParam_chroma;
  265|       |  p->type = heif_encoder_parameter_type_string;
  266|       |  p->string.default_value = "420";
  267|       |  p->has_default = true;
  268|       |  p->string.valid_values = kParam_chroma_valid_values;
  269|       |  d[i++] = p++;
  270|       |#endif
  271|       |
  272|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (272:3): [True: 2, False: 0]
  ------------------
  273|      2|  p->version = 2;
  274|      2|  p->name = kParam_qp;
  275|      2|  p->type = heif_encoder_parameter_type_integer;
  276|      2|  p->integer.default_value = 50;
  277|      2|  p->has_default = false;
  278|      2|  p->integer.have_minimum_maximum = true;
  279|      2|  p->integer.minimum = 0;
  280|      2|  p->integer.maximum = 63;
  281|      2|  p->integer.valid_values = nullptr;
  282|      2|  p->integer.num_valid_values = 0;
  283|      2|  d[i++] = p++;
  284|       |
  285|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (285:3): [True: 2, False: 0]
  ------------------
  286|      2|  p->version = 2;
  287|      2|  p->name = kParam_min_q;
  288|      2|  p->type = heif_encoder_parameter_type_integer;
  289|      2|  p->integer.default_value = 0;
  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 = 63;
  294|      2|  p->integer.valid_values = nullptr;
  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 = kParam_max_q;
  301|      2|  p->type = heif_encoder_parameter_type_integer;
  302|      2|  p->integer.default_value = 63;
  303|      2|  p->has_default = true;
  304|      2|  p->integer.have_minimum_maximum = true;
  305|      2|  p->integer.minimum = 0;
  306|      2|  p->integer.maximum = 63;
  307|      2|  p->integer.valid_values = nullptr;
  308|      2|  p->integer.num_valid_values = 0;
  309|      2|  d[i++] = p++;
  310|       |
  311|      2|#if SVT_AV1_CHECK_VERSION(0, 9, 1)
  312|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (312:3): [True: 2, False: 0]
  ------------------
  313|      2|  p->version = 2;
  314|      2|  p->name = kParam_tune;
  315|      2|  p->type = heif_encoder_parameter_type_string;
  316|      2|  p->string.default_value = "psnr";
  317|      2|  p->has_default = true;
  318|      2|  p->string.valid_values = kParam_tune_valid_values;
  319|      2|  d[i++] = p++;
  320|      2|#endif
  321|       |
  322|      2|  d[i++] = nullptr;
  323|      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:
  882|      2|{
  883|      2|  return &encoder_plugin_vvenc;
  884|      2|}
encoder_vvenc.cc:_ZL17vvenc_init_pluginv:
  138|      2|{
  139|      2|  vvenc_init_parameters();
  140|      2|}
encoder_vvenc.cc:_ZL21vvenc_init_parametersv:
  101|      2|{
  102|      2|  heif_encoder_parameter* p = vvenc_encoder_params;
  103|      2|  const heif_encoder_parameter** d = vvenc_encoder_parameter_ptrs;
  104|      2|  int i = 0;
  105|       |
  106|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (106:3): [True: 2, False: 0]
  ------------------
  107|      2|  p->version = 2;
  108|      2|  p->name = heif_encoder_parameter_name_quality;
  ------------------
  |  |  317|      2|#define heif_encoder_parameter_name_quality  "quality"
  ------------------
  109|      2|  p->type = heif_encoder_parameter_type_integer;
  110|      2|  p->integer.default_value = 50;
  111|      2|  p->has_default = true;
  112|      2|  p->integer.have_minimum_maximum = true;
  113|      2|  p->integer.minimum = 0;
  114|      2|  p->integer.maximum = 100;
  115|      2|  p->integer.valid_values = NULL;
  116|      2|  p->integer.num_valid_values = 0;
  117|      2|  d[i++] = p++;
  118|       |
  119|      2|  assert(i < MAX_NPARAMETERS);
  ------------------
  |  Branch (119:3): [True: 2, False: 0]
  ------------------
  120|      2|  p->version = 2;
  121|      2|  p->name = heif_encoder_parameter_name_lossless;
  ------------------
  |  |  318|      2|#define heif_encoder_parameter_name_lossless "lossless"
  ------------------
  122|      2|  p->type = heif_encoder_parameter_type_boolean;
  123|      2|  p->boolean.default_value = false;
  124|      2|  p->has_default = true;
  125|      2|  d[i++] = p++;
  126|       |
  127|      2|  d[i++] = nullptr;
  128|      2|}

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

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

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

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

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

_ZN13Box_containerC2EPKc:
   37|  2.60k|  {
   38|  2.60k|    set_short_type(fourcc(type));
   39|  2.60k|  }
_ZN8Box_moovC2Ev:
   51|    409|  Box_moov() : Box_container("moov") {}
_ZNK8Box_moov14debug_box_nameEv:
   53|    384|  const char* debug_box_name() const override { return "Movie"; }
_ZN8Box_mvhdC2Ev:
   61|  1.75k|  {
   62|  1.75k|    set_short_type(fourcc("mvhd"));
   63|  1.75k|  }
_ZNK8Box_mvhd14debug_box_nameEv:
   67|  1.52k|  const char* debug_box_name() const override { return "Movie Header"; }
_ZNK8Box_mvhd8get_rateEv:
   73|  1.52k|  double get_rate() const { return m_rate / double(0x10000); }
_ZNK8Box_mvhd10get_volumeEv:
   75|  1.52k|  float get_volume() const { return float(m_volume) / float(0x100); }
_ZN8Box_trakC2Ev:
  121|    357|  Box_trak() : Box_container("trak") {}
_ZNK8Box_trak14debug_box_nameEv:
  123|    322|  const char* debug_box_name() const override { return "Track"; }
_ZN8Box_tkhdC2Ev:
  131|  1.33k|  {
  132|  1.33k|    set_short_type(fourcc("tkhd"));
  133|       |
  134|       |    // set default flags according to ISO 14496-12
  135|  1.33k|    set_flags(Track_enabled | Track_in_movie | Track_in_preview);
  136|  1.33k|  }
_ZNK8Box_tkhd14debug_box_nameEv:
  147|  1.27k|  const char* debug_box_name() const override { return "Track Header"; }
_ZNK8Box_tkhd10get_volumeEv:
  153|  1.27k|  float get_volume() const { return float(m_volume) / float(0x100); }
_ZNK8Box_tkhd9get_widthEv:
  157|  1.27k|  double get_width() const { return float(m_width) / double(0x10000); }
_ZNK8Box_tkhd10get_heightEv:
  159|  1.27k|  double get_height() const { return float(m_height) / double(0x10000); }
_ZN8Box_mdiaC2Ev:
  198|     72|  Box_mdia() : Box_container("mdia") {}
_ZNK8Box_mdia14debug_box_nameEv:
  200|     70|  const char* debug_box_name() const override { return "Media"; }
_ZN8Box_mdhdC2Ev:
  208|    657|  {
  209|    657|    set_short_type(fourcc("mdhd"));
  210|    657|  }
_ZNK8Box_mdhd14debug_box_nameEv:
  214|    628|  const char* debug_box_name() const override { return "Media Header"; }
_ZN8Box_minfC2Ev:
  246|    532|  Box_minf() : Box_container("minf") {}
_ZNK8Box_minf14debug_box_nameEv:
  248|    435|  const char* debug_box_name() const override { return "Media Information"; }
_ZN8Box_vmhdC2Ev:
  256|    564|  {
  257|    564|    set_short_type(fourcc("vmhd"));
  258|    564|    set_flags(1);
  259|    564|  }
_ZNK8Box_vmhd14debug_box_nameEv:
  263|    457|  const char* debug_box_name() const override { return "Video Media Header"; }
_ZN8Box_nmhdC2Ev:
  280|    542|  {
  281|    542|    set_short_type(fourcc("nmhd"));
  282|    542|    set_flags(1);
  283|    542|  }
_ZNK8Box_nmhd14debug_box_nameEv:
  287|    493|  const char* debug_box_name() const override { return "Null Media Header"; }
_ZN8Box_stblC2Ev:
  299|    638|  Box_stbl() : Box_container("stbl") {}
_ZNK8Box_stbl14debug_box_nameEv:
  301|    516|  const char* debug_box_name() const override { return "Sample Table"; }
_ZN8Box_stsdC2Ev:
  309|  1.36k|  {
  310|  1.36k|    set_short_type(fourcc("stsd"));
  311|  1.36k|  }
_ZNK8Box_stsd14debug_box_nameEv:
  315|    918|  const char* debug_box_name() const override { return "Sample Description"; }
_ZN8Box_sttsC2Ev:
  347|    398|  {
  348|    398|    set_short_type(fourcc("stts"));
  349|    398|  }
_ZNK8Box_stts14debug_box_nameEv:
  353|    243|  const char* debug_box_name() const override { return "Decoding Time to Sample"; }
_ZN8Box_cttsC2Ev:
  393|  1.00k|  {
  394|  1.00k|    set_short_type(fourcc("ctts"));
  395|  1.00k|  }
_ZNK8Box_ctts14debug_box_nameEv:
  399|    648|  const char* debug_box_name() const override { return "Composition Time to Sample"; }
_ZN8Box_stscC2Ev:
  433|    386|  {
  434|    386|    set_short_type(fourcc("stsc"));
  435|    386|  }
_ZNK8Box_stsc14debug_box_nameEv:
  439|    151|  const char* debug_box_name() const override { return "Sample to Chunk"; }
_ZN8Box_stcoC2Ev:
  477|    829|  {
  478|    829|    set_short_type(fourcc("stco"));
  479|    829|  }
_ZNK8Box_stco14debug_box_nameEv:
  483|    745|  const char* debug_box_name() const override { return "Sample Offset"; }
_ZN8Box_stszC2Ev:
  510|  1.21k|  {
  511|  1.21k|    set_short_type(fourcc("stsz"));
  512|  1.21k|  }
_ZNK8Box_stsz14debug_box_nameEv:
  516|  1.08k|  const char* debug_box_name() const override { return "Sample Size"; }
_ZN8Box_stssC2Ev:
  545|    430|  {
  546|    430|    set_short_type(fourcc("stss"));
  547|    430|  }
_ZNK8Box_stss14debug_box_nameEv:
  551|    343|  const char* debug_box_name() const override { return "Sync Sample"; }
_ZN8Box_ccstC2Ev:
  584|    598|  {
  585|    598|    set_short_type(fourcc("ccst"));
  586|    598|  }
_ZNK8Box_ccst14debug_box_nameEv:
  590|    494|  const char* debug_box_name() const override { return "Coding Constraints"; }
_ZN8Box_auxiC2Ev:
  609|  1.94k|  {
  610|  1.94k|    set_short_type(fourcc("auxi"));
  611|  1.94k|  }
_ZNK8Box_auxi14debug_box_nameEv:
  615|  1.65k|  const char* debug_box_name() const override { return "Auxiliary Info Type"; }
_ZNK17VisualSampleEntry25get_horizontal_resolutionEv:
  654|    735|  double get_horizontal_resolution() const { return horizresolution / double(0x10000); }
_ZNK17VisualSampleEntry23get_vertical_resolutionEv:
  656|    735|  double get_vertical_resolution() const { return vertresolution / double(0x10000); }
_ZN22Box_URIMetaSampleEntryC2Ev:
  687|  1.20k|  {
  688|  1.20k|    set_short_type(fourcc("urim"));
  689|  1.20k|  }
_ZNK22Box_URIMetaSampleEntry14debug_box_nameEv:
  695|  1.06k|  const char* debug_box_name() const override { return "URI Meta Sample Entry"; }
_ZN7Box_uriC2Ev:
  710|    807|  {
  711|    807|    set_short_type(fourcc("uri "));
  712|    807|  }
_ZNK7Box_uri14debug_box_nameEv:
  722|    606|  const char* debug_box_name() const override { return "URI"; }
_ZN8Box_sbgpC2Ev:
  736|    785|  {
  737|    785|    set_short_type(fourcc("sbgp"));
  738|    785|  }
_ZNK8Box_sbgp14debug_box_nameEv:
  744|    699|  const char* debug_box_name() const override { return "Sample to Group"; }
_ZN8Box_sgpdC2Ev:
  797|  1.34k|  {
  798|  1.34k|    set_short_type(fourcc("sgpd"));
  799|  1.34k|  }
_ZNK8Box_sgpd14debug_box_nameEv:
  805|  1.28k|  const char* debug_box_name() const override { return "Sample Group Description"; }
_ZN8Box_btrtC2Ev:
  830|    647|  {
  831|    647|    set_short_type(fourcc("btrt"));
  832|    647|  }
_ZNK8Box_btrt14debug_box_nameEv:
  836|    645|  const char* debug_box_name() const override { return "Bitrate"; }
_ZN8Box_saizC2Ev:
  853|  1.01k|  {
  854|  1.01k|    set_short_type(fourcc("saiz"));
  855|  1.01k|  }
_ZNK8Box_saiz14debug_box_nameEv:
  875|    864|  const char* debug_box_name() const override { return "Sample Auxiliary Information Sizes"; }
_ZN8Box_saioC2Ev:
  896|  1.68k|  {
  897|  1.68k|    set_short_type(fourcc("saio"));
  898|  1.68k|  }
_ZNK8Box_saio14debug_box_nameEv:
  915|  1.49k|  const char* debug_box_name() const override { return "Sample Auxiliary Information Offsets"; }
_ZN8Box_sdtpC2Ev:
  941|    785|  {
  942|    785|    set_short_type(fourcc("sdtp"));
  943|    785|  }
_ZNK8Box_sdtp14debug_box_nameEv:
  947|    635|  const char* debug_box_name() const override { return "Independent and Disposable Samples"; }
_ZNK8Box_sdtp14get_is_leadingEj:
  951|  4.32M|  uint8_t get_is_leading(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 6) & 3; }
_ZNK8Box_sdtp14get_depends_onEj:
  953|  4.32M|  uint8_t get_depends_on(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 4) & 3; }
_ZNK8Box_sdtp18get_is_depended_onEj:
  955|  4.32M|  uint8_t get_is_depended_on(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 2) & 3; }
_ZNK8Box_sdtp18get_has_redundancyEj:
  957|  4.32M|  uint8_t get_has_redundancy(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx]) & 3; }
_ZN8Box_trefC2Ev:
  971|  1.01k|  {
  972|  1.01k|    set_short_type(fourcc("tref"));
  973|  1.01k|  }
_ZNK8Box_tref14debug_box_nameEv:
  982|    716|  const char* debug_box_name() const override { return "Track Reference"; }
_ZN8Box_edtsC2Ev:
 1009|    595|  Box_edts() : Box_container("edts") {}
_ZNK8Box_edts14debug_box_nameEv:
 1011|    533|  const char* debug_box_name() const override { return "Edit List Container"; }
_ZN8Box_elstC2Ev:
 1019|  1.21k|  {
 1020|  1.21k|    set_short_type(fourcc("elst"));
 1021|  1.21k|  }
_ZNK8Box_elst14debug_box_nameEv:
 1029|  1.03k|  const char* debug_box_name() const override { return "Edit List"; }
_ZN16SampleGroupEntryD2Ev:
  768|   153k|  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:
  210|      2|{
  211|      2|  std::lock_guard<std::mutex> lock(de265_init_mutex());
  212|       |
  213|      2|  de265_init_count++;
  214|       |
  215|      2|  if (de265_init_count > 1) {
  ------------------
  |  Branch (215:7): [True: 0, False: 2]
  ------------------
  216|       |    // we are not the first -> already initialized
  217|       |
  218|      0|    return DE265_OK;
  219|      0|  }
  220|       |
  221|       |
  222|       |  // do initializations
  223|       |
  224|      2|  init_scan_orders();
  225|      2|  pps_scan_cache_init();
  226|       |
  227|      2|  if (!alloc_and_init_significant_coeff_ctxIdx_lookupTable()) {
  ------------------
  |  Branch (227:7): [True: 0, False: 2]
  ------------------
  228|      0|    pps_scan_cache_free();
  229|      0|    de265_init_count--;
  230|      0|    return DE265_ERROR_LIBRARY_INITIALIZATION_FAILED;
  231|      0|  }
  232|       |
  233|      2|  return DE265_OK;
  234|      2|}
de265.cc:_ZL16de265_init_mutexv:
  203|      2|{
  204|      2|  static std::mutex de265_init_mutex;
  205|      2|  return de265_init_mutex;
  206|      2|}

_Z19pps_scan_cache_initv:
  677|      2|{
  678|      2|  if (!g_pps_scan_cache.load(std::memory_order_relaxed)) {
  ------------------
  |  Branch (678:7): [True: 2, False: 0]
  ------------------
  679|      2|    g_pps_scan_cache.store(new pps_scan_cache(), std::memory_order_release);
  680|      2|  }
  681|      2|}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

