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

heif_polarization_angle_is_no_filter:
  569|  35.0k|{
  570|  35.0k|  uint32_t bits;
  571|  35.0k|  memcpy(&bits, &angle, sizeof(bits));
  572|  35.0k|  return bits == 0xFFFFFFFF;
  573|  35.0k|}

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

_ZN19StreamReader_memoryC2EPKhmb:
   78|  16.7k|    : m_length(size),
   79|  16.7k|      m_position(0)
   80|  16.7k|{
   81|  16.7k|  if (copy) {
  ------------------
  |  Branch (81:7): [True: 0, False: 16.7k]
  ------------------
   82|      0|    m_owned_data = new uint8_t[m_length];
   83|      0|    memcpy(m_owned_data, data, size);
   84|       |
   85|      0|    m_data = m_owned_data;
   86|      0|  }
   87|  16.7k|  else {
   88|  16.7k|    m_data = data;
   89|  16.7k|  }
   90|  16.7k|}
_ZN19StreamReader_memoryD2Ev:
   93|  16.7k|{
   94|  16.7k|  if (m_owned_data) {
  ------------------
  |  Branch (94:7): [True: 0, False: 16.7k]
  ------------------
   95|      0|    delete[] m_owned_data;
   96|      0|  }
   97|  16.7k|}
_ZNK19StreamReader_memory12get_positionEv:
  100|  1.13M|{
  101|  1.13M|  return m_position;
  102|  1.13M|}
_ZN19StreamReader_memory18wait_for_file_sizeEm:
  105|  1.00M|{
  106|  1.00M|  return (target_size > m_length) ? grow_status::size_beyond_eof : grow_status::size_reached;
  ------------------
  |  Branch (106:10): [True: 11.5k, False: 994k]
  ------------------
  107|  1.00M|}
_ZN19StreamReader_memory4readEPvm:
  110|  64.7M|{
  111|  64.7M|  uint64_t end_pos = m_position + size;
  112|  64.7M|  if (end_pos > m_length) {
  ------------------
  |  Branch (112:7): [True: 0, False: 64.7M]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|  64.7M|  memcpy(data, &m_data[m_position], size);
  117|  64.7M|  m_position += size;
  118|       |
  119|  64.7M|  return true;
  120|  64.7M|}
_ZN19StreamReader_memory4seekEm:
  123|   104k|{
  124|   104k|  if (position > m_length)
  ------------------
  |  Branch (124:7): [True: 0, False: 104k]
  ------------------
  125|      0|    return false;
  126|       |
  127|   104k|  m_position = position;
  128|   104k|  return true;
  129|   104k|}
_ZN14BitstreamRangeC2ENSt3__110shared_ptrI12StreamReaderEEmPS_:
  157|   516k|    : m_istr(std::move(istr)), m_parent_range(parent), m_remaining(length)
  158|   516k|{
  159|   516k|  if (parent) {
  ------------------
  |  Branch (159:7): [True: 500k, False: 16.7k]
  ------------------
  160|   500k|    m_nesting_level = parent->m_nesting_level + 1;
  161|   500k|  }
  162|   516k|}
_ZN14BitstreamRange5read8Ev:
  185|  21.1M|{
  186|  21.1M|  if (!prepare_read(1)) {
  ------------------
  |  Branch (186:7): [True: 188k, False: 21.0M]
  ------------------
  187|   188k|    return 0;
  188|   188k|  }
  189|       |
  190|  21.0M|  uint8_t buf;
  191|       |
  192|  21.0M|  auto istr = get_istream();
  193|  21.0M|  bool success = istr->read((char*) &buf, 1);
  194|       |
  195|  21.0M|  if (!success) {
  ------------------
  |  Branch (195:7): [True: 0, False: 21.0M]
  ------------------
  196|      0|    set_eof_while_reading();
  197|      0|    return 0;
  198|      0|  }
  199|       |
  200|  21.0M|  return buf;
  201|  21.0M|}
_ZN14BitstreamRange6read16Ev:
  205|  8.26M|{
  206|  8.26M|  if (!prepare_read(2)) {
  ------------------
  |  Branch (206:7): [True: 20.6k, False: 8.24M]
  ------------------
  207|  20.6k|    return 0;
  208|  20.6k|  }
  209|       |
  210|  8.24M|  uint8_t buf[2];
  211|       |
  212|  8.24M|  auto istr = get_istream();
  213|  8.24M|  bool success = istr->read((char*) buf, 2);
  214|       |
  215|  8.24M|  if (!success) {
  ------------------
  |  Branch (215:7): [True: 0, False: 8.24M]
  ------------------
  216|      0|    set_eof_while_reading();
  217|      0|    return 0;
  218|      0|  }
  219|       |
  220|  8.24M|  return static_cast<uint16_t>((buf[0] << 8) | (buf[1]));
  221|  8.24M|}
_ZN14BitstreamRange7read16sEv:
  225|   547k|{
  226|   547k|  uint16_t v = read16();
  227|       |
  228|   547k|  if (v & 0x8000) {
  ------------------
  |  Branch (228:7): [True: 64.6k, False: 482k]
  ------------------
  229|  64.6k|    auto val = static_cast<int16_t>((~v) & 0x7fff);
  230|  64.6k|    return static_cast<int16_t>(-val - 1);
  231|  64.6k|  }
  232|   482k|  else {
  233|   482k|    return static_cast<int16_t>(v);
  234|   482k|  }
  235|   547k|}
_ZN14BitstreamRange6read24Ev:
  239|    203|{
  240|    203|  if (!prepare_read(3)) {
  ------------------
  |  Branch (240:7): [True: 0, False: 203]
  ------------------
  241|      0|    return 0;
  242|      0|  }
  243|       |
  244|    203|  uint8_t buf[3];
  245|       |
  246|    203|  auto istr = get_istream();
  247|    203|  bool success = istr->read((char*) buf, 3);
  248|       |
  249|    203|  if (!success) {
  ------------------
  |  Branch (249:7): [True: 0, False: 203]
  ------------------
  250|      0|    set_eof_while_reading();
  251|      0|    return 0;
  252|      0|  }
  253|       |
  254|    203|  return (uint32_t) ((buf[0] << 16) |
  255|    203|                     (buf[1] << 8) |
  256|    203|                     (buf[2]));
  257|    203|}
_ZN14BitstreamRange6read32Ev:
  260|  1.17G|{
  261|  1.17G|  if (!prepare_read(4)) {
  ------------------
  |  Branch (261:7): [True: 1.16G, False: 4.50M]
  ------------------
  262|  1.16G|    return 0;
  263|  1.16G|  }
  264|       |
  265|  4.50M|  uint8_t buf[4];
  266|       |
  267|  4.50M|  auto istr = get_istream();
  268|  4.50M|  bool success = istr->read((char*) buf, 4);
  269|       |
  270|  4.50M|  if (!success) {
  ------------------
  |  Branch (270:7): [True: 0, False: 4.50M]
  ------------------
  271|      0|    set_eof_while_reading();
  272|      0|    return 0;
  273|      0|  }
  274|       |
  275|  4.50M|  return four_bytes_to_uint32(buf[0], buf[1], buf[2], buf[3]);
  276|  4.50M|}
_ZN14BitstreamRange9read_uintEi:
  280|  2.20M|{
  281|  2.20M|  switch (len)
  282|  2.20M|  {
  283|  1.79M|    case 8:
  ------------------
  |  Branch (283:5): [True: 1.79M, False: 405k]
  ------------------
  284|  1.79M|      return read8();
  285|   101k|    case 16:
  ------------------
  |  Branch (285:5): [True: 101k, False: 2.10M]
  ------------------
  286|   101k|      return read16();
  287|    203|    case 24:
  ------------------
  |  Branch (287:5): [True: 203, False: 2.20M]
  ------------------
  288|    203|      return read24();
  289|   303k|    case 32:
  ------------------
  |  Branch (289:5): [True: 303k, False: 1.90M]
  ------------------
  290|   303k|      return read32();
  291|    262|    case 64:
  ------------------
  |  Branch (291:5): [True: 262, False: 2.20M]
  ------------------
  292|    262|      return read64();
  293|      0|    default:
  ------------------
  |  Branch (293:5): [True: 0, False: 2.20M]
  ------------------
  294|      0|      assert(false);
  ------------------
  |  Branch (294:7): [Folded, False: 0]
  ------------------
  295|      0|      return 0;
  296|  2.20M|  }
  297|  2.20M|}
_ZN14BitstreamRange7read32sEv:
  301|   351k|{
  302|   351k|  uint32_t v = read32();
  303|       |
  304|   351k|  if (v & 0x80000000) {
  ------------------
  |  Branch (304:7): [True: 67.5k, False: 283k]
  ------------------
  305|  67.5k|    return -static_cast<int32_t>((~v) & 0x7fffffff) -1;
  306|  67.5k|  }
  307|   283k|  else {
  308|   283k|    return static_cast<int32_t>(v);
  309|   283k|  }
  310|   351k|}
_ZN14BitstreamRange6read64Ev:
  314|  5.90k|{
  315|  5.90k|  if (!prepare_read(8)) {
  ------------------
  |  Branch (315:7): [True: 83, False: 5.82k]
  ------------------
  316|     83|    return 0;
  317|     83|  }
  318|       |
  319|  5.82k|  uint8_t buf[8];
  320|       |
  321|  5.82k|  auto istr = get_istream();
  322|  5.82k|  bool success = istr->read((char*) buf, 8);
  323|       |
  324|  5.82k|  if (!success) {
  ------------------
  |  Branch (324:7): [True: 0, False: 5.82k]
  ------------------
  325|      0|    set_eof_while_reading();
  326|      0|    return 0;
  327|      0|  }
  328|       |
  329|  5.82k|  return ((static_cast<uint64_t>(buf[0]) << 56) |
  330|  5.82k|          (static_cast<uint64_t>(buf[1]) << 48) |
  331|  5.82k|          (static_cast<uint64_t>(buf[2]) << 40) |
  332|  5.82k|          (static_cast<uint64_t>(buf[3]) << 32) |
  333|  5.82k|          (static_cast<uint64_t>(buf[4]) << 24) |
  334|  5.82k|          (static_cast<uint64_t>(buf[5]) << 16) |
  335|  5.82k|          (static_cast<uint64_t>(buf[6]) << 8) |
  336|  5.82k|          (static_cast<uint64_t>(buf[7])));
  337|  5.82k|}
_ZN14BitstreamRange7read64sEv:
  341|  1.35k|{
  342|  1.35k|  uint64_t v = read64();
  343|       |
  344|  1.35k|  if (v & 0x8000000000000000) {
  ------------------
  |  Branch (344:7): [True: 253, False: 1.10k]
  ------------------
  345|    253|    return -static_cast<int64_t >((~v) & 0x7fffffffffffffff) -1;
  346|    253|  }
  347|  1.10k|  else {
  348|  1.10k|    return static_cast<int64_t >(v);
  349|  1.10k|  }
  350|  1.35k|}
_ZN14BitstreamRange12read_float32Ev:
  354|  1.16G|{
  355|  1.16G|#if __cpp_lib_bit_cast >= 201806L
  356|  1.16G|  uint32_t i = read32();
  357|  1.16G|  return std::bit_cast<float>(i); // this works directly on the value layout, thus we do not have to worry about memory layout
  358|       |#else
  359|       |  // compiler too old to support bit_cast
  360|       |
  361|       |  // TODO: I am not sure this works everywhere as there seem to be systems where
  362|       |  //       the float byte order is different from the integer endianness
  363|       |  //       https://en.wikipedia.org/wiki/Endianness#Floating_point
  364|       |  uint32_t i = read32();
  365|       |  float f;
  366|       |  memcpy(&f, &i, sizeof(float));
  367|       |  return f;
  368|       |#endif
  369|  1.16G|}
_ZN14BitstreamRange11read_stringEv:
  390|  29.7k|{
  391|  29.7k|  std::string str;
  392|       |
  393|       |  // Reading a string when no more data is available, returns an empty string.
  394|       |  // Such a case happens, for example, when reading a 'url' box without content.
  395|  29.7k|  if (eof()) {
  ------------------
  |  Branch (395:7): [True: 5.94k, False: 23.8k]
  ------------------
  396|  5.94k|    return std::string();
  397|  5.94k|  }
  398|       |
  399|  23.8k|  auto istr = get_istream();
  400|       |
  401|  30.7M|  for (;;) {
  402|  30.7M|    if (!prepare_read(1)) {
  ------------------
  |  Branch (402:9): [True: 0, False: 30.7M]
  ------------------
  403|      0|      return std::string();
  404|      0|    }
  405|       |
  406|  30.7M|    char c;
  407|  30.7M|    bool success = istr->read(&c, 1);
  408|       |
  409|  30.7M|    if (!success) {
  ------------------
  |  Branch (409:9): [True: 0, False: 30.7M]
  ------------------
  410|      0|      set_eof_while_reading();
  411|      0|      return std::string();
  412|      0|    }
  413|       |
  414|  30.7M|    if (c == 0 || m_remaining==0) {
  ------------------
  |  Branch (414:9): [True: 23.1k, False: 30.7M]
  |  Branch (414:19): [True: 665, False: 30.7M]
  ------------------
  415|  23.8k|      break;
  416|  23.8k|    }
  417|  30.7M|    else {
  418|  30.7M|      str += (char) c;
  419|  30.7M|    }
  420|  30.7M|  }
  421|       |
  422|  23.8k|  return str;
  423|  23.8k|}
_ZN14BitstreamRange17read_fixed_stringEi:
  427|  1.17k|{
  428|  1.17k|  std::string str;
  429|       |
  430|  1.17k|  if (!prepare_read(len)) {
  ------------------
  |  Branch (430:7): [True: 66, False: 1.10k]
  ------------------
  431|     66|    return std::string();
  432|     66|  }
  433|       |
  434|  1.10k|  auto istr = get_istream();
  435|       |
  436|  1.10k|  uint8_t n;
  437|  1.10k|  bool success = istr->read(&n, 1);
  438|  1.10k|  if (!success || n > len - 1) {
  ------------------
  |  Branch (438:7): [True: 0, False: 1.10k]
  |  Branch (438:19): [True: 404, False: 704]
  ------------------
  439|    404|    return {};
  440|    404|  }
  441|       |
  442|  7.14k|  for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (442:19): [True: 6.44k, False: 704]
  ------------------
  443|  6.44k|    char c;
  444|  6.44k|    success = istr->read(&c, 1);
  445|       |
  446|  6.44k|    if (!success) {
  ------------------
  |  Branch (446:9): [True: 0, False: 6.44k]
  ------------------
  447|      0|      set_eof_while_reading();
  448|      0|      return std::string();
  449|      0|    }
  450|       |
  451|  6.44k|    str += (char) c;
  452|  6.44k|  }
  453|       |
  454|    704|  istr->seek_cur(len-n-1);
  455|       |
  456|    704|  return str;
  457|    704|}
_ZN14BitstreamRange21read_string_until_eofEv:
  461|  1.81k|{
  462|  1.81k|  size_t n = get_remaining_bytes();
  463|       |
  464|  1.81k|  [[maybe_unused]] bool success = prepare_read(n);
  465|  1.81k|  assert(success); // we are reading exactly the rest of the box
  ------------------
  |  Branch (465:3): [True: 1.81k, False: 0]
  ------------------
  466|       |
  467|  1.81k|  std::string str;
  468|  1.81k|  str.resize(n);
  469|  1.81k|  get_istream()->read(str.data(), n);
  470|       |
  471|  1.81k|  return str;
  472|  1.81k|}
_ZN14BitstreamRange4readEPhm:
  476|   178k|{
  477|   178k|  if (!prepare_read(n)) {
  ------------------
  |  Branch (477:7): [True: 59, False: 178k]
  ------------------
  478|     59|    return false;
  479|     59|  }
  480|       |
  481|   178k|  auto istr = get_istream();
  482|   178k|  bool success = istr->read(data, n);
  483|       |
  484|   178k|  if (!success) {
  ------------------
  |  Branch (484:7): [True: 0, False: 178k]
  ------------------
  485|      0|    set_eof_while_reading();
  486|      0|  }
  487|       |
  488|   178k|  return success;
  489|   178k|}
_ZN14BitstreamRange12prepare_readEm:
  493|  1.57G|{
  494|       |  // Note: we do not test for negative nBytes anymore because we now use the unsigned size_t
  495|       |
  496|  1.57G|  if (m_remaining < nBytes) {
  ------------------
  |  Branch (496:7): [True: 1.16G, False: 406M]
  ------------------
  497|       |    // --- not enough data left in box -> move to end of box and set error flag
  498|       |
  499|  1.16G|    skip_to_end_of_box();
  500|       |
  501|  1.16G|    m_error = true;
  502|  1.16G|    return false;
  503|  1.16G|  }
  504|   406M|  else {
  505|       |    // --- this is the normal case (m_remaining >= nBytes)
  506|       |
  507|   406M|    if (m_parent_range) {
  ------------------
  |  Branch (507:9): [True: 341M, False: 64.7M]
  ------------------
  508|   341M|      if (!m_parent_range->prepare_read(nBytes)) {
  ------------------
  |  Branch (508:11): [True: 0, False: 341M]
  ------------------
  509|      0|        return false;
  510|      0|      }
  511|   341M|    }
  512|       |
  513|   406M|    m_remaining -= nBytes;
  514|       |
  515|   406M|    return true;
  516|   406M|  }
  517|  1.57G|}
_ZN14BitstreamRange24wait_for_available_bytesEm:
  521|  1.00M|{
  522|  1.00M|  int64_t target_size = m_istr->get_position() + nBytes;
  523|       |
  524|  1.00M|  return m_istr->wait_for_file_size(target_size);
  525|  1.00M|}
_ZN14BitstreamRange31skip_without_advancing_file_posEm:
  529|   773k|{
  530|   773k|  assert(n <= m_remaining);
  ------------------
  |  Branch (530:3): [True: 773k, False: 0]
  ------------------
  531|       |
  532|   773k|  m_remaining -= n;
  533|       |
  534|   773k|  if (m_parent_range) {
  ------------------
  |  Branch (534:7): [True: 672k, False: 101k]
  ------------------
  535|   672k|    m_parent_range->skip_without_advancing_file_pos(n);
  536|   672k|  }
  537|   773k|}
_ZN9BitReaderC2EPKhm:
  541|  10.3k|  : data_start(buffer),
  542|  10.3k|    data_length(len)
  543|  10.3k|{
  544|  10.3k|  data = buffer;
  545|  10.3k|  bytes_remaining = len;
  546|       |
  547|  10.3k|  nextbits = 0;
  548|  10.3k|  nextbits_cnt = 0;
  549|       |
  550|  10.3k|  refill();
  551|  10.3k|}
_ZN9BitReader8get_bitsEi:
  567|   611k|{
  568|   611k|  assert(n <= 32);
  ------------------
  |  Branch (568:3): [True: 611k, False: 0]
  ------------------
  569|       |
  570|   611k|  if (nextbits_cnt < n) {
  ------------------
  |  Branch (570:7): [True: 67.5k, False: 543k]
  ------------------
  571|  67.5k|    refill();
  572|  67.5k|  }
  573|       |
  574|   611k|  uint64_t val = nextbits;
  575|   611k|  val >>= 64 - n;
  576|       |
  577|   611k|#if AVOID_FUZZER_FALSE_POSITIVE
  578|       |  // Shifting an unsigned integer left such that some MSBs fall out is well defined in C++ despite the fuzzer claiming otherwise.
  579|   611k|  nextbits &= (0xffffffffffffffffULL >> n);
  580|   611k|#endif
  581|       |
  582|   611k|  nextbits <<= n;
  583|   611k|  nextbits_cnt -= n;
  584|       |
  585|   611k|  return static_cast<uint32_t>(val);
  586|   611k|}
_ZN9BitReader9get_bits8Ei:
  590|   105k|{
  591|   105k|  assert(n>0 && n <= 8);
  ------------------
  |  Branch (591:3): [True: 105k, False: 0]
  |  Branch (591:3): [True: 105k, False: 0]
  |  Branch (591:3): [True: 105k, False: 0]
  ------------------
  592|   105k|  return static_cast<uint8_t>(get_bits(n));
  593|   105k|}
_ZN9BitReader10get_bits16Ei:
  596|  43.4k|{
  597|  43.4k|  assert(n>0 && n <= 16);
  ------------------
  |  Branch (597:3): [True: 43.4k, False: 0]
  |  Branch (597:3): [True: 43.4k, False: 0]
  |  Branch (597:3): [True: 43.4k, False: 0]
  ------------------
  598|  43.4k|  return static_cast<uint16_t>(get_bits(n));
  599|  43.4k|}
_ZN9BitReader10get_bits32Ei:
  602|   116k|{
  603|   116k|  assert(n>0 && n <= 32);
  ------------------
  |  Branch (603:3): [True: 116k, False: 0]
  |  Branch (603:3): [True: 116k, False: 0]
  |  Branch (603:3): [True: 116k, False: 0]
  ------------------
  604|   116k|  return static_cast<uint32_t>(get_bits(n));
  605|   116k|}
_ZN9BitReader11get_bits32sEv:
  608|  2.99k|{
  609|  2.99k|  uint32_t bits = get_bits(32);
  610|  2.99k|  return static_cast<int32_t>(bits);
  611|  2.99k|}
_ZN9BitReader8get_flagEv:
  615|   342k|{
  616|   342k|  return (get_bits(1) == 0x01);
  617|   342k|}
_ZN9BitReader10read_bytesEj:
  620|  6.11k|{
  621|       |  // TODO: this implementation isn't very efficient
  622|  6.11k|  std::vector<uint8_t> bytes;
  623|  40.5k|  for (uint32_t i = 0; i < n; i++) {
  ------------------
  |  Branch (623:24): [True: 34.4k, False: 6.11k]
  ------------------
  624|  34.4k|    bytes.push_back(get_bits8(8));
  625|  34.4k|  }
  626|  6.11k|  return bytes;
  627|  6.11k|}
_ZN9BitReader10skip_bytesEj:
  655|  19.6k|{
  656|       |  // TODO: this is slow
  657|   325k|  while (nBytes) {
  ------------------
  |  Branch (657:10): [True: 305k, False: 19.6k]
  ------------------
  658|   305k|    nBytes--;
  659|   305k|    skip_bits(8);
  660|   305k|  }
  661|  19.6k|}
_ZN9BitReader9skip_bitsEi:
  664|   334k|{
  665|   334k|  if (nextbits_cnt < n) {
  ------------------
  |  Branch (665:7): [True: 50.1k, False: 284k]
  ------------------
  666|  50.1k|    refill();
  667|  50.1k|  }
  668|       |
  669|   334k|#if AVOID_FUZZER_FALSE_POSITIVE
  670|   334k|  nextbits &= (0xffffffffffffffffULL >> n);
  671|   334k|#endif
  672|       |
  673|   334k|  nextbits <<= n;
  674|   334k|  nextbits_cnt -= n;
  675|   334k|}
_ZN9BitReader21skip_to_byte_boundaryEv:
  688|  10.3k|{
  689|  10.3k|  int nskip = (nextbits_cnt & 7);
  690|       |
  691|  10.3k|#if AVOID_FUZZER_FALSE_POSITIVE
  692|  10.3k|  nextbits &= (0xffffffffffffffffULL >> nskip);
  693|  10.3k|#endif
  694|       |
  695|  10.3k|  nextbits <<= nskip;
  696|  10.3k|  nextbits_cnt -= nskip;
  697|  10.3k|}
_ZN9BitReader6refillEv:
  738|   128k|{
  739|       |#if 0
  740|       |  // TODO: activate me once I'm sure this works
  741|       |  while (nextbits_cnt <= 64-8 && bytes_remaining) {
  742|       |    uint64_t newval = *data++;
  743|       |    bytes_remaining--;
  744|       |
  745|       |    nextbits_cnt += 8;
  746|       |    newval <<= 64-nextbits_cnt;
  747|       |    nextbits |= newval;
  748|       |  }
  749|       |#else
  750|   128k|  int shift = 64 - nextbits_cnt;
  751|       |
  752|   971k|  while (shift >= 8 && bytes_remaining) {
  ------------------
  |  Branch (752:10): [True: 849k, False: 121k]
  |  Branch (752:24): [True: 843k, False: 6.68k]
  ------------------
  753|   843k|    uint64_t newval = *data++;
  754|   843k|    bytes_remaining--;
  755|       |
  756|   843k|    shift -= 8;
  757|   843k|    newval <<= shift;
  758|   843k|    nextbits |= newval;
  759|   843k|  }
  760|       |
  761|   128k|  nextbits_cnt = 64 - shift;
  762|   128k|#endif
  763|   128k|}

_ZNK14BitstreamRange5errorEv:
  383|  8.82M|  {
  384|  8.82M|    return m_error;
  385|  8.82M|  }
_ZN12StreamReader8seek_curEm:
   62|   104k|  {
   63|   104k|    return seek(get_position() + position_offset);
   64|   104k|  }
_ZN14BitstreamRange19skip_to_end_of_fileEv:
  328|     77|  {
  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|     77|    m_remaining = 0;
  332|       |
  333|     77|    if (m_parent_range) {
  ------------------
  |  Branch (333:9): [True: 69, False: 8]
  ------------------
  334|     69|      m_parent_range->skip_to_end_of_file();
  335|     69|    }
  336|     77|  }
_ZN14BitstreamRange4skipEm:
  339|  19.1k|  {
  340|  19.1k|    size_t actual_skip = std::min(static_cast<size_t>(n), m_remaining);
  341|       |
  342|  19.1k|    if (m_parent_range) {
  ------------------
  |  Branch (342:9): [True: 19.1k, False: 0]
  ------------------
  343|       |      // also advance position in parent range
  344|  19.1k|      m_parent_range->skip_without_advancing_file_pos(actual_skip);
  345|  19.1k|    }
  346|       |
  347|  19.1k|    assert(actual_skip <= static_cast<uint64_t>(std::numeric_limits<int64_t>::max()));
  ------------------
  |  Branch (347:5): [True: 19.1k, False: 0]
  ------------------
  348|       |
  349|  19.1k|    m_istr->seek_cur(static_cast<int64_t>(actual_skip));
  350|  19.1k|    m_remaining -= actual_skip;
  351|  19.1k|  }
_ZN14BitstreamRange18skip_to_end_of_boxEv:
  354|  1.16G|  {
  355|  1.16G|    if (m_remaining > 0) {
  ------------------
  |  Branch (355:9): [True: 82.5k, False: 1.16G]
  ------------------
  356|  82.5k|      if (m_parent_range) {
  ------------------
  |  Branch (356:11): [True: 82.5k, False: 3]
  ------------------
  357|       |        // also advance position in parent range
  358|  82.5k|        m_parent_range->skip_without_advancing_file_pos(m_remaining);
  359|  82.5k|      }
  360|       |
  361|  82.5k|      m_istr->seek_cur(m_remaining);
  362|  82.5k|      m_remaining = 0;
  363|  82.5k|    }
  364|  1.16G|  }
_ZNK14BitstreamRange3eofEv:
  378|  13.5M|  {
  379|  13.5M|    return m_remaining == 0;
  380|  13.5M|  }
_ZNK14BitstreamRange9get_errorEv:
  388|  2.89M|  {
  389|  2.89M|    if (m_error) {
  ------------------
  |  Branch (389:9): [True: 9.25k, False: 2.88M]
  ------------------
  390|  9.25k|      return Error(heif_error_Invalid_input,
  391|  9.25k|                   heif_suberror_End_of_data);
  392|  9.25k|    }
  393|  2.88M|    else {
  394|  2.88M|      return Error::Ok;
  395|  2.88M|    }
  396|  2.89M|  }
_ZN14BitstreamRange11get_istreamEv:
  398|  34.5M|  std::shared_ptr<StreamReader> get_istream() { return m_istr; }
_ZNK14BitstreamRange17get_nesting_levelEv:
  400|   503k|  int get_nesting_level() const { return m_nesting_level; }
_ZNK14BitstreamRange19get_remaining_bytesEv:
  402|   599k|  size_t get_remaining_bytes() const { return m_remaining; }
_ZNK9BitReader22get_current_byte_indexEv:
  460|  19.6k|  {
  461|  19.6k|    return data_length - bytes_remaining - nextbits_cnt / 8;
  462|  19.6k|  }
_ZNK9BitReader18get_bits_remainingEv:
  465|  10.3k|  {
  466|  10.3k|    return ((int64_t) bytes_remaining) * 8 + nextbits_cnt;
  467|  10.3k|  }
_ZN12StreamReaderD2Ev:
   42|  16.7k|  virtual ~StreamReader() = default;

_ZN8FractionC2Eii:
   64|  67.7k|{
   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|  67.7k|  numerator = num;
   70|  67.7k|  denominator = den;
   71|       |
   72|   601k|  while (denominator > MAX_FRACTION_VALUE || denominator < -MAX_FRACTION_VALUE) {
  ------------------
  |  Branch (72:10): [True: 534k, False: 67.7k]
  |  Branch (72:46): [True: 0, False: 67.7k]
  ------------------
   73|   534k|    numerator /= 2;
   74|   534k|    denominator /= 2;
   75|   534k|  }
   76|       |
   77|   136k|  while (denominator > 1 && (numerator > MAX_FRACTION_VALUE || numerator < -MAX_FRACTION_VALUE)) {
  ------------------
  |  Branch (77:10): [True: 116k, False: 20.1k]
  |  Branch (77:30): [True: 68.1k, False: 47.9k]
  |  Branch (77:64): [True: 348, False: 47.5k]
  ------------------
   78|  68.5k|    numerator /= 2;
   79|  68.5k|    denominator /= 2;
   80|  68.5k|  }
   81|  67.7k|}
_ZN8FractionC2Ejj:
   84|  33.8k|{
   85|  33.8k|  assert(num <= (uint32_t) std::numeric_limits<int32_t>::max());
  ------------------
  |  Branch (85:3): [True: 33.8k, False: 0]
  ------------------
   86|  33.8k|  assert(den <= (uint32_t) std::numeric_limits<int32_t>::max());
  ------------------
  |  Branch (86:3): [True: 33.8k, False: 0]
  ------------------
   87|       |
   88|  33.8k|  *this = Fraction(int32_t(num), int32_t(den));
   89|  33.8k|}
_ZNK8Fraction8is_validEv:
  162|  63.9k|{
  163|  63.9k|  return denominator != 0;
  164|  63.9k|}
_ZN9BoxHeaderC2Ev:
  167|  1.12M|BoxHeader::BoxHeader() = default;
_ZNK9BoxHeader8get_typeEv:
  171|   119k|{
  172|   119k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (172:7): [True: 3.99k, False: 115k]
  ------------------
  173|  3.99k|    return m_uuid_type;
  174|  3.99k|  }
  175|   115k|  else {
  176|   115k|    std::vector<uint8_t> type(4);
  177|   115k|    type[0] = static_cast<uint8_t>((m_type >> 24) & 0xFF);
  178|   115k|    type[1] = static_cast<uint8_t>((m_type >> 16) & 0xFF);
  179|   115k|    type[2] = static_cast<uint8_t>((m_type >> 8) & 0xFF);
  180|   115k|    type[3] = static_cast<uint8_t>((m_type >> 0) & 0xFF);
  181|   115k|    return type;
  182|   115k|  }
  183|   119k|}
_ZNK9BoxHeader15get_type_stringEv:
  187|  1.04M|{
  188|  1.04M|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (188:7): [True: 29.0k, False: 1.01M]
  ------------------
  189|       |    // 8-4-4-4-12
  190|       |
  191|  29.0k|    std::ostringstream sstr;
  192|  29.0k|    sstr << std::hex;
  193|  29.0k|    sstr << std::setfill('0');
  194|       |
  195|   493k|    for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (195:21): [True: 464k, False: 29.0k]
  ------------------
  196|   464k|      if (i == 4 || i == 6 || i == 8 || i == 10) {
  ------------------
  |  Branch (196:11): [True: 29.0k, False: 435k]
  |  Branch (196:21): [True: 29.0k, False: 406k]
  |  Branch (196:31): [True: 29.0k, False: 377k]
  |  Branch (196:41): [True: 29.0k, False: 348k]
  ------------------
  197|   116k|        sstr << '-';
  198|   116k|      }
  199|       |
  200|   464k|      sstr << std::setw(2);
  201|   464k|      sstr << ((int) m_uuid_type[i]);
  202|   464k|    }
  203|       |
  204|  29.0k|    return sstr.str();
  205|  29.0k|  }
  206|  1.01M|  else {
  207|  1.01M|    return fourcc_to_string(m_type);
  208|  1.01M|  }
  209|  1.04M|}
_ZNK9BoxHeader13get_uuid_typeEv:
  213|  36.8k|{
  214|  36.8k|  if (m_type != fourcc("uuid")) {
  ------------------
  |  Branch (214:7): [True: 0, False: 36.8k]
  ------------------
  215|      0|    return {};
  216|      0|  }
  217|       |
  218|  36.8k|  return m_uuid_type;
  219|  36.8k|}
_ZN9BoxHeader13set_uuid_typeERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  223|  2.22k|{
  224|  2.22k|  m_type = fourcc("uuid");
  225|  2.22k|  m_uuid_type = type;
  226|  2.22k|}
_ZN9BoxHeader12parse_headerER14BitstreamRange:
  230|   531k|{
  231|   531k|  StreamReader::grow_status status;
  232|   531k|  status = range.wait_for_available_bytes(8);
  233|   531k|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (233:7): [True: 8.13k, False: 523k]
  ------------------
  234|       |    // TODO: return recoverable error at timeout
  235|  8.13k|    return Error(heif_error_Invalid_input,
  236|  8.13k|                 heif_suberror_End_of_data);
  237|  8.13k|  }
  238|       |
  239|   523k|  m_size = range.read32();
  240|   523k|  m_type = range.read32();
  241|       |
  242|   523k|  m_header_size = 8;
  243|       |
  244|   523k|  if (m_size == 1) {
  ------------------
  |  Branch (244:7): [True: 382, False: 522k]
  ------------------
  245|    382|    status = range.wait_for_available_bytes(8);
  246|    382|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (246:9): [True: 2, False: 380]
  ------------------
  247|       |      // TODO: return recoverable error at timeout
  248|      2|      return Error(heif_error_Invalid_input,
  249|      2|                   heif_suberror_End_of_data);
  250|      2|    }
  251|       |
  252|    380|    uint64_t high = range.read32();
  253|    380|    uint64_t low = range.read32();
  254|       |
  255|    380|    m_size = (high << 32) | low;
  256|    380|    m_header_size += 8;
  257|       |
  258|    380|    std::stringstream sstr;
  259|    380|    sstr << "Box size " << m_size << " exceeds security limit.";
  260|       |
  261|    380|    if (m_size > MAX_LARGE_BOX_SIZE) {
  ------------------
  |  Branch (261:9): [True: 10, False: 370]
  ------------------
  262|     10|      return Error(heif_error_Memory_allocation_error,
  263|     10|                   heif_suberror_Security_limit_exceeded,
  264|     10|                   sstr.str());
  265|     10|    }
  266|    380|  }
  267|       |
  268|   523k|  if (m_type == fourcc("uuid")) {
  ------------------
  |  Branch (268:7): [True: 14.0k, False: 509k]
  ------------------
  269|  14.0k|    status = range.wait_for_available_bytes(16);
  270|  14.0k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (270:9): [True: 3, False: 14.0k]
  ------------------
  271|       |      // TODO: return recoverable error at timeout
  272|      3|      return Error(heif_error_Invalid_input,
  273|      3|                   heif_suberror_End_of_data);
  274|      3|    }
  275|       |
  276|  14.0k|    if (range.prepare_read(16)) {
  ------------------
  |  Branch (276:9): [True: 14.0k, False: 1]
  ------------------
  277|  14.0k|      m_uuid_type.resize(16);
  278|  14.0k|      bool success = range.get_istream()->read((char*) m_uuid_type.data(), 16);
  279|  14.0k|      assert(success);
  ------------------
  |  Branch (279:7): [True: 14.0k, False: 0]
  ------------------
  280|  14.0k|      (void) success;
  281|  14.0k|    }
  282|       |
  283|  14.0k|    m_header_size += 16;
  284|  14.0k|  }
  285|       |
  286|   523k|  return range.get_error();
  287|   523k|}
_ZNK9BoxHeader4dumpER6Indent:
  392|   407k|{
  393|   407k|  std::ostringstream sstr;
  394|   407k|  sstr << indent << "Box: " << get_type_string();
  395|   407k|  const char* debug_name = debug_box_name();
  396|   407k|  if (debug_name) {
  ------------------
  |  Branch (396:7): [True: 196k, False: 211k]
  ------------------
  397|   196k|    sstr << " ----- (" << debug_name << ")\n";
  398|   196k|  }
  399|   211k|  else {
  400|   211k|    sstr << " -----\n";
  401|   211k|  }
  402|       |
  403|   407k|  sstr << indent << "size: " << get_box_size() << "   (header size: " << get_header_size() << ")\n";
  404|       |
  405|   407k|  return sstr.str();
  406|   407k|}
_ZN3Box5parseER14BitstreamRangePK20heif_security_limits:
  410|  2.50k|{
  411|       |  // skip box
  412|       |
  413|  2.50k|  if (get_box_size() == size_until_end_of_file) {
  ------------------
  |  Branch (413:7): [True: 8, False: 2.50k]
  ------------------
  414|      8|    range.skip_to_end_of_file();
  415|      8|  }
  416|  2.50k|  else {
  417|  2.50k|    uint64_t content_size = get_box_size() - get_header_size();
  418|       |
  419|  2.50k|    assert(MAX_BOX_SIZE <= SIZE_MAX);
  ------------------
  |  Branch (419:5): [True: 2.50k, Folded]
  ------------------
  420|       |
  421|  2.50k|    if (content_size > MAX_BOX_SIZE) {
  ------------------
  |  Branch (421:9): [True: 0, False: 2.50k]
  ------------------
  422|      0|      return Error(heif_error_Invalid_input,
  423|      0|                   heif_suberror_Invalid_box_size);
  424|      0|    }
  425|       |
  426|  2.50k|    if (range.prepare_read(static_cast<size_t>(content_size))) {
  ------------------
  |  Branch (426:9): [True: 2.50k, False: 0]
  ------------------
  427|  2.50k|      range.get_istream()->seek_cur(get_box_size() - get_header_size());
  428|  2.50k|    }
  429|  2.50k|  }
  430|       |
  431|       |  // Note: seekg() clears the eof flag and it will not be set again afterwards,
  432|       |  // hence we have to test for the fail flag.
  433|       |
  434|  2.50k|  return range.get_error();
  435|  2.50k|}
_ZN7FullBox21parse_full_box_headerER14BitstreamRange:
  439|   107k|{
  440|   107k|  uint32_t data = range.read32();
  441|   107k|  m_version = static_cast<uint8_t>(data >> 24);
  442|   107k|  m_flags = data & 0x00FFFFFF;
  443|       |  //m_is_full_box = true;
  444|       |
  445|   107k|  m_header_size += 4;
  446|       |
  447|   107k|  return range.get_error();
  448|   107k|}
_ZN3Box4readER14BitstreamRangePNSt3__110shared_ptrIS_EEPK20heif_security_limits:
  452|   511k|{
  453|   511k|  BoxHeader hdr;
  454|   511k|  Error err = hdr.parse_header(range);
  455|   511k|  if (err) {
  ------------------
  |  Branch (455:7): [True: 8.17k, False: 503k]
  ------------------
  456|  8.17k|    return err;
  457|  8.17k|  }
  458|       |
  459|   503k|  if (range.error()) {
  ------------------
  |  Branch (459:7): [True: 0, False: 503k]
  ------------------
  460|      0|    return range.get_error();
  461|      0|  }
  462|       |
  463|   503k|  result->reset();
  464|       |
  465|   503k|  std::shared_ptr<Box> box;
  466|       |
  467|   503k|  switch (hdr.get_short_type()) {
  468|  11.4k|    case fourcc("ftyp"):
  ------------------
  |  Branch (468:5): [True: 11.4k, False: 492k]
  ------------------
  469|  11.4k|      box = std::make_shared<Box_ftyp>();
  470|  11.4k|      break;
  471|       |
  472|    681|    case fourcc("free"):
  ------------------
  |  Branch (472:5): [True: 681, False: 502k]
  ------------------
  473|    951|    case fourcc("skip"):
  ------------------
  |  Branch (473:5): [True: 270, False: 503k]
  ------------------
  474|    951|      box = std::make_shared<Box_free>();
  475|    951|      break;
  476|       |
  477|  3.38k|    case fourcc("meta"):
  ------------------
  |  Branch (477:5): [True: 3.38k, False: 500k]
  ------------------
  478|  3.38k|      box = std::make_shared<Box_meta>();
  479|  3.38k|      break;
  480|       |
  481|  4.91k|    case fourcc("hdlr"):
  ------------------
  |  Branch (481:5): [True: 4.91k, False: 498k]
  ------------------
  482|  4.91k|      box = std::make_shared<Box_hdlr>();
  483|  4.91k|      break;
  484|       |
  485|  3.41k|    case fourcc("pitm"):
  ------------------
  |  Branch (485:5): [True: 3.41k, False: 500k]
  ------------------
  486|  3.41k|      box = std::make_shared<Box_pitm>();
  487|  3.41k|      break;
  488|       |
  489|  2.19k|    case fourcc("iloc"):
  ------------------
  |  Branch (489:5): [True: 2.19k, False: 501k]
  ------------------
  490|  2.19k|      box = std::make_shared<Box_iloc>();
  491|  2.19k|      break;
  492|       |
  493|  4.07k|    case fourcc("iinf"):
  ------------------
  |  Branch (493:5): [True: 4.07k, False: 499k]
  ------------------
  494|  4.07k|      box = std::make_shared<Box_iinf>();
  495|  4.07k|      break;
  496|       |
  497|  4.52k|    case fourcc("infe"):
  ------------------
  |  Branch (497:5): [True: 4.52k, False: 499k]
  ------------------
  498|  4.52k|      box = std::make_shared<Box_infe>();
  499|  4.52k|      break;
  500|       |
  501|  29.9k|    case fourcc("iprp"):
  ------------------
  |  Branch (501:5): [True: 29.9k, False: 473k]
  ------------------
  502|  29.9k|      box = std::make_shared<Box_iprp>();
  503|  29.9k|      break;
  504|       |
  505|  14.3k|    case fourcc("ipco"):
  ------------------
  |  Branch (505:5): [True: 14.3k, False: 489k]
  ------------------
  506|  14.3k|      box = std::make_shared<Box_ipco>();
  507|  14.3k|      break;
  508|       |
  509|  3.16k|    case fourcc("ipma"):
  ------------------
  |  Branch (509:5): [True: 3.16k, False: 500k]
  ------------------
  510|  3.16k|      box = std::make_shared<Box_ipma>();
  511|  3.16k|      break;
  512|       |
  513|  2.97k|    case fourcc("ispe"):
  ------------------
  |  Branch (513:5): [True: 2.97k, False: 500k]
  ------------------
  514|  2.97k|      box = std::make_shared<Box_ispe>();
  515|  2.97k|      break;
  516|       |
  517|    963|    case fourcc("auxC"):
  ------------------
  |  Branch (517:5): [True: 963, False: 502k]
  ------------------
  518|    963|      box = std::make_shared<Box_auxC>();
  519|    963|      break;
  520|       |
  521|  12.8k|    case fourcc("irot"):
  ------------------
  |  Branch (521:5): [True: 12.8k, False: 490k]
  ------------------
  522|  12.8k|      box = std::make_shared<Box_irot>();
  523|  12.8k|      break;
  524|       |
  525|  2.53k|    case fourcc("imir"):
  ------------------
  |  Branch (525:5): [True: 2.53k, False: 501k]
  ------------------
  526|  2.53k|      box = std::make_shared<Box_imir>();
  527|  2.53k|      break;
  528|       |
  529|  19.1k|    case fourcc("clap"):
  ------------------
  |  Branch (529:5): [True: 19.1k, False: 484k]
  ------------------
  530|  19.1k|      box = std::make_shared<Box_clap>();
  531|  19.1k|      break;
  532|       |
  533|    698|    case fourcc("iscl"):
  ------------------
  |  Branch (533:5): [True: 698, False: 502k]
  ------------------
  534|    698|      box = std::make_shared<Box_iscl>();
  535|    698|      break;
  536|       |
  537|  14.8k|    case fourcc("iref"):
  ------------------
  |  Branch (537:5): [True: 14.8k, False: 488k]
  ------------------
  538|  14.8k|      box = std::make_shared<Box_iref>();
  539|  14.8k|      break;
  540|       |
  541|    807|    case fourcc("rref"):
  ------------------
  |  Branch (541:5): [True: 807, False: 502k]
  ------------------
  542|    807|      box = std::make_shared<Box_rref>();
  543|    807|      break;
  544|       |
  545|  4.56k|    case fourcc("hvcC"):
  ------------------
  |  Branch (545:5): [True: 4.56k, False: 499k]
  ------------------
  546|  4.56k|      box = std::make_shared<Box_hvcC>();
  547|  4.56k|      break;
  548|       |
  549|    140|    case fourcc("hvc1"):
  ------------------
  |  Branch (549:5): [True: 140, False: 503k]
  ------------------
  550|    140|      box = std::make_shared<Box_hvc1>();
  551|    140|      break;
  552|       |
  553|  3.50k|    case fourcc("av1C"):
  ------------------
  |  Branch (553:5): [True: 3.50k, False: 500k]
  ------------------
  554|  3.50k|      box = std::make_shared<Box_av1C>();
  555|  3.50k|      break;
  556|       |
  557|    160|    case fourcc("av01"):
  ------------------
  |  Branch (557:5): [True: 160, False: 503k]
  ------------------
  558|    160|      box = std::make_shared<Box_av01>();
  559|    160|      break;
  560|       |
  561|  2.42k|    case fourcc("vvcC"):
  ------------------
  |  Branch (561:5): [True: 2.42k, False: 501k]
  ------------------
  562|  2.42k|      box = std::make_shared<Box_vvcC>();
  563|  2.42k|      break;
  564|       |
  565|    144|    case fourcc("vvc1"):
  ------------------
  |  Branch (565:5): [True: 144, False: 503k]
  ------------------
  566|    144|      box = std::make_shared<Box_vvc1>();
  567|    144|      break;
  568|       |
  569|  9.84k|    case fourcc("idat"):
  ------------------
  |  Branch (569:5): [True: 9.84k, False: 493k]
  ------------------
  570|  9.84k|      box = std::make_shared<Box_idat>();
  571|  9.84k|      break;
  572|       |
  573|  1.82k|    case fourcc("grpl"):
  ------------------
  |  Branch (573:5): [True: 1.82k, False: 501k]
  ------------------
  574|  1.82k|      box = std::make_shared<Box_grpl>();
  575|  1.82k|      break;
  576|       |
  577|  1.65k|    case fourcc("pymd"):
  ------------------
  |  Branch (577:5): [True: 1.65k, False: 501k]
  ------------------
  578|  1.65k|      box = std::make_shared<Box_pymd>();
  579|  1.65k|      break;
  580|       |
  581|     87|    case fourcc("altr"):
  ------------------
  |  Branch (581:5): [True: 87, False: 503k]
  ------------------
  582|     87|      box = std::make_shared<Box_EntityToGroup>();
  583|     87|      break;
  584|       |
  585|  1.20k|    case fourcc("ster"):
  ------------------
  |  Branch (585:5): [True: 1.20k, False: 502k]
  ------------------
  586|  1.20k|      box = std::make_shared<Box_ster>();
  587|  1.20k|      break;
  588|       |
  589|  8.12k|    case fourcc("dinf"):
  ------------------
  |  Branch (589:5): [True: 8.12k, False: 495k]
  ------------------
  590|  8.12k|      box = std::make_shared<Box_dinf>();
  591|  8.12k|      break;
  592|       |
  593|  1.46k|    case fourcc("dref"):
  ------------------
  |  Branch (593:5): [True: 1.46k, False: 502k]
  ------------------
  594|  1.46k|      box = std::make_shared<Box_dref>();
  595|  1.46k|      break;
  596|       |
  597|  2.06k|    case fourcc("url "):
  ------------------
  |  Branch (597:5): [True: 2.06k, False: 501k]
  ------------------
  598|  2.06k|      box = std::make_shared<Box_url>();
  599|  2.06k|      break;
  600|       |
  601|  12.3k|    case fourcc("colr"):
  ------------------
  |  Branch (601:5): [True: 12.3k, False: 491k]
  ------------------
  602|  12.3k|      box = std::make_shared<Box_colr>();
  603|  12.3k|      break;
  604|       |
  605|  3.77k|    case fourcc("pixi"):
  ------------------
  |  Branch (605:5): [True: 3.77k, False: 499k]
  ------------------
  606|  3.77k|      box = std::make_shared<Box_pixi>();
  607|  3.77k|      break;
  608|       |
  609|  14.8k|    case fourcc("pasp"):
  ------------------
  |  Branch (609:5): [True: 14.8k, False: 488k]
  ------------------
  610|  14.8k|      box = std::make_shared<Box_pasp>();
  611|  14.8k|      break;
  612|       |
  613|  7.51k|    case fourcc("lsel"):
  ------------------
  |  Branch (613:5): [True: 7.51k, False: 496k]
  ------------------
  614|  7.51k|      box = std::make_shared<Box_lsel>();
  615|  7.51k|      break;
  616|       |
  617|  18.9k|    case fourcc("a1op"):
  ------------------
  |  Branch (617:5): [True: 18.9k, False: 484k]
  ------------------
  618|  18.9k|      box = std::make_shared<Box_a1op>();
  619|  18.9k|      break;
  620|       |
  621|  5.57k|    case fourcc("a1lx"):
  ------------------
  |  Branch (621:5): [True: 5.57k, False: 497k]
  ------------------
  622|  5.57k|      box = std::make_shared<Box_a1lx>();
  623|  5.57k|      break;
  624|       |
  625|  3.52k|    case fourcc("clli"):
  ------------------
  |  Branch (625:5): [True: 3.52k, False: 500k]
  ------------------
  626|  3.52k|      box = std::make_shared<Box_clli>();
  627|  3.52k|      break;
  628|       |
  629|  4.39k|    case fourcc("mdcv"):
  ------------------
  |  Branch (629:5): [True: 4.39k, False: 499k]
  ------------------
  630|  4.39k|      box = std::make_shared<Box_mdcv>();
  631|  4.39k|      break;
  632|       |
  633|  1.03k|    case fourcc("amve"):
  ------------------
  |  Branch (633:5): [True: 1.03k, False: 502k]
  ------------------
  634|  1.03k|      box = std::make_shared<Box_amve>();
  635|  1.03k|      break;
  636|       |
  637|    614|    case fourcc("ndwt"):
  ------------------
  |  Branch (637:5): [True: 614, False: 502k]
  ------------------
  638|    614|      box = std::make_shared<Box_ndwt>();
  639|    614|      break;
  640|       |
  641|  1.89k|    case fourcc("cmin"):
  ------------------
  |  Branch (641:5): [True: 1.89k, False: 501k]
  ------------------
  642|  1.89k|      box = std::make_shared<Box_cmin>();
  643|  1.89k|      break;
  644|       |
  645|  2.10k|    case fourcc("cmex"):
  ------------------
  |  Branch (645:5): [True: 2.10k, False: 501k]
  ------------------
  646|  2.10k|      box = std::make_shared<Box_cmex>();
  647|  2.10k|      break;
  648|       |
  649|  1.72k|    case fourcc("udes"):
  ------------------
  |  Branch (649:5): [True: 1.72k, False: 501k]
  ------------------
  650|  1.72k|      box = std::make_shared<Box_udes>();
  651|  1.72k|      break;
  652|       |
  653|  5.27k|    case fourcc("jpgC"):
  ------------------
  |  Branch (653:5): [True: 5.27k, False: 498k]
  ------------------
  654|  5.27k|      box = std::make_shared<Box_jpgC>();
  655|  5.27k|      break;
  656|       |
  657|    126|    case fourcc("mjpg"):
  ------------------
  |  Branch (657:5): [True: 126, False: 503k]
  ------------------
  658|    126|      box = std::make_shared<Box_mjpg>();
  659|    126|      break;
  660|       |
  661|  1.09k|    case fourcc("elng"):
  ------------------
  |  Branch (661:5): [True: 1.09k, False: 502k]
  ------------------
  662|  1.09k|      box = std::make_shared<Box_elng>();
  663|  1.09k|      break;
  664|       |
  665|       |
  666|      0|#if WITH_UNCOMPRESSED_CODEC
  667|  1.12k|    case fourcc("cmpd"):
  ------------------
  |  Branch (667:5): [True: 1.12k, False: 502k]
  ------------------
  668|  1.12k|      box = std::make_shared<Box_cmpd>();
  669|  1.12k|      break;
  670|       |
  671|  5.75k|    case fourcc("uncC"):
  ------------------
  |  Branch (671:5): [True: 5.75k, False: 497k]
  ------------------
  672|  5.75k|      box = std::make_shared<Box_uncC>();
  673|  5.75k|      break;
  674|       |
  675|    743|    case fourcc("cmpC"):
  ------------------
  |  Branch (675:5): [True: 743, False: 502k]
  ------------------
  676|    743|      box = std::make_shared<Box_cmpC>();
  677|    743|      break;
  678|       |
  679|  1.04k|    case fourcc("icef"):
  ------------------
  |  Branch (679:5): [True: 1.04k, False: 502k]
  ------------------
  680|  1.04k|      box = std::make_shared<Box_icef>();
  681|  1.04k|      break;
  682|       |
  683|    740|    case fourcc("cpat"):
  ------------------
  |  Branch (683:5): [True: 740, False: 502k]
  ------------------
  684|    740|      box = std::make_shared<Box_cpat>();
  685|    740|      break;
  686|       |
  687|    554|    case fourcc("splz"):
  ------------------
  |  Branch (687:5): [True: 554, False: 503k]
  ------------------
  688|    554|      box = std::make_shared<Box_splz>();
  689|    554|      break;
  690|       |
  691|    834|    case fourcc("sbpm"):
  ------------------
  |  Branch (691:5): [True: 834, False: 502k]
  ------------------
  692|    834|      box = std::make_shared<Box_sbpm>();
  693|    834|      break;
  694|       |
  695|    210|    case fourcc("snuc"):
  ------------------
  |  Branch (695:5): [True: 210, False: 503k]
  ------------------
  696|    210|      box = std::make_shared<Box_snuc>();
  697|    210|      break;
  698|       |
  699|    234|    case fourcc("cloc"):
  ------------------
  |  Branch (699:5): [True: 234, False: 503k]
  ------------------
  700|    234|      box = std::make_shared<Box_cloc>();
  701|    234|      break;
  702|       |
  703|    458|    case fourcc("uncv"):
  ------------------
  |  Branch (703:5): [True: 458, False: 503k]
  ------------------
  704|    458|      box = std::make_shared<Box_uncv>();
  705|    458|      break;
  706|      0|#endif
  707|       |
  708|       |    // --- JPEG 2000
  709|       |
  710|  7.71k|    case fourcc("j2kH"):
  ------------------
  |  Branch (710:5): [True: 7.71k, False: 495k]
  ------------------
  711|  7.71k|      box = std::make_shared<Box_j2kH>();
  712|  7.71k|      break;
  713|       |
  714|  9.06k|    case fourcc("cdef"):
  ------------------
  |  Branch (714:5): [True: 9.06k, False: 494k]
  ------------------
  715|  9.06k|      box = std::make_shared<Box_cdef>();
  716|  9.06k|      break;
  717|       |
  718|  3.17k|    case fourcc("cmap"):
  ------------------
  |  Branch (718:5): [True: 3.17k, False: 500k]
  ------------------
  719|  3.17k|      box = std::make_shared<Box_cmap>();
  720|  3.17k|      break;
  721|       |
  722|  1.86k|    case fourcc("pclr"):
  ------------------
  |  Branch (722:5): [True: 1.86k, False: 501k]
  ------------------
  723|  1.86k|      box = std::make_shared<Box_pclr>();
  724|  1.86k|      break;
  725|       |
  726|    688|    case fourcc("j2kL"):
  ------------------
  |  Branch (726:5): [True: 688, False: 502k]
  ------------------
  727|    688|      box = std::make_shared<Box_j2kL>();
  728|    688|      break;
  729|       |
  730|     95|    case fourcc("j2ki"):
  ------------------
  |  Branch (730:5): [True: 95, False: 503k]
  ------------------
  731|     95|      box = std::make_shared<Box_j2ki>();
  732|     95|      break;
  733|       |
  734|       |
  735|       |    // --- mski
  736|       |
  737|    652|    case fourcc("mskC"):
  ------------------
  |  Branch (737:5): [True: 652, False: 502k]
  ------------------
  738|    652|      box = std::make_shared<Box_mskC>();
  739|    652|      break;
  740|       |
  741|       |    // --- TAI timestamps
  742|       |
  743|    521|    case fourcc("itai"):
  ------------------
  |  Branch (743:5): [True: 521, False: 503k]
  ------------------
  744|    521|      box = std::make_shared<Box_itai>();
  745|    521|      break;
  746|       |
  747|  1.35k|    case fourcc("taic"):
  ------------------
  |  Branch (747:5): [True: 1.35k, False: 502k]
  ------------------
  748|  1.35k|      box = std::make_shared<Box_taic>();
  749|  1.35k|      break;
  750|       |
  751|       |    // --- AVC (H.264)
  752|       |
  753|  4.65k|    case fourcc("avcC"):
  ------------------
  |  Branch (753:5): [True: 4.65k, False: 498k]
  ------------------
  754|  4.65k|      box = std::make_shared<Box_avcC>();
  755|  4.65k|      break;
  756|       |
  757|     66|    case fourcc("avc1"):
  ------------------
  |  Branch (757:5): [True: 66, False: 503k]
  ------------------
  758|     66|      box = std::make_shared<Box_avc1>();
  759|     66|      break;
  760|       |
  761|      0|#if HEIF_ENABLE_EXPERIMENTAL_FEATURES
  762|  1.29k|    case fourcc("tilC"):
  ------------------
  |  Branch (762:5): [True: 1.29k, False: 502k]
  ------------------
  763|  1.29k|      box = std::make_shared<Box_tilC>();
  764|  1.29k|      break;
  765|      0|#endif
  766|       |
  767|  10.4k|    case fourcc("mini"):
  ------------------
  |  Branch (767:5): [True: 10.4k, False: 493k]
  ------------------
  768|  10.4k|      box = std::make_shared<Box_mini>();
  769|  10.4k|      break;
  770|       |
  771|  2.51k|    case fourcc("mdat"):
  ------------------
  |  Branch (771:5): [True: 2.51k, False: 501k]
  ------------------
  772|       |      // avoid generating a 'Box_other'
  773|  2.51k|      box = std::make_shared<Box>();
  774|  2.51k|      break;
  775|       |
  776|  13.6k|    case fourcc("uuid"):
  ------------------
  |  Branch (776:5): [True: 13.6k, False: 489k]
  ------------------
  777|  13.6k|      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 (777:11): [True: 2.50k, False: 11.1k]
  ------------------
  778|  2.50k|        box = std::make_shared<Box_cmin>();
  779|  2.50k|      }
  780|  11.1k|      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 (780:16): [True: 4.22k, False: 6.92k]
  ------------------
  781|  4.22k|        box = std::make_shared<Box_cmex>();
  782|  4.22k|      }
  783|  6.92k|      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 (783:16): [True: 1.81k, False: 5.10k]
  ------------------
  784|  1.81k|        box = std::make_shared<Box_gimi_content_id>();
  785|  1.81k|      }
  786|  5.10k|#if WITH_UNCOMPRESSED_CODEC
  787|  5.10k|      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 (787:16): [True: 408, False: 4.69k]
  ------------------
  788|    408|        box = std::make_shared<Box_gimi_component_content_ids>();
  789|    408|      }
  790|  4.69k|#endif
  791|  4.69k|      else {
  792|  4.69k|        box = std::make_shared<Box_other>(hdr.get_short_type());
  793|  4.69k|      }
  794|  13.6k|      break;
  795|       |
  796|       |    // --- sequences
  797|       |
  798|    419|    case fourcc("moov"):
  ------------------
  |  Branch (798:5): [True: 419, False: 503k]
  ------------------
  799|    419|      box = std::make_shared<Box_moov>();
  800|    419|      break;
  801|       |
  802|  1.15k|    case fourcc("mvhd"):
  ------------------
  |  Branch (802:5): [True: 1.15k, False: 502k]
  ------------------
  803|  1.15k|      box = std::make_shared<Box_mvhd>();
  804|  1.15k|      break;
  805|       |
  806|    519|    case fourcc("trak"):
  ------------------
  |  Branch (806:5): [True: 519, False: 503k]
  ------------------
  807|    519|      box = std::make_shared<Box_trak>();
  808|    519|      break;
  809|       |
  810|  1.35k|    case fourcc("tkhd"):
  ------------------
  |  Branch (810:5): [True: 1.35k, False: 502k]
  ------------------
  811|  1.35k|      box = std::make_shared<Box_tkhd>();
  812|  1.35k|      break;
  813|       |
  814|     77|    case fourcc("mdia"):
  ------------------
  |  Branch (814:5): [True: 77, False: 503k]
  ------------------
  815|     77|      box = std::make_shared<Box_mdia>();
  816|     77|      break;
  817|       |
  818|  1.04k|    case fourcc("mdhd"):
  ------------------
  |  Branch (818:5): [True: 1.04k, False: 502k]
  ------------------
  819|  1.04k|      box = std::make_shared<Box_mdhd>();
  820|  1.04k|      break;
  821|       |
  822|    293|    case fourcc("minf"):
  ------------------
  |  Branch (822:5): [True: 293, False: 503k]
  ------------------
  823|    293|      box = std::make_shared<Box_minf>();
  824|    293|      break;
  825|       |
  826|    762|    case fourcc("vmhd"):
  ------------------
  |  Branch (826:5): [True: 762, False: 502k]
  ------------------
  827|    762|      box = std::make_shared<Box_vmhd>();
  828|    762|      break;
  829|       |
  830|    521|    case fourcc("stbl"):
  ------------------
  |  Branch (830:5): [True: 521, False: 503k]
  ------------------
  831|    521|      box = std::make_shared<Box_stbl>();
  832|    521|      break;
  833|       |
  834|  1.16k|    case fourcc("stsd"):
  ------------------
  |  Branch (834:5): [True: 1.16k, False: 502k]
  ------------------
  835|  1.16k|      box = std::make_shared<Box_stsd>();
  836|  1.16k|      break;
  837|       |
  838|    878|    case fourcc("stts"):
  ------------------
  |  Branch (838:5): [True: 878, False: 502k]
  ------------------
  839|    878|      box = std::make_shared<Box_stts>();
  840|    878|      break;
  841|       |
  842|  1.08k|    case fourcc("ctts"):
  ------------------
  |  Branch (842:5): [True: 1.08k, False: 502k]
  ------------------
  843|  1.08k|      box = std::make_shared<Box_ctts>();
  844|  1.08k|      break;
  845|       |
  846|    391|    case fourcc("stsc"):
  ------------------
  |  Branch (846:5): [True: 391, False: 503k]
  ------------------
  847|    391|      box = std::make_shared<Box_stsc>();
  848|    391|      break;
  849|       |
  850|    544|    case fourcc("stco"):
  ------------------
  |  Branch (850:5): [True: 544, False: 503k]
  ------------------
  851|    544|      box = std::make_shared<Box_stco>();
  852|    544|      break;
  853|       |
  854|    759|    case fourcc("stsz"):
  ------------------
  |  Branch (854:5): [True: 759, False: 502k]
  ------------------
  855|    759|      box = std::make_shared<Box_stsz>();
  856|    759|      break;
  857|       |
  858|    570|    case fourcc("stss"):
  ------------------
  |  Branch (858:5): [True: 570, False: 503k]
  ------------------
  859|    570|      box = std::make_shared<Box_stss>();
  860|    570|      break;
  861|       |
  862|    678|    case fourcc("ccst"):
  ------------------
  |  Branch (862:5): [True: 678, False: 502k]
  ------------------
  863|    678|      box = std::make_shared<Box_ccst>();
  864|    678|      break;
  865|       |
  866|    747|    case fourcc("auxi"):
  ------------------
  |  Branch (866:5): [True: 747, False: 502k]
  ------------------
  867|    747|      box = std::make_shared<Box_auxi>();
  868|    747|      break;
  869|       |
  870|    332|    case fourcc("edts"):
  ------------------
  |  Branch (870:5): [True: 332, False: 503k]
  ------------------
  871|    332|      box = std::make_shared<Box_edts>();
  872|    332|      break;
  873|       |
  874|  1.02k|    case fourcc("elst"):
  ------------------
  |  Branch (874:5): [True: 1.02k, False: 502k]
  ------------------
  875|  1.02k|      box = std::make_shared<Box_elst>();
  876|  1.02k|      break;
  877|       |
  878|  1.52k|    case fourcc("sbgp"):
  ------------------
  |  Branch (878:5): [True: 1.52k, False: 502k]
  ------------------
  879|  1.52k|      box = std::make_shared<Box_sbgp>();
  880|  1.52k|      break;
  881|       |
  882|  1.43k|    case fourcc("sgpd"):
  ------------------
  |  Branch (882:5): [True: 1.43k, False: 502k]
  ------------------
  883|  1.43k|      box = std::make_shared<Box_sgpd>();
  884|  1.43k|      break;
  885|       |
  886|    791|    case fourcc("btrt"):
  ------------------
  |  Branch (886:5): [True: 791, False: 502k]
  ------------------
  887|    791|      box = std::make_shared<Box_btrt>();
  888|    791|      break;
  889|       |
  890|  1.45k|    case fourcc("saiz"):
  ------------------
  |  Branch (890:5): [True: 1.45k, False: 502k]
  ------------------
  891|  1.45k|      box = std::make_shared<Box_saiz>();
  892|  1.45k|      break;
  893|       |
  894|  1.75k|    case fourcc("saio"):
  ------------------
  |  Branch (894:5): [True: 1.75k, False: 501k]
  ------------------
  895|  1.75k|      box = std::make_shared<Box_saio>();
  896|  1.75k|      break;
  897|       |
  898|  1.37k|    case fourcc("urim"):
  ------------------
  |  Branch (898:5): [True: 1.37k, False: 502k]
  ------------------
  899|  1.37k|      box = std::make_shared<Box_URIMetaSampleEntry>();
  900|  1.37k|      break;
  901|       |
  902|    829|    case fourcc("uri "):
  ------------------
  |  Branch (902:5): [True: 829, False: 502k]
  ------------------
  903|    829|      box = std::make_shared<Box_uri>();
  904|    829|      break;
  905|       |
  906|    453|    case fourcc("nmhd"):
  ------------------
  |  Branch (906:5): [True: 453, False: 503k]
  ------------------
  907|    453|      box = std::make_shared<Box_nmhd>();
  908|    453|      break;
  909|       |
  910|  1.22k|    case fourcc("tref"):
  ------------------
  |  Branch (910:5): [True: 1.22k, False: 502k]
  ------------------
  911|  1.22k|      box = std::make_shared<Box_tref>();
  912|  1.22k|      break;
  913|       |
  914|    565|    case fourcc("sdtp"):
  ------------------
  |  Branch (914:5): [True: 565, False: 503k]
  ------------------
  915|    565|      box = std::make_shared<Box_sdtp>();
  916|    565|      break;
  917|       |
  918|       |    // OMAF
  919|    743|    case fourcc("prfr"):
  ------------------
  |  Branch (919:5): [True: 743, False: 502k]
  ------------------
  920|    743|      box = std::make_shared<Box_prfr>();
  921|    743|      break;
  922|       |
  923|   148k|    default:
  ------------------
  |  Branch (923:5): [True: 148k, False: 355k]
  ------------------
  924|   148k|      box = std::make_shared<Box_other>(hdr.get_short_type());
  925|   148k|      break;
  926|   503k|  }
  927|       |
  928|   503k|  box->set_short_header(hdr);
  929|       |
  930|   503k|  box->m_debug_box_type = hdr.get_type_string(); // only for debugging
  931|       |
  932|       |
  933|   503k|  if (range.get_nesting_level() > MAX_BOX_NESTING_LEVEL) {
  ------------------
  |  Branch (933:7): [True: 5, False: 503k]
  ------------------
  934|      5|    return Error(heif_error_Memory_allocation_error,
  935|      5|                 heif_suberror_Security_limit_exceeded,
  936|      5|                 "Security limit for maximum nesting of boxes has been exceeded");
  937|      5|  }
  938|       |
  939|   503k|  if (hdr.has_fixed_box_size()) {
  ------------------
  |  Branch (939:7): [True: 444k, False: 58.6k]
  ------------------
  940|       |    // Sanity checks
  941|   444k|    if (hdr.get_box_size() < hdr.get_header_size()) {
  ------------------
  |  Branch (941:9): [True: 32, False: 444k]
  ------------------
  942|     32|      std::stringstream sstr;
  943|     32|      sstr << "Box size (" << hdr.get_box_size() << " bytes) smaller than header size ("
  944|     32|           << hdr.get_header_size() << " bytes)";
  945|       |
  946|     32|      return {heif_error_Invalid_input,
  947|     32|              heif_suberror_Invalid_box_size,
  948|     32|              sstr.str()};
  949|     32|    }
  950|       |
  951|       |    // this is >= 0 because of above condition
  952|   444k|    auto nBytes = static_cast<uint64_t>(hdr.get_box_size() - hdr.get_header_size());
  953|   444k|    if (nBytes > SIZE_MAX) {
  ------------------
  |  Branch (953:9): [True: 0, False: 444k]
  ------------------
  954|      0|      return {heif_error_Memory_allocation_error,
  955|      0|              heif_suberror_Invalid_box_size,
  956|      0|              "Box size too large"};
  957|      0|    }
  958|       |
  959|       |    // Security check: make sure that box size does not exceed int64 size.
  960|       |
  961|   444k|    if (hdr.get_box_size() > (uint64_t) std::numeric_limits<int64_t>::max()) {
  ------------------
  |  Branch (961:9): [True: 0, False: 444k]
  ------------------
  962|      0|      return {heif_error_Invalid_input,
  963|      0|              heif_suberror_Invalid_box_size};
  964|      0|    }
  965|       |
  966|       |    // --- wait for data to arrive
  967|       |
  968|   444k|    auto status = range.wait_for_available_bytes(static_cast<size_t>(nBytes));
  969|   444k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (969:9): [True: 3.35k, False: 441k]
  ------------------
  970|       |      // TODO: return recoverable error at timeout
  971|  3.35k|      return {heif_error_Invalid_input,
  972|  3.35k|              heif_suberror_End_of_data};
  973|  3.35k|    }
  974|   444k|  }
  975|       |
  976|   500k|  auto box_size = static_cast<int64_t>(hdr.get_box_size());
  977|   500k|  int64_t box_size_without_header = hdr.has_fixed_box_size() ? (box_size - hdr.get_header_size()) : (int64_t)range.get_remaining_bytes();
  ------------------
  |  Branch (977:37): [True: 441k, False: 58.6k]
  ------------------
  978|       |
  979|       |  // Box size may not be larger than remaining bytes in parent box.
  980|       |
  981|   500k|  if ((int64_t)range.get_remaining_bytes() < box_size_without_header) {
  ------------------
  |  Branch (981:7): [True: 2, False: 500k]
  ------------------
  982|      2|    return {heif_error_Invalid_input,
  983|      2|            heif_suberror_Invalid_box_size};
  984|      2|  }
  985|       |
  986|       |
  987|       |  // Create child bitstream range and read box from that range.
  988|       |
  989|   500k|  BitstreamRange boxrange(range.get_istream(),
  990|   500k|                          box_size_without_header,
  991|   500k|                          &range);
  992|       |
  993|   500k|  err = box->parse(boxrange, limits);
  994|   500k|  boxrange.skip_to_end_of_box();
  995|       |
  996|   500k|  if (err == Error::Ok) {
  ------------------
  |  Branch (996:7): [True: 466k, False: 33.6k]
  ------------------
  997|   466k|    *result = std::move(box);
  998|   466k|  }
  999|  33.6k|  else {
 1000|  33.6k|    parse_error_fatality fatality = box->get_parse_error_fatality();
 1001|       |
 1002|  33.6k|    box = std::make_shared<Box_Error>(box->get_short_type(), err, fatality);
 1003|       |
 1004|       |    // We return a Box_Error that represents the parse error.
 1005|  33.6k|    *result = std::move(box);
 1006|  33.6k|  }
 1007|       |
 1008|   500k|  return err;
 1009|   500k|}
_ZNK3Box4dumpER6Indent:
 1013|   269k|{
 1014|   269k|  std::ostringstream sstr;
 1015|       |
 1016|   269k|  sstr << BoxHeader::dump(indent);
 1017|       |
 1018|   269k|  return sstr.str();
 1019|   269k|}
_ZNK7FullBox4dumpER6Indent:
 1023|  22.6k|{
 1024|  22.6k|  std::ostringstream sstr;
 1025|       |
 1026|  22.6k|  sstr << Box::dump(indent);
 1027|       |
 1028|  22.6k|  sstr << indent << "version: " << ((int) m_version) << "\n"
 1029|  22.6k|       << indent << "flags: " << std::hex << m_flags << "\n";
 1030|       |
 1031|  22.6k|  return sstr.str();
 1032|  22.6k|}
_ZN3Box13read_childrenER14BitstreamRangejPK20heif_security_limits:
 1093|  75.4k|{
 1094|  75.4k|  uint32_t count = 0;
 1095|       |
 1096|   443k|  while (!range.eof() && !range.error()) {
  ------------------
  |  Branch (1096:10): [True: 373k, False: 69.9k]
  |  Branch (1096:26): [True: 373k, False: 0]
  ------------------
 1097|   373k|    std::shared_ptr<Box> box;
 1098|   373k|    Error error = Box::read(range, &box, limits);
 1099|   373k|    if (error != Error::Ok && (!box || box->get_parse_error_fatality() == parse_error_fatality::fatal)) {
  ------------------
  |  Branch (1099:9): [True: 28.3k, False: 345k]
  |  Branch (1099:32): [True: 312, False: 28.0k]
  |  Branch (1099:40): [True: 2.34k, False: 25.7k]
  ------------------
 1100|  2.65k|      return error;
 1101|  2.65k|    }
 1102|       |
 1103|   370k|    if (max_number == READ_CHILDREN_ALL) {
  ------------------
  |  Branch (1103:9): [True: 123k, False: 247k]
  ------------------
 1104|   123k|      uint32_t max_children;
 1105|   123k|      if (get_short_type() == fourcc("iinf")) {
  ------------------
  |  Branch (1105:11): [True: 1.19k, False: 122k]
  ------------------
 1106|  1.19k|        max_children = limits->max_items;
 1107|  1.19k|      }
 1108|   122k|      else {
 1109|   122k|        max_children = limits->max_children_per_box;
 1110|   122k|      }
 1111|       |
 1112|   123k|      if (max_children && m_children.size() > max_children) {
  ------------------
  |  Branch (1112:11): [True: 123k, False: 0]
  |  Branch (1112:27): [True: 68, False: 123k]
  ------------------
 1113|     68|        std::stringstream sstr;
 1114|     68|        sstr << "Maximum number of child boxes (" << max_children << ") in '" << get_type_string() << "' box exceeded.";
 1115|       |
 1116|       |        // Sanity check.
 1117|     68|        return Error(heif_error_Memory_allocation_error,
 1118|     68|                     heif_suberror_Security_limit_exceeded,
 1119|     68|                     sstr.str());
 1120|     68|      }
 1121|   123k|    }
 1122|       |
 1123|   370k|    m_children.push_back(std::move(box));
 1124|       |
 1125|       |
 1126|       |    // count the new child and end reading new children when we reached the expected number
 1127|       |
 1128|   370k|    count++;
 1129|       |
 1130|   370k|    if (max_number != READ_CHILDREN_ALL &&
  ------------------
  |  Branch (1130:9): [True: 247k, False: 123k]
  ------------------
 1131|   247k|        count == max_number) {
  ------------------
  |  Branch (1131:9): [True: 2.83k, False: 244k]
  ------------------
 1132|  2.83k|      break;
 1133|  2.83k|    }
 1134|   370k|  }
 1135|       |
 1136|  72.7k|  return range.get_error();
 1137|  75.4k|}
_ZNK3Box13dump_childrenER6Indentb:
 1154|  69.1k|{
 1155|  69.1k|  std::ostringstream sstr;
 1156|       |
 1157|  69.1k|  bool first = true;
 1158|  69.1k|  int idx=1;
 1159|       |
 1160|  69.1k|  indent++;
 1161|   294k|  for (const auto& childBox : m_children) {
  ------------------
  |  Branch (1161:29): [True: 294k, False: 69.1k]
  ------------------
 1162|   294k|    if (first) {
  ------------------
  |  Branch (1162:9): [True: 57.0k, False: 237k]
  ------------------
 1163|  57.0k|      first = false;
 1164|  57.0k|    }
 1165|   237k|    else {
 1166|   237k|      sstr << indent << "\n";
 1167|   237k|    }
 1168|       |
 1169|   294k|    if (with_index) {
  ------------------
  |  Branch (1169:9): [True: 29.8k, False: 265k]
  ------------------
 1170|  29.8k|      sstr << indent << "index: " << idx << "\n";
 1171|  29.8k|      idx++;
 1172|  29.8k|    }
 1173|       |
 1174|   294k|    sstr << childBox->dump(indent);
 1175|   294k|  }
 1176|  69.1k|  indent--;
 1177|       |
 1178|  69.1k|  return sstr.str();
 1179|  69.1k|}
_ZN9Box_other5parseER14BitstreamRangePK20heif_security_limits:
 1203|   150k|{
 1204|   150k|  if (has_fixed_box_size()) {
  ------------------
  |  Branch (1204:7): [True: 144k, False: 5.59k]
  ------------------
 1205|   144k|    size_t len;
 1206|   144k|    if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (1206:9): [True: 144k, False: 0]
  ------------------
 1207|   144k|      auto len64 = get_box_size() - get_header_size();
 1208|   144k|      if (len64 > MAX_BOX_SIZE) {
  ------------------
  |  Branch (1208:11): [True: 0, False: 144k]
  ------------------
 1209|      0|        return {heif_error_Invalid_input,
 1210|      0|                heif_suberror_Security_limit_exceeded,
 1211|      0|                "Box size too large"};
 1212|      0|      }
 1213|       |
 1214|   144k|      len = static_cast<size_t>(len64);
 1215|       |
 1216|   144k|      m_data.resize(len);
 1217|   144k|      range.read(m_data.data(), len);
 1218|   144k|    }
 1219|      0|    else {
 1220|      0|      return {heif_error_Invalid_input,
 1221|      0|              heif_suberror_Invalid_box_size};
 1222|      0|    }
 1223|   144k|  }
 1224|  5.59k|  else {
 1225|       |    // TODO: boxes until end of file (we will probably never need this)
 1226|  5.59k|  }
 1227|       |
 1228|   150k|  return range.get_error();
 1229|   150k|}
_ZNK9Box_other4dumpER6Indent:
 1249|   126k|{
 1250|   126k|  std::ostringstream sstr;
 1251|       |
 1252|   126k|  sstr << BoxHeader::dump(indent);
 1253|       |
 1254|       |  // --- show raw box content
 1255|       |
 1256|   126k|  size_t len = 0;
 1257|   126k|  if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (1257:7): [True: 121k, False: 4.65k]
  ------------------
 1258|       |    // We can cast because if it does not fit, it would fail during parsing.
 1259|   121k|    len = static_cast<size_t>(get_box_size() - get_header_size());
 1260|   121k|  }
 1261|  4.65k|  else {
 1262|  4.65k|    sstr << indent << "invalid box size " << get_box_size() << " (smaller than header)\n";
 1263|  4.65k|    return sstr.str();
 1264|  4.65k|  }
 1265|       |
 1266|   121k|  sstr << write_raw_data_as_hex(m_data.data(), len,
 1267|   121k|                                indent.get_string() + "data: ",
 1268|   121k|                                indent.get_string() + "      ");
 1269|       |
 1270|   121k|  return sstr.str();
 1271|   126k|}
_ZNK9Box_Error4dumpER6Indent:
 1275|  8.35k|{
 1276|  8.35k|  std::ostringstream sstr;
 1277|  8.35k|  sstr << indent << '\'' << fourcc_to_string(m_box_type_with_parse_error) << "' parse error: " << m_error.message << "\n";
 1278|  8.35k|  sstr << indent << "fatality: ";
 1279|  8.35k|  switch (m_fatality) {
  ------------------
  |  Branch (1279:11): [True: 8.35k, False: 0]
  ------------------
 1280|      0|    case parse_error_fatality::fatal: sstr << "fatal\n"; break;
  ------------------
  |  Branch (1280:5): [True: 0, False: 8.35k]
  ------------------
 1281|  5.58k|    case parse_error_fatality::ignorable: sstr << "ignorable\n"; break;
  ------------------
  |  Branch (1281:5): [True: 5.58k, False: 2.76k]
  ------------------
 1282|  2.76k|    case parse_error_fatality::optional: sstr << "optional\n"; break;
  ------------------
  |  Branch (1282:5): [True: 2.76k, False: 5.58k]
  ------------------
 1283|  8.35k|  }
 1284|       |
 1285|  8.35k|  return sstr.str();
 1286|  8.35k|}
_ZNK9Box_Error24get_parse_error_fatalityEv:
 1289|  28.0k|{
 1290|  28.0k|  return m_fatality;
 1291|  28.0k|}
_ZN8Box_ftyp5parseER14BitstreamRangePK20heif_security_limits:
 1295|  11.4k|{
 1296|  11.4k|  m_major_brand = range.read32();
 1297|  11.4k|  m_minor_version = range.read32();
 1298|       |
 1299|  11.4k|  uint64_t box_size = get_box_size();
 1300|  11.4k|  if (box_size < 8 || box_size - 8 < get_header_size()) {
  ------------------
  |  Branch (1300:7): [True: 5, False: 11.4k]
  |  Branch (1300:23): [True: 7, False: 11.3k]
  ------------------
 1301|       |    // Sanity check.
 1302|     12|    return Error(heif_error_Invalid_input,
 1303|     12|                 heif_suberror_Invalid_box_size,
 1304|     12|                 "ftyp box too small (less than 8 bytes)");
 1305|     12|  }
 1306|       |
 1307|  11.3k|  uint64_t n_minor_brands = (get_box_size() - get_header_size() - 8) / 4;
 1308|       |
 1309|  11.3k|  if (limits->max_number_of_file_brands && n_minor_brands > limits->max_number_of_file_brands) {
  ------------------
  |  Branch (1309:7): [True: 11.3k, False: 0]
  |  Branch (1309:44): [True: 2, False: 11.3k]
  ------------------
 1310|      2|    return {
 1311|      2|      heif_error_Memory_allocation_error,
 1312|      2|      heif_suberror_Security_limit_exceeded,
 1313|      2|      "Number of minor brands in file exceeds security limit"
 1314|      2|    };
 1315|      2|  }
 1316|       |
 1317|  45.3k|  for (uint64_t i = 0; i < n_minor_brands && !range.error(); i++) {
  ------------------
  |  Branch (1317:24): [True: 33.9k, False: 11.3k]
  |  Branch (1317:46): [True: 33.9k, False: 0]
  ------------------
 1318|  33.9k|    m_compatible_brands.push_back(range.read32());
 1319|  33.9k|  }
 1320|       |
 1321|  11.3k|  return range.get_error();
 1322|  11.3k|}
_ZNK8Box_ftyp4dumpER6Indent:
 1335|  10.6k|{
 1336|  10.6k|  std::ostringstream sstr;
 1337|       |
 1338|  10.6k|  sstr << BoxHeader::dump(indent);
 1339|       |
 1340|  10.6k|  sstr << indent << "major brand: " << fourcc_to_string(m_major_brand) << "\n"
 1341|  10.6k|       << indent << "minor version: ";
 1342|  10.6k|  if (m_minor_version < ('A' << 24)) {
  ------------------
  |  Branch (1342:7): [True: 9.19k, False: 1.47k]
  ------------------
 1343|       |    // This is probably a version number
 1344|  9.19k|    sstr << m_minor_version;
 1345|  9.19k|  } else {
 1346|       |    // probably a 4CC, as used for mif3
 1347|  1.47k|    sstr << fourcc_to_string(m_minor_version);
 1348|  1.47k|  }
 1349|  10.6k|  sstr << "\n" << indent << "compatible brands: ";
 1350|       |
 1351|  10.6k|  bool first = true;
 1352|  31.7k|  for (uint32_t brand : m_compatible_brands) {
  ------------------
  |  Branch (1352:23): [True: 31.7k, False: 10.6k]
  ------------------
 1353|  31.7k|    if (first) { first = false; }
  ------------------
  |  Branch (1353:9): [True: 9.89k, False: 21.8k]
  ------------------
 1354|  21.8k|    else { sstr << ','; }
 1355|       |
 1356|  31.7k|    sstr << fourcc_to_string(brand);
 1357|  31.7k|  }
 1358|  10.6k|  sstr << "\n";
 1359|       |
 1360|  10.6k|  return sstr.str();
 1361|  10.6k|}
_ZN8Box_free5parseER14BitstreamRangePK20heif_security_limits:
 1390|    947|{
 1391|    947|  range.skip_to_end_of_box();
 1392|    947|  return range.get_error();
 1393|    947|}
_ZNK8Box_free4dumpER6Indent:
 1397|    883|{
 1398|    883|  std::ostringstream sstr;
 1399|    883|  sstr << BoxHeader::dump(indent);
 1400|    883|  return sstr.str();
 1401|    883|}
_ZN8Box_meta5parseER14BitstreamRangePK20heif_security_limits:
 1413|  3.38k|{
 1414|  3.38k|  parse_full_box_header(range);
 1415|       |
 1416|  3.38k|  if (get_version() != 0) {
  ------------------
  |  Branch (1416:7): [True: 2, False: 3.37k]
  ------------------
 1417|      2|    return unsupported_version_error("meta");
 1418|      2|  }
 1419|       |
 1420|       |  /*
 1421|       |  uint64_t boxSizeLimit;
 1422|       |  if (get_box_size() == BoxHeader::size_until_end_of_file) {
 1423|       |    boxSizeLimit = sizeLimit;
 1424|       |  }
 1425|       |  else {
 1426|       |    boxSizeLimit = get_box_size() - get_header_size();
 1427|       |  }
 1428|       |  */
 1429|       |
 1430|  3.37k|  return read_children(range, READ_CHILDREN_ALL, limits);
 1431|  3.38k|}
_ZNK8Box_meta4dumpER6Indent:
 1435|  3.22k|{
 1436|  3.22k|  std::ostringstream sstr;
 1437|  3.22k|  sstr << Box::dump(indent);
 1438|  3.22k|  sstr << dump_children(indent);
 1439|       |
 1440|  3.22k|  return sstr.str();
 1441|  3.22k|}
_ZNK7FullBox25unsupported_version_errorEPKc:
 1445|  2.03k|{
 1446|  2.03k|  std::stringstream sstr;
 1447|  2.03k|  sstr << box << " box data version " << ((int) m_version) << " is not implemented yet";
 1448|       |
 1449|  2.03k|  return {heif_error_Unsupported_feature,
 1450|  2.03k|          heif_suberror_Unsupported_data_version,
 1451|  2.03k|          sstr.str()};
 1452|  2.03k|}
_ZN8Box_hdlr5parseER14BitstreamRangePK20heif_security_limits:
 1456|  4.90k|{
 1457|  4.90k|  parse_full_box_header(range);
 1458|       |
 1459|  4.90k|  if (get_version() != 0) {
  ------------------
  |  Branch (1459:7): [True: 6, False: 4.90k]
  ------------------
 1460|      6|    return unsupported_version_error("hdlr");
 1461|      6|  }
 1462|       |
 1463|  4.90k|  m_pre_defined = range.read32();
 1464|  4.90k|  m_handler_type = range.read32();
 1465|       |
 1466|  19.6k|  for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (1466:19): [True: 14.7k, False: 4.90k]
  ------------------
 1467|  14.7k|    m_reserved[i] = range.read32();
 1468|  14.7k|  }
 1469|       |
 1470|  4.90k|  m_name = range.read_string();
 1471|       |
 1472|  4.90k|  return range.get_error();
 1473|  4.90k|}
_ZNK8Box_hdlr4dumpER6Indent:
 1477|  4.05k|{
 1478|  4.05k|  std::ostringstream sstr;
 1479|  4.05k|  sstr << Box::dump(indent);
 1480|  4.05k|  sstr << indent << "pre_defined: " << m_pre_defined << "\n"
 1481|  4.05k|       << indent << "handler_type: " << fourcc_to_string(m_handler_type) << "\n"
 1482|  4.05k|       << indent << "name: " << m_name << "\n";
 1483|       |
 1484|  4.05k|  return sstr.str();
 1485|  4.05k|}
_ZN8Box_pitm5parseER14BitstreamRangePK20heif_security_limits:
 1508|  3.41k|{
 1509|  3.41k|  parse_full_box_header(range);
 1510|       |
 1511|  3.41k|  if (get_version() > 1) {
  ------------------
  |  Branch (1511:7): [True: 1, False: 3.41k]
  ------------------
 1512|      1|    return unsupported_version_error("pitm");
 1513|      1|  }
 1514|       |
 1515|       |
 1516|  3.41k|  if (get_version() == 0) {
  ------------------
  |  Branch (1516:7): [True: 3.14k, False: 263]
  ------------------
 1517|  3.14k|    m_item_ID = range.read16();
 1518|  3.14k|  }
 1519|    263|  else {
 1520|    263|    m_item_ID = range.read32();
 1521|    263|  }
 1522|       |
 1523|  3.41k|  return range.get_error();
 1524|  3.41k|}
_ZNK8Box_pitm4dumpER6Indent:
 1528|  2.97k|{
 1529|  2.97k|  std::ostringstream sstr;
 1530|  2.97k|  sstr << Box::dump(indent);
 1531|  2.97k|  sstr << indent << "item_ID: " << m_item_ID << "\n";
 1532|       |
 1533|  2.97k|  return sstr.str();
 1534|  2.97k|}
_ZN8Box_iloc5parseER14BitstreamRangePK20heif_security_limits:
 1567|  2.18k|{
 1568|  2.18k|  parse_full_box_header(range);
 1569|       |
 1570|  2.18k|  if (get_version() > 2) {
  ------------------
  |  Branch (1570:7): [True: 1, False: 2.18k]
  ------------------
 1571|      1|    return unsupported_version_error("iloc");
 1572|      1|  }
 1573|       |
 1574|  2.18k|  const int version = get_version();
 1575|       |
 1576|  2.18k|  uint16_t values4 = range.read16();
 1577|       |
 1578|  2.18k|  int offset_size = (values4 >> 12) & 0xF;
 1579|  2.18k|  int length_size = (values4 >> 8) & 0xF;
 1580|  2.18k|  int base_offset_size = (values4 >> 4) & 0xF;
 1581|  2.18k|  int index_size = 0;
 1582|       |
 1583|  2.18k|  if (version == 1 || version == 2) {
  ------------------
  |  Branch (1583:7): [True: 368, False: 1.82k]
  |  Branch (1583:23): [True: 235, False: 1.58k]
  ------------------
 1584|    603|    index_size = (values4 & 0xF);
 1585|    603|  }
 1586|       |
 1587|  2.18k|  uint32_t item_count = 0;
 1588|  2.18k|  if (version < 2) {
  ------------------
  |  Branch (1588:7): [True: 1.95k, False: 235]
  ------------------
 1589|  1.95k|    item_count = range.read16();
 1590|  1.95k|  }
 1591|    235|  else if (version == 2) {
  ------------------
  |  Branch (1591:12): [True: 235, False: 0]
  ------------------
 1592|    235|    item_count = range.read32();
 1593|    235|  }
 1594|       |
 1595|       |  // Sanity check. (This might be obsolete now as we check for range.error() below).
 1596|  2.18k|  if (limits->max_items && item_count > limits->max_items) {
  ------------------
  |  Branch (1596:7): [True: 2.18k, False: 0]
  |  Branch (1596:28): [True: 37, False: 2.15k]
  ------------------
 1597|     37|    std::stringstream sstr;
 1598|     37|    sstr << "iloc box contains " << item_count << " items, which exceeds the security limit of "
 1599|     37|         << limits->max_items << " items.";
 1600|       |
 1601|     37|    return Error(heif_error_Memory_allocation_error,
 1602|     37|                 heif_suberror_Security_limit_exceeded,
 1603|     37|                 sstr.str());
 1604|     37|  }
 1605|       |
 1606|  7.94k|  for (uint32_t i = 0; i < item_count; i++) {
  ------------------
  |  Branch (1606:24): [True: 5.95k, False: 1.98k]
  ------------------
 1607|  5.95k|    Item item;
 1608|       |
 1609|  5.95k|    if (range.eof()) {
  ------------------
  |  Branch (1609:9): [True: 100, False: 5.85k]
  ------------------
 1610|    100|      std::stringstream sstr;
 1611|    100|      sstr << "iloc box should contain " << item_count << " items, but we can only read " << i << " items.";
 1612|       |
 1613|    100|      return {heif_error_Invalid_input,
 1614|    100|              heif_suberror_End_of_data,
 1615|    100|              sstr.str()};
 1616|    100|    }
 1617|       |
 1618|  5.85k|    if (version < 2) {
  ------------------
  |  Branch (1618:9): [True: 5.64k, False: 215]
  ------------------
 1619|  5.64k|      item.item_ID = range.read16();
 1620|  5.64k|    }
 1621|    215|    else if (version == 2) {
  ------------------
  |  Branch (1621:14): [True: 215, False: 0]
  ------------------
 1622|    215|      item.item_ID = range.read32();
 1623|    215|    }
 1624|       |
 1625|  5.85k|    if (version >= 1) {
  ------------------
  |  Branch (1625:9): [True: 787, False: 5.06k]
  ------------------
 1626|    787|      values4 = range.read16();
 1627|    787|      item.construction_method = (values4 & 0xF);
 1628|    787|    }
 1629|       |
 1630|  5.85k|    item.data_reference_index = range.read16();
 1631|       |
 1632|  5.85k|    item.base_offset = 0;
 1633|  5.85k|    if (base_offset_size == 4) {
  ------------------
  |  Branch (1633:9): [True: 1.08k, False: 4.76k]
  ------------------
 1634|  1.08k|      item.base_offset = range.read32();
 1635|  1.08k|    }
 1636|  4.76k|    else if (base_offset_size == 8) {
  ------------------
  |  Branch (1636:14): [True: 194, False: 4.57k]
  ------------------
 1637|    194|      item.base_offset = ((uint64_t) range.read32()) << 32;
 1638|    194|      item.base_offset |= range.read32();
 1639|    194|    }
 1640|       |
 1641|  5.85k|    uint16_t extent_count = range.read16();
 1642|       |
 1643|       |    // Sanity check.
 1644|  5.85k|    auto max_iloc_extents = limits->max_iloc_extents_per_item;
 1645|  5.85k|    if (max_iloc_extents && extent_count > max_iloc_extents) {
  ------------------
  |  Branch (1645:9): [True: 5.85k, False: 0]
  |  Branch (1645:29): [True: 25, False: 5.83k]
  ------------------
 1646|     25|      std::stringstream sstr;
 1647|     25|      sstr << "Number of extents in iloc box (" << extent_count << ") exceeds security limit ("
 1648|     25|           << max_iloc_extents << ")\n";
 1649|       |
 1650|     25|      return Error(heif_error_Memory_allocation_error,
 1651|     25|                   heif_suberror_Security_limit_exceeded,
 1652|     25|                   sstr.str());
 1653|     25|    }
 1654|       |
 1655|  21.2k|    for (int e = 0; e < extent_count; e++) {
  ------------------
  |  Branch (1655:21): [True: 15.4k, False: 5.79k]
  ------------------
 1656|  15.4k|      Extent extent;
 1657|       |
 1658|  15.4k|      if (range.eof()) {
  ------------------
  |  Branch (1658:11): [True: 39, False: 15.4k]
  ------------------
 1659|     39|        std::stringstream sstr;
 1660|     39|        sstr << "iloc item should contain " << extent_count << " extents, but we can only read " << e << " extents.";
 1661|       |
 1662|     39|        return {heif_error_Invalid_input,
 1663|     39|                heif_suberror_End_of_data,
 1664|     39|                sstr.str()};
 1665|     39|      }
 1666|       |
 1667|  15.4k|      if ((version == 1 || version == 2) && index_size > 0) {
  ------------------
  |  Branch (1667:12): [True: 1.44k, False: 13.9k]
  |  Branch (1667:28): [True: 336, False: 13.6k]
  |  Branch (1667:45): [True: 997, False: 781]
  ------------------
 1668|    997|        if (index_size == 4) {
  ------------------
  |  Branch (1668:13): [True: 289, False: 708]
  ------------------
 1669|    289|          extent.index = range.read32();
 1670|    289|        }
 1671|    708|        else if (index_size == 8) {
  ------------------
  |  Branch (1671:18): [True: 394, False: 314]
  ------------------
 1672|    394|          extent.index = ((uint64_t) range.read32()) << 32;
 1673|    394|          extent.index |= range.read32();
 1674|    394|        }
 1675|    997|      }
 1676|       |
 1677|  15.4k|      extent.offset = 0;
 1678|  15.4k|      if (offset_size == 4) {
  ------------------
  |  Branch (1678:11): [True: 1.09k, False: 14.3k]
  ------------------
 1679|  1.09k|        extent.offset = range.read32();
 1680|  1.09k|      }
 1681|  14.3k|      else if (offset_size == 8) {
  ------------------
  |  Branch (1681:16): [True: 220, False: 14.1k]
  ------------------
 1682|    220|        extent.offset = ((uint64_t) range.read32()) << 32;
 1683|    220|        extent.offset |= range.read32();
 1684|    220|      }
 1685|       |
 1686|       |
 1687|  15.4k|      extent.length = 0;
 1688|  15.4k|      if (length_size == 4) {
  ------------------
  |  Branch (1688:11): [True: 1.12k, False: 14.2k]
  ------------------
 1689|  1.12k|        extent.length = range.read32();
 1690|  1.12k|      }
 1691|  14.2k|      else if (length_size == 8) {
  ------------------
  |  Branch (1691:16): [True: 195, False: 14.0k]
  ------------------
 1692|    195|        extent.length = ((uint64_t) range.read32()) << 32;
 1693|    195|        extent.length |= range.read32();
 1694|    195|      }
 1695|       |
 1696|  15.4k|      item.extents.push_back(extent);
 1697|  15.4k|    }
 1698|       |
 1699|  5.79k|    if (!range.error()) {
  ------------------
  |  Branch (1699:9): [True: 5.71k, False: 80]
  ------------------
 1700|  5.71k|      m_items.push_back(item);
 1701|  5.71k|    }
 1702|  5.79k|  }
 1703|       |
 1704|  1.98k|  return range.get_error();
 1705|  2.15k|}
_ZN8Box_ilocC2Ev:
 1709|  2.19k|{
 1710|  2.19k|  set_short_type(fourcc("iloc"));
 1711|       |
 1712|  2.19k|  set_use_tmp_file(false);
 1713|  2.19k|}
_ZN8Box_ilocD2Ev:
 1717|  2.19k|{
 1718|  2.19k|  if (m_use_tmpfile) {
  ------------------
  |  Branch (1718:7): [True: 0, False: 2.19k]
  ------------------
 1719|      0|    unlink(m_tmp_filename);
 1720|      0|  }
 1721|  2.19k|}
_ZN8Box_iloc16set_use_tmp_fileEb:
 1725|  2.19k|{
 1726|  2.19k|  m_use_tmpfile = flag;
 1727|  2.19k|  if (flag) {
  ------------------
  |  Branch (1727:7): [True: 0, False: 2.19k]
  ------------------
 1728|      0|#if !defined(_WIN32)
 1729|      0|    strcpy(m_tmp_filename, "/tmp/libheif-XXXXXX");
 1730|      0|    m_tmpfile_fd = mkstemp(m_tmp_filename);
 1731|       |#else
 1732|       |    // TODO Currently unused code. Implement when needed.
 1733|       |    assert(false);
 1734|       |#  if 0
 1735|       |    char tmpname[L_tmpnam_s];
 1736|       |    // TODO: check return value (errno_t)
 1737|       |    tmpnam_s(tmpname, L_tmpnam_s);
 1738|       |    _sopen_s(&m_tmpfile_fd, tmpname, _O_CREAT | _O_TEMPORARY | _O_TRUNC | _O_RDWR, _SH_DENYRW, _S_IREAD | _S_IWRITE);
 1739|       |#  endif
 1740|       |#endif
 1741|      0|  }
 1742|  2.19k|}
_ZNK8Box_iloc4dumpER6Indent:
 1746|  1.73k|{
 1747|  1.73k|  std::ostringstream sstr;
 1748|  1.73k|  sstr << Box::dump(indent);
 1749|       |
 1750|  3.45k|  for (const Item& item : m_items) {
  ------------------
  |  Branch (1750:25): [True: 3.45k, False: 1.73k]
  ------------------
 1751|  3.45k|    sstr << indent << "item ID: " << item.item_ID << "\n"
 1752|  3.45k|         << indent << "  construction method: " << ((int) item.construction_method) << "\n"
 1753|  3.45k|         << indent << "  data_reference_index: " << std::hex
 1754|  3.45k|         << item.data_reference_index << std::dec << "\n"
 1755|  3.45k|         << indent << "  base_offset: " << item.base_offset << "\n";
 1756|       |
 1757|  3.45k|    sstr << indent << "  extents: ";
 1758|  8.45k|    for (const Extent& extent : item.extents) {
  ------------------
  |  Branch (1758:31): [True: 8.45k, False: 3.45k]
  ------------------
 1759|  8.45k|      sstr << extent.offset << "," << extent.length;
 1760|  8.45k|      if (extent.index != 0) {
  ------------------
  |  Branch (1760:11): [True: 387, False: 8.07k]
  ------------------
 1761|    387|        sstr << ";index=" << extent.index;
 1762|    387|      }
 1763|  8.45k|      sstr << " ";
 1764|  8.45k|    }
 1765|  3.45k|    sstr << "\n";
 1766|  3.45k|  }
 1767|       |
 1768|  1.73k|  return sstr.str();
 1769|  1.73k|}
_ZN8Box_infe5parseER14BitstreamRangePK20heif_security_limits:
 2391|  4.51k|{
 2392|  4.51k|  parse_full_box_header(range);
 2393|       |
 2394|       |  // only versions 2,3 are required by HEIF
 2395|  4.51k|  if (get_version() > 3) {
  ------------------
  |  Branch (2395:7): [True: 2, False: 4.51k]
  ------------------
 2396|      2|    return unsupported_version_error("infe");
 2397|      2|  }
 2398|       |
 2399|  4.51k|  if (get_version() <= 1) {
  ------------------
  |  Branch (2399:7): [True: 238, False: 4.27k]
  ------------------
 2400|    238|    m_item_ID = range.read16();
 2401|    238|    m_item_protection_index = range.read16();
 2402|       |
 2403|    238|    m_item_name = range.read_string();
 2404|    238|    m_content_type = range.read_string();
 2405|    238|    m_content_encoding = range.read_string();
 2406|    238|  }
 2407|       |
 2408|  4.51k|  m_item_type_4cc = 0;
 2409|       |
 2410|  4.51k|  if (get_version() >= 2) {
  ------------------
  |  Branch (2410:7): [True: 4.27k, False: 238]
  ------------------
 2411|  4.27k|    m_hidden_item = (get_flags() & 1);
 2412|       |
 2413|  4.27k|    if (get_version() == 2) {
  ------------------
  |  Branch (2413:9): [True: 4.07k, False: 206]
  ------------------
 2414|  4.07k|      m_item_ID = range.read16();
 2415|  4.07k|    }
 2416|    206|    else {
 2417|    206|      m_item_ID = range.read32();
 2418|    206|    }
 2419|       |
 2420|  4.27k|    m_item_protection_index = range.read16();
 2421|  4.27k|    m_item_type_4cc = range.read32();
 2422|       |
 2423|  4.27k|    m_item_name = range.read_string();
 2424|  4.27k|    if (m_item_type_4cc == fourcc("mime")) {
  ------------------
  |  Branch (2424:9): [True: 291, False: 3.98k]
  ------------------
 2425|    291|      m_content_type = range.read_string();
 2426|    291|      m_content_encoding = range.read_string();
 2427|    291|    }
 2428|  3.98k|    else if (m_item_type_4cc == fourcc("uri ")) {
  ------------------
  |  Branch (2428:14): [True: 911, False: 3.07k]
  ------------------
 2429|    911|      m_item_uri_type = range.read_string();
 2430|    911|    }
 2431|  4.27k|  }
 2432|       |
 2433|  4.51k|  return range.get_error();
 2434|  4.51k|}
_ZNK8Box_infe4dumpER6Indent:
 2512|  4.03k|{
 2513|  4.03k|  std::ostringstream sstr;
 2514|  4.03k|  sstr << Box::dump(indent);
 2515|       |
 2516|  4.03k|  sstr << indent << "item_ID: " << m_item_ID << "\n"
 2517|  4.03k|       << indent << "item_protection_index: " << m_item_protection_index << "\n"
 2518|  4.03k|       << indent << "item_type: " << fourcc_to_string(m_item_type_4cc) << "\n"
 2519|  4.03k|       << indent << "item_name: " << m_item_name << "\n";
 2520|       |
 2521|  4.03k|  if (m_item_type_4cc == fourcc("mime")) {
  ------------------
  |  Branch (2521:7): [True: 291, False: 3.74k]
  ------------------
 2522|    291|    sstr << indent << "content_type: " << m_content_type << "\n"
 2523|    291|         << indent << "content_encoding: " << m_content_encoding << "\n";
 2524|    291|  }
 2525|       |
 2526|  4.03k|  if (m_item_type_4cc == fourcc("uri ")) {
  ------------------
  |  Branch (2526:7): [True: 820, False: 3.21k]
  ------------------
 2527|    820|    sstr << indent << "item uri type: " << m_item_uri_type << "\n";
 2528|    820|  }
 2529|       |
 2530|  4.03k|  sstr << indent << "hidden item: " << std::boolalpha << m_hidden_item << "\n";
 2531|       |
 2532|  4.03k|  return sstr.str();
 2533|  4.03k|}
_ZN8Box_iinf5parseER14BitstreamRangePK20heif_security_limits:
 2537|  4.07k|{
 2538|  4.07k|  parse_full_box_header(range);
 2539|       |
 2540|       |  // TODO: there are several images in circulation that have an iinf version=2. We should not enforce this with a hard error.
 2541|  4.07k|  if (false && get_version() > 1) {
  ------------------
  |  Branch (2541:7): [Folded, False: 4.07k]
  |  Branch (2541:16): [True: 0, False: 0]
  ------------------
 2542|      0|    return unsupported_version_error("iinf");
 2543|      0|  }
 2544|       |
 2545|  4.07k|  int nEntries_size = (get_version() > 0) ? 4 : 2;
  ------------------
  |  Branch (2545:23): [True: 1.08k, False: 2.99k]
  ------------------
 2546|       |
 2547|  4.07k|  uint32_t item_count;
 2548|  4.07k|  if (nEntries_size == 2) {
  ------------------
  |  Branch (2548:7): [True: 2.99k, False: 1.08k]
  ------------------
 2549|  2.99k|    item_count = range.read16();
 2550|  2.99k|  }
 2551|  1.08k|  else {
 2552|  1.08k|    item_count = range.read32();
 2553|  1.08k|  }
 2554|       |
 2555|  4.07k|  if (item_count == 0) {
  ------------------
  |  Branch (2555:7): [True: 506, False: 3.57k]
  ------------------
 2556|    506|    return Error::Ok;
 2557|    506|  }
 2558|       |
 2559|  3.57k|  return read_children(range, item_count, limits);
 2560|  4.07k|}
_ZNK8Box_iinf4dumpER6Indent:
 2564|  3.65k|{
 2565|  3.65k|  std::ostringstream sstr;
 2566|  3.65k|  sstr << Box::dump(indent);
 2567|       |
 2568|  3.65k|  sstr << dump_children(indent);
 2569|       |
 2570|  3.65k|  return sstr.str();
 2571|  3.65k|}
_ZN8Box_iprp5parseER14BitstreamRangePK20heif_security_limits:
 2575|  29.9k|{
 2576|       |  //parse_full_box_header(range);
 2577|       |
 2578|  29.9k|  return read_children(range, READ_CHILDREN_ALL, limits);
 2579|  29.9k|}
_ZNK8Box_iprp4dumpER6Indent:
 2611|  27.3k|{
 2612|  27.3k|  std::ostringstream sstr;
 2613|  27.3k|  sstr << Box::dump(indent);
 2614|       |
 2615|  27.3k|  sstr << dump_children(indent);
 2616|       |
 2617|  27.3k|  return sstr.str();
 2618|  27.3k|}
_ZN8Box_ipco5parseER14BitstreamRangePK20heif_security_limits:
 2633|  14.3k|{
 2634|       |  //parse_full_box_header(range);
 2635|       |
 2636|  14.3k|  return read_children(range, READ_CHILDREN_ALL, limits);
 2637|  14.3k|}
_ZNK8Box_ipco4dumpER6Indent:
 2641|  13.1k|{
 2642|  13.1k|  std::ostringstream sstr;
 2643|  13.1k|  sstr << Box::dump(indent);
 2644|       |
 2645|  13.1k|  sstr << dump_children(indent, true);
 2646|       |
 2647|  13.1k|  return sstr.str();
 2648|  13.1k|}
_ZN8Box_pixi5parseER14BitstreamRangePK20heif_security_limits:
 2652|  3.77k|{
 2653|  3.77k|  parse_full_box_header(range);
 2654|       |
 2655|  3.77k|  if (get_version() != 0) {
  ------------------
  |  Branch (2655:7): [True: 315, False: 3.46k]
  ------------------
 2656|    315|    return unsupported_version_error("pixi");
 2657|    315|  }
 2658|       |
 2659|  3.46k|  StreamReader::grow_status status;
 2660|  3.46k|  uint8_t num_channels = range.read8();
 2661|  3.46k|  status = range.wait_for_available_bytes(num_channels);
 2662|  3.46k|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (2662:7): [True: 28, False: 3.43k]
  ------------------
 2663|       |    // TODO: return recoverable error at timeout
 2664|     28|    return Error(heif_error_Invalid_input,
 2665|     28|                 heif_suberror_End_of_data);
 2666|     28|  }
 2667|       |
 2668|  3.43k|  m_bits_per_channel.resize(num_channels);
 2669|  23.2k|  for (int i = 0; i < num_channels; i++) {
  ------------------
  |  Branch (2669:19): [True: 19.8k, False: 3.43k]
  ------------------
 2670|  19.8k|    m_bits_per_channel[i] = range.read8();
 2671|  19.8k|  }
 2672|       |
 2673|  3.43k|  return range.get_error();
 2674|  3.46k|}
_ZNK8Box_pixi4dumpER6Indent:
 2678|  2.62k|{
 2679|  2.62k|  std::ostringstream sstr;
 2680|  2.62k|  sstr << Box::dump(indent);
 2681|       |
 2682|  2.62k|  sstr << indent << "bits_per_channel: ";
 2683|       |
 2684|  9.75k|  for (size_t i = 0; i < m_bits_per_channel.size(); i++) {
  ------------------
  |  Branch (2684:22): [True: 7.12k, False: 2.62k]
  ------------------
 2685|  7.12k|    if (i > 0) sstr << ",";
  ------------------
  |  Branch (2685:9): [True: 5.01k, False: 2.10k]
  ------------------
 2686|  7.12k|    sstr << ((int) m_bits_per_channel[i]);
 2687|  7.12k|  }
 2688|       |
 2689|  2.62k|  sstr << "\n";
 2690|       |
 2691|  2.62k|  return sstr.str();
 2692|  2.62k|}
_ZN8Box_pasp5parseER14BitstreamRangePK20heif_security_limits:
 2717|  14.8k|{
 2718|       |  //parse_full_box_header(range);
 2719|       |
 2720|  14.8k|  hSpacing = range.read32();
 2721|  14.8k|  vSpacing = range.read32();
 2722|       |
 2723|  14.8k|  return range.get_error();
 2724|  14.8k|}
_ZNK8Box_pasp4dumpER6Indent:
 2728|  14.0k|{
 2729|  14.0k|  std::ostringstream sstr;
 2730|  14.0k|  sstr << Box::dump(indent);
 2731|       |
 2732|  14.0k|  sstr << indent << "hSpacing: " << hSpacing << "\n";
 2733|  14.0k|  sstr << indent << "vSpacing: " << vSpacing << "\n";
 2734|       |
 2735|  14.0k|  return sstr.str();
 2736|  14.0k|}
_ZN8Box_lsel5parseER14BitstreamRangePK20heif_security_limits:
 2753|  7.51k|{
 2754|  7.51k|  layer_id = range.read16();
 2755|       |
 2756|  7.51k|  return range.get_error();
 2757|  7.51k|}
_ZNK8Box_lsel4dumpER6Indent:
 2761|  6.47k|{
 2762|  6.47k|  std::ostringstream sstr;
 2763|  6.47k|  sstr << Box::dump(indent);
 2764|       |
 2765|  6.47k|  sstr << indent << "layer_id: " << layer_id << "\n";
 2766|       |
 2767|  6.47k|  return sstr.str();
 2768|  6.47k|}
_ZN8Box_clli5parseER14BitstreamRangePK20heif_security_limits:
 2784|  3.51k|{
 2785|       |  //parse_full_box_header(range);
 2786|       |
 2787|  3.51k|  clli.max_content_light_level = range.read16();
 2788|  3.51k|  clli.max_pic_average_light_level = range.read16();
 2789|       |
 2790|  3.51k|  return range.get_error();
 2791|  3.51k|}
_ZNK8Box_clli4dumpER6Indent:
 2795|  2.25k|{
 2796|  2.25k|  std::ostringstream sstr;
 2797|  2.25k|  sstr << Box::dump(indent);
 2798|       |
 2799|  2.25k|  sstr << indent << "max_content_light_level: " << clli.max_content_light_level << "\n";
 2800|  2.25k|  sstr << indent << "max_pic_average_light_level: " << clli.max_pic_average_light_level << "\n";
 2801|       |
 2802|  2.25k|  return sstr.str();
 2803|  2.25k|}
_ZN8Box_mdcvC2Ev:
 2820|  8.04k|{
 2821|  8.04k|  set_short_type(fourcc("mdcv"));
 2822|       |
 2823|  8.04k|  memset(&mdcv, 0, sizeof(heif_mastering_display_colour_volume));
 2824|  8.04k|}
_ZN8Box_mdcv5parseER14BitstreamRangePK20heif_security_limits:
 2828|  4.39k|{
 2829|       |  //parse_full_box_header(range);
 2830|       |
 2831|  17.5k|  for (int c = 0; c < 3; c++) {
  ------------------
  |  Branch (2831:19): [True: 13.1k, False: 4.39k]
  ------------------
 2832|  13.1k|    mdcv.display_primaries_x[c] = range.read16();
 2833|  13.1k|    mdcv.display_primaries_y[c] = range.read16();
 2834|  13.1k|  }
 2835|       |
 2836|  4.39k|  mdcv.white_point_x = range.read16();
 2837|  4.39k|  mdcv.white_point_y = range.read16();
 2838|  4.39k|  mdcv.max_display_mastering_luminance = range.read32();
 2839|  4.39k|  mdcv.min_display_mastering_luminance = range.read32();
 2840|       |
 2841|  4.39k|  return range.get_error();
 2842|  4.39k|}
_ZNK8Box_mdcv4dumpER6Indent:
 2846|  3.15k|{
 2847|  3.15k|  std::ostringstream sstr;
 2848|  3.15k|  sstr << Box::dump(indent);
 2849|       |
 2850|  3.15k|  sstr << indent << "display_primaries (x,y): ";
 2851|  3.15k|  sstr << "(" << mdcv.display_primaries_x[0] << ";" << mdcv.display_primaries_y[0] << "), ";
 2852|  3.15k|  sstr << "(" << mdcv.display_primaries_x[1] << ";" << mdcv.display_primaries_y[1] << "), ";
 2853|  3.15k|  sstr << "(" << mdcv.display_primaries_x[2] << ";" << mdcv.display_primaries_y[2] << ")\n";
 2854|       |
 2855|  3.15k|  sstr << indent << "white point (x,y): (" << mdcv.white_point_x << ";" << mdcv.white_point_y << ")\n";
 2856|  3.15k|  sstr << indent << "max display mastering luminance: " << mdcv.max_display_mastering_luminance << "\n";
 2857|  3.15k|  sstr << indent << "min display mastering luminance: " << mdcv.min_display_mastering_luminance << "\n";
 2858|       |
 2859|  3.15k|  return sstr.str();
 2860|  3.15k|}
_ZN8Box_amveC2Ev:
 2884|  4.55k|{
 2885|  4.55k|  set_short_type(fourcc("amve"));
 2886|       |
 2887|       |  // These values are not valid.
 2888|  4.55k|  amve.ambient_illumination = 0;
 2889|  4.55k|  amve.ambient_light_x = 0;
 2890|  4.55k|  amve.ambient_light_y = 0;
 2891|  4.55k|}
_ZN8Box_amve5parseER14BitstreamRangePK20heif_security_limits:
 2894|  1.03k|{
 2895|  1.03k|  amve.ambient_illumination = range.read32();
 2896|  1.03k|  amve.ambient_light_x = range.read16();
 2897|  1.03k|  amve.ambient_light_y = range.read16();
 2898|       |
 2899|  1.03k|  return range.get_error();
 2900|  1.03k|}
_ZNK8Box_amve4dumpER6Indent:
 2904|    518|{
 2905|    518|  std::ostringstream sstr;
 2906|    518|  sstr << Box::dump(indent);
 2907|       |
 2908|    518|  sstr << indent << "ambient_illumination: " << amve.ambient_illumination << "\n";
 2909|    518|  sstr << indent << "ambient_light_x: " << amve.ambient_light_x << "\n";
 2910|    518|  sstr << indent << "ambient_light_y: " << amve.ambient_light_y << "\n";
 2911|       |
 2912|    518|  return sstr.str();
 2913|    518|}
_ZN8Box_ndwt5parseER14BitstreamRangePK20heif_security_limits:
 2931|    608|{
 2932|    608|  parse_full_box_header(range);
 2933|       |
 2934|    608|  if (get_version() != 0) {
  ------------------
  |  Branch (2934:7): [True: 38, False: 570]
  ------------------
 2935|     38|    return unsupported_version_error("ndwt");
 2936|     38|  }
 2937|       |
 2938|    570|  m_diffuse_white_luminance = range.read32();
 2939|       |
 2940|    570|  return range.get_error();
 2941|    608|}
_ZNK8Box_ndwt4dumpER6Indent:
 2945|    505|{
 2946|    505|  std::ostringstream sstr;
 2947|    505|  sstr << Box::dump(indent);
 2948|       |
 2949|    505|  sstr << indent << "diffuse_white_luminance: " << m_diffuse_white_luminance << "\n";
 2950|       |
 2951|    505|  return sstr.str();
 2952|    505|}
_ZN8Box_cclvC2Ev:
 2968|  5.78k|{
 2969|  5.78k|  set_short_type(fourcc("cclv"));
 2970|       |
 2971|  5.78k|  m_ccv_primaries_valid = false;
 2972|  5.78k|}
_ZN8Box_cclv13set_primariesEiiiiii:
 2976|    499|{
 2977|    499|  m_ccv_primaries_valid = true;
 2978|    499|  m_ccv_primaries_x[0] = x0;
 2979|    499|  m_ccv_primaries_y[0] = y0;
 2980|    499|  m_ccv_primaries_x[1] = x1;
 2981|    499|  m_ccv_primaries_y[1] = y1;
 2982|    499|  m_ccv_primaries_x[2] = x2;
 2983|    499|  m_ccv_primaries_y[2] = y2;
 2984|    499|}
_ZN8Box_ispe5parseER14BitstreamRangePK20heif_security_limits:
 3168|  2.96k|{
 3169|  2.96k|  parse_full_box_header(range);
 3170|       |
 3171|  2.96k|  if (get_version() != 0) {
  ------------------
  |  Branch (3171:7): [True: 1, False: 2.96k]
  ------------------
 3172|      1|    return unsupported_version_error("ispe");
 3173|      1|  }
 3174|       |
 3175|  2.96k|  m_image_width = range.read32();
 3176|  2.96k|  m_image_height = range.read32();
 3177|       |
 3178|  2.96k|  return range.get_error();
 3179|  2.96k|}
_ZNK8Box_ispe4dumpER6Indent:
 3183|  2.57k|{
 3184|  2.57k|  std::ostringstream sstr;
 3185|  2.57k|  sstr << Box::dump(indent);
 3186|       |
 3187|  2.57k|  sstr << indent << "image width: " << m_image_width << "\n"
 3188|  2.57k|       << indent << "image height: " << m_image_height << "\n";
 3189|       |
 3190|  2.57k|  return sstr.str();
 3191|  2.57k|}
_ZN8Box_ipma5parseER14BitstreamRangePK20heif_security_limits:
 3220|  3.15k|{
 3221|  3.15k|  parse_full_box_header(range);
 3222|       |
 3223|       |  // TODO: is there any specification of allowed values for the ipma version in the HEIF standards?
 3224|       |
 3225|  3.15k|  if (get_version() > 1) {
  ------------------
  |  Branch (3225:7): [True: 1, False: 3.15k]
  ------------------
 3226|      1|    return unsupported_version_error("ipma");
 3227|      1|  }
 3228|       |
 3229|  3.15k|  uint32_t entry_cnt = range.read32();
 3230|       |
 3231|  3.15k|  if (limits->max_items && entry_cnt > limits->max_items) {
  ------------------
  |  Branch (3231:7): [True: 3.15k, False: 0]
  |  Branch (3231:28): [True: 11, False: 3.14k]
  ------------------
 3232|     11|    std::stringstream sstr;
 3233|     11|    sstr << "ipma box wants to define properties for " << entry_cnt
 3234|     11|         << " items, but the security limit has been set to " << limits->max_items << " items";
 3235|     11|    return {heif_error_Invalid_input,
 3236|     11|            heif_suberror_Security_limit_exceeded,
 3237|     11|            sstr.str()};
 3238|     11|  }
 3239|       |
 3240|  19.3k|  for (uint32_t i = 0; i < entry_cnt && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (3240:24): [True: 16.5k, False: 2.85k]
  |  Branch (3240:41): [True: 16.4k, False: 58]
  |  Branch (3240:59): [True: 16.2k, False: 228]
  ------------------
 3241|  16.2k|    Entry entry;
 3242|  16.2k|    if (get_version() < 1) {
  ------------------
  |  Branch (3242:9): [True: 10.0k, False: 6.18k]
  ------------------
 3243|  10.0k|      entry.item_ID = range.read16();
 3244|  10.0k|    }
 3245|  6.18k|    else {
 3246|  6.18k|      entry.item_ID = range.read32();
 3247|  6.18k|    }
 3248|       |
 3249|  16.2k|    int assoc_cnt = range.read8();
 3250|   959k|    for (int k = 0; k < assoc_cnt; k++) {
  ------------------
  |  Branch (3250:21): [True: 942k, False: 16.2k]
  ------------------
 3251|   942k|      PropertyAssociation association{};
 3252|       |
 3253|   942k|      uint16_t index;
 3254|   942k|      if (get_flags() & 1) {
  ------------------
  |  Branch (3254:11): [True: 1.67k, False: 941k]
  ------------------
 3255|  1.67k|        index = range.read16();
 3256|  1.67k|        association.essential = !!(index & 0x8000);
 3257|  1.67k|        association.property_index = (index & 0x7fff);
 3258|  1.67k|      }
 3259|   941k|      else {
 3260|   941k|        index = range.read8();
 3261|   941k|        association.essential = !!(index & 0x80);
 3262|   941k|        association.property_index = (index & 0x7f);
 3263|   941k|      }
 3264|       |
 3265|   942k|      entry.associations.push_back(association);
 3266|   942k|    }
 3267|       |
 3268|  16.2k|    m_entries.push_back(entry);
 3269|  16.2k|  }
 3270|       |
 3271|  3.14k|  return range.get_error();
 3272|  3.15k|}
_ZNK8Box_ipma4dumpER6Indent:
 3336|  2.70k|{
 3337|  2.70k|  std::ostringstream sstr;
 3338|  2.70k|  sstr << Box::dump(indent);
 3339|       |
 3340|  15.2k|  for (const Entry& entry : m_entries) {
  ------------------
  |  Branch (3340:27): [True: 15.2k, False: 2.70k]
  ------------------
 3341|  15.2k|    sstr << indent << "associations for item ID: " << entry.item_ID << "\n";
 3342|  15.2k|    indent++;
 3343|   937k|    for (const auto& assoc : entry.associations) {
  ------------------
  |  Branch (3343:28): [True: 937k, False: 15.2k]
  ------------------
 3344|   937k|      sstr << indent << "property index: " << assoc.property_index
 3345|   937k|           << " (essential: " << std::boolalpha << assoc.essential << ")\n";
 3346|   937k|    }
 3347|  15.2k|    indent--;
 3348|  15.2k|  }
 3349|       |
 3350|  2.70k|  return sstr.str();
 3351|  2.70k|}
_ZN8Box_auxC5parseER14BitstreamRangePK20heif_security_limits:
 3446|    959|{
 3447|    959|  parse_full_box_header(range);
 3448|       |
 3449|    959|  if (get_version() != 0) {
  ------------------
  |  Branch (3449:7): [True: 1, False: 958]
  ------------------
 3450|      1|    return unsupported_version_error("auxC");
 3451|      1|  }
 3452|       |
 3453|    958|  m_aux_type = range.read_string();
 3454|       |
 3455|  5.28M|  while (!range.eof()) {
  ------------------
  |  Branch (3455:10): [True: 5.27M, False: 958]
  ------------------
 3456|  5.27M|    m_aux_subtypes.push_back(range.read8());
 3457|  5.27M|  }
 3458|       |
 3459|    958|  return range.get_error();
 3460|    959|}
_ZNK8Box_auxC4dumpER6Indent:
 3480|    747|{
 3481|    747|  std::ostringstream sstr;
 3482|    747|  sstr << Box::dump(indent);
 3483|       |
 3484|    747|  sstr << indent << "aux type: " << m_aux_type << "\n"
 3485|    747|       << indent << "aux subtypes: ";
 3486|  5.27M|  for (uint8_t subtype : m_aux_subtypes) {
  ------------------
  |  Branch (3486:24): [True: 5.27M, False: 747]
  ------------------
 3487|  5.27M|    sstr << std::hex << std::setw(2) << std::setfill('0') << ((int) subtype) << " ";
 3488|  5.27M|  }
 3489|       |
 3490|    747|  sstr << "\n";
 3491|       |
 3492|    747|  return sstr.str();
 3493|    747|}
_ZN8Box_irot5parseER14BitstreamRangePK20heif_security_limits:
 3497|  12.8k|{
 3498|       |  //parse_full_box_header(range);
 3499|       |
 3500|  12.8k|  uint16_t rotation = range.read8();
 3501|  12.8k|  rotation &= 0x03;
 3502|       |
 3503|  12.8k|  m_rotation = rotation * 90;
 3504|       |
 3505|  12.8k|  return range.get_error();
 3506|  12.8k|}
_ZNK8Box_irot4dumpER6Indent:
 3522|  10.2k|{
 3523|  10.2k|  std::ostringstream sstr;
 3524|  10.2k|  sstr << Box::dump(indent);
 3525|       |
 3526|  10.2k|  sstr << indent << "rotation: " << m_rotation << " degrees (CCW)\n";
 3527|       |
 3528|  10.2k|  return sstr.str();
 3529|  10.2k|}
_ZN8Box_imir5parseER14BitstreamRangePK20heif_security_limits:
 3533|  2.53k|{
 3534|       |  //parse_full_box_header(range);
 3535|       |
 3536|  2.53k|  uint8_t axis = range.read8();
 3537|  2.53k|  if (axis & 1) {
  ------------------
  |  Branch (3537:7): [True: 142, False: 2.38k]
  ------------------
 3538|    142|    m_axis = heif_transform_mirror_direction_horizontal;
 3539|    142|  }
 3540|  2.38k|  else {
 3541|  2.38k|    m_axis = heif_transform_mirror_direction_vertical;
 3542|  2.38k|  }
 3543|       |
 3544|  2.53k|  return range.get_error();
 3545|  2.53k|}
_ZNK8Box_imir4dumpER6Indent:
 3561|  1.88k|{
 3562|  1.88k|  std::ostringstream sstr;
 3563|  1.88k|  sstr << Box::dump(indent);
 3564|       |
 3565|  1.88k|  sstr << indent << "mirror direction: ";
 3566|  1.88k|  switch (m_axis) {
  ------------------
  |  Branch (3566:11): [True: 1.88k, False: 0]
  ------------------
 3567|  1.74k|    case heif_transform_mirror_direction_vertical:
  ------------------
  |  Branch (3567:5): [True: 1.74k, False: 142]
  ------------------
 3568|  1.74k|      sstr << "vertical\n";
 3569|  1.74k|      break;
 3570|    142|    case heif_transform_mirror_direction_horizontal:
  ------------------
  |  Branch (3570:5): [True: 142, False: 1.74k]
  ------------------
 3571|    142|      sstr << "horizontal\n";
 3572|    142|      break;
 3573|      0|    case heif_transform_mirror_direction_invalid:
  ------------------
  |  Branch (3573:5): [True: 0, False: 1.88k]
  ------------------
 3574|      0|      sstr << "invalid\n";
 3575|      0|      break;
 3576|  1.88k|  }
 3577|       |
 3578|  1.88k|  return sstr.str();
 3579|  1.88k|}
_ZN8Box_iscl5parseER14BitstreamRangePK20heif_security_limits:
 3583|    691|{
 3584|    691|  parse_full_box_header(range);
 3585|       |
 3586|    691|  if (get_version() != 0) {
  ------------------
  |  Branch (3586:7): [True: 79, False: 612]
  ------------------
 3587|     79|    return unsupported_version_error("iscl");
 3588|     79|  }
 3589|       |
 3590|    612|  m_target_width_numerator = range.read16();
 3591|    612|  m_target_width_denominator = range.read16();
 3592|    612|  m_target_height_numerator = range.read16();
 3593|    612|  m_target_height_denominator = range.read16();
 3594|       |
 3595|    612|  if (m_target_width_numerator == 0 || m_target_width_denominator == 0 ||
  ------------------
  |  Branch (3595:7): [True: 69, False: 543]
  |  Branch (3595:40): [True: 88, False: 455]
  ------------------
 3596|    455|      m_target_height_numerator == 0 || m_target_height_denominator == 0) {
  ------------------
  |  Branch (3596:7): [True: 42, False: 413]
  |  Branch (3596:41): [True: 27, False: 386]
  ------------------
 3597|    226|    return {heif_error_Invalid_input,
 3598|    226|            heif_suberror_Invalid_fractional_number,
 3599|    226|            "iscl property has zero numerator or denominator"};
 3600|    226|  }
 3601|       |
 3602|    386|  return range.get_error();
 3603|    612|}
_ZNK8Box_iscl4dumpER6Indent:
 3622|    369|{
 3623|    369|  std::ostringstream sstr;
 3624|    369|  sstr << FullBox::dump(indent);
 3625|       |
 3626|    369|  sstr << indent << "horizontal scaling factor: " << m_target_width_numerator << " / " << m_target_width_denominator << "\n";
 3627|    369|  sstr << indent << "vertical scaling factor:   " << m_target_height_numerator << " / " << m_target_height_denominator << "\n";
 3628|       |
 3629|    369|  return sstr.str();
 3630|    369|}
_ZN8Box_clap5parseER14BitstreamRangePK20heif_security_limits:
 3634|  19.1k|{
 3635|       |  //parse_full_box_header(range);
 3636|       |
 3637|  19.1k|  uint32_t clean_aperture_width_num = range.read32();
 3638|  19.1k|  uint32_t clean_aperture_width_den = range.read32();
 3639|  19.1k|  uint32_t clean_aperture_height_num = range.read32();
 3640|  19.1k|  uint32_t clean_aperture_height_den = range.read32();
 3641|       |
 3642|       |  // Note: in the standard document 14496-12(2015), it says that the offset values should also be unsigned integers,
 3643|       |  // but this is obviously an error. Even the accompanying standard text says that offsets may be negative.
 3644|  19.1k|  int32_t horizontal_offset_num = (int32_t) range.read32();
 3645|  19.1k|  uint32_t horizontal_offset_den = (uint32_t) range.read32();
 3646|  19.1k|  int32_t vertical_offset_num = (int32_t) range.read32();
 3647|  19.1k|  uint32_t vertical_offset_den = (uint32_t) range.read32();
 3648|       |
 3649|  19.1k|  if (clean_aperture_width_num > (uint32_t) std::numeric_limits<int32_t>::max() ||
  ------------------
  |  Branch (3649:7): [True: 1.22k, False: 17.8k]
  ------------------
 3650|  17.8k|      clean_aperture_width_den > (uint32_t) std::numeric_limits<int32_t>::max() ||
  ------------------
  |  Branch (3650:7): [True: 447, False: 17.4k]
  ------------------
 3651|  17.4k|      clean_aperture_height_num > (uint32_t) std::numeric_limits<int32_t>::max() ||
  ------------------
  |  Branch (3651:7): [True: 72, False: 17.3k]
  ------------------
 3652|  17.3k|      clean_aperture_height_den > (uint32_t) std::numeric_limits<int32_t>::max() ||
  ------------------
  |  Branch (3652:7): [True: 128, False: 17.2k]
  ------------------
 3653|  17.2k|      horizontal_offset_den > (uint32_t) std::numeric_limits<int32_t>::max() ||
  ------------------
  |  Branch (3653:7): [True: 204, False: 17.0k]
  ------------------
 3654|  17.0k|      vertical_offset_den > (uint32_t) std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (3654:7): [True: 112, False: 16.9k]
  ------------------
 3655|  2.19k|    return Error(heif_error_Invalid_input,
 3656|  2.19k|                 heif_suberror_Invalid_fractional_number,
 3657|  2.19k|                 "Exceeded supported value range.");
 3658|  2.19k|  }
 3659|       |
 3660|  16.9k|  m_clean_aperture_width = Fraction(clean_aperture_width_num,
 3661|  16.9k|                                    clean_aperture_width_den);
 3662|  16.9k|  m_clean_aperture_height = Fraction(clean_aperture_height_num,
 3663|  16.9k|                                     clean_aperture_height_den);
 3664|  16.9k|  m_horizontal_offset = Fraction(horizontal_offset_num, (int32_t) horizontal_offset_den);
 3665|  16.9k|  m_vertical_offset = Fraction(vertical_offset_num, (int32_t) vertical_offset_den);
 3666|  16.9k|  if (!m_clean_aperture_width.is_valid() || !m_clean_aperture_height.is_valid() ||
  ------------------
  |  Branch (3666:7): [True: 868, False: 16.0k]
  |  Branch (3666:45): [True: 353, False: 15.7k]
  ------------------
 3667|  16.2k|      !m_horizontal_offset.is_valid() || !m_vertical_offset.is_valid()) {
  ------------------
  |  Branch (3667:7): [True: 526, False: 15.1k]
  |  Branch (3667:42): [True: 14.4k, False: 722]
  ------------------
 3668|  16.2k|    return Error(heif_error_Invalid_input,
 3669|  16.2k|                 heif_suberror_Invalid_fractional_number);
 3670|  16.2k|  }
 3671|       |
 3672|    722|  return range.get_error();
 3673|  16.9k|}
_ZNK8Box_clap4dumpER6Indent:
 3696|    509|{
 3697|    509|  std::ostringstream sstr;
 3698|    509|  sstr << Box::dump(indent);
 3699|       |
 3700|    509|  sstr << indent << "clean_aperture: " << m_clean_aperture_width.numerator
 3701|    509|       << "/" << m_clean_aperture_width.denominator << " x "
 3702|    509|       << m_clean_aperture_height.numerator << "/"
 3703|    509|       << m_clean_aperture_height.denominator << "\n";
 3704|    509|  sstr << indent << "offset: " << m_horizontal_offset.numerator << "/"
 3705|    509|       << m_horizontal_offset.denominator << " ; "
 3706|    509|       << m_vertical_offset.numerator << "/"
 3707|    509|       << m_vertical_offset.denominator << "\n";
 3708|       |
 3709|    509|  return sstr.str();
 3710|    509|}
_ZN8Box_iref5parseER14BitstreamRangePK20heif_security_limits:
 3799|  14.8k|{
 3800|  14.8k|  parse_full_box_header(range);
 3801|       |
 3802|  14.8k|  if (get_version() > 1) {
  ------------------
  |  Branch (3802:7): [True: 7, False: 14.8k]
  ------------------
 3803|      7|    return unsupported_version_error("iref");
 3804|      7|  }
 3805|       |
 3806|  31.8k|  while (!range.eof()) {
  ------------------
  |  Branch (3806:10): [True: 17.0k, False: 14.7k]
  ------------------
 3807|  17.0k|    Reference ref;
 3808|       |
 3809|  17.0k|    Error err = ref.header.parse_header(range);
 3810|  17.0k|    if (err != Error::Ok) {
  ------------------
  |  Branch (3810:9): [True: 9, False: 17.0k]
  ------------------
 3811|      9|      return err;
 3812|      9|    }
 3813|       |
 3814|  17.0k|    int read_len = (get_version() == 0) ? 16 : 32;
  ------------------
  |  Branch (3814:20): [True: 15.7k, False: 1.24k]
  ------------------
 3815|       |
 3816|  17.0k|    ref.from_item_ID = static_cast<uint32_t>(range.read_uint(read_len));
 3817|  17.0k|    uint16_t nRefs = range.read16();
 3818|       |
 3819|  17.0k|    if (nRefs==0) {
  ------------------
  |  Branch (3819:9): [True: 3, False: 17.0k]
  ------------------
 3820|      3|      return {heif_error_Invalid_input,
 3821|      3|              heif_suberror_Unspecified,
 3822|      3|              "Input file has an 'iref' box with no references."};
 3823|      3|    }
 3824|       |
 3825|  17.0k|    if (limits->max_items && nRefs > limits->max_items) {
  ------------------
  |  Branch (3825:9): [True: 17.0k, False: 0]
  |  Branch (3825:30): [True: 15, False: 17.0k]
  ------------------
 3826|     15|      std::stringstream sstr;
 3827|     15|      sstr << "Number of references in iref box (" << nRefs << ") exceeds the security limits of " << limits->max_items << " references.";
 3828|       |
 3829|     15|      return {heif_error_Invalid_input,
 3830|     15|              heif_suberror_Security_limit_exceeded,
 3831|     15|              sstr.str()};
 3832|     15|    }
 3833|       |
 3834|   404k|    for (int i = 0; i < nRefs; i++) {
  ------------------
  |  Branch (3834:21): [True: 387k, False: 16.9k]
  ------------------
 3835|   387k|      if (range.eof()) {
  ------------------
  |  Branch (3835:11): [True: 30, False: 387k]
  ------------------
 3836|     30|        std::stringstream sstr;
 3837|     30|        sstr << "iref box should contain " << nRefs << " references, but we can only read " << i << " references.";
 3838|       |
 3839|     30|        return {heif_error_Invalid_input,
 3840|     30|                heif_suberror_End_of_data,
 3841|     30|                sstr.str()};
 3842|     30|      }
 3843|       |
 3844|   387k|      ref.to_item_ID.push_back(static_cast<uint32_t>(range.read_uint(read_len)));
 3845|   387k|    }
 3846|       |
 3847|  16.9k|    m_references.push_back(ref);
 3848|  16.9k|  }
 3849|       |
 3850|       |
 3851|       |  // --- check for duplicate references
 3852|       |
 3853|  14.7k|  if (auto error = check_for_double_references()) {
  ------------------
  |  Branch (3853:12): [True: 56, False: 14.7k]
  ------------------
 3854|     56|    return error;
 3855|     56|  }
 3856|       |
 3857|       |
 3858|       |#if 0
 3859|       |  // Note: This input sanity check first did not work as expected.
 3860|       |  // Its idea was to prevent infinite recursions while decoding when the input file
 3861|       |  // contains cyclic references. However, apparently there are cases where cyclic
 3862|       |  // references are actually allowed, like with images that have premultiplied alpha channels:
 3863|       |  // | Box: iref -----
 3864|       |  // | size: 40   (header size: 12)
 3865|       |  // | reference with type 'auxl' from ID: 2 to IDs: 1
 3866|       |  // | reference with type 'prem' from ID: 1 to IDs: 2
 3867|       |  //
 3868|       |  // We now test for cyclic references during the image decoding.
 3869|       |  // We pass down the item IDs that have already been seen during the decoding process.
 3870|       |  // If we try to decode an image IDs that has already been seen previously, we throw an error.
 3871|       |  // The advantage is that the error only occurs when we are trying to decode the faulty image.
 3872|       |
 3873|       |  // --- check for cyclic references
 3874|       |
 3875|       |  for (const auto& ref : m_references) {
 3876|       |    if (ref.header.get_short_type() != fourcc("dimg") &&
 3877|       |        ref.header.get_short_type() != fourcc("auxl")) {
 3878|       |      continue;
 3879|       |    }
 3880|       |
 3881|       |    std::set<heif_item_id> reached_ids; // IDs that we have already reached in the DAG
 3882|       |    std::set<heif_item_id> todo;    // IDs that still need to be followed
 3883|       |
 3884|       |    bool reverse = (ref.header.get_short_type() != fourcc("auxl"));
 3885|       |
 3886|       |    if (!reverse) {
 3887|       |      todo.insert(ref.from_item_ID);  // start at base item
 3888|       |    }
 3889|       |    else {
 3890|       |      if (ref.to_item_ID.empty()) {
 3891|       |        continue;
 3892|       |      }
 3893|       |
 3894|       |      // TODO: what if aux image is assigned to multiple images?
 3895|       |      todo.insert(ref.to_item_ID[0]);  // start at base item
 3896|       |    }
 3897|       |
 3898|       |    while (!todo.empty()) {
 3899|       |      // transfer ID into set of reached IDs
 3900|       |      auto id = *todo.begin();
 3901|       |      todo.erase(id);
 3902|       |      reached_ids.insert(id);
 3903|       |
 3904|       |      // if this ID refers to another 'iref', follow it
 3905|       |
 3906|       |      for (const auto& succ_ref : m_references) {
 3907|       |        if (succ_ref.header.get_short_type() != fourcc("dimg") &&
 3908|       |            succ_ref.header.get_short_type() != fourcc("auxl")) {
 3909|       |          continue;
 3910|       |        }
 3911|       |
 3912|       |        heif_item_id from;
 3913|       |        std::vector<heif_item_id> to;
 3914|       |
 3915|       |        if (succ_ref.header.get_short_type() == fourcc("auxl")) {
 3916|       |          if (succ_ref.to_item_ID.empty()) {
 3917|       |            continue;
 3918|       |          }
 3919|       |
 3920|       |          from = succ_ref.to_item_ID[0];
 3921|       |          to = {succ_ref.from_item_ID};
 3922|       |        }
 3923|       |        else {
 3924|       |          from = succ_ref.from_item_ID;
 3925|       |          to = succ_ref.to_item_ID;
 3926|       |        }
 3927|       |
 3928|       |        if (from == id) {
 3929|       |
 3930|       |          // Check whether any successor IDs has been visited yet, which would be an error.
 3931|       |          // Otherwise, put that ID into the 'todo' set.
 3932|       |
 3933|       |          for (const auto& succ_ref_id : to) {
 3934|       |            if (reached_ids.find(succ_ref_id) != reached_ids.end()) {
 3935|       |              return Error(heif_error_Invalid_input,
 3936|       |                           heif_suberror_Unspecified,
 3937|       |                           "'iref' has cyclic references");
 3938|       |            }
 3939|       |
 3940|       |            todo.insert(succ_ref_id);
 3941|       |          }
 3942|       |        }
 3943|       |      }
 3944|       |    }
 3945|       |  }
 3946|       |#endif
 3947|       |
 3948|  14.7k|  return range.get_error();
 3949|  14.7k|}
_ZNK8Box_iref27check_for_double_referencesEv:
 3953|  14.7k|{
 3954|  15.1k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (3954:24): [True: 15.1k, False: 14.7k]
  ------------------
 3955|  15.1k|    std::set<heif_item_id> to_ids;
 3956|  69.2k|    for (const auto to_id : ref.to_item_ID) {
  ------------------
  |  Branch (3956:27): [True: 69.2k, False: 15.1k]
  ------------------
 3957|  69.2k|      if (to_ids.find(to_id) == to_ids.end()) {
  ------------------
  |  Branch (3957:11): [True: 69.2k, False: 56]
  ------------------
 3958|  69.2k|        to_ids.insert(to_id);
 3959|  69.2k|      }
 3960|     56|      else {
 3961|     56|        return {heif_error_Invalid_input,
 3962|     56|                heif_suberror_Unspecified,
 3963|     56|                "'iref' has double references"};
 3964|     56|      }
 3965|  69.2k|    }
 3966|  15.1k|  }
 3967|       |
 3968|  14.7k|  return Error::Ok;
 3969|  14.7k|}
_ZNK8Box_iref4dumpER6Indent:
 4026|  14.0k|{
 4027|  14.0k|  std::ostringstream sstr;
 4028|  14.0k|  sstr << Box::dump(indent);
 4029|       |
 4030|  14.2k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (4030:24): [True: 14.2k, False: 14.0k]
  ------------------
 4031|  14.2k|    sstr << indent << "reference with type '" << ref.header.get_type_string() << "'"
 4032|  14.2k|         << " from ID: " << ref.from_item_ID
 4033|  14.2k|         << " to IDs: ";
 4034|  57.3k|    for (uint32_t id : ref.to_item_ID) {
  ------------------
  |  Branch (4034:22): [True: 57.3k, False: 14.2k]
  ------------------
 4035|  57.3k|      sstr << id << " ";
 4036|  57.3k|    }
 4037|  14.2k|    sstr << "\n";
 4038|  14.2k|  }
 4039|       |
 4040|  14.0k|  return sstr.str();
 4041|  14.0k|}
_ZN8Box_rref5parseER14BitstreamRangePK20heif_security_limits:
 4112|    803|{
 4113|    803|  parse_full_box_header(range);
 4114|       |
 4115|    803|  if (get_version() > 1) {
  ------------------
  |  Branch (4115:7): [True: 7, False: 796]
  ------------------
 4116|      7|    return unsupported_version_error("rref");
 4117|      7|  }
 4118|       |
 4119|    796|  size_t remainingBytes = range.get_remaining_bytes();
 4120|       |
 4121|       |  // The number of reference types should be stored in uint(8), but the
 4122|       |  // common test images C043, C044 store them as uint(32).
 4123|       |  // Let us detect this case by the number of data bytes in this box.
 4124|    796|  bool cnt_as_uint32 = (remainingBytes > 0 && remainingBytes % 4 == 0);
  ------------------
  |  Branch (4124:25): [True: 792, False: 4]
  |  Branch (4124:47): [True: 546, False: 246]
  ------------------
 4125|       |
 4126|    796|  uint8_t nRefTypes;
 4127|    796|  if (cnt_as_uint32) {
  ------------------
  |  Branch (4127:7): [True: 546, False: 250]
  ------------------
 4128|       |    // fix broken C043, C044 files
 4129|       |    // TODO: remove me when the files have been corrected as the above check can misfire when there is extra padding
 4130|    546|    nRefTypes = (uint8_t)range.read32();
 4131|    546|  }
 4132|    250|  else {
 4133|    250|    nRefTypes = range.read8();
 4134|    250|  }
 4135|       |
 4136|  3.85k|  for (uint8_t i = 0; i < nRefTypes; i++) {
  ------------------
  |  Branch (4136:23): [True: 3.08k, False: 773]
  ------------------
 4137|  3.08k|    uint32_t refType = range.read32();
 4138|       |
 4139|  3.08k|    if (range.error()) {
  ------------------
  |  Branch (4139:9): [True: 23, False: 3.06k]
  ------------------
 4140|     23|      std::stringstream sstr;
 4141|     23|      sstr << "rref box should contain " << ((int)nRefTypes) << " reference types, but we can only read " << m_reference_types.size() << " reference types.";
 4142|       |
 4143|     23|      return {
 4144|     23|        heif_error_Invalid_input,
 4145|     23|        heif_suberror_End_of_data,
 4146|     23|        sstr.str()
 4147|     23|      };
 4148|     23|    }
 4149|       |
 4150|  3.06k|    m_reference_types.push_back(refType);
 4151|  3.06k|  }
 4152|       |
 4153|    773|  return range.get_error();
 4154|    796|}
_ZNK8Box_rref4dumpER6Indent:
 4239|    597|{
 4240|    597|  std::ostringstream sstr;
 4241|    597|  sstr << Box::dump(indent);
 4242|       |
 4243|    597|  sstr << indent << "reference types: ";
 4244|  2.55k|  for (size_t i = 0; i < m_reference_types.size(); i++) {
  ------------------
  |  Branch (4244:22): [True: 1.95k, False: 597]
  ------------------
 4245|  1.95k|    if (i > 0) sstr << ", ";
  ------------------
  |  Branch (4245:9): [True: 1.85k, False: 103]
  ------------------
 4246|  1.95k|    sstr << fourcc_to_string(m_reference_types[i]);
 4247|  1.95k|  }
 4248|    597|  sstr << "\n";
 4249|       |
 4250|    597|  return sstr.str();
 4251|    597|}
_ZN8Box_idat5parseER14BitstreamRangePK20heif_security_limits:
 4255|  9.84k|{
 4256|       |  //parse_full_box_header(range);
 4257|       |
 4258|  9.84k|  m_data_start_pos = range.get_istream()->get_position();
 4259|       |
 4260|  9.84k|  return range.get_error();
 4261|  9.84k|}
_ZNK8Box_idat4dumpER6Indent:
 4277|  8.44k|{
 4278|  8.44k|  std::ostringstream sstr;
 4279|  8.44k|  sstr << Box::dump(indent);
 4280|       |
 4281|  8.44k|  if (get_box_size() >= get_header_size()) {
  ------------------
  |  Branch (4281:7): [True: 8.02k, False: 420]
  ------------------
 4282|  8.02k|    sstr << indent << "number of data bytes: " << get_box_size() - get_header_size() << "\n";
 4283|  8.02k|  } else {
 4284|    420|     sstr << indent << "number of data bytes is invalid\n";
 4285|    420|  }
 4286|       |
 4287|  8.44k|  return sstr.str();
 4288|  8.44k|}
_ZN8Box_grpl5parseER14BitstreamRangePK20heif_security_limits:
 4351|  1.82k|{
 4352|       |  //parse_full_box_header(range);
 4353|       |
 4354|  1.82k|  return read_children(range, READ_CHILDREN_ALL, limits); // should we pass the parsing context 'grpl' or are the box types unique?
 4355|  1.82k|}
_ZNK8Box_grpl4dumpER6Indent:
 4359|  1.35k|{
 4360|  1.35k|  std::ostringstream sstr;
 4361|  1.35k|  sstr << Box::dump(indent);
 4362|  1.35k|  sstr << dump_children(indent);
 4363|  1.35k|  return sstr.str();
 4364|  1.35k|}
_ZN17Box_EntityToGroup5parseER14BitstreamRangePK20heif_security_limits:
 4368|  2.93k|{
 4369|  2.93k|  Error err = parse_full_box_header(range);
 4370|  2.93k|  if (err != Error::Ok) {
  ------------------
  |  Branch (4370:7): [True: 333, False: 2.59k]
  ------------------
 4371|    333|    return err;
 4372|    333|  }
 4373|       |
 4374|  2.59k|  group_id = range.read32();
 4375|  2.59k|  uint32_t nEntities = range.read32();
 4376|       |
 4377|  2.59k|  if (nEntities > range.get_remaining_bytes() / 4) {
  ------------------
  |  Branch (4377:7): [True: 89, False: 2.50k]
  ------------------
 4378|     89|    std::stringstream sstr;
 4379|     89|    size_t maxEntries = range.get_remaining_bytes() / 4;
 4380|     89|    sstr << "entity group box should contain " << nEntities << " entities, but we can only read " << maxEntries << " entities.";
 4381|       |
 4382|     89|    return {heif_error_Invalid_input,
 4383|     89|            heif_suberror_End_of_data,
 4384|     89|            sstr.str()};
 4385|     89|  }
 4386|       |
 4387|  2.50k|  if (limits->max_size_entity_group && nEntities > limits->max_size_entity_group) {
  ------------------
  |  Branch (4387:7): [True: 2.50k, False: 0]
  |  Branch (4387:40): [True: 49, False: 2.46k]
  ------------------
 4388|     49|    std::stringstream sstr;
 4389|     49|    sstr << "entity group box contains " << nEntities << " entities, but the security limit is set to " << limits->max_size_entity_group << " entities.";
 4390|       |
 4391|     49|    return {heif_error_Invalid_input,
 4392|     49|            heif_suberror_Security_limit_exceeded,
 4393|     49|            sstr.str()};
 4394|     49|  }
 4395|       |
 4396|  2.46k|  entity_ids.resize(nEntities);
 4397|  6.97k|  for (uint32_t i = 0; i < nEntities; i++) {
  ------------------
  |  Branch (4397:24): [True: 4.51k, False: 2.46k]
  ------------------
 4398|  4.51k|    entity_ids[i] = range.read32();
 4399|  4.51k|  }
 4400|       |
 4401|  2.46k|  return Error::Ok;
 4402|  2.50k|}
_ZNK17Box_EntityToGroup4dumpER6Indent:
 4431|  1.15k|{
 4432|  1.15k|  std::ostringstream sstr;
 4433|  1.15k|  sstr << Box::dump(indent);
 4434|       |
 4435|  1.15k|  sstr << indent << "group id: " << group_id << "\n"
 4436|  1.15k|       << indent << "entity IDs: ";
 4437|       |
 4438|  1.15k|  bool first = true;
 4439|  2.11k|  for (uint32_t id : entity_ids) {
  ------------------
  |  Branch (4439:20): [True: 2.11k, False: 1.15k]
  ------------------
 4440|  2.11k|    if (first) {
  ------------------
  |  Branch (4440:9): [True: 502, False: 1.61k]
  ------------------
 4441|    502|      first = false;
 4442|    502|    }
 4443|  1.61k|    else {
 4444|  1.61k|      sstr << ' ';
 4445|  1.61k|    }
 4446|       |
 4447|  2.11k|    sstr << id;
 4448|  2.11k|  }
 4449|       |
 4450|  1.15k|  sstr << "\n";
 4451|       |
 4452|  1.15k|  return sstr.str();
 4453|  1.15k|}
_ZN8Box_ster5parseER14BitstreamRangePK20heif_security_limits:
 4457|  1.19k|{
 4458|  1.19k|  Error err = Box_EntityToGroup::parse(range, limits);
 4459|  1.19k|  if (err) {
  ------------------
  |  Branch (4459:7): [True: 14, False: 1.18k]
  ------------------
 4460|     14|    return err;
 4461|     14|  }
 4462|       |
 4463|  1.18k|  if (entity_ids.size() != 2) {
  ------------------
  |  Branch (4463:7): [True: 2, False: 1.18k]
  ------------------
 4464|      2|    return {heif_error_Invalid_input,
 4465|      2|            heif_suberror_Invalid_box_size,
 4466|      2|            "'ster' entity group does not exists of exactly two images"};
 4467|      2|  }
 4468|       |
 4469|  1.18k|  return Error::Ok;
 4470|  1.18k|}
_ZNK8Box_ster4dumpER6Indent:
 4474|    817|{
 4475|    817|  std::ostringstream sstr;
 4476|    817|  sstr << Box::dump(indent);
 4477|       |
 4478|    817|  sstr << indent << "group id: " << group_id << "\n"
 4479|    817|       << indent << "left image ID: " << entity_ids[0] << "\n"
 4480|    817|       << indent << "right image ID: " << entity_ids[1] << "\n";
 4481|       |
 4482|    817|  return sstr.str();
 4483|    817|}
_ZN8Box_pymd5parseER14BitstreamRangePK20heif_security_limits:
 4488|  1.65k|{
 4489|  1.65k|  Error err = Box_EntityToGroup::parse(range, limits);
 4490|  1.65k|  if (err) {
  ------------------
  |  Branch (4490:7): [True: 450, False: 1.20k]
  ------------------
 4491|    450|    return err;
 4492|    450|  }
 4493|       |
 4494|  1.20k|  tile_size_x = range.read16();
 4495|  1.20k|  tile_size_y = range.read16();
 4496|       |
 4497|  3.22k|  for (size_t i = 0; i < entity_ids.size(); i++) {
  ------------------
  |  Branch (4497:22): [True: 2.02k, False: 1.20k]
  ------------------
 4498|  2.02k|    LayerInfo layer{};
 4499|  2.02k|    layer.layer_binning = range.read16();
 4500|  2.02k|    layer.tiles_in_layer_row_minus1 = range.read16();
 4501|  2.02k|    layer.tiles_in_layer_column_minus1 = range.read16();
 4502|       |
 4503|  2.02k|    m_layer_infos.push_back(layer);
 4504|  2.02k|  }
 4505|       |
 4506|  1.20k|  return Error::Ok;
 4507|  1.65k|}
_ZNK8Box_pymd4dumpER6Indent:
 4534|  1.11k|{
 4535|  1.11k|  std::ostringstream sstr;
 4536|  1.11k|  sstr << Box_EntityToGroup::dump(indent);
 4537|       |
 4538|  1.11k|  sstr << indent << "tile size: " << tile_size_x << "x" << tile_size_y << "\n";
 4539|       |
 4540|  1.11k|  int layerNr = 0;
 4541|  2.02k|  for (const auto& layer : m_layer_infos) {
  ------------------
  |  Branch (4541:26): [True: 2.02k, False: 1.11k]
  ------------------
 4542|  2.02k|    sstr << indent << "layer " << layerNr << ":\n"
 4543|  2.02k|         << indent << "| binning: " << layer.layer_binning << "\n"
 4544|  2.02k|         << indent << "| tiles: " << (layer.tiles_in_layer_row_minus1 + 1) << "x" << (layer.tiles_in_layer_column_minus1 + 1) << "\n";
 4545|       |
 4546|  2.02k|    layerNr++;
 4547|  2.02k|  }
 4548|       |
 4549|  1.11k|  return sstr.str();
 4550|  1.11k|}
_ZN8Box_dinf5parseER14BitstreamRangePK20heif_security_limits:
 4554|  8.12k|{
 4555|       |  //parse_full_box_header(range);
 4556|       |
 4557|  8.12k|  return read_children(range, READ_CHILDREN_ALL, limits);
 4558|  8.12k|}
_ZNK8Box_dinf4dumpER6Indent:
 4562|  7.52k|{
 4563|  7.52k|  std::ostringstream sstr;
 4564|  7.52k|  sstr << Box::dump(indent);
 4565|  7.52k|  sstr << dump_children(indent);
 4566|       |
 4567|  7.52k|  return sstr.str();
 4568|  7.52k|}
_ZN8Box_dref5parseER14BitstreamRangePK20heif_security_limits:
 4572|  1.46k|{
 4573|  1.46k|  parse_full_box_header(range);
 4574|       |
 4575|  1.46k|  if (get_version() != 0) {
  ------------------
  |  Branch (4575:7): [True: 6, False: 1.45k]
  ------------------
 4576|      6|    return unsupported_version_error("dref");
 4577|      6|  }
 4578|       |
 4579|  1.45k|  uint32_t nEntities = range.read32();
 4580|       |
 4581|       |  /*
 4582|       |  for (int i=0;i<nEntities;i++) {
 4583|       |    if (range.eof()) {
 4584|       |      break;
 4585|       |    }
 4586|       |  }
 4587|       |  */
 4588|       |
 4589|  1.45k|  if (nEntities > (uint32_t)std::numeric_limits<int>::max()) {
  ------------------
  |  Branch (4589:7): [True: 1, False: 1.45k]
  ------------------
 4590|      1|    return Error(heif_error_Memory_allocation_error,
 4591|      1|                 heif_suberror_Security_limit_exceeded,
 4592|      1|                 "Too many entities in dref box.");
 4593|      1|  }
 4594|       |
 4595|  1.45k|  Error err = read_children(range, (int)nEntities, limits);
 4596|  1.45k|  if (err) {
  ------------------
  |  Branch (4596:7): [True: 99, False: 1.35k]
  ------------------
 4597|     99|    return err;
 4598|     99|  }
 4599|       |
 4600|  1.35k|  if (m_children.size() != nEntities) {
  ------------------
  |  Branch (4600:7): [True: 1.12k, False: 235]
  ------------------
 4601|       |    // TODO return Error(
 4602|  1.12k|  }
 4603|       |
 4604|  1.35k|  return err;
 4605|  1.45k|}
_ZNK8Box_dref4dumpER6Indent:
 4629|  1.35k|{
 4630|  1.35k|  std::ostringstream sstr;
 4631|  1.35k|  sstr << Box::dump(indent);
 4632|  1.35k|  sstr << dump_children(indent);
 4633|       |
 4634|  1.35k|  return sstr.str();
 4635|  1.35k|}
_ZN7Box_url5parseER14BitstreamRangePK20heif_security_limits:
 4639|  2.06k|{
 4640|  2.06k|  parse_full_box_header(range);
 4641|       |
 4642|  2.06k|  if (get_version() > 0) {
  ------------------
  |  Branch (4642:7): [True: 6, False: 2.05k]
  ------------------
 4643|      6|    return unsupported_version_error("url");
 4644|      6|  }
 4645|       |
 4646|  2.05k|  if (get_flags() & 1) {
  ------------------
  |  Branch (4646:7): [True: 1.44k, False: 609]
  ------------------
 4647|       |    // data in same file
 4648|  1.44k|    m_location.clear();
 4649|  1.44k|  }
 4650|    609|  else {
 4651|    609|    m_location = range.read_string();
 4652|    609|  }
 4653|       |
 4654|  2.05k|  return range.get_error();
 4655|  2.06k|}
_ZNK7Box_url4dumpER6Indent:
 4676|  2.00k|{
 4677|  2.00k|  std::ostringstream sstr;
 4678|  2.00k|  sstr << Box::dump(indent);
 4679|       |  //sstr << dump_children(indent);
 4680|       |
 4681|  2.00k|  sstr << indent << "location: " << m_location << "\n";
 4682|       |
 4683|  2.00k|  return sstr.str();
 4684|  2.00k|}
_ZN8Box_udes5parseER14BitstreamRangePK20heif_security_limits:
 4688|  1.72k|{
 4689|  1.72k|  parse_full_box_header(range);
 4690|       |
 4691|  1.72k|  if (get_version() > 0) {
  ------------------
  |  Branch (4691:7): [True: 79, False: 1.64k]
  ------------------
 4692|     79|    return unsupported_version_error("udes");
 4693|     79|  }
 4694|       |
 4695|  1.64k|  m_lang = range.read_string();
 4696|  1.64k|  m_name = range.read_string();
 4697|  1.64k|  m_description = range.read_string();
 4698|  1.64k|  m_tags = range.read_string();
 4699|  1.64k|  return range.get_error();
 4700|  1.72k|}
_ZNK8Box_udes4dumpER6Indent:
 4703|  1.09k|{
 4704|  1.09k|  std::ostringstream sstr;
 4705|  1.09k|  sstr << Box::dump(indent);
 4706|  1.09k|  sstr << indent << "lang: " << m_lang << "\n";
 4707|  1.09k|  sstr << indent << "name: " << m_name << "\n";
 4708|  1.09k|  sstr << indent << "description: " << m_description << "\n";
 4709|  1.09k|  sstr << indent << "tags: " << m_lang << "\n";
 4710|  1.09k|  return sstr.str();
 4711|  1.09k|}
_ZNK8Box_cmin4dumpER6Indent:
 4759|  2.81k|{
 4760|  2.81k|  std::ostringstream sstr;
 4761|  2.81k|  sstr << Box::dump(indent);
 4762|  2.81k|  sstr << indent << "principal-point: " << m_matrix.principal_point_x << ", " << m_matrix.principal_point_y << "\n";
 4763|  2.81k|  if (m_matrix.is_anisotropic) {
  ------------------
  |  Branch (4763:7): [True: 501, False: 2.31k]
  ------------------
 4764|    501|    sstr << indent << "focal-length: " << m_matrix.focal_length_x << ", " << m_matrix.focal_length_y << "\n";
 4765|    501|    sstr << indent << "skew: " << m_matrix.skew << "\n";
 4766|    501|  }
 4767|  2.31k|  else {
 4768|  2.31k|    sstr << indent << "focal-length: " << m_matrix.focal_length_x << "\n";
 4769|  2.31k|    sstr << indent << "no skew\n";
 4770|  2.31k|  }
 4771|       |
 4772|  2.81k|  return sstr.str();
 4773|  2.81k|}
_ZN8Box_cmin5parseER14BitstreamRangePK20heif_security_limits:
 4777|  4.39k|{
 4778|  4.39k|  parse_full_box_header(range);
 4779|       |
 4780|  4.39k|  if (get_version() > 0) {
  ------------------
  |  Branch (4780:7): [True: 118, False: 4.27k]
  ------------------
 4781|    118|    return unsupported_version_error("cmin");
 4782|    118|  }
 4783|       |
 4784|  4.27k|  m_denominatorShift = (get_flags() & 0x1F00) >> 8;
 4785|  4.27k|  uint32_t denominator = (1U << m_denominatorShift);
 4786|       |
 4787|  4.27k|  m_matrix.focal_length_x = range.read32s() / (double)denominator;
 4788|  4.27k|  m_matrix.principal_point_x = range.read32s() / (double)denominator;
 4789|  4.27k|  m_matrix.principal_point_y = range.read32s() / (double)denominator;
 4790|       |
 4791|  4.27k|  if (get_flags() & 1) {
  ------------------
  |  Branch (4791:7): [True: 639, False: 3.63k]
  ------------------
 4792|    639|    m_skewDenominatorShift = ((get_flags()) & 0x1F0000) >> 16;
 4793|    639|    uint32_t skewDenominator = (1U << m_skewDenominatorShift);
 4794|       |
 4795|    639|    m_matrix.focal_length_y = range.read32s() / (double)denominator;
 4796|    639|    m_matrix.skew = range.read32s() / (double)skewDenominator;
 4797|       |
 4798|    639|    m_matrix.is_anisotropic = true;
 4799|    639|  }
 4800|  3.63k|  else {
 4801|  3.63k|    m_matrix.is_anisotropic = false;
 4802|  3.63k|    m_matrix.focal_length_y = 0;
 4803|  3.63k|    m_matrix.skew = 0;
 4804|  3.63k|  }
 4805|  4.27k|  return range.get_error();
 4806|  4.39k|}
_ZN8Box_cmex5parseER14BitstreamRangePK20heif_security_limits:
 4964|  6.32k|{
 4965|  6.32k|  parse_full_box_header(range);
 4966|       |
 4967|  6.32k|  if (get_version() > 0) {
  ------------------
  |  Branch (4967:7): [True: 1.14k, False: 5.17k]
  ------------------
 4968|  1.14k|    return unsupported_version_error("cmex");
 4969|  1.14k|  }
 4970|       |
 4971|  5.17k|  m_matrix = ExtrinsicMatrix{};
 4972|       |
 4973|  5.17k|  if (get_flags() & pos_x_present) {
  ------------------
  |  Branch (4973:7): [True: 3.90k, False: 1.26k]
  ------------------
 4974|  3.90k|    m_has_pos_x = true;
 4975|  3.90k|    m_matrix.pos_x = range.read32s();
 4976|  3.90k|  }
 4977|       |
 4978|  5.17k|  if (get_flags() & pos_y_present) {
  ------------------
  |  Branch (4978:7): [True: 4.26k, False: 909]
  ------------------
 4979|  4.26k|    m_has_pos_y = true;
 4980|  4.26k|    m_matrix.pos_y = range.read32s();
 4981|  4.26k|  }
 4982|       |
 4983|  5.17k|  if (get_flags() & pos_z_present) {
  ------------------
  |  Branch (4983:7): [True: 459, False: 4.71k]
  ------------------
 4984|    459|    m_has_pos_z = true;
 4985|    459|    m_matrix.pos_z = range.read32s();
 4986|    459|  }
 4987|       |
 4988|  5.17k|  if (get_flags() & orientation_present) {
  ------------------
  |  Branch (4988:7): [True: 1.08k, False: 4.08k]
  ------------------
 4989|  1.08k|    m_has_orientation = true;
 4990|       |
 4991|  1.08k|    if (get_version() == 0) {
  ------------------
  |  Branch (4991:9): [True: 1.08k, False: 0]
  ------------------
 4992|  1.08k|      bool use32bit = (get_flags() & rot_large_field_size);
 4993|  1.08k|      int32_t quat_x = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (4993:24): [True: 335, False: 753]
  ------------------
 4994|  1.08k|      int32_t quat_y = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (4994:24): [True: 335, False: 753]
  ------------------
 4995|  1.08k|      int32_t quat_z = use32bit ? range.read32s() : range.read16s();
  ------------------
  |  Branch (4995:24): [True: 335, False: 753]
  ------------------
 4996|       |
 4997|  1.08k|      uint32_t div = 1U << (14 + (use32bit ? 16 : 0));
  ------------------
  |  Branch (4997:35): [True: 335, False: 753]
  ------------------
 4998|       |
 4999|  1.08k|      m_matrix.rotation_as_quaternions = true;
 5000|  1.08k|      m_matrix.quaternion_x = quat_x / (double)div;
 5001|  1.08k|      m_matrix.quaternion_y = quat_y / (double)div;
 5002|  1.08k|      m_matrix.quaternion_z = quat_z / (double)div;
 5003|       |
 5004|  1.08k|      double q_sum = (m_matrix.quaternion_x * m_matrix.quaternion_x +
 5005|  1.08k|                      m_matrix.quaternion_y * m_matrix.quaternion_y +
 5006|  1.08k|                      m_matrix.quaternion_z * m_matrix.quaternion_z);
 5007|       |
 5008|  1.08k|      if (q_sum > 1.0) {
  ------------------
  |  Branch (5008:11): [True: 308, False: 780]
  ------------------
 5009|    308|        return Error(heif_error_Invalid_input,
 5010|    308|                     heif_suberror_Unspecified,
 5011|    308|                     "Invalid quaternion in extrinsic rotation matrix");
 5012|    308|      }
 5013|       |
 5014|    780|      m_matrix.quaternion_w = sqrt(1 - q_sum);
 5015|       |
 5016|    780|    } else if (get_version() == 1) {
  ------------------
  |  Branch (5016:16): [True: 0, False: 0]
  ------------------
 5017|      0|      uint32_t div = 1<<16;
 5018|      0|      m_matrix.rotation_yaw = range.read32s() / (double)div;
 5019|      0|      m_matrix.rotation_pitch = range.read32s() / (double)div;
 5020|      0|      m_matrix.rotation_roll = range.read32s() / (double)div;
 5021|      0|    }
 5022|  1.08k|  }
 5023|       |
 5024|  4.86k|  if (get_flags() & id_present) {
  ------------------
  |  Branch (5024:7): [True: 3.89k, False: 970]
  ------------------
 5025|  3.89k|    m_has_world_coordinate_system_id = true;
 5026|  3.89k|    m_matrix.world_coordinate_system_id = range.read32();
 5027|  3.89k|  }
 5028|       |
 5029|  4.86k|  return range.get_error();
 5030|  5.17k|}
_ZNK8Box_cmex4dumpER6Indent:
 5034|  3.86k|{
 5035|  3.86k|  std::ostringstream sstr;
 5036|  3.86k|  sstr << Box::dump(indent);
 5037|  3.86k|  sstr << indent << "camera position (um): ";
 5038|  3.86k|  sstr << m_matrix.pos_x << " ; ";
 5039|  3.86k|  sstr << m_matrix.pos_y << " ; ";
 5040|  3.86k|  sstr << m_matrix.pos_z << "\n";
 5041|       |
 5042|  3.86k|  sstr << indent << "orientation ";
 5043|  3.86k|  if (m_matrix.rotation_as_quaternions) {
  ------------------
  |  Branch (5043:7): [True: 3.86k, False: 0]
  ------------------
 5044|  3.86k|    sstr << "(quaterion)\n";
 5045|  3.86k|    sstr << indent << "  q = ["
 5046|  3.86k|         << m_matrix.quaternion_x << ";"
 5047|  3.86k|         << m_matrix.quaternion_y << ";"
 5048|  3.86k|         << m_matrix.quaternion_z << ";"
 5049|  3.86k|         << m_matrix.quaternion_w << "]\n";
 5050|  3.86k|  }
 5051|      0|  else {
 5052|      0|    sstr << "(angles)\n";
 5053|      0|    sstr << indent << "  yaw:   " << m_matrix.rotation_yaw << "\n";
 5054|      0|    sstr << indent << "  pitch: " << m_matrix.rotation_pitch << "\n";
 5055|      0|    sstr << indent << "  roll:  " << m_matrix.rotation_roll << "\n";
 5056|      0|  }
 5057|       |
 5058|  3.86k|  sstr << indent << "world coordinate system id: " << m_matrix.world_coordinate_system_id << "\n";
 5059|       |
 5060|  3.86k|  return sstr.str();
 5061|  3.86k|}
_ZN8Box_taic4dumpERK19heif_tai_clock_infoR6Indent:
 5201|  1.19k|{
 5202|  1.19k|  std::ostringstream sstr;
 5203|  1.19k|  sstr << indent << "time_uncertainty: ";
 5204|  1.19k|  if (info.time_uncertainty == heif_tai_clock_info_time_uncertainty_unknown) {
  ------------------
  |  |   52|  1.19k|#define heif_tai_clock_info_time_uncertainty_unknown UINT64_C(0xFFFFFFFFFFFFFFFF)
  ------------------
  |  Branch (5204:7): [True: 34, False: 1.16k]
  ------------------
 5205|     34|    sstr << "unknown\n";
 5206|     34|  }
 5207|  1.16k|  else {
 5208|  1.16k|    sstr << info.time_uncertainty << "\n";
 5209|  1.16k|  }
 5210|  1.19k|  sstr << indent << "clock_resolution: " << info.clock_resolution << "\n";
 5211|  1.19k|  sstr << indent << "clock_drift_rate: ";
 5212|  1.19k|  if (info.clock_drift_rate == heif_tai_clock_info_clock_drift_rate_unknown) {
  ------------------
  |  |   53|  1.19k|#define heif_tai_clock_info_clock_drift_rate_unknown INT32_C(0x7FFFFFFF)
  ------------------
  |  Branch (5212:7): [True: 201, False: 997]
  ------------------
 5213|    201|    sstr << "undefined\n";
 5214|    201|  }
 5215|    997|  else {
 5216|    997|    sstr << info.clock_drift_rate << "\n";
 5217|    997|  }
 5218|       |
 5219|  1.19k|  sstr << indent << "clock_type: " << int(info.clock_type) << " ";
 5220|  1.19k|  switch (info.clock_type) {
 5221|    683|    case heif_tai_clock_info_clock_type_unknown: sstr << "(unknown)\n"; break;
  ------------------
  |  |   54|    683|#define heif_tai_clock_info_clock_type_unknown 0
  ------------------
  |  Branch (5221:5): [True: 683, False: 515]
  ------------------
 5222|     14|    case heif_tai_clock_info_clock_type_synchronized_to_atomic_source: sstr << "(synchronized to atomic source)\n"; break;
  ------------------
  |  |   56|     14|#define heif_tai_clock_info_clock_type_synchronized_to_atomic_source 2
  ------------------
  |  Branch (5222:5): [True: 14, False: 1.18k]
  ------------------
 5223|     52|    case heif_tai_clock_info_clock_type_not_synchronized_to_atomic_source: sstr << "(not synchronized to atomic source)\n"; break;
  ------------------
  |  |   55|     52|#define heif_tai_clock_info_clock_type_not_synchronized_to_atomic_source 1
  ------------------
  |  Branch (5223:5): [True: 52, False: 1.14k]
  ------------------
 5224|    449|    default: sstr << "(illegal value)\n"; break;;
  ------------------
  |  Branch (5224:5): [True: 449, False: 749]
  ------------------
 5225|  1.19k|  }
 5226|  1.19k|  return sstr.str();
 5227|  1.19k|}
_ZNK8Box_taic4dumpER6Indent:
 5230|  1.19k|std::string Box_taic::dump(Indent& indent) const {
 5231|  1.19k|  std::ostringstream sstr;
 5232|  1.19k|  sstr << Box::dump(indent);
 5233|  1.19k|  sstr << dump(m_info, indent);
 5234|       |
 5235|  1.19k|  return sstr.str();
 5236|  1.19k|}
_ZN8Box_taic5parseER14BitstreamRangePK20heif_security_limits:
 5250|  1.34k|Error Box_taic::parse(BitstreamRange& range, const heif_security_limits*) {
 5251|  1.34k|  parse_full_box_header(range);
 5252|       |
 5253|  1.34k|  m_info.time_uncertainty = range.read64();
 5254|  1.34k|  m_info.clock_resolution = range.read32();
 5255|       |
 5256|  1.34k|  m_info.clock_drift_rate = range.read32s();
 5257|  1.34k|  m_info.clock_type = range.read8() >> 6;
 5258|  1.34k|  return range.get_error();
 5259|  1.34k|}
_ZNK8Box_itai4dumpER6Indent:
 5283|    371|std::string Box_itai::dump(Indent& indent) const {
 5284|    371|  std::ostringstream sstr;
 5285|    371|  sstr << Box::dump(indent);
 5286|    371|  sstr << indent << "tai_timestamp: " << m_timestamp.tai_timestamp << "\n";
 5287|    371|  sstr << indent << "synchronization_state: " << int(m_timestamp.synchronization_state) << "\n";
 5288|    371|  sstr << indent << "timestamp_generation_failure: " << int(m_timestamp.timestamp_generation_failure) << "\n";
 5289|    371|  sstr << indent << "timestamp_is_modified: " << int(m_timestamp.timestamp_is_modified) << "\n";
 5290|    371|  return sstr.str();
 5291|    371|}
_ZN8Box_itai5parseER14BitstreamRangePK20heif_security_limits:
 5378|    518|Error Box_itai::parse(BitstreamRange& range, const heif_security_limits*) {
 5379|    518|  parse_full_box_header(range);
 5380|       |
 5381|    518|  m_timestamp.version = 1;
 5382|    518|  m_timestamp.tai_timestamp = range.read64();
 5383|       |
 5384|    518|  uint8_t status_bits = range.read8();
 5385|       |
 5386|    518|  m_timestamp.synchronization_state = !!(status_bits & 0x80);
 5387|    518|  m_timestamp.timestamp_generation_failure = !!(status_bits & 0x40);
 5388|    518|  m_timestamp.timestamp_is_modified = !!(status_bits & 0x20);
 5389|       |
 5390|    518|  return range.get_error();
 5391|    518|}
_ZN8Box_elng5parseER14BitstreamRangePK20heif_security_limits:
 5394|  1.09k|{
 5395|  1.09k|  parse_full_box_header(range);
 5396|       |
 5397|  1.09k|  if (get_version() > 0) {
  ------------------
  |  Branch (5397:7): [True: 66, False: 1.03k]
  ------------------
 5398|     66|    return unsupported_version_error("elng");
 5399|     66|  }
 5400|       |
 5401|  1.03k|  m_lang = range.read_string();
 5402|  1.03k|  return range.get_error();
 5403|  1.09k|}
_ZNK8Box_elng4dumpER6Indent:
 5406|    735|{
 5407|    735|  std::ostringstream sstr;
 5408|    735|  sstr << Box::dump(indent);
 5409|    735|  sstr << indent << "extended_language: " << m_lang << "\n";
 5410|    735|  return sstr.str();
 5411|    735|}
_ZN19Box_gimi_content_id5parseER14BitstreamRangePK20heif_security_limits:
 5423|  1.81k|{
 5424|  1.81k|  m_content_id = range.read_string_until_eof();
 5425|       |
 5426|  1.81k|  return range.get_error();
 5427|  1.81k|}
_ZNK19Box_gimi_content_id4dumpER6Indent:
 5443|  1.66k|{
 5444|  1.66k|  std::ostringstream sstr;
 5445|  1.66k|  sstr << Box::dump(indent);
 5446|       |
 5447|  1.66k|  sstr << indent << "content ID: " << m_content_id << "\n";
 5448|       |
 5449|  1.66k|  return sstr.str();
 5450|  1.66k|}

_ZNK9BoxHeader12get_box_sizeEv:
  119|  2.84M|  uint64_t get_box_size() const { return m_size; }
_ZNK9BoxHeader18has_fixed_box_sizeEv:
  121|  1.17M|  bool has_fixed_box_size() const { return m_size != 0; }
_ZNK9BoxHeader15get_header_sizeEv:
  123|  2.33M|  uint32_t get_header_size() const { return m_header_size; }
_ZNK9BoxHeader14get_short_typeEv:
  125|   816k|  uint32_t get_short_type() const { return m_type; }
_ZNK9BoxHeader14debug_box_nameEv:
  131|   211k|  virtual const char* debug_box_name() const { return nullptr; }
_ZN9BoxHeader14set_short_typeEj:
  133|   581k|  void set_short_type(uint32_t type) { m_type = type; }
_ZN3Box16set_short_headerERK9BoxHeader:
  183|   503k|  {
  184|   503k|    *(BoxHeader*) this = hdr;
  185|   503k|  }
_ZN3Box19set_output_positionEm:
  262|  16.7k|  void set_output_position(uint64_t pos) { m_output_position = pos; }
_ZNK3Box24get_parse_error_fatalityEv:
  264|  7.49k|  virtual parse_error_fatality get_parse_error_fatality() const { return parse_error_fatality::fatal; }
_ZNK7FullBox11get_versionEv:
  322|   811k|  uint8_t get_version() const { return m_version; }
_ZNK7FullBox9get_flagsEv:
  326|   995k|  uint32_t get_flags() const { return m_flags; }
_ZN7FullBox9set_flagsEj:
  328|  4.63k|  void set_flags(uint32_t flags) { m_flags = flags; }
_ZN9Box_otherC2Ej:
  350|   153k|  {
  351|   153k|    set_short_type(short_type);
  352|   153k|  }
_ZN9Box_ErrorC2Ej5Error20parse_error_fatality:
  374|  33.6k|  {
  375|  33.6k|    set_short_type(fourcc("ERR "));
  376|       |
  377|  33.6k|    m_box_type_with_parse_error = box4cc;
  378|  33.6k|    m_error = std::move(err);
  379|  33.6k|    m_fatality = fatality;
  380|  33.6k|  }
_ZN8Box_ftypC2Ev:
  405|  44.9k|  {
  406|  44.9k|    set_short_type(fourcc("ftyp"));
  407|  44.9k|  }
_ZNK8Box_ftyp14debug_box_nameEv:
  411|  10.6k|  const char* debug_box_name() const override { return "File Type"; }
_ZN8Box_freeC2Ev:
  445|    951|  {
  446|    951|    set_short_type(fourcc("free"));
  447|    951|  }
_ZNK8Box_free14debug_box_nameEv:
  451|    883|  const char* debug_box_name() const override { return "Free Space"; }
_ZN8Box_metaC2Ev:
  464|  3.38k|  {
  465|  3.38k|    set_short_type(fourcc("meta"));
  466|  3.38k|  }
_ZNK8Box_meta14debug_box_nameEv:
  470|  3.22k|  const char* debug_box_name() const override { return "Metadata"; }
_ZN8Box_hdlrC2Ev:
  481|  4.91k|  {
  482|  4.91k|    set_short_type(fourcc("hdlr"));
  483|  4.91k|  }
_ZNK8Box_hdlr14debug_box_nameEv:
  487|  4.05k|  const char* debug_box_name() const override { return "Handler Reference"; }
_ZN8Box_pitmC2Ev:
  512|  3.41k|  {
  513|  3.41k|    set_short_type(fourcc("pitm"));
  514|  3.41k|  }
_ZNK8Box_pitm14debug_box_nameEv:
  518|  2.97k|  const char* debug_box_name() const override { return "Primary Item"; }
_ZNK8Box_iloc14debug_box_nameEv:
  547|  1.73k|  const char* debug_box_name() const override { return "Item Location"; }
_ZN8Box_infeC2Ev:
  642|  4.52k|  {
  643|  4.52k|    set_short_type(fourcc("infe"));
  644|  4.52k|  }
_ZNK8Box_infe14debug_box_nameEv:
  648|  4.03k|  const char* debug_box_name() const override { return "Item Info Entry"; }
_ZN8Box_iinfC2Ev:
  704|  4.07k|  {
  705|  4.07k|    set_short_type(fourcc("iinf"));
  706|  4.07k|  }
_ZNK8Box_iinf14debug_box_nameEv:
  710|  3.65k|  const char* debug_box_name() const override { return "Item Information"; }
_ZN8Box_iprpC2Ev:
  728|  29.9k|  {
  729|  29.9k|    set_short_type(fourcc("iprp"));
  730|  29.9k|  }
_ZNK8Box_iprp14debug_box_nameEv:
  734|  27.3k|  const char* debug_box_name() const override { return "Item Properties"; }
_ZN8Box_ipcoC2Ev:
  745|  14.3k|  {
  746|  14.3k|    set_short_type(fourcc("ipco"));
  747|  14.3k|  }
_ZNK8Box_ipco14debug_box_nameEv:
  765|  13.1k|  const char* debug_box_name() const override { return "Item Property Container"; }
_ZN8Box_ispeC2Ev:
  776|  2.97k|  {
  777|  2.97k|    set_short_type(fourcc("ispe"));
  778|  2.97k|  }
_ZNK8Box_ispe14debug_box_nameEv:
  792|  2.57k|  const char* debug_box_name() const override { return "Image Spatial Extents"; }
_ZN8Box_ipmaC2Ev:
  814|  3.16k|  {
  815|  3.16k|    set_short_type(fourcc("ipma"));
  816|  3.16k|  }
_ZNK8Box_ipma14debug_box_nameEv:
  820|  2.70k|  const char* debug_box_name() const override { return "Item Property Association"; }
_ZN8Box_auxCC2Ev:
  861|    963|  {
  862|    963|    set_short_type(fourcc("auxC"));
  863|    963|  }
_ZNK8Box_auxC14debug_box_nameEv:
  875|    747|  const char* debug_box_name() const override { return "Image Properties for Auxiliary Images"; }
_ZN8Box_irotC2Ev:
  892|  12.8k|  {
  893|  12.8k|    set_short_type(fourcc("irot"));
  894|  12.8k|  }
_ZNK8Box_irot14debug_box_nameEv:
  902|  10.2k|  const char* debug_box_name() const override { return "Image Rotation"; }
_ZNK8Box_irot24get_parse_error_fatalityEv:
  909|    195|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_imirC2Ev:
  925|  2.53k|  {
  926|  2.53k|    set_short_type(fourcc("imir"));
  927|  2.53k|  }
_ZNK8Box_imir14debug_box_nameEv:
  939|  1.88k|  const char* debug_box_name() const override { return "Image Mirroring"; }
_ZNK8Box_imir24get_parse_error_fatalityEv:
  941|    534|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_isclC2Ev:
  957|    698|  {
  958|    698|    set_short_type(fourcc("iscl"));
  959|    698|  }
_ZNK8Box_iscl14debug_box_nameEv:
  980|    369|  const char* debug_box_name() const override { return "Image Scaling"; }
_ZNK8Box_iscl24get_parse_error_fatalityEv:
  982|    305|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_clapC2Ev:
 1001|  19.1k|  {
 1002|  19.1k|    set_short_type(fourcc("clap"));
 1003|  19.1k|  }
_ZNK8Box_clap14debug_box_nameEv:
 1011|    509|  const char* debug_box_name() const override { return "Clean Aperture"; }
_ZNK8Box_clap24get_parse_error_fatalityEv:
 1028|  18.4k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_irefC2Ev:
 1047|  14.8k|  {
 1048|  14.8k|    set_short_type(fourcc("iref"));
 1049|  14.8k|  }
_ZNK8Box_iref14debug_box_nameEv:
 1062|  14.0k|  const char* debug_box_name() const override { return "Item Reference"; }
_ZN8Box_rrefC2Ev:
 1092|    807|  {
 1093|    807|    set_short_type(fourcc("rref"));
 1094|    807|  }
_ZNK8Box_rref14debug_box_nameEv:
 1100|    597|  const char* debug_box_name() const override { return "Required Reference Types"; }
_ZNK8Box_idat14debug_box_nameEv:
 1125|  8.44k|  const char* debug_box_name() const override { return "Item Data"; }
_ZN8Box_grplC2Ev:
 1158|  1.82k|  {
 1159|  1.82k|    set_short_type(fourcc("grpl"));
 1160|  1.82k|  }
_ZNK8Box_grpl14debug_box_nameEv:
 1164|  1.35k|  const char* debug_box_name() const override { return "Groups List"; }
_ZN8Box_sterC2Ev:
 1200|  1.20k|  {
 1201|  1.20k|    set_short_type(fourcc("ster"));
 1202|  1.20k|  }
_ZNK8Box_ster14debug_box_nameEv:
 1206|    817|  const char* debug_box_name() const override { return "Stereo pair"; }
_ZN8Box_pymdC2Ev:
 1221|  1.65k|  {
 1222|  1.65k|    set_short_type(fourcc("pymd"));
 1223|  1.65k|  }
_ZNK8Box_pymd14debug_box_nameEv:
 1227|  1.11k|  const char* debug_box_name() const override { return "Image pyramid group"; }
_ZNK8Box_pymd24get_parse_error_fatalityEv:
 1250|    450|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_dinfC2Ev:
 1268|  8.12k|  {
 1269|  8.12k|    set_short_type(fourcc("dinf"));
 1270|  8.12k|  }
_ZNK8Box_dinf14debug_box_nameEv:
 1274|  7.52k|  const char* debug_box_name() const override { return "Data Information"; }
_ZN8Box_drefC2Ev:
 1285|  1.46k|  {
 1286|  1.46k|    set_short_type(fourcc("dref"));
 1287|  1.46k|  }
_ZNK8Box_dref14debug_box_nameEv:
 1291|  1.35k|  const char* debug_box_name() const override { return "Data Reference"; }
_ZN7Box_urlC2Ev:
 1304|  2.06k|  {
 1305|  2.06k|    set_short_type(fourcc("url "));
 1306|  2.06k|    set_flags(1);
 1307|  2.06k|  }
_ZNK7Box_url14debug_box_nameEv:
 1311|  2.00k|  const char* debug_box_name() const override { return "Data Entry URL"; }
_ZN8Box_pixiC2Ev:
 1331|  3.77k|  {
 1332|  3.77k|    set_short_type(fourcc("pixi"));
 1333|  3.77k|  }
_ZNK8Box_pixi14debug_box_nameEv:
 1352|  2.62k|  const char* debug_box_name() const override { return "Pixel Information"; }
_ZNK8Box_pixi24get_parse_error_fatalityEv:
 1356|    612|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_paspC2Ev:
 1370|  14.8k|  {
 1371|  14.8k|    set_short_type(fourcc("pasp"));
 1372|  14.8k|  }
_ZNK8Box_pasp14debug_box_nameEv:
 1379|  14.0k|  const char* debug_box_name() const override { return "Pixel Aspect Ratio"; }
_ZNK8Box_pasp24get_parse_error_fatalityEv:
 1383|    263|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_lselC2Ev:
 1394|  7.51k|  {
 1395|  7.51k|    set_short_type(fourcc("lsel"));
 1396|  7.51k|  }
_ZNK8Box_lsel14debug_box_nameEv:
 1402|  6.47k|  const char* debug_box_name() const override { return "Layer Selection"; }
_ZNK8Box_lsel24get_parse_error_fatalityEv:
 1406|    509|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_clliC2Ev:
 1417|  10.6k|  {
 1418|  10.6k|    set_short_type(fourcc("clli"));
 1419|       |
 1420|  10.6k|    clli.max_content_light_level = 0;
 1421|  10.6k|    clli.max_pic_average_light_level = 0;
 1422|  10.6k|  }
_ZNK8Box_clli14debug_box_nameEv:
 1428|  2.25k|  const char* debug_box_name() const override { return "Content Light Level Information"; }
_ZNK8Box_clli24get_parse_error_fatalityEv:
 1432|    180|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_mdcv14debug_box_nameEv:
 1448|  3.15k|  const char* debug_box_name() const override { return "Master Display Colour Volume"; }
_ZNK8Box_mdcv24get_parse_error_fatalityEv:
 1452|    458|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_amve14debug_box_nameEv:
 1468|    518|  const char* debug_box_name() const override { return "Ambient Viewing Environment"; }
_ZNK8Box_amve24get_parse_error_fatalityEv:
 1472|    409|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_ndwtC2Ev:
 1483|  6.01k|  {
 1484|  6.01k|    set_short_type(fourcc("ndwt"));
 1485|  6.01k|  }
_ZNK8Box_ndwt27get_diffuse_white_luminanceEv:
 1489|  3.23k|  uint32_t get_diffuse_white_luminance() const { return m_diffuse_white_luminance; }
_ZN8Box_ndwt27set_diffuse_white_luminanceEj:
 1491|  5.40k|  void set_diffuse_white_luminance(uint32_t luminance) { m_diffuse_white_luminance = luminance; }
_ZNK8Box_ndwt14debug_box_nameEv:
 1495|    505|  const char* debug_box_name() const override { return "Nominal Diffuse White"; }
_ZNK8Box_ndwt24get_parse_error_fatalityEv:
 1499|     40|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_cclv23ccv_primaries_are_validEv:
 1514|  7.33k|  bool ccv_primaries_are_valid() const { return m_ccv_primaries_valid; }
_ZNK8Box_cclv18get_ccv_primary_x0Ev:
 1515|    338|  int32_t get_ccv_primary_x0() const { return m_ccv_primaries_x[0]; }
_ZNK8Box_cclv18get_ccv_primary_y0Ev:
 1516|    338|  int32_t get_ccv_primary_y0() const { return m_ccv_primaries_y[0]; }
_ZNK8Box_cclv18get_ccv_primary_x1Ev:
 1517|    338|  int32_t get_ccv_primary_x1() const { return m_ccv_primaries_x[1]; }
_ZNK8Box_cclv18get_ccv_primary_y1Ev:
 1518|    338|  int32_t get_ccv_primary_y1() const { return m_ccv_primaries_y[1]; }
_ZNK8Box_cclv18get_ccv_primary_x2Ev:
 1519|    338|  int32_t get_ccv_primary_x2() const { return m_ccv_primaries_x[2]; }
_ZNK8Box_cclv18get_ccv_primary_y2Ev:
 1520|    338|  int32_t get_ccv_primary_y2() const { return m_ccv_primaries_y[2]; }
_ZNK8Box_cclv22min_luminance_is_validEv:
 1523|  7.33k|  bool min_luminance_is_valid() const { return m_ccv_min_luminance_value.has_value(); }
_ZNK8Box_cclv17get_min_luminanceEv:
 1524|    612|  uint32_t get_min_luminance() const { return *m_ccv_min_luminance_value; }
_ZN8Box_cclv17set_min_luminanceEj:
 1525|    733|  void set_min_luminance(uint32_t luminance) { m_ccv_min_luminance_value = luminance; }
_ZNK8Box_cclv22max_luminance_is_validEv:
 1527|  7.33k|  bool max_luminance_is_valid() const { return m_ccv_max_luminance_value.has_value(); }
_ZNK8Box_cclv17get_max_luminanceEv:
 1528|  1.22k|  uint32_t get_max_luminance() const { return *m_ccv_max_luminance_value; }
_ZN8Box_cclv17set_max_luminanceEj:
 1529|  1.82k|  void set_max_luminance(uint32_t luminance) { m_ccv_max_luminance_value = luminance; }
_ZNK8Box_cclv22avg_luminance_is_validEv:
 1531|  7.33k|  bool avg_luminance_is_valid() const { return m_ccv_avg_luminance_value.has_value(); }
_ZNK8Box_cclv17get_avg_luminanceEv:
 1532|    625|  uint32_t get_avg_luminance() const { return *m_ccv_avg_luminance_value; }
_ZN8Box_cclv17set_avg_luminanceEj:
 1533|    781|  void set_avg_luminance(uint32_t luminance) { m_ccv_avg_luminance_value = luminance; }
_ZN8Box_cminC2Ev:
 1561|  4.39k|  {
 1562|  4.39k|    set_short_type(fourcc("cmin"));
 1563|  4.39k|  }
_ZNK8Box_cmin14debug_box_nameEv:
 1618|  2.81k|  const char* debug_box_name() const override { return "Camera Intrinsic Matrix"; }
_ZNK8Box_cmin24get_parse_error_fatalityEv:
 1624|  1.13k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_cmexC2Ev:
 1643|  6.32k|  {
 1644|  6.32k|    set_short_type(fourcc("cmex"));
 1645|  6.32k|  }
_ZNK8Box_cmex14debug_box_nameEv:
 1675|  3.86k|  const char* debug_box_name() const override { return "Camera Extrinsic Matrix"; }
_ZNK8Box_cmex24get_parse_error_fatalityEv:
 1681|  1.99k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_udesC2Ev:
 1723|  1.72k|  {
 1724|  1.72k|    set_short_type(fourcc("udes"));
 1725|  1.72k|  }
_ZNK8Box_udes14debug_box_nameEv:
 1729|  1.09k|  const char* debug_box_name() const override { return "User Description"; }
_ZNK8Box_udes24get_parse_error_fatalityEv:
 1795|    282|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_taicC2Ev:
 1816|  1.35k|  {
 1817|  1.35k|    set_short_type(fourcc("taic"));
 1818|  1.35k|    initialize_heif_tai_clock_info(&m_info);
 1819|  1.35k|  }
_ZNK8Box_taic14debug_box_nameEv:
 1825|  1.19k|  const char* debug_box_name() const override { return "TAI Clock Information"; }
_ZN8Box_itaiC2Ev:
 1896|    521|  {
 1897|    521|    set_short_type(fourcc("itai"));
 1898|    521|    initialize_heif_tai_timestamp_packet(&m_timestamp);
 1899|    521|  }
_ZNK8Box_itai14debug_box_nameEv:
 1903|    371|  const char* debug_box_name() const override { return "Item TAI Timestamp"; }
_ZN19Box_gimi_content_idC2Ev:
 1961|  1.81k|  {
 1962|  1.81k|    set_uuid_type(std::vector<uint8_t>{0x26, 0x1e, 0xf3, 0x74, 0x1d, 0x97, 0x5b, 0xba, 0xac, 0xbd, 0x9d, 0x2c, 0x8e, 0xa7, 0x35, 0x22});
 1963|  1.81k|  }
_ZNK19Box_gimi_content_id14debug_box_nameEv:
 1971|  1.66k|  const char* debug_box_name() const override { return "GIMI Content ID"; }
_ZN8Box_elngC2Ev:
 2004|  1.09k|  {
 2005|  1.09k|    set_short_type(fourcc("elng"));
 2006|  1.09k|  }
_ZNK8Box_elng14debug_box_nameEv:
 2010|    735|  const char* debug_box_name() const override { return "Extended language"; }
_ZNK8Box_elng24get_parse_error_fatalityEv:
 2030|     70|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN9BoxHeaderD2Ev:
  115|  1.15M|  virtual ~BoxHeader() = default;
_ZN3BoxC2Ev:
  180|   596k|  Box() = default;
_ZN8FractionC2Ev:
   66|  76.5k|  Fraction() = default;

_ZN8Box_avcC5parseER14BitstreamRangePK20heif_security_limits:
   35|  4.64k|{
   36|  4.64k|  m_configuration.configuration_version = range.read8();
   37|  4.64k|  m_configuration.AVCProfileIndication = range.read8();
   38|  4.64k|  m_configuration.profile_compatibility = range.read8();
   39|  4.64k|  m_configuration.AVCLevelIndication = range.read8();
   40|  4.64k|  uint8_t lengthSizeMinusOneWithReserved = range.read8();
   41|  4.64k|  m_configuration.lengthSize =
   42|  4.64k|      (lengthSizeMinusOneWithReserved & 0b00000011) + 1;
   43|       |
   44|  4.64k|  uint8_t numOfSequenceParameterSets = (range.read8() & 0b00011111);
   45|  7.57k|  for (int i = 0; i < numOfSequenceParameterSets; i++) {
  ------------------
  |  Branch (45:19): [True: 2.93k, False: 4.64k]
  ------------------
   46|  2.93k|    uint16_t sequenceParameterSetLength = range.read16();
   47|  2.93k|    std::vector<uint8_t> sps(sequenceParameterSetLength);
   48|  2.93k|    range.read(sps.data(), sps.size());
   49|  2.93k|    m_sps.push_back(sps);
   50|  2.93k|  }
   51|       |
   52|  4.64k|  uint8_t numOfPictureParameterSets = range.read8();
   53|  9.33k|  for (int i = 0; i < numOfPictureParameterSets; i++) {
  ------------------
  |  Branch (53:19): [True: 4.69k, False: 4.64k]
  ------------------
   54|  4.69k|    uint16_t pictureParameterSetLength = range.read16();
   55|  4.69k|    std::vector<uint8_t> pps(pictureParameterSetLength);
   56|  4.69k|    range.read(pps.data(), pps.size());
   57|  4.69k|    m_pps.push_back(pps);
   58|  4.69k|  }
   59|       |
   60|       |  // See ISO/IEC 14496-15 2017 Section 5.3.3.1.2
   61|  4.64k|  if (range.get_remaining_bytes() > 0) {
  ------------------
  |  Branch (61:7): [True: 2.22k, False: 2.42k]
  ------------------
   62|  2.22k|    if ((m_configuration.AVCProfileIndication != 66) &&
  ------------------
  |  Branch (62:9): [True: 1.88k, False: 335]
  ------------------
   63|  1.88k|        (m_configuration.AVCProfileIndication != 77) &&
  ------------------
  |  Branch (63:9): [True: 1.44k, False: 441]
  ------------------
   64|  1.44k|        (m_configuration.AVCProfileIndication != 88)) {
  ------------------
  |  Branch (64:9): [True: 1.23k, False: 211]
  ------------------
   65|  1.23k|      m_configuration.chroma_format = (heif_chroma) (range.read8() & 0b00000011);
   66|  1.23k|      m_configuration.bit_depth_luma = 8 + (range.read8() & 0b00000111);
   67|  1.23k|      m_configuration.bit_depth_chroma = 8 + (range.read8() & 0b00000111);
   68|  1.23k|      uint8_t numOfSequenceParameterSetExt = range.read8();
   69|  6.61k|      for (int i = 0; i < numOfSequenceParameterSetExt; i++) {
  ------------------
  |  Branch (69:23): [True: 5.38k, False: 1.23k]
  ------------------
   70|  5.38k|        uint16_t sequenceParameterSetExtLength = range.read16();
   71|  5.38k|        std::vector<uint8_t> sps_ext(sequenceParameterSetExtLength);
   72|  5.38k|        range.read(sps_ext.data(), sps_ext.size());
   73|  5.38k|        m_sps_ext.push_back(sps_ext);
   74|  5.38k|      }
   75|  1.23k|    }
   76|  2.22k|  }
   77|       |
   78|  4.64k|  return range.get_error();
   79|  4.64k|}
_ZNK8Box_avcC4dumpER6Indent:
  170|  4.03k|{
  171|  4.03k|  std::ostringstream sstr;
  172|  4.03k|  sstr << Box::dump(indent);
  173|  4.03k|  sstr << indent << "configuration_version: " << ((int) m_configuration.configuration_version) << "\n"
  174|  4.03k|      << indent << "AVCProfileIndication: " << ((int) m_configuration.AVCProfileIndication) << " (" << profileIndicationAsText() << ")\n"
  175|  4.03k|      << indent << "profile_compatibility: " << ((int) m_configuration.profile_compatibility) << "\n"
  176|  4.03k|      << indent << "AVCLevelIndication: " << ((int) m_configuration.AVCLevelIndication) << "\n"
  177|  4.03k|      << indent << "Chroma format: ";
  178|       |
  179|  4.03k|  switch (m_configuration.chroma_format) {
  180|  1.08k|    case heif_chroma_monochrome:
  ------------------
  |  |   75|  1.08k|#define heif_chroma_monochrome heif_chroma_planar
  ------------------
  |  Branch (180:5): [True: 1.08k, False: 2.94k]
  ------------------
  181|  1.08k|      sstr << "4:0:0\n";
  182|  1.08k|      break;
  183|  2.88k|    case heif_chroma_420:
  ------------------
  |  Branch (183:5): [True: 2.88k, False: 1.15k]
  ------------------
  184|  2.88k|      sstr << "4:2:0\n";
  185|  2.88k|      break;
  186|     28|    case heif_chroma_422:
  ------------------
  |  Branch (186:5): [True: 28, False: 4.00k]
  ------------------
  187|     28|      sstr << "4:2:2\n";
  188|     28|      break;
  189|     40|    case heif_chroma_444:
  ------------------
  |  Branch (189:5): [True: 40, False: 3.99k]
  ------------------
  190|     40|      sstr << "4:4:4\n";
  191|     40|      break;
  192|      0|    default:
  ------------------
  |  Branch (192:5): [True: 0, False: 4.03k]
  ------------------
  193|      0|      sstr << "unsupported\n";
  194|      0|      break;
  195|  4.03k|  }
  196|       |
  197|  4.03k|  sstr << indent << "Bit depth luma: " << ((int) m_configuration.bit_depth_luma) << "\n"
  198|  4.03k|      << indent << "Bit depth chroma: " << ((int) m_configuration.bit_depth_chroma) << "\n";
  199|       |
  200|  4.03k|  for (const auto& sps : m_sps) {
  ------------------
  |  Branch (200:24): [True: 2.21k, False: 4.03k]
  ------------------
  201|  2.21k|    sstr << indent << "SPS: ";
  202|   672k|    for (uint8_t b : sps) {
  ------------------
  |  Branch (202:20): [True: 672k, False: 2.21k]
  ------------------
  203|   672k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  204|   672k|    }
  205|  2.21k|    sstr << "\n";
  206|  2.21k|    sstr << std::dec;
  207|  2.21k|  }
  208|       |
  209|  4.03k|  for (const auto& spsext : m_sps_ext) {
  ------------------
  |  Branch (209:27): [True: 2.62k, False: 4.03k]
  ------------------
  210|  2.62k|    sstr << indent << "SPS-EXT: ";
  211|  2.62k|    for (uint8_t b : spsext) {
  ------------------
  |  Branch (211:20): [True: 1.73k, False: 2.62k]
  ------------------
  212|  1.73k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  213|  1.73k|    }
  214|  2.62k|    sstr << "\n";
  215|  2.62k|    sstr << std::dec;
  216|  2.62k|  }
  217|       |
  218|  4.03k|  for (const auto& pps : m_pps) {
  ------------------
  |  Branch (218:24): [True: 2.22k, False: 4.03k]
  ------------------
  219|  2.22k|    sstr << indent << "PPS: ";
  220|   192k|    for (uint8_t b : pps) {
  ------------------
  |  Branch (220:20): [True: 192k, False: 2.22k]
  ------------------
  221|   192k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  222|   192k|    }
  223|  2.22k|    sstr << "\n";
  224|  2.22k|    sstr << std::dec;
  225|  2.22k|  }
  226|       |
  227|  4.03k|  return sstr.str();
  228|  4.03k|}
_ZNK8Box_avcC23profileIndicationAsTextEv:
  231|  4.03k|{
  232|       |  // See ISO/IEC 14496-10:2022 Annex A
  233|  4.03k|  switch (m_configuration.AVCProfileIndication) {
  234|    495|    case 44:
  ------------------
  |  Branch (234:5): [True: 495, False: 3.53k]
  ------------------
  235|    495|      return "CALVC 4:4:4";
  236|    826|    case 66:
  ------------------
  |  Branch (236:5): [True: 826, False: 3.20k]
  ------------------
  237|    826|      return "Constrained Baseline";
  238|  1.23k|    case 77:
  ------------------
  |  Branch (238:5): [True: 1.23k, False: 2.79k]
  ------------------
  239|  1.23k|      return "Main";
  240|    523|    case 88:
  ------------------
  |  Branch (240:5): [True: 523, False: 3.50k]
  ------------------
  241|    523|      return "Extended";
  242|    122|    case 100:
  ------------------
  |  Branch (242:5): [True: 122, False: 3.90k]
  ------------------
  243|    122|      return "High variant";
  244|    214|    case 110:
  ------------------
  |  Branch (244:5): [True: 214, False: 3.81k]
  ------------------
  245|    214|      return "High 10";
  246|     71|    case 122:
  ------------------
  |  Branch (246:5): [True: 71, False: 3.96k]
  ------------------
  247|     71|      return "High 4:2:2";
  248|    210|    case 244:
  ------------------
  |  Branch (248:5): [True: 210, False: 3.82k]
  ------------------
  249|    210|      return "High 4:4:4";
  250|    333|    default:
  ------------------
  |  Branch (250:5): [True: 333, False: 3.69k]
  ------------------
  251|    333|      return "Unknown";
  252|  4.03k|  }
  253|  4.03k|}

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

_ZN8Box_av1C5parseER14BitstreamRangePK20heif_security_limits:
   37|  3.49k|{
   38|       |  //parse_full_box_header(range);
   39|       |
   40|  3.49k|  if (!has_fixed_box_size()) {
  ------------------
  |  Branch (40:7): [True: 3, False: 3.49k]
  ------------------
   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|      3|    return Error{heif_error_Invalid_input, heif_suberror_Unspecified, "av1C with unspecified box size"};
   45|      3|  }
   46|       |
   47|  3.49k|  uint8_t byte;
   48|       |
   49|  3.49k|  auto& c = m_configuration; // abbreviation
   50|       |
   51|  3.49k|  byte = range.read8();
   52|  3.49k|  if ((byte & 0x80) == 0) {
  ------------------
  |  Branch (52:7): [True: 1.28k, False: 2.21k]
  ------------------
   53|       |    // error: marker bit not set
   54|  1.28k|  }
   55|       |
   56|  3.49k|  c.version = byte & 0x7F;
   57|       |
   58|  3.49k|  byte = range.read8();
   59|  3.49k|  c.seq_profile = (byte >> 5) & 0x7;
   60|  3.49k|  c.seq_level_idx_0 = byte & 0x1f;
   61|       |
   62|  3.49k|  byte = range.read8();
   63|  3.49k|  c.seq_tier_0 = (byte >> 7) & 1;
   64|  3.49k|  c.high_bitdepth = (byte >> 6) & 1;
   65|  3.49k|  c.twelve_bit = (byte >> 5) & 1;
   66|  3.49k|  c.monochrome = (byte >> 4) & 1;
   67|  3.49k|  c.chroma_subsampling_x = (byte >> 3) & 1;
   68|  3.49k|  c.chroma_subsampling_y = (byte >> 2) & 1;
   69|  3.49k|  c.chroma_sample_position = byte & 3;
   70|       |
   71|  3.49k|  byte = range.read8();
   72|  3.49k|  c.initial_presentation_delay_present = (byte >> 4) & 1;
   73|  3.49k|  if (c.initial_presentation_delay_present) {
  ------------------
  |  Branch (73:7): [True: 328, False: 3.16k]
  ------------------
   74|    328|    c.initial_presentation_delay_minus_one = byte & 0x0F;
   75|    328|  }
   76|       |
   77|  3.49k|  const size_t configOBUs_bytes = range.get_remaining_bytes();
   78|  3.49k|  m_config_OBUs.resize(configOBUs_bytes);
   79|       |
   80|  3.49k|  if (!range.read(m_config_OBUs.data(), configOBUs_bytes)) {
  ------------------
  |  Branch (80:7): [True: 0, False: 3.49k]
  ------------------
   81|       |    // error
   82|      0|  }
   83|       |
   84|  3.49k|  return range.get_error();
   85|  3.49k|}
_ZNK8Box_av1C4dumpER6Indent:
  116|  3.14k|{
  117|  3.14k|  std::ostringstream sstr;
  118|  3.14k|  sstr << Box::dump(indent);
  119|       |
  120|  3.14k|  const auto& c = m_configuration; // abbreviation
  121|       |
  122|  3.14k|  sstr << indent << "version: " << ((int) c.version) << "\n"
  123|  3.14k|       << indent << "seq_profile: " << ((int) c.seq_profile) << "\n"
  124|  3.14k|       << indent << "seq_level_idx_0: " << ((int) c.seq_level_idx_0) << "\n"
  125|  3.14k|       << indent << "high_bitdepth: " << ((int) c.high_bitdepth) << "\n"
  126|  3.14k|       << indent << "twelve_bit: " << ((int) c.twelve_bit) << "\n"
  127|  3.14k|       << indent << "monochrome: " << ((int) c.monochrome) << "\n"
  128|  3.14k|       << indent << "chroma_subsampling_x: " << ((int) c.chroma_subsampling_x) << "\n"
  129|  3.14k|       << indent << "chroma_subsampling_y: " << ((int) c.chroma_subsampling_y) << "\n"
  130|  3.14k|       << indent << "chroma_sample_position: " << ((int) c.chroma_sample_position) << "\n"
  131|  3.14k|       << indent << "initial_presentation_delay: ";
  132|       |
  133|  3.14k|  if (c.initial_presentation_delay_present) {
  ------------------
  |  Branch (133:7): [True: 326, False: 2.82k]
  ------------------
  134|    326|    sstr << c.initial_presentation_delay_minus_one + 1 << "\n";
  135|    326|  }
  136|  2.82k|  else {
  137|  2.82k|    sstr << "not present\n";
  138|  2.82k|  }
  139|       |
  140|  3.14k|  sstr << indent << "config OBUs:";
  141|   282k|  for (size_t i = 0; i < m_config_OBUs.size(); i++) {
  ------------------
  |  Branch (141:22): [True: 279k, False: 3.14k]
  ------------------
  142|   279k|    sstr << " " << std::hex << std::setfill('0') << std::setw(2)
  143|   279k|         << ((int) m_config_OBUs[i]);
  144|   279k|  }
  145|  3.14k|  sstr << std::dec << "\n";
  146|       |
  147|  3.14k|  return sstr.str();
  148|  3.14k|}
_ZN8Box_a1op5parseER14BitstreamRangePK20heif_security_limits:
  194|  18.9k|{
  195|  18.9k|  op_index = range.read8();
  196|       |
  197|  18.9k|  return range.get_error();
  198|  18.9k|}
_ZNK8Box_a1op4dumpER6Indent:
  202|  16.7k|{
  203|  16.7k|  std::ostringstream sstr;
  204|  16.7k|  sstr << Box::dump(indent);
  205|       |
  206|  16.7k|  sstr << indent << "op-index: " << ((int) op_index) << "\n";
  207|       |
  208|  16.7k|  return sstr.str();
  209|  16.7k|}
_ZN8Box_a1lx5parseER14BitstreamRangePK20heif_security_limits:
  225|  5.57k|{
  226|  5.57k|  uint8_t flags = range.read8();
  227|       |
  228|  22.2k|  for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (228:19): [True: 16.7k, False: 5.57k]
  ------------------
  229|  16.7k|    if (flags & 1) {
  ------------------
  |  Branch (229:9): [True: 504, False: 16.2k]
  ------------------
  230|    504|      layer_size[i] = range.read32();
  231|    504|    }
  232|  16.2k|    else {
  233|  16.2k|      layer_size[i] = range.read16();
  234|  16.2k|    }
  235|  16.7k|  }
  236|       |
  237|  5.57k|  return range.get_error();
  238|  5.57k|}
_ZNK8Box_a1lx4dumpER6Indent:
  242|  4.59k|{
  243|  4.59k|  std::ostringstream sstr;
  244|  4.59k|  sstr << Box::dump(indent);
  245|       |
  246|  4.59k|  sstr << indent << "layer-sizes: [" << layer_size[0] << "," << layer_size[1] << "," << layer_size[2] << "]\n";
  247|       |
  248|  4.59k|  return sstr.str();
  249|  4.59k|}

_ZN8Box_av1CC2Ev:
   45|  3.50k|  {
   46|  3.50k|    set_short_type(fourcc("av1C"));
   47|  3.50k|  }
_ZN8Box_av01C2Ev:
  122|    160|  {
  123|    160|    set_short_type(fourcc("av01"));
  124|    160|  }
_ZN8Box_a1opC2Ev:
  131|  18.9k|  {
  132|  18.9k|    set_short_type(fourcc("a1op"));
  133|  18.9k|  }
_ZN8Box_a1lxC2Ev:
  150|  5.57k|  {
  151|  5.57k|    set_short_type(fourcc("a1lx"));
  152|  5.57k|  }

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

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

_ZN8Box_cdef5parseER14BitstreamRangePK20heif_security_limits:
   33|  9.06k|{
   34|  9.06k|  uint16_t channel_count = range.read16();
   35|       |
   36|  9.06k|  if (limits->max_components && channel_count > limits->max_components) {
  ------------------
  |  Branch (36:7): [True: 9.06k, False: 0]
  |  Branch (36:33): [True: 10, False: 9.05k]
  ------------------
   37|     10|    std::stringstream sstr;
   38|     10|    sstr << "cdef box wants to define " << channel_count << " JPEG-2000 channels, but the security limit is set to "
   39|     10|         << limits->max_components << " components";
   40|     10|    return {heif_error_Invalid_input,
   41|     10|            heif_suberror_Security_limit_exceeded,
   42|     10|            sstr.str()};
   43|     10|  }
   44|       |
   45|  9.05k|  if (channel_count > range.get_remaining_bytes() / 6) {
  ------------------
  |  Branch (45:7): [True: 11, False: 9.03k]
  ------------------
   46|     11|    std::stringstream sstr;
   47|     11|    sstr << "cdef box wants to define " << channel_count << " JPEG-2000 channels, but file only contains "
   48|     11|         << range.get_remaining_bytes() / 6 << " components";
   49|     11|    return {heif_error_Invalid_input,
   50|     11|            heif_suberror_End_of_data,
   51|     11|            sstr.str()};
   52|     11|  }
   53|       |
   54|  9.03k|  m_channels.resize(channel_count);
   55|       |
   56|  17.5k|  for (uint16_t i = 0; i < channel_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (56:24): [True: 8.49k, False: 9.03k]
  |  Branch (56:45): [True: 8.49k, False: 0]
  |  Branch (56:63): [True: 8.49k, False: 0]
  ------------------
   57|  8.49k|    Channel channel;
   58|  8.49k|    channel.channel_index = range.read16();
   59|  8.49k|    channel.channel_type = range.read16();
   60|  8.49k|    channel.channel_association = range.read16();
   61|  8.49k|    m_channels[i] = channel;
   62|  8.49k|  }
   63|       |
   64|  9.03k|  return range.get_error();
   65|  9.05k|}
_ZNK8Box_cdef4dumpER6Indent:
   68|  8.70k|{
   69|  8.70k|  std::ostringstream sstr;
   70|  8.70k|  sstr << Box::dump(indent);
   71|       |
   72|  8.70k|  for (const auto& channel : m_channels) {
  ------------------
  |  Branch (72:28): [True: 8.35k, False: 8.70k]
  ------------------
   73|  8.35k|    sstr << indent << "channel_index: " << channel.channel_index
   74|  8.35k|         << ", channel_type: " << channel.channel_type
   75|  8.35k|         << ", channel_association: " << channel.channel_association << "\n";
   76|  8.35k|  }
   77|       |
   78|  8.70k|  return sstr.str();
   79|  8.70k|}
_ZN8Box_cmap5parseER14BitstreamRangePK20heif_security_limits:
  136|  3.16k|{
  137|  5.95M|  while (!range.eof() && !range.error()) {
  ------------------
  |  Branch (137:10): [True: 5.95M, False: 3.16k]
  |  Branch (137:26): [True: 5.95M, False: 0]
  ------------------
  138|  5.95M|    Component component;
  139|  5.95M|    component.component_index = range.read16();
  140|  5.95M|    component.mapping_type = range.read8();
  141|  5.95M|    component.palette_colour = range.read8();
  142|  5.95M|    m_components.push_back(component);
  143|  5.95M|  }
  144|       |
  145|  3.16k|  return range.get_error();
  146|  3.16k|}
_ZNK8Box_cmap4dumpER6Indent:
  150|  1.49k|{
  151|  1.49k|  std::ostringstream sstr;
  152|  1.49k|  sstr << Box::dump(indent);
  153|       |
  154|  5.55M|  for (const auto& component : m_components) {
  ------------------
  |  Branch (154:30): [True: 5.55M, False: 1.49k]
  ------------------
  155|  5.55M|    sstr << indent << "component_index: " << component.component_index
  156|  5.55M|         << ", mapping_type: " << (int) (component.mapping_type)
  157|  5.55M|         << ", palette_colour: " << (int) (component.palette_colour) << "\n";
  158|  5.55M|  }
  159|       |
  160|  1.49k|  return sstr.str();
  161|  1.49k|}
_ZN8Box_pclr5parseER14BitstreamRangePK20heif_security_limits:
  181|  1.86k|{
  182|  1.86k|  uint16_t num_entries = range.read16();
  183|  1.86k|  uint8_t num_palette_columns = range.read8();
  184|  8.35k|  for (uint8_t i = 0; i < num_palette_columns; i++) {
  ------------------
  |  Branch (184:23): [True: 6.50k, False: 1.85k]
  ------------------
  185|  6.50k|    uint8_t bit_depth = range.read8();
  186|  6.50k|    if (bit_depth & 0x80) {
  ------------------
  |  Branch (186:9): [True: 5, False: 6.49k]
  ------------------
  187|      5|      return Error(heif_error_Unsupported_feature,
  188|      5|                   heif_suberror_Unsupported_data_version,
  189|      5|                   "pclr with signed data is not supported");
  190|      5|    }
  191|  6.49k|    if (bit_depth > 16) {
  ------------------
  |  Branch (191:9): [True: 5, False: 6.49k]
  ------------------
  192|      5|      return Error(heif_error_Unsupported_feature,
  193|      5|                   heif_suberror_Unsupported_data_version,
  194|      5|                   "pclr more than 16 bits per channel is not supported");
  195|      5|    }
  196|  6.49k|    m_bitDepths.push_back(bit_depth);
  197|  6.49k|  }
  198|  33.3M|  for (uint16_t j = 0; j < num_entries; j++) {
  ------------------
  |  Branch (198:24): [True: 33.3M, False: 1.85k]
  ------------------
  199|  33.3M|    PaletteEntry entry;
  200|  33.3M|    for (unsigned long int i = 0; i < entry.columns.size(); i++) {
  ------------------
  |  Branch (200:35): [True: 0, False: 33.3M]
  ------------------
  201|      0|      if (m_bitDepths[i] <= 8) {
  ------------------
  |  Branch (201:11): [True: 0, False: 0]
  ------------------
  202|      0|        entry.columns.push_back(range.read8());
  203|      0|      }
  204|      0|      else {
  205|      0|        entry.columns.push_back(range.read16());
  206|      0|      }
  207|      0|    }
  208|  33.3M|    m_entries.push_back(entry);
  209|  33.3M|  }
  210|       |
  211|  1.85k|  return range.get_error();
  212|  1.86k|}
_ZNK8Box_pclr4dumpER6Indent:
  216|  1.75k|{
  217|  1.75k|  std::ostringstream sstr;
  218|  1.75k|  sstr << Box::dump(indent);
  219|       |
  220|  1.75k|  sstr << indent << "NE: " << m_entries.size();
  221|  1.75k|  sstr << ", NPC: " << (int) get_num_columns();
  222|  1.75k|  sstr << ", B: ";
  223|  4.68k|  for (uint8_t b : m_bitDepths) {
  ------------------
  |  Branch (223:18): [True: 4.68k, False: 1.75k]
  ------------------
  224|  4.68k|    sstr << (int) b << ", ";
  225|  4.68k|  }
  226|       |  // TODO: maybe dump entries too?
  227|  1.75k|  sstr << "\n";
  228|       |
  229|  1.75k|  return sstr.str();
  230|  1.75k|}
_ZN8Box_j2kL5parseER14BitstreamRangePK20heif_security_limits:
  273|    687|{
  274|    687|  uint16_t layer_count = range.read16();
  275|       |
  276|    687|  if (layer_count > range.get_remaining_bytes() / (2+1+2)) {
  ------------------
  |  Branch (276:7): [True: 16, False: 671]
  ------------------
  277|     16|    std::stringstream sstr;
  278|     16|    sstr << "j2kL box wants to define " << layer_count << "JPEG-2000 layers, but the box only contains "
  279|     16|         << range.get_remaining_bytes() / (2 + 1 + 2) << " layers entries";
  280|     16|    return {heif_error_Invalid_input,
  281|     16|            heif_suberror_End_of_data,
  282|     16|            sstr.str()};
  283|     16|  }
  284|       |
  285|    671|  m_layers.resize(layer_count);
  286|       |
  287|   626k|  for (int i = 0; i < layer_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (287:19): [True: 625k, False: 671]
  |  Branch (287:38): [True: 625k, False: 0]
  |  Branch (287:56): [True: 625k, False: 0]
  ------------------
  288|   625k|    Layer layer;
  289|   625k|    layer.layer_id = range.read16();
  290|   625k|    layer.discard_levels = range.read8();
  291|   625k|    layer.decode_layers = range.read16();
  292|   625k|    m_layers[i] = layer;
  293|   625k|  }
  294|       |
  295|    671|  if (range.get_error()) {
  ------------------
  |  Branch (295:7): [True: 3, False: 668]
  ------------------
  296|      3|    m_layers.clear();
  297|      3|  }
  298|       |
  299|    671|  return range.get_error();
  300|    687|}
_ZNK8Box_j2kL4dumpER6Indent:
  303|    571|{
  304|    571|  std::ostringstream sstr;
  305|    571|  sstr << Box::dump(indent);
  306|       |
  307|   625k|  for (const auto& layer : m_layers) {
  ------------------
  |  Branch (307:26): [True: 625k, False: 571]
  ------------------
  308|   625k|    sstr << indent << "layer_id: " << layer.layer_id
  309|   625k|         << ", discard_levels: " << (int) (layer.discard_levels)
  310|   625k|         << ", decode_layers: " << layer.decode_layers << "\n";
  311|   625k|  }
  312|       |
  313|    571|  return sstr.str();
  314|    571|}
_ZN8Box_j2kH5parseER14BitstreamRangePK20heif_security_limits:
  335|  7.71k|{
  336|  7.71k|  return read_children(range, READ_CHILDREN_ALL, limits);
  337|  7.71k|}
_ZNK8Box_j2kH4dumpER6Indent:
  340|  7.05k|{
  341|  7.05k|  std::ostringstream sstr;
  342|  7.05k|  sstr << Box::dump(indent);
  343|       |
  344|  7.05k|  sstr << dump_children(indent);
  345|       |
  346|  7.05k|  return sstr.str();
  347|  7.05k|}

_ZN8Box_j2kHC2Ev:
  314|  7.71k|    Box_j2kH() { set_short_type(fourcc("j2kH")); }
_ZN8Box_cdefC2Ev:
   57|  9.06k|    Box_cdef() { set_short_type(fourcc("cdef")); }
_ZN8Box_cmapC2Ev:
  141|  3.17k|    Box_cmap() { set_short_type(fourcc("cmap")); }
_ZN8Box_pclrC2Ev:
  186|  1.86k|    {
  187|  1.86k|        set_short_type(fourcc("pclr"));
  188|  1.86k|    }
_ZN8Box_j2kLC2Ev:
  269|    688|    Box_j2kL() { set_short_type(fourcc("j2kL")); }
_ZN8Box_j2kiC2Ev:
  527|     95|  {
  528|     95|    set_short_type(fourcc("j2ki"));
  529|     95|  }
_ZNK8Box_pclr15get_num_columnsEv:
  227|  1.75k|    {
  228|  1.75k|        return (uint8_t)(m_bitDepths.size());
  229|  1.75k|    }

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

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

_Z25is_valid_component_formath:
   43|  2.97k|{
   44|  2.97k|  return format <= component_format_max_valid;
   45|  2.97k|}
_Z24is_valid_interleave_modeh:
   62|    655|{
   63|    655|  return interleave <= interleave_mode_max_valid;
   64|    655|}
_Z22is_valid_sampling_modeh:
   83|    657|{
   84|    657|  return sampling <= sampling_mode_max_valid;
   85|    657|}
_Z28is_predefined_component_typet:
   96|  8.96k|{
   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|  8.96k|  return type <= heif_cmpd_component_type_max_valid;
  ------------------
  |  |   29|  8.96k|#define heif_cmpd_component_type_max_valid heif_cmpd_component_type_key_black
  ------------------
  100|  8.96k|}
_ZN8Box_cmpd5parseER14BitstreamRangePK20heif_security_limits:
  144|  1.12k|{
  145|  1.12k|  uint32_t component_count = range.read32();
  146|       |
  147|  1.12k|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (147:7): [True: 1.12k, False: 0]
  |  Branch (147:33): [True: 50, False: 1.07k]
  ------------------
  148|     50|    std::stringstream sstr;
  149|     50|    sstr << "cmpd box should contain " << component_count << " components, but security limit is set to "
  150|     50|         << limits->max_components << " components";
  151|       |
  152|     50|    return {heif_error_Invalid_input,
  153|     50|            heif_suberror_Security_limit_exceeded,
  154|     50|            sstr.str()
  155|     50|    };
  156|     50|  }
  157|       |
  158|  13.0k|  for (unsigned int i = 0; i < component_count ; i++) {
  ------------------
  |  Branch (158:28): [True: 12.0k, False: 992]
  ------------------
  159|  12.0k|    if (range.eof()) {
  ------------------
  |  Branch (159:9): [True: 83, False: 11.9k]
  ------------------
  160|     83|      std::stringstream sstr;
  161|     83|      sstr << "cmpd box should contain " << component_count << " components, but box only contained "
  162|     83|           << i << " components";
  163|       |
  164|     83|      return {heif_error_Invalid_input,
  165|     83|              heif_suberror_End_of_data,
  166|     83|              sstr.str()
  167|     83|      };
  168|     83|    }
  169|       |
  170|  11.9k|    Component component;
  171|  11.9k|    component.component_type = range.read16();
  172|  11.9k|    if (component.component_type >= 0x8000) {
  ------------------
  |  Branch (172:9): [True: 2.65k, False: 9.32k]
  ------------------
  173|  2.65k|      component.component_type_uri = range.read_string();
  174|  2.65k|    }
  175|  9.32k|    else {
  176|  9.32k|      component.component_type_uri = std::string();
  177|  9.32k|    }
  178|  11.9k|    m_components.push_back(component);
  179|  11.9k|  }
  180|       |
  181|    992|  return range.get_error();
  182|  1.07k|}
_ZN8Box_cmpd9Component23get_component_type_nameEt:
  185|  8.96k|{
  186|  8.96k|  std::stringstream sstr;
  187|       |
  188|  8.96k|  if (is_predefined_component_type(component_type)) {
  ------------------
  |  Branch (188:7): [True: 3.81k, False: 5.14k]
  ------------------
  189|  3.81k|    sstr << get_name(heif_cmpd_component_type(component_type), sNames_uncompressed_component_type) << "\n";
  190|  3.81k|  }
  191|  5.14k|  else {
  192|  5.14k|    sstr << "0x" << std::hex << component_type << std::dec << "\n";
  193|  5.14k|  }
  194|       |
  195|  8.96k|  return sstr.str();
  196|  8.96k|}
_ZNK8Box_cmpd4dumpER6Indent:
  207|    823|{
  208|    823|  std::ostringstream sstr;
  209|    823|  sstr << Box::dump(indent);
  210|       |
  211|  8.96k|  for (const auto& component : m_components) {
  ------------------
  |  Branch (211:30): [True: 8.96k, False: 823]
  ------------------
  212|  8.96k|    sstr << indent << "component_type: " << component.get_component_type_name();
  213|       |
  214|  8.96k|    if (component.component_type >= 0x8000) {
  ------------------
  |  Branch (214:9): [True: 1.48k, False: 7.48k]
  ------------------
  215|  1.48k|      sstr << indent << "| component_type_uri: " << component.component_type_uri << "\n";
  216|  1.48k|    }
  217|  8.96k|  }
  218|       |
  219|    823|  return sstr.str();
  220|    823|}
_ZN8Box_uncC5parseER14BitstreamRangePK20heif_security_limits:
  240|  5.74k|{
  241|  5.74k|  parse_full_box_header(range);
  242|       |
  243|  5.74k|  m_profile = range.read32();
  244|       |
  245|  5.74k|  if (get_version() == 1) {
  ------------------
  |  Branch (245:7): [True: 2.48k, False: 3.25k]
  ------------------
  246|  2.48k|    switch (m_profile) {
  247|    222|      case fourcc("rgb3"):
  ------------------
  |  Branch (247:7): [True: 222, False: 2.26k]
  ------------------
  248|    256|      case fourcc("rgba"):
  ------------------
  |  Branch (248:7): [True: 34, False: 2.45k]
  ------------------
  249|    631|      case fourcc("abgr"):
  ------------------
  |  Branch (249:7): [True: 375, False: 2.11k]
  ------------------
  250|    826|      case fourcc("2vuy"):
  ------------------
  |  Branch (250:7): [True: 195, False: 2.29k]
  ------------------
  251|    924|      case fourcc("yuv2"):
  ------------------
  |  Branch (251:7): [True: 98, False: 2.39k]
  ------------------
  252|    934|      case fourcc("yvyu"):
  ------------------
  |  Branch (252:7): [True: 10, False: 2.47k]
  ------------------
  253|  1.12k|      case fourcc("vyuy"):
  ------------------
  |  Branch (253:7): [True: 194, False: 2.29k]
  ------------------
  254|  1.17k|      case fourcc("yuv1"):
  ------------------
  |  Branch (254:7): [True: 45, False: 2.44k]
  ------------------
  255|  1.23k|      case fourcc("v308"):
  ------------------
  |  Branch (255:7): [True: 66, False: 2.42k]
  ------------------
  256|  1.30k|      case fourcc("v408"):
  ------------------
  |  Branch (256:7): [True: 66, False: 2.42k]
  ------------------
  257|  1.37k|      case fourcc("y210"):
  ------------------
  |  Branch (257:7): [True: 66, False: 2.42k]
  ------------------
  258|  1.39k|      case fourcc("v410"):
  ------------------
  |  Branch (258:7): [True: 20, False: 2.46k]
  ------------------
  259|  1.42k|      case fourcc("v210"):
  ------------------
  |  Branch (259:7): [True: 34, False: 2.45k]
  ------------------
  260|  1.49k|      case fourcc("i420"):
  ------------------
  |  Branch (260:7): [True: 66, False: 2.42k]
  ------------------
  261|  1.55k|      case fourcc("nv12"):
  ------------------
  |  Branch (261:7): [True: 66, False: 2.42k]
  ------------------
  262|  1.59k|      case fourcc("nv21"):
  ------------------
  |  Branch (262:7): [True: 34, False: 2.45k]
  ------------------
  263|  1.65k|      case fourcc("yu22"):
  ------------------
  |  Branch (263:7): [True: 68, False: 2.42k]
  ------------------
  264|  1.88k|      case fourcc("yv22"):
  ------------------
  |  Branch (264:7): [True: 224, False: 2.26k]
  ------------------
  265|  1.95k|      case fourcc("yv20"):
  ------------------
  |  Branch (265:7): [True: 67, False: 2.42k]
  ------------------
  266|  1.95k|        break;
  267|    539|      default:
  ------------------
  |  Branch (267:7): [True: 539, False: 1.95k]
  ------------------
  268|    539|        return Error{heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Unknown uncC v1 profile"};
  269|  2.48k|    }
  270|  3.25k|  } else if (get_version() == 0) {
  ------------------
  |  Branch (270:14): [True: 714, False: 2.54k]
  ------------------
  271|       |
  272|    714|    uint32_t component_count = range.read32();
  273|       |
  274|    714|    if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (274:9): [True: 714, False: 0]
  |  Branch (274:35): [True: 44, False: 670]
  ------------------
  275|     44|      std::stringstream sstr;
  276|     44|      sstr << "Number of image components (" << component_count << ") exceeds security limit ("
  277|     44|           << limits->max_components << ")";
  278|       |
  279|     44|      return {heif_error_Invalid_input,
  280|     44|              heif_suberror_Security_limit_exceeded,
  281|     44|              sstr.str()};
  282|     44|    }
  283|       |
  284|  3.63k|    for (uint32_t i = 0; i < component_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (284:26): [True: 3.00k, False: 625]
  |  Branch (284:49): [True: 2.98k, False: 22]
  |  Branch (284:67): [True: 2.97k, False: 10]
  ------------------
  285|  2.97k|      Component component;
  286|  2.97k|      component.component_index = range.read16();
  287|  2.97k|      component.component_bit_depth = uint16_t(range.read8() + 1);
  288|  2.97k|      component.component_format = range.read8();
  289|  2.97k|      component.component_align_size = range.read8();
  290|  2.97k|      m_components.push_back(component);
  291|       |
  292|  2.97k|      if (!is_valid_component_format(component.component_format)) {
  ------------------
  |  Branch (292:11): [True: 11, False: 2.96k]
  ------------------
  293|     11|        return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid component format"};
  294|     11|      }
  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.96k|      if (component.component_align_size != 0 &&
  ------------------
  |  Branch (299:11): [True: 814, False: 2.14k]
  ------------------
  300|    814|          uint32_t(component.component_align_size) * 8 < component.component_bit_depth) {
  ------------------
  |  Branch (300:11): [True: 2, False: 812]
  ------------------
  301|      2|        std::stringstream sstr;
  302|      2|        sstr << "Component alignment (" << int(component.component_align_size)
  303|      2|             << " bytes) is too small for component bit depth (" << component.component_bit_depth << " bits)";
  304|      2|        return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, sstr.str()};
  305|      2|      }
  306|  2.96k|    }
  307|       |
  308|    657|    m_sampling_type = range.read8();
  309|    657|    if (!is_valid_sampling_mode(m_sampling_type)) {
  ------------------
  |  Branch (309:9): [True: 2, False: 655]
  ------------------
  310|      2|      return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid sampling mode"};
  311|      2|    }
  312|       |
  313|    655|    m_interleave_type = range.read8();
  314|    655|    if (!is_valid_interleave_mode(m_interleave_type)) {
  ------------------
  |  Branch (314:9): [True: 1, False: 654]
  ------------------
  315|      1|      return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid interleave mode"};
  316|      1|    }
  317|       |
  318|    654|    m_block_size = range.read8();
  319|       |
  320|    654|    uint8_t flags = range.read8();
  321|    654|    m_components_little_endian = !!(flags & 0x80);
  322|    654|    m_block_pad_lsb = !!(flags & 0x40);
  323|    654|    m_block_little_endian = !!(flags & 0x20);
  324|    654|    m_block_reversed = !!(flags & 0x10);
  325|    654|    m_pad_unknown = !!(flags & 0x08);
  326|       |
  327|    654|    m_pixel_size = range.read32();
  328|       |
  329|    654|    if (limits->version >= 4 &&
  ------------------
  |  Branch (329:9): [True: 654, False: 0]
  ------------------
  330|    654|        limits->max_iso23001_17_pixel_size_bytes != 0 &&
  ------------------
  |  Branch (330:9): [True: 654, False: 0]
  ------------------
  331|    654|        m_pixel_size > limits->max_iso23001_17_pixel_size_bytes) {
  ------------------
  |  Branch (331:9): [True: 33, False: 621]
  ------------------
  332|     33|      std::stringstream sstr;
  333|     33|      sstr << "uncC pixel_size (" << m_pixel_size << " bytes) exceeds security limit of "
  334|     33|           << limits->max_iso23001_17_pixel_size_bytes << " bytes";
  335|     33|      return {heif_error_Memory_allocation_error,
  336|     33|              heif_suberror_Security_limit_exceeded,
  337|     33|              sstr.str()};
  338|     33|    }
  339|       |
  340|    621|    m_row_align_size = range.read32();
  341|       |
  342|    621|    m_tile_align_size = range.read32();
  343|       |
  344|    621|    uint32_t num_tile_cols_minus_one = range.read32();
  345|    621|    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|    621|    if (num_tile_cols_minus_one == 0xFFFFFFFF || num_tile_rows_minus_one == 0xFFFFFFFF) {
  ------------------
  |  Branch (351:9): [True: 1, False: 620]
  |  Branch (351:50): [True: 1, False: 619]
  ------------------
  352|      2|      return {heif_error_Unsupported_feature,
  353|      2|              heif_suberror_Invalid_parameter_value,
  354|      2|              "uncC num_tile_cols/rows_minus_one of 0xFFFFFFFF (2^32 tiles) exceeds the supported range"};
  355|      2|    }
  356|       |
  357|    619|    if (limits->max_number_of_tiles &&
  ------------------
  |  Branch (357:9): [True: 619, False: 0]
  ------------------
  358|    619|        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: 40, False: 579]
  ------------------
  359|     40|      std::stringstream sstr;
  360|     40|      sstr << "Tiling size "
  361|     40|           << ((uint64_t)num_tile_cols_minus_one + 1) << " x " << ((uint64_t)num_tile_rows_minus_one + 1)
  362|     40|           << " exceeds the maximum allowed number " << limits->max_number_of_tiles << " set as security limit";
  363|     40|      return {heif_error_Memory_allocation_error,
  364|     40|              heif_suberror_Security_limit_exceeded,
  365|     40|              sstr.str()};
  366|     40|    }
  367|       |
  368|    579|    m_num_tile_cols = num_tile_cols_minus_one + 1;
  369|    579|    m_num_tile_rows = num_tile_rows_minus_one + 1;
  370|    579|  }
  371|       |
  372|  5.07k|  return range.get_error();
  373|  5.74k|}
_ZNK8Box_uncC4dumpER6Indent:
  378|  3.42k|{
  379|  3.42k|  std::ostringstream sstr;
  380|  3.42k|  sstr << Box::dump(indent);
  381|       |
  382|  3.42k|  sstr << indent << "profile: " << m_profile;
  383|  3.42k|  if (m_profile != 0) {
  ------------------
  |  Branch (383:7): [True: 2.91k, False: 503]
  ------------------
  384|  2.91k|    sstr << " (" << fourcc_to_string(m_profile) << ")";
  385|  2.91k|  }
  386|  3.42k|  sstr << "\n";
  387|  3.42k|  if (get_version() == 0) {
  ------------------
  |  Branch (387:7): [True: 524, False: 2.89k]
  ------------------
  388|  2.13k|    for (const auto& component : m_components) {
  ------------------
  |  Branch (388:32): [True: 2.13k, False: 524]
  ------------------
  389|  2.13k|      sstr << indent << "component_index: " << component.component_index << "\n";
  390|  2.13k|      indent++;
  391|  2.13k|      sstr << indent << "component_bit_depth: " << (int) component.component_bit_depth << "\n";
  392|  2.13k|      sstr << indent << "component_format: " << get_name(heif_uncompressed_component_format(component.component_format), sNames_uncompressed_component_format) << "\n";
  393|  2.13k|      sstr << indent << "component_align_size: " << (int) component.component_align_size << "\n";
  394|  2.13k|      indent--;
  395|  2.13k|    }
  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|  3.42k|  return sstr.str();
  420|  3.42k|}
_ZN8Box_cmpC5parseER14BitstreamRangePK20heif_security_limits:
  750|    740|{
  751|    740|  parse_full_box_header(range);
  752|       |
  753|    740|  if (get_version() != 0) {
  ------------------
  |  Branch (753:7): [True: 6, False: 734]
  ------------------
  754|      6|    return unsupported_version_error("cmpC");
  755|      6|  }
  756|       |
  757|    734|  m_compression_type = range.read32();
  758|       |
  759|    734|  uint8_t unit_type = range.read8();
  760|    734|  if (unit_type > heif_cmpC_compressed_unit_type_image_pixel) {
  ------------------
  |  Branch (760:7): [True: 3, False: 731]
  ------------------
  761|      3|    return {heif_error_Invalid_input,
  762|      3|            heif_suberror_Unsupported_parameter,
  763|      3|            "Unsupported cmpC compressed unit type"};
  764|    731|  };
  765|       |
  766|    731|  m_compressed_unit_type = static_cast<heif_cmpC_compressed_unit_type>(unit_type);
  767|       |
  768|    731|  return range.get_error();
  769|    734|}
_ZNK8Box_cmpC4dumpER6Indent:
  773|    603|{
  774|    603|  std::ostringstream sstr;
  775|    603|  sstr << Box::dump(indent);
  776|    603|  sstr << indent << "compression_type: " << fourcc_to_string(m_compression_type) << "\n";
  777|    603|  sstr << indent << "compressed_entity_type: " << (int)m_compressed_unit_type << "\n";
  778|    603|  return sstr.str();
  779|    603|}
_ZN8Box_icef5parseER14BitstreamRangePK20heif_security_limits:
  798|  1.03k|{
  799|  1.03k|  parse_full_box_header(range);
  800|       |
  801|  1.03k|  if (get_version() != 0) {
  ------------------
  |  Branch (801:7): [True: 1, False: 1.03k]
  ------------------
  802|      1|    return unsupported_version_error("icef");
  803|      1|  }
  804|  1.03k|  uint8_t codes = range.read8();
  805|  1.03k|  uint8_t unit_offset_code = (codes & 0b11100000) >> 5;
  806|  1.03k|  uint8_t unit_size_code = (codes & 0b00011100) >> 2;
  807|  1.03k|  uint32_t num_compressed_units = range.read32();
  808|  1.03k|  uint64_t implied_offset = 0;
  809|       |
  810|  1.03k|  if (unit_offset_code > 4) {
  ------------------
  |  Branch (810:7): [True: 1, False: 1.03k]
  ------------------
  811|      1|    return {heif_error_Usage_error, heif_suberror_Unsupported_parameter, "Unsupported icef unit offset code"};
  812|      1|  }
  813|       |
  814|  1.03k|  if (unit_size_code > 4) {
  ------------------
  |  Branch (814:7): [True: 4, False: 1.03k]
  ------------------
  815|      4|    return {heif_error_Usage_error, heif_suberror_Unsupported_parameter, "Unsupported icef unit size code"};
  816|      4|  }
  817|       |
  818|       |  // --- precompute fields lengths
  819|       |
  820|  1.03k|  uint8_t unit_offset_bits = unit_offset_bits_table[unit_offset_code];
  821|  1.03k|  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|  1.03k|  uint64_t data_size_bytes = static_cast<uint64_t>(num_compressed_units) * (unit_offset_bits + unit_size_bits) / 8;
  835|  1.03k|  if (data_size_bytes > range.get_remaining_bytes()) {
  ------------------
  |  Branch (835:7): [True: 46, False: 986]
  ------------------
  836|     46|    uint64_t contained_units = range.get_remaining_bytes() / ((unit_offset_bits + unit_size_bits) * 8);
  837|     46|    std::stringstream sstr;
  838|     46|    sstr << "icef box declares " << num_compressed_units << " units, but only " << contained_units
  839|     46|         << " were contained in the file";
  840|     46|    return {heif_error_Invalid_input,
  841|     46|            heif_suberror_End_of_data,
  842|     46|            sstr.str()};
  843|     46|  }
  844|       |
  845|       |  // --- read box content
  846|       |
  847|    986|  if (auto err = m_memory_handle.alloc(num_compressed_units, sizeof(CompressedUnitInfo),
  ------------------
  |  Branch (847:12): [True: 0, False: 986]
  ------------------
  848|    986|                                       limits, "icef box compressed unit infos")) {
  849|      0|    return err;
  850|      0|  }
  851|       |
  852|    986|  m_unit_infos.resize(num_compressed_units);
  853|       |
  854|  1.80M|  for (uint32_t r = 0; r < num_compressed_units; r++) {
  ------------------
  |  Branch (854:24): [True: 1.80M, False: 983]
  ------------------
  855|  1.80M|    CompressedUnitInfo unitInfo;
  856|  1.80M|    if (unit_offset_code == 0) {
  ------------------
  |  Branch (856:9): [True: 1.79M, False: 405]
  ------------------
  857|  1.79M|      unitInfo.unit_offset = implied_offset;
  858|  1.79M|    } else {
  859|    405|      unitInfo.unit_offset = range.read_uint(unit_offset_bits);
  860|    405|    }
  861|       |
  862|  1.80M|    unitInfo.unit_size = range.read_uint(unit_size_bits);
  863|       |
  864|       |    // Reject unit_offset + unit_size wrapping past the 64 bit range.
  865|  1.80M|    if (unitInfo.unit_size >= UINT64_MAX - unitInfo.unit_offset) {
  ------------------
  |  Branch (865:9): [True: 3, False: 1.80M]
  ------------------
  866|      3|      return {heif_error_Invalid_input,
  867|      3|              heif_suberror_Invalid_parameter_value,
  868|      3|              "icef unit offset + size exceeds 64 bit range"};
  869|      3|    }
  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.80M|    if (unit_offset_code == 0) {
  ------------------
  |  Branch (873:9): [True: 1.79M, False: 404]
  ------------------
  874|  1.79M|      implied_offset += unitInfo.unit_size;
  875|  1.79M|    }
  876|       |
  877|  1.80M|    if (range.get_error() != Error::Ok) {
  ------------------
  |  Branch (877:9): [True: 0, False: 1.80M]
  ------------------
  878|      0|      return range.get_error();
  879|      0|    }
  880|       |
  881|  1.80M|    m_unit_infos[r] = unitInfo;
  882|  1.80M|  }
  883|       |
  884|    983|  return range.get_error();
  885|    986|}
_ZNK8Box_icef4dumpER6Indent:
  889|    871|{
  890|    871|  std::ostringstream sstr;
  891|    871|  sstr << Box::dump(indent);
  892|    871|  sstr << indent << "num_compressed_units: " << m_unit_infos.size() << "\n";
  893|  1.80M|  for (CompressedUnitInfo unit_info: m_unit_infos) {
  ------------------
  |  Branch (893:36): [True: 1.80M, False: 871]
  ------------------
  894|  1.80M|    sstr << indent << "unit_offset: " << unit_info.unit_offset << ", unit_size: " << unit_info.unit_size << "\n";
  895|  1.80M|  }
  896|    871|  return sstr.str();
  897|    871|}
_ZN8Box_cpat5parseER14BitstreamRangePK20heif_security_limits:
 1014|    736|{
 1015|    736|  parse_full_box_header(range);
 1016|       |
 1017|    736|  if (get_version() != 0) {
  ------------------
  |  Branch (1017:7): [True: 1, False: 735]
  ------------------
 1018|      1|    return unsupported_version_error("cpat");
 1019|      1|  }
 1020|       |
 1021|    735|  m_pattern.pattern_width = range.read16();
 1022|    735|  m_pattern.pattern_height = range.read16();
 1023|       |
 1024|    735|  if (m_pattern.pattern_width == 0 || m_pattern.pattern_height == 0) {
  ------------------
  |  Branch (1024:7): [True: 4, False: 731]
  |  Branch (1024:39): [True: 10, False: 721]
  ------------------
 1025|     14|    return {heif_error_Invalid_input,
 1026|     14|            heif_suberror_Invalid_parameter_value,
 1027|     14|            "Zero Bayer pattern size."};
 1028|     14|  }
 1029|       |
 1030|    721|  auto max_bayer_pattern_size = limits->max_bayer_pattern_pixels;
 1031|    721|  if (max_bayer_pattern_size && m_pattern.pattern_height > max_bayer_pattern_size / m_pattern.pattern_width) {
  ------------------
  |  Branch (1031:7): [True: 721, False: 0]
  |  Branch (1031:33): [True: 10, False: 711]
  ------------------
 1032|     10|    return {heif_error_Invalid_input,
 1033|     10|            heif_suberror_Security_limit_exceeded,
 1034|     10|            "Maximum Bayer pattern size exceeded."};
 1035|     10|  }
 1036|       |
 1037|    711|  size_t num_pixels = size_t{m_pattern.pattern_width} * m_pattern.pattern_height;
 1038|    711|  m_pattern.pixels.resize(num_pixels);
 1039|       |
 1040|  5.38k|  for (size_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1040:22): [True: 4.67k, False: 711]
  ------------------
 1041|  4.67k|    BayerPatternPixelCmpd pixel{};
 1042|  4.67k|    pixel.cmpd_index = range.read32();
 1043|  4.67k|    pixel.component_gain = range.read_float32();
 1044|  4.67k|    m_pattern.pixels[i] = pixel;
 1045|  4.67k|  }
 1046|       |
 1047|    711|  return range.get_error();
 1048|    721|}
_ZNK8Box_cpat4dumpER6Indent:
 1052|    692|{
 1053|    692|  std::ostringstream sstr;
 1054|       |
 1055|    692|  sstr << FullBox::dump(indent);
 1056|    692|  sstr << indent << "pattern_width: " << get_pattern_width() << "\n";
 1057|    692|  sstr << indent << "pattern_height: " << get_pattern_height() << "\n";
 1058|       |
 1059|  3.06k|  for (const auto& pixel : m_pattern.pixels) {
  ------------------
  |  Branch (1059:26): [True: 3.06k, False: 692]
  ------------------
 1060|  3.06k|    sstr << indent << "component index: " << pixel.cmpd_index << ", gain: " << pixel.component_gain << "\n";
 1061|  3.06k|  }
 1062|    692|  return sstr.str();
 1063|    692|}
_ZN8Box_splz5parseER14BitstreamRangePK20heif_security_limits:
 1091|    550|{
 1092|    550|  parse_full_box_header(range);
 1093|       |
 1094|    550|  if (get_version() != 0) {
  ------------------
  |  Branch (1094:7): [True: 1, False: 549]
  ------------------
 1095|      1|    return unsupported_version_error("splz");
 1096|      1|  }
 1097|       |
 1098|    549|  uint32_t component_count = range.read32();
 1099|    549|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1099:7): [True: 549, False: 0]
  |  Branch (1099:33): [True: 43, False: 506]
  ------------------
 1100|     43|    return {heif_error_Invalid_input,
 1101|     43|            heif_suberror_Security_limit_exceeded,
 1102|     43|            "Number of components in splz box exceeds the security limits."};
 1103|     43|  }
 1104|       |
 1105|    506|  m_pattern.component_ids.resize(component_count);
 1106|  2.70k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1106:24): [True: 2.19k, False: 506]
  ------------------
 1107|  2.19k|    m_pattern.component_ids[i] = range.read32();
 1108|  2.19k|  }
 1109|       |
 1110|    506|  m_pattern.pattern_width = range.read16();
 1111|    506|  m_pattern.pattern_height = range.read16();
 1112|       |
 1113|    506|  if (m_pattern.pattern_width == 0 || m_pattern.pattern_height == 0) {
  ------------------
  |  Branch (1113:7): [True: 10, False: 496]
  |  Branch (1113:39): [True: 1, False: 495]
  ------------------
 1114|     11|    return {heif_error_Invalid_input,
 1115|     11|            heif_suberror_Invalid_parameter_value,
 1116|     11|            "Zero polarization pattern size."};
 1117|     11|  }
 1118|       |
 1119|    495|  auto max_pattern_size = limits->max_bayer_pattern_pixels;
 1120|    495|  if (max_pattern_size && m_pattern.pattern_height > max_pattern_size / m_pattern.pattern_width) {
  ------------------
  |  Branch (1120:7): [True: 495, False: 0]
  |  Branch (1120:27): [True: 3, False: 492]
  ------------------
 1121|      3|    return {heif_error_Invalid_input,
 1122|      3|            heif_suberror_Security_limit_exceeded,
 1123|      3|            "Maximum polarization pattern size exceeded."};
 1124|      3|  }
 1125|       |
 1126|    492|  size_t num_pixels = size_t{m_pattern.pattern_width} * m_pattern.pattern_height;
 1127|    492|  m_pattern.polarization_angles.resize(num_pixels);
 1128|       |
 1129|  39.2k|  for (size_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1129:22): [True: 38.7k, False: 492]
  ------------------
 1130|  38.7k|    m_pattern.polarization_angles[i] = range.read_float32();
 1131|  38.7k|  }
 1132|       |
 1133|    492|  return range.get_error();
 1134|    495|}
_ZNK8Box_splz4dumpER6Indent:
 1138|    450|{
 1139|    450|  std::ostringstream sstr;
 1140|       |
 1141|    450|  sstr << FullBox::dump(indent);
 1142|       |
 1143|    450|  sstr << indent << "component_count: " << m_pattern.component_ids.size() << "\n";
 1144|  2.05k|  for (size_t i = 0; i < m_pattern.component_ids.size(); i++) {
  ------------------
  |  Branch (1144:22): [True: 1.60k, False: 450]
  ------------------
 1145|  1.60k|    sstr << indent << "  component_index[" << i << "]: " << m_pattern.component_ids[i] << "\n";
 1146|  1.60k|  }
 1147|       |
 1148|    450|  sstr << indent << "pattern_width: " << m_pattern.pattern_width << "\n";
 1149|    450|  sstr << indent << "pattern_height: " << m_pattern.pattern_height << "\n";
 1150|       |
 1151|  10.1k|  for (uint16_t y = 0; y < m_pattern.pattern_height; y++) {
  ------------------
  |  Branch (1151:24): [True: 9.70k, False: 450]
  ------------------
 1152|  44.7k|    for (uint16_t x = 0; x < m_pattern.pattern_width; x++) {
  ------------------
  |  Branch (1152:26): [True: 35.0k, False: 9.70k]
  ------------------
 1153|  35.0k|      float angle = m_pattern.polarization_angles[y * m_pattern.pattern_width + x];
 1154|  35.0k|      if (heif_polarization_angle_is_no_filter(angle)) {
  ------------------
  |  Branch (1154:11): [True: 887, False: 34.1k]
  ------------------
 1155|    887|        sstr << indent << "  [" << x << "," << y << "]: no filter\n";
 1156|    887|      }
 1157|  34.1k|      else {
 1158|  34.1k|        sstr << indent << "  [" << x << "," << y << "]: " << angle << " degrees\n";
 1159|  34.1k|      }
 1160|  35.0k|    }
 1161|  9.70k|  }
 1162|       |
 1163|    450|  return sstr.str();
 1164|    450|}
_ZN8Box_sbpm5parseER14BitstreamRangePK20heif_security_limits:
 1196|    831|{
 1197|    831|  parse_full_box_header(range);
 1198|       |
 1199|    831|  if (get_version() != 0) {
  ------------------
  |  Branch (1199:7): [True: 7, False: 824]
  ------------------
 1200|      7|    return unsupported_version_error("sbpm");
 1201|      7|  }
 1202|       |
 1203|    824|  uint32_t component_count = range.read32();
 1204|       |
 1205|    824|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1205:7): [True: 824, False: 0]
  |  Branch (1205:33): [True: 43, False: 781]
  ------------------
 1206|     43|    return {heif_error_Invalid_input,
 1207|     43|            heif_suberror_Security_limit_exceeded,
 1208|     43|            "sbpm component_count exceeds security limit."};
 1209|     43|  }
 1210|       |
 1211|    781|  m_map.component_ids.resize(component_count);
 1212|  3.23k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1212:24): [True: 2.45k, False: 781]
  ------------------
 1213|  2.45k|    m_map.component_ids[i] = range.read32();
 1214|  2.45k|  }
 1215|       |
 1216|    781|  uint8_t flags = range.read8();
 1217|    781|  m_map.correction_applied = !!(flags & 0x80);
 1218|       |
 1219|    781|  uint32_t num_bad_rows = range.read32();
 1220|    781|  uint32_t num_bad_cols = range.read32();
 1221|    781|  uint32_t num_bad_pixels = range.read32();
 1222|       |
 1223|       |  // Security check: limit total number of entries
 1224|    781|  uint64_t total_entries = static_cast<uint64_t>(num_bad_rows) + num_bad_cols + num_bad_pixels;
 1225|    781|  if (limits->max_bad_pixels && total_entries > limits->max_bad_pixels) {
  ------------------
  |  Branch (1225:7): [True: 781, False: 0]
  |  Branch (1225:33): [True: 6, False: 775]
  ------------------
 1226|      6|    return {heif_error_Invalid_input,
 1227|      6|            heif_suberror_Security_limit_exceeded,
 1228|      6|            "sbpm total bad pixel entries exceed security limit."};
 1229|      6|  }
 1230|       |
 1231|    775|  m_map.bad_rows.resize(num_bad_rows);
 1232|  6.35k|  for (uint32_t i = 0; i < num_bad_rows; i++) {
  ------------------
  |  Branch (1232:24): [True: 5.58k, False: 775]
  ------------------
 1233|  5.58k|    m_map.bad_rows[i] = range.read32();
 1234|  5.58k|  }
 1235|       |
 1236|    775|  m_map.bad_columns.resize(num_bad_cols);
 1237|  4.92k|  for (uint32_t i = 0; i < num_bad_cols; i++) {
  ------------------
  |  Branch (1237:24): [True: 4.15k, False: 775]
  ------------------
 1238|  4.15k|    m_map.bad_columns[i] = range.read32();
 1239|  4.15k|  }
 1240|       |
 1241|    775|  m_map.bad_pixels.resize(num_bad_pixels);
 1242|  6.15k|  for (uint32_t i = 0; i < num_bad_pixels; i++) {
  ------------------
  |  Branch (1242:24): [True: 5.37k, False: 775]
  ------------------
 1243|  5.37k|    m_map.bad_pixels[i].row = range.read32();
 1244|  5.37k|    m_map.bad_pixels[i].column = range.read32();
 1245|  5.37k|  }
 1246|       |
 1247|    775|  return range.get_error();
 1248|    781|}
_ZNK8Box_sbpm4dumpER6Indent:
 1252|    649|{
 1253|    649|  std::ostringstream sstr;
 1254|       |
 1255|    649|  sstr << FullBox::dump(indent);
 1256|       |
 1257|    649|  sstr << indent << "component_count: " << m_map.component_ids.size() << "\n";
 1258|  2.27k|  for (size_t i = 0; i < m_map.component_ids.size(); i++) {
  ------------------
  |  Branch (1258:22): [True: 1.62k, False: 649]
  ------------------
 1259|  1.62k|    sstr << indent << "  component_index[" << i << "]: " << m_map.component_ids[i] << "\n";
 1260|  1.62k|  }
 1261|       |
 1262|    649|  sstr << indent << "correction_applied: " << m_map.correction_applied << "\n";
 1263|       |
 1264|    649|  sstr << indent << "num_bad_rows: " << m_map.bad_rows.size() << "\n";
 1265|  1.95k|  for (size_t i = 0; i < m_map.bad_rows.size(); i++) {
  ------------------
  |  Branch (1265:22): [True: 1.31k, False: 649]
  ------------------
 1266|  1.31k|    sstr << indent << "  bad_row[" << i << "]: " << m_map.bad_rows[i] << "\n";
 1267|  1.31k|  }
 1268|       |
 1269|    649|  sstr << indent << "num_bad_columns: " << m_map.bad_columns.size() << "\n";
 1270|  1.53k|  for (size_t i = 0; i < m_map.bad_columns.size(); i++) {
  ------------------
  |  Branch (1270:22): [True: 885, False: 649]
  ------------------
 1271|    885|    sstr << indent << "  bad_column[" << i << "]: " << m_map.bad_columns[i] << "\n";
 1272|    885|  }
 1273|       |
 1274|    649|  sstr << indent << "num_bad_pixels: " << m_map.bad_pixels.size() << "\n";
 1275|  3.79k|  for (size_t i = 0; i < m_map.bad_pixels.size(); i++) {
  ------------------
  |  Branch (1275:22): [True: 3.14k, False: 649]
  ------------------
 1276|  3.14k|    sstr << indent << "  bad_pixel[" << i << "]: row=" << m_map.bad_pixels[i].row
 1277|  3.14k|         << ", column=" << m_map.bad_pixels[i].column << "\n";
 1278|  3.14k|  }
 1279|       |
 1280|    649|  return sstr.str();
 1281|    649|}
_ZN8Box_snuc5parseER14BitstreamRangePK20heif_security_limits:
 1320|    207|{
 1321|    207|  parse_full_box_header(range);
 1322|       |
 1323|    207|  if (get_version() != 0) {
  ------------------
  |  Branch (1323:7): [True: 8, False: 199]
  ------------------
 1324|      8|    return unsupported_version_error("snuc");
 1325|      8|  }
 1326|       |
 1327|    199|  uint32_t component_count = range.read32();
 1328|       |
 1329|    199|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1329:7): [True: 199, False: 0]
  |  Branch (1329:33): [True: 27, False: 172]
  ------------------
 1330|     27|    return {heif_error_Invalid_input,
 1331|     27|            heif_suberror_Security_limit_exceeded,
 1332|     27|            "snuc component_count exceeds security limit."};
 1333|     27|  }
 1334|       |
 1335|    172|  m_nuc.component_ids.resize(component_count);
 1336|  1.37k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1336:24): [True: 1.20k, False: 172]
  ------------------
 1337|  1.20k|    m_nuc.component_ids[i] = range.read32();
 1338|  1.20k|  }
 1339|       |
 1340|    172|  uint8_t flags = range.read8();
 1341|    172|  m_nuc.nuc_is_applied = !!(flags & 0x80);
 1342|       |
 1343|    172|  m_nuc.image_width = range.read32();
 1344|    172|  m_nuc.image_height = range.read32();
 1345|       |
 1346|    172|  if (m_nuc.image_width == 0 || m_nuc.image_height == 0) {
  ------------------
  |  Branch (1346:7): [True: 10, False: 162]
  |  Branch (1346:33): [True: 28, False: 134]
  ------------------
 1347|     38|    return {heif_error_Invalid_input,
 1348|     38|            heif_suberror_Invalid_parameter_value,
 1349|     38|            "snuc image width and height must be non-zero."};
 1350|     38|  }
 1351|       |
 1352|    134|  uint64_t num_pixels = static_cast<uint64_t>(m_nuc.image_width) * m_nuc.image_height;
 1353|       |
 1354|    134|  if (limits->max_image_size_pixels && num_pixels > limits->max_image_size_pixels) {
  ------------------
  |  Branch (1354:7): [True: 134, False: 0]
  |  Branch (1354:40): [True: 57, False: 77]
  ------------------
 1355|     57|    return {heif_error_Invalid_input,
 1356|     57|            heif_suberror_Security_limit_exceeded,
 1357|     57|            "snuc image dimensions exceed security limit."};
 1358|     57|  }
 1359|       |
 1360|     77|  Error err = m_memory_handle.alloc(num_pixels, 2 * sizeof(float), limits, "snuc box");
 1361|     77|  if (err) {
  ------------------
  |  Branch (1361:7): [True: 5, False: 72]
  ------------------
 1362|      5|    return err;
 1363|      5|  }
 1364|       |
 1365|     72|  m_nuc.nuc_gains.resize(num_pixels);
 1366|   583M|  for (uint64_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1366:24): [True: 583M, False: 72]
  ------------------
 1367|   583M|    m_nuc.nuc_gains[i] = range.read_float32();
 1368|   583M|  }
 1369|       |
 1370|     72|  m_nuc.nuc_offsets.resize(num_pixels);
 1371|   583M|  for (uint64_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1371:24): [True: 583M, False: 72]
  ------------------
 1372|   583M|    m_nuc.nuc_offsets[i] = range.read_float32();
 1373|   583M|  }
 1374|       |
 1375|     72|  return range.get_error();
 1376|     77|}
_ZNK8Box_snuc4dumpER6Indent:
 1380|     48|{
 1381|     48|  std::ostringstream sstr;
 1382|       |
 1383|     48|  sstr << FullBox::dump(indent);
 1384|       |
 1385|     48|  sstr << indent << "component_count: " << m_nuc.component_ids.size() << "\n";
 1386|    610|  for (size_t i = 0; i < m_nuc.component_ids.size(); i++) {
  ------------------
  |  Branch (1386:22): [True: 562, False: 48]
  ------------------
 1387|    562|    sstr << indent << "  component_index[" << i << "]: " << m_nuc.component_ids[i] << "\n";
 1388|    562|  }
 1389|       |
 1390|     48|  sstr << indent << "nuc_is_applied: " << m_nuc.nuc_is_applied << "\n";
 1391|     48|  sstr << indent << "image_width: " << m_nuc.image_width << "\n";
 1392|     48|  sstr << indent << "image_height: " << m_nuc.image_height << "\n";
 1393|       |
 1394|     48|  uint64_t num_pixels = static_cast<uint64_t>(m_nuc.image_width) * m_nuc.image_height;
 1395|     48|  sstr << indent << "nuc_gains: " << num_pixels << " values\n";
 1396|     48|  sstr << indent << "nuc_offsets: " << num_pixels << " values\n";
 1397|       |
 1398|     48|  return sstr.str();
 1399|     48|}
_ZN8Box_cloc5parseER14BitstreamRangePK20heif_security_limits:
 1432|    230|{
 1433|    230|  parse_full_box_header(range);
 1434|       |
 1435|    230|  if (get_version() != 0) {
  ------------------
  |  Branch (1435:7): [True: 7, False: 223]
  ------------------
 1436|      7|    return unsupported_version_error("cloc");
 1437|      7|  }
 1438|       |
 1439|    223|  m_chroma_location = range.read8();
 1440|       |
 1441|    223|  if (m_chroma_location > 6) {
  ------------------
  |  Branch (1441:7): [True: 6, False: 217]
  ------------------
 1442|      6|    return {heif_error_Invalid_input,
 1443|      6|            heif_suberror_Invalid_parameter_value,
 1444|      6|            "cloc chroma_location value out of range (must be 0-6)."};
 1445|      6|  }
 1446|       |
 1447|    217|  return range.get_error();
 1448|    223|}
_ZNK8Box_cloc4dumpER6Indent:
 1452|    216|{
 1453|    216|  std::ostringstream sstr;
 1454|       |
 1455|    216|  sstr << FullBox::dump(indent);
 1456|       |
 1457|    216|  static const char* location_names[] = {
 1458|    216|    "h=0,   v=0.5",   // 0
 1459|    216|    "h=0.5, v=0.5",   // 1
 1460|    216|    "h=0,   v=0",     // 2
 1461|    216|    "h=0.5, v=0",     // 3
 1462|    216|    "h=0,   v=1",     // 4
 1463|    216|    "h=0.5, v=1",     // 5
 1464|    216|    "Cr:0,0 / Cb:1,0" // 6
 1465|    216|  };
 1466|       |
 1467|    216|  sstr << indent << "chroma_location: " << static_cast<int>(m_chroma_location);
 1468|    216|  if (m_chroma_location <= 6) {
  ------------------
  |  Branch (1468:7): [True: 216, False: 0]
  ------------------
 1469|    216|    sstr << " (" << location_names[m_chroma_location] << ")";
 1470|    216|  }
 1471|    216|  sstr << "\n";
 1472|       |
 1473|    216|  return sstr.str();
 1474|    216|}
_ZN30Box_gimi_component_content_ids5parseER14BitstreamRangePK20heif_security_limits:
 1490|    407|{
 1491|    407|  uint32_t number_of_components = range.read32();
 1492|       |
 1493|    407|  if (limits->max_components && number_of_components > limits->max_components) {
  ------------------
  |  Branch (1493:7): [True: 407, False: 0]
  |  Branch (1493:33): [True: 117, False: 290]
  ------------------
 1494|    117|    std::stringstream sstr;
 1495|    117|    sstr << "GIMI component content IDs box contains " << number_of_components
 1496|    117|         << " components, but security limit is set to " << limits->max_components << " components";
 1497|    117|    return {heif_error_Invalid_input,
 1498|    117|            heif_suberror_Security_limit_exceeded,
 1499|    117|            sstr.str()};
 1500|    117|  }
 1501|       |
 1502|  5.31k|  for (uint32_t i = 0; i < number_of_components; i++) {
  ------------------
  |  Branch (1502:24): [True: 5.13k, False: 178]
  ------------------
 1503|  5.13k|    if (range.eof()) {
  ------------------
  |  Branch (1503:9): [True: 112, False: 5.02k]
  ------------------
 1504|    112|      return {heif_error_Invalid_input,
 1505|    112|              heif_suberror_End_of_data,
 1506|    112|              "Not enough data for all component content IDs"};
 1507|    112|    }
 1508|  5.02k|    m_content_ids.push_back(range.read_string());
 1509|  5.02k|  }
 1510|       |
 1511|    178|  return range.get_error();
 1512|    290|}
_ZNK30Box_gimi_component_content_ids4dumpER6Indent:
 1532|    158|{
 1533|    158|  std::ostringstream sstr;
 1534|    158|  sstr << Box::dump(indent);
 1535|       |
 1536|  3.49k|  for (size_t i = 0; i < m_content_ids.size(); i++) {
  ------------------
  |  Branch (1536:22): [True: 3.33k, False: 158]
  ------------------
 1537|  3.33k|    sstr << indent << "[" << i << "] content ID: " << m_content_ids[i] << "\n";
 1538|  3.33k|  }
 1539|       |
 1540|    158|  return sstr.str();
 1541|    158|}
_Z8get_nameI24heif_cmpd_component_typeEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|  3.81k|{
  124|  3.81k|  auto iter = table.find(val);
  125|  3.81k|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 3.81k]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|  3.81k|  else {
  129|  3.81k|    return iter->second;
  130|  3.81k|  }
  131|  3.81k|}
_Z8get_nameI34heif_uncompressed_component_formatEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|  2.13k|{
  124|  2.13k|  auto iter = table.find(val);
  125|  2.13k|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 2.13k]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|  2.13k|  else {
  129|  2.13k|    return iter->second;
  130|  2.13k|  }
  131|  2.13k|}
_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.12k|  {
   46|  1.12k|    set_short_type(fourcc("cmpd"));
   47|  1.12k|  }
_ZN8Box_uncCC2Ev:
   90|  5.75k|  Box_uncC() {
   91|  5.75k|    set_short_type(fourcc("uncC"));
   92|  5.75k|  }
_ZN8Box_cmpCC2Ev:
  270|    743|  {
  271|    743|    set_short_type(fourcc("cmpC"));
  272|    743|  }
_ZN8Box_icefC2Ev:
  304|  1.04k|  {
  305|  1.04k|    set_short_type(fourcc("icef"));
  306|  1.04k|  }
_ZN8Box_cpatC2Ev:
  359|    740|  {
  360|    740|    set_short_type(fourcc("cpat"));
  361|    740|  }
_ZN8Box_splzC2Ev:
  394|    554|  Box_splz() { set_short_type(fourcc("splz")); }
_ZN8Box_sbpmC2Ev:
  423|    834|  Box_sbpm() { set_short_type(fourcc("sbpm")); }
_ZN8Box_snucC2Ev:
  449|    210|  Box_snuc() { set_short_type(fourcc("snuc")); }
_ZN8Box_clocC2Ev:
  475|    234|  Box_cloc() { set_short_type(fourcc("cloc")); }
_ZN8Box_uncvC2Ev:
  498|    458|  {
  499|    458|    set_short_type(fourcc("uncv"));
  500|    458|  }
_ZN30Box_gimi_component_content_idsC2Ev:
  516|    408|  {
  517|    408|    set_uuid_type(std::vector<uint8_t>{0x9d, 0xb9, 0xdd, 0x6e, 0x37, 0x3c, 0x5a, 0x4e,
  518|    408|                                       0x81, 0x10, 0x21, 0xfc, 0x83, 0xa9, 0x11, 0xfd});
  519|    408|  }
_ZNK8Box_cmpd9Component23get_component_type_nameEv:
   60|  8.96k|    std::string get_component_type_name() const { return get_component_type_name(component_type); }
_ZNK8Box_cpat17get_pattern_widthEv:
  363|    692|  uint16_t get_pattern_width() const { return m_pattern.pattern_width; }
_ZNK8Box_cpat18get_pattern_heightEv:
  365|    692|  uint16_t get_pattern_height() const { return m_pattern.pattern_height; }
_ZNK30Box_gimi_component_content_ids14debug_box_nameEv:
  527|    158|  const char* debug_box_name() const override { return "GIMI Component Content IDs"; }
_ZNK30Box_gimi_component_content_ids24get_parse_error_fatalityEv:
  533|    244|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }

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

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

_Z16fourcc_to_stringj:
  152|  1.10M|{
  153|  1.10M|  std::string str("    ");
  154|  1.10M|  str[0] = static_cast<char>((code >> 24) & 0xFF);
  155|  1.10M|  str[1] = static_cast<char>((code >> 16) & 0xFF);
  156|  1.10M|  str[2] = static_cast<char>((code >> 8) & 0xFF);
  157|  1.10M|  str[3] = static_cast<char>((code >> 0) & 0xFF);
  158|       |
  159|  1.10M|  return str;
  160|  1.10M|}

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

_ZN11HeifContextC2Ev:
  148|  16.7k|    : m_memory_tracker(&m_limits)
  149|  16.7k|{
  150|  16.7k|  const char* security_limits_variable = getenv("LIBHEIF_SECURITY_LIMITS");
  151|       |
  152|  16.7k|  if (security_limits_variable && (strcmp(security_limits_variable, "off") == 0 ||
  ------------------
  |  Branch (152:7): [True: 0, False: 16.7k]
  |  Branch (152:36): [True: 0, False: 0]
  ------------------
  153|      0|                                   strcmp(security_limits_variable, "OFF") == 0)) {
  ------------------
  |  Branch (153:36): [True: 0, False: 0]
  ------------------
  154|      0|    m_limits = disabled_security_limits;
  155|      0|  }
  156|  16.7k|  else {
  157|  16.7k|    m_limits = global_security_limits;
  158|  16.7k|  }
  159|       |
  160|  16.7k|  reset_to_empty_heif();
  161|  16.7k|}
_ZN11HeifContextD2Ev:
  165|  16.7k|{
  166|       |  // Break circular references between Images (when a faulty input image has circular image references)
  167|  16.7k|  for (auto& it : m_all_images) {
  ------------------
  |  Branch (167:17): [True: 0, False: 16.7k]
  ------------------
  168|      0|    std::shared_ptr<ImageItem> image = it.second;
  169|      0|    image->clear();
  170|      0|  }
  171|  16.7k|}
_ZN11HeifContext19reset_to_empty_heifEv:
  280|  16.7k|{
  281|  16.7k|  m_heif_file = std::make_shared<HeifFile>();
  282|  16.7k|  m_heif_file->set_security_limits(&m_limits);
  283|  16.7k|  m_heif_file->new_empty_file();
  284|       |
  285|  16.7k|  m_all_images.clear();
  286|  16.7k|  m_top_level_images.clear();
  287|  16.7k|  m_primary_image.reset();
  288|  16.7k|}

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

_ZN5ErrorC2Ev:
   46|  50.3k|Error::Error() = default;
_ZN5ErrorC2E15heif_error_code18heif_suberror_codeRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   52|  45.2k|    : error_code(c),
   53|  45.2k|      sub_error_code(sc),
   54|  45.2k|      message(msg)
   55|  45.2k|{
   56|  45.2k|}

_ZNK5ErrorneERKS_:
   95|  2.33M|  bool operator!=(const Error& other) const { return !(*this == other); }
_ZNK5ErroreqERKS_:
   93|  2.83M|  bool operator==(const Error& other) const { return error_code == other.error_code; }
_ZNK5ErrorcvbEv:
  106|   734k|  operator bool() const { return error_code != heif_error_Ok; }
_ZN11ErrorBufferC2Ev:
   47|  16.7k|  ErrorBuffer() = default;

_ZN8HeifFileC2Ev:
   66|  16.7k|{
   67|  16.7k|  m_file_layout = std::make_shared<FileLayout>();
   68|  16.7k|}
_ZN8HeifFileD2Ev:
   70|  16.7k|HeifFile::~HeifFile() = default;
_ZN8HeifFile14new_empty_fileEv:
  160|  16.7k|{
  161|       |  //m_input_stream.reset();
  162|  16.7k|  m_top_level_boxes.clear();
  163|       |
  164|  16.7k|  m_ftyp_box = std::make_shared<Box_ftyp>();
  165|  16.7k|  m_top_level_boxes.push_back(m_ftyp_box);
  166|  16.7k|}

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

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

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

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

_ZN8Box_tilC32init_heif_tiled_image_parametersER27heif_tiled_image_parameters:
  115|  1.29k|{
  116|  1.29k|  params.version = 1;
  117|       |
  118|  1.29k|  params.image_width = 0;
  119|  1.29k|  params.image_height = 0;
  120|  1.29k|  params.tile_width = 0;
  121|  1.29k|  params.tile_height = 0;
  122|  1.29k|  params.compression_format_fourcc = 0;
  123|  1.29k|  params.offset_field_length = 40;
  124|  1.29k|  params.size_field_length = 24;
  125|  1.29k|  params.number_of_extra_dimensions = 0;
  126|       |
  127|  10.3k|  for (uint32_t& dim : params.extra_dimensions) {
  ------------------
  |  Branch (127:22): [True: 10.3k, False: 1.29k]
  ------------------
  128|  10.3k|    dim = 0;
  129|  10.3k|  }
  130|       |
  131|  1.29k|  params.tiles_are_sequential = false;
  132|  1.29k|}
_ZNK8Box_tilC4dumpER6Indent:
  222|    763|{
  223|    763|  std::ostringstream sstr;
  224|       |
  225|    763|  sstr << BoxHeader::dump(indent);
  226|       |
  227|    763|  sstr << indent << "version: " << ((int) get_version()) << "\n"
  228|       |       //<< indent << "image size: " << m_parameters.image_width << "x" << m_parameters.image_height << "\n"
  229|    763|       << indent << "tile size: " << m_parameters.tile_width << "x" << m_parameters.tile_height << "\n"
  230|    763|       << indent << "compression: " << fourcc_to_string(m_parameters.compression_format_fourcc) << "\n"
  231|    763|       << indent << "tiles are sequential: " << (m_parameters.tiles_are_sequential ? "yes" : "no") << "\n"
  ------------------
  |  Branch (231:50): [True: 46, False: 717]
  ------------------
  232|    763|       << indent << "offset field length: " << ((int) m_parameters.offset_field_length) << " bits\n"
  233|    763|       << indent << "size field length: " << ((int) m_parameters.size_field_length) << " bits\n"
  234|    763|       << indent << "number of extra dimensions: " << ((int) m_parameters.number_of_extra_dimensions) << "\n";
  235|       |
  236|    763|  sstr << indent << "tile properties:\n"
  237|    763|       << dump_children(indent, true);
  238|       |
  239|    763|  return sstr.str();
  240|       |
  241|    763|}
_ZN8Box_tilC5parseER14BitstreamRangePK20heif_security_limits:
  245|  1.28k|{
  246|  1.28k|  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.28k|  if (get_version() > 1) {
  ------------------
  |  Branch (249:7): [True: 7, False: 1.28k]
  ------------------
  250|      7|    std::stringstream sstr;
  251|      7|    sstr << "'tili' image version " << ((int) get_version()) << " is not implemented yet";
  252|       |
  253|      7|    return {heif_error_Unsupported_feature,
  254|      7|            heif_suberror_Unsupported_data_version,
  255|      7|            sstr.str()};
  256|      7|  }
  257|       |
  258|  1.28k|  m_parameters.version = get_version();
  259|       |
  260|  1.28k|  uint32_t flags = get_flags();
  261|       |
  262|  1.28k|  switch (flags & 0x03) {
  ------------------
  |  Branch (262:11): [True: 1.28k, False: 0]
  ------------------
  263|    760|    case 0:
  ------------------
  |  Branch (263:5): [True: 760, False: 522]
  ------------------
  264|    760|      m_parameters.offset_field_length = 32;
  265|    760|      break;
  266|     91|    case 1:
  ------------------
  |  Branch (266:5): [True: 91, False: 1.19k]
  ------------------
  267|     91|      m_parameters.offset_field_length = 40;
  268|     91|      break;
  269|    175|    case 2:
  ------------------
  |  Branch (269:5): [True: 175, False: 1.10k]
  ------------------
  270|    175|      m_parameters.offset_field_length = 48;
  271|    175|      break;
  272|    256|    case 3:
  ------------------
  |  Branch (272:5): [True: 256, False: 1.02k]
  ------------------
  273|    256|      m_parameters.offset_field_length = 64;
  274|    256|      break;
  275|  1.28k|  }
  276|       |
  277|  1.28k|  switch (flags & 0x0c) {
  ------------------
  |  Branch (277:11): [True: 1.28k, False: 0]
  ------------------
  278|    586|    case 0x00:
  ------------------
  |  Branch (278:5): [True: 586, False: 696]
  ------------------
  279|    586|      m_parameters.size_field_length = 0;
  280|    586|      break;
  281|    127|    case 0x04:
  ------------------
  |  Branch (281:5): [True: 127, False: 1.15k]
  ------------------
  282|    127|      m_parameters.size_field_length = 24;
  283|    127|      break;
  284|    458|    case 0x08:
  ------------------
  |  Branch (284:5): [True: 458, False: 824]
  ------------------
  285|    458|      m_parameters.size_field_length = 32;
  286|    458|      break;
  287|    111|    case 0x0c:
  ------------------
  |  Branch (287:5): [True: 111, False: 1.17k]
  ------------------
  288|    111|      m_parameters.size_field_length = 64;
  289|    111|      break;
  290|  1.28k|  }
  291|       |
  292|  1.28k|  m_parameters.tiles_are_sequential = !!(flags & 0x10);
  293|       |
  294|       |
  295|  1.28k|  m_parameters.tile_width = range.read32();
  296|  1.28k|  m_parameters.tile_height = range.read32();
  297|  1.28k|  m_parameters.compression_format_fourcc = range.read32();
  298|       |
  299|  1.28k|  if (m_parameters.tile_width == 0 || m_parameters.tile_height == 0) {
  ------------------
  |  Branch (299:7): [True: 6, False: 1.27k]
  |  Branch (299:39): [True: 37, False: 1.23k]
  ------------------
  300|     43|    return {heif_error_Invalid_input,
  301|     43|            heif_suberror_Unspecified,
  302|     43|            "Tile with zero width or height."};
  303|     43|  }
  304|       |
  305|       |
  306|       |  // --- extra dimensions
  307|       |
  308|  1.23k|  m_parameters.number_of_extra_dimensions = range.read8();
  309|       |
  310|  1.98k|  for (int i = 0; i < m_parameters.number_of_extra_dimensions; i++) {
  ------------------
  |  Branch (310:19): [True: 792, False: 1.18k]
  ------------------
  311|    792|    uint32_t size = range.read32();
  312|       |
  313|    792|    if (size == 0) {
  ------------------
  |  Branch (313:9): [True: 50, False: 742]
  ------------------
  314|     50|      return {heif_error_Invalid_input,
  315|     50|              heif_suberror_Unspecified,
  316|     50|              "'tili' extra dimension may not be zero."};
  317|     50|    }
  318|       |
  319|    742|    if (i < 8) {
  ------------------
  |  Branch (319:9): [True: 404, False: 338]
  ------------------
  320|    404|      m_parameters.extra_dimensions[i] = size;
  321|    404|    }
  322|    338|    else {
  323|       |      // TODO: error: too many dimensions (not supported)
  324|    338|    }
  325|    742|  }
  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.18k|  if (get_version() == 0) {
  ------------------
  |  Branch (331:7): [True: 404, False: 785]
  ------------------
  332|    404|    uint8_t num_properties = range.read8();
  333|       |
  334|    404|    Error error = read_children(range, num_properties, limits);
  335|    404|    if (error) {
  ------------------
  |  Branch (335:9): [True: 121, False: 283]
  ------------------
  336|    121|      return error;
  337|    121|    }
  338|    404|  }
  339|       |
  340|  1.06k|  return range.get_error();
  341|  1.18k|}

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

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

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

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

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

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

_ZN17color_profile_rawC2EjRKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  105|  11.3k|      : m_type(type), m_data(data) {}
_ZNK17color_profile_raw8get_typeEv:
  107|  9.58k|  uint32_t get_type() const override { return m_type; }
_ZN18color_profile_nclxC2Ev:
  175|    932|  color_profile_nclx() { m_profile.set_sRGB_defaults(); }
_ZNK18color_profile_nclx8get_typeEv:
  184|    768|  uint32_t get_type() const override { return fourcc("nclx"); }
_ZN8Box_colrC2Ev:
  205|  12.3k|  {
  206|  12.3k|    set_short_type(fourcc("colr"));
  207|  12.3k|  }
_ZNK8Box_colr22get_color_profile_typeEv:
  211|  10.3k|  uint32_t get_color_profile_type() const { return m_color_profile->get_type(); }
_ZN13color_profileD2Ev:
   92|  12.2k|  virtual ~color_profile() = default;

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

_ZN8Box_prfrC2Ev:
   37|    743|  {
   38|    743|    set_short_type(fourcc("prfr"));
   39|    743|  }
_ZNK8Box_prfr14debug_box_nameEv:
   47|    691|  const char* debug_box_name() const override { return "Projection Format"; }
_ZNK8Box_prfr24get_parse_error_fatalityEv:
   49|     46|  [[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:
  435|      2|{
  436|      2|  return &decoder_aom;
  437|      2|}
decoder_aom.cc:_ZL15aom_init_pluginv:
   88|      2|{
   89|      2|}

_Z24get_decoder_plugin_dav1dv:
  446|      2|{
  447|      2|  return &decoder_dav1d;
  448|      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:
  522|      2|{
  523|      2|  return &decoder_libde265;
  524|      2|}
decoder_libde265.cc:_ZL20libde265_init_pluginv:
   67|      2|{
   68|      2|  de265_init();
   69|      2|}

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

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

_ZN12MemoryHandleD2Ev:
   85|  22.0k|  ~MemoryHandle() { free(); }
_ZN12MemoryHandleC2Ev:
   84|  22.0k|  MemoryHandle() = default;

_ZN13Box_container5parseER14BitstreamRangePK20heif_security_limits:
   30|  2.15k|{
   31|  2.15k|  return read_children(range, READ_CHILDREN_ALL, limits);
   32|  2.15k|}
_ZNK13Box_container4dumpER6Indent:
   36|  1.99k|{
   37|  1.99k|  std::ostringstream sstr;
   38|  1.99k|  sstr << Box::dump(indent);
   39|  1.99k|  sstr << dump_children(indent);
   40|       |
   41|  1.99k|  return sstr.str();
   42|  1.99k|}
_ZNK8Box_mvhd18get_matrix_elementEi:
   46|  9.44k|{
   47|  9.44k|  if (idx == 8) {
  ------------------
  |  Branch (47:7): [True: 1.04k, False: 8.39k]
  ------------------
   48|  1.04k|    return 1.0;
   49|  1.04k|  }
   50|       |
   51|  8.39k|  return m_matrix[idx] / double(0x10000);
   52|  9.44k|}
_ZN8Box_mvhd5parseER14BitstreamRangePK20heif_security_limits:
   56|  1.14k|{
   57|  1.14k|  parse_full_box_header(range);
   58|       |
   59|  1.14k|  if (get_version() > 1) {
  ------------------
  |  Branch (59:7): [True: 1, False: 1.14k]
  ------------------
   60|      1|    return unsupported_version_error("mvhd");
   61|      1|  }
   62|       |
   63|  1.14k|  if (get_version() == 1) {
  ------------------
  |  Branch (63:7): [True: 38, False: 1.10k]
  ------------------
   64|     38|    m_creation_time = range.read64();
   65|     38|    m_modification_time = range.read64();
   66|     38|    m_timescale = range.read32();
   67|     38|    m_duration = range.read64();
   68|     38|  }
   69|  1.10k|  else {
   70|       |    // version==0
   71|  1.10k|    m_creation_time = range.read32();
   72|  1.10k|    m_modification_time = range.read32();
   73|  1.10k|    m_timescale = range.read32();
   74|  1.10k|    m_duration = range.read32();
   75|  1.10k|  }
   76|       |
   77|  1.14k|  m_rate = range.read32();
   78|  1.14k|  m_volume = range.read16();
   79|  1.14k|  range.skip(2);
   80|  1.14k|  range.skip(8);
   81|  10.3k|  for (uint32_t& m : m_matrix) {
  ------------------
  |  Branch (81:20): [True: 10.3k, False: 1.14k]
  ------------------
   82|  10.3k|    m = range.read32();
   83|  10.3k|  }
   84|  8.02k|  for (int i = 0; i < 6; i++) {
  ------------------
  |  Branch (84:19): [True: 6.88k, False: 1.14k]
  ------------------
   85|  6.88k|    range.skip(4);
   86|  6.88k|  }
   87|       |
   88|  1.14k|  m_next_track_ID = range.read32();
   89|       |
   90|  1.14k|  return range.get_error();
   91|  1.14k|}
_ZNK8Box_mvhd4dumpER6Indent:
   95|  1.04k|{
   96|  1.04k|  std::ostringstream sstr;
   97|  1.04k|  sstr << FullBox::dump(indent);
   98|  1.04k|  sstr << indent << "creation time:     " << m_creation_time << "\n"
   99|  1.04k|      << indent << "modification time: " << m_modification_time << "\n"
  100|  1.04k|      << indent << "timescale: " << m_timescale << "\n"
  101|  1.04k|      << indent << "duration: " << m_duration << "\n";
  102|  1.04k|  sstr << indent << "rate: " << get_rate() << "\n"
  103|  1.04k|      << indent << "volume: " << get_volume() << "\n"
  104|  1.04k|      << indent << "matrix:\n";
  105|  4.19k|  for (int y = 0; y < 3; y++) {
  ------------------
  |  Branch (105:19): [True: 3.14k, False: 1.04k]
  ------------------
  106|  3.14k|    sstr << indent << "  ";
  107|  12.5k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (107:21): [True: 9.44k, False: 3.14k]
  ------------------
  108|  9.44k|      sstr << get_matrix_element(i + 3 * y) << " ";
  109|  9.44k|    }
  110|  3.14k|    sstr << "\n";
  111|  3.14k|  }
  112|  1.04k|  sstr << indent << "next_track_ID: " << m_next_track_ID << "\n";
  113|       |
  114|  1.04k|  return sstr.str();
  115|  1.04k|}
_ZNK8Box_tkhd18get_matrix_elementEi:
  170|  10.8k|{
  171|  10.8k|  if (idx == 8) {
  ------------------
  |  Branch (171:7): [True: 1.20k, False: 9.60k]
  ------------------
  172|  1.20k|    return 1.0;
  173|  1.20k|  }
  174|       |
  175|  9.60k|  return m_matrix[idx] / double(0x10000);
  176|  10.8k|}
_ZN8Box_tkhd5parseER14BitstreamRangePK20heif_security_limits:
  180|  1.35k|{
  181|  1.35k|  parse_full_box_header(range);
  182|       |
  183|  1.35k|  if (get_version() > 1) {
  ------------------
  |  Branch (183:7): [True: 2, False: 1.35k]
  ------------------
  184|      2|    return unsupported_version_error("tkhd");
  185|      2|  }
  186|       |
  187|  1.35k|  if (get_version() == 1) {
  ------------------
  |  Branch (187:7): [True: 103, False: 1.25k]
  ------------------
  188|    103|    m_creation_time = range.read64();
  189|    103|    m_modification_time = range.read64();
  190|    103|    m_track_id = range.read32();
  191|    103|    range.skip(4);
  192|    103|    m_duration = range.read64();
  193|    103|  }
  194|  1.25k|  else {
  195|       |    // version==0
  196|  1.25k|    m_creation_time = range.read32();
  197|  1.25k|    m_modification_time = range.read32();
  198|  1.25k|    m_track_id = range.read32();
  199|  1.25k|    range.skip(4);
  200|  1.25k|    m_duration = range.read32();
  201|  1.25k|  }
  202|       |
  203|  1.35k|  range.skip(8);
  204|  1.35k|  m_layer = range.read16();
  205|  1.35k|  m_alternate_group = range.read16();
  206|  1.35k|  m_volume = range.read16();
  207|  1.35k|  range.skip(2);
  208|  12.1k|  for (uint32_t& m : m_matrix) {
  ------------------
  |  Branch (208:20): [True: 12.1k, False: 1.35k]
  ------------------
  209|  12.1k|    m = range.read32();
  210|  12.1k|  }
  211|       |
  212|  1.35k|  m_width = range.read32();
  213|  1.35k|  m_height = range.read32();
  214|       |
  215|  1.35k|  return range.get_error();
  216|  1.35k|}
_ZNK8Box_tkhd4dumpER6Indent:
  220|  1.20k|{
  221|  1.20k|  std::ostringstream sstr;
  222|  1.20k|  sstr << FullBox::dump(indent);
  223|  1.20k|  sstr << indent << "track enabled: " << ((get_flags() & Track_enabled) ? "yes" : "no") << "\n"
  ------------------
  |  Branch (223:43): [True: 372, False: 828]
  ------------------
  224|  1.20k|       << indent << "track in movie: " << ((get_flags() & Track_in_movie) ? "yes" : "no") << "\n"
  ------------------
  |  Branch (224:44): [True: 386, False: 814]
  ------------------
  225|  1.20k|       << indent << "track in preview: " << ((get_flags() & Track_in_preview) ? "yes" : "no") << "\n"
  ------------------
  |  Branch (225:46): [True: 386, False: 814]
  ------------------
  226|  1.20k|       << indent << "track size is aspect ratio: " << ((get_flags() & Track_size_is_aspect_ratio) ? "yes" : "no") << "\n";
  ------------------
  |  Branch (226:56): [True: 371, False: 829]
  ------------------
  227|  1.20k|  sstr << indent << "creation time:     " << m_creation_time << "\n"
  228|  1.20k|      << indent << "modification time: " << m_modification_time << "\n"
  229|  1.20k|      << indent << "track ID: " << m_track_id << "\n"
  230|  1.20k|      << indent << "duration: " << m_duration << "\n";
  231|  1.20k|  sstr << indent << "layer: " << m_layer << "\n"
  232|  1.20k|      << indent << "alternate_group: " << m_alternate_group << "\n"
  233|  1.20k|      << indent << "volume: " << get_volume() << "\n"
  234|  1.20k|      << indent << "matrix:\n";
  235|  4.80k|  for (int y = 0; y < 3; y++) {
  ------------------
  |  Branch (235:19): [True: 3.60k, False: 1.20k]
  ------------------
  236|  3.60k|    sstr << indent << "  ";
  237|  14.4k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (237:21): [True: 10.8k, False: 3.60k]
  ------------------
  238|  10.8k|      sstr << get_matrix_element(i + 3 * y) << " ";
  239|  10.8k|    }
  240|  3.60k|    sstr << "\n";
  241|  3.60k|  }
  242|       |
  243|  1.20k|  sstr << indent << "width: " << get_width() << "\n"
  244|  1.20k|      << indent << "height: " << get_height() << "\n";
  245|       |
  246|  1.20k|  return sstr.str();
  247|  1.20k|}
_ZN8Box_mdhd5parseER14BitstreamRangePK20heif_security_limits:
  302|  1.04k|{
  303|  1.04k|  parse_full_box_header(range);
  304|       |
  305|  1.04k|  if (get_version() > 1) {
  ------------------
  |  Branch (305:7): [True: 4, False: 1.03k]
  ------------------
  306|      4|    return unsupported_version_error("mdhd");
  307|      4|  }
  308|       |
  309|  1.03k|  if (get_version() == 1) {
  ------------------
  |  Branch (309:7): [True: 72, False: 965]
  ------------------
  310|     72|    m_creation_time = range.read64();
  311|     72|    m_modification_time = range.read64();
  312|     72|    m_timescale = range.read32();
  313|     72|    m_duration = range.read64();
  314|     72|  }
  315|    965|  else {
  316|       |    // version==0
  317|    965|    m_creation_time = range.read32();
  318|    965|    m_modification_time = range.read32();
  319|    965|    m_timescale = range.read32();
  320|    965|    m_duration = range.read32();
  321|    965|  }
  322|       |
  323|  1.03k|  uint16_t language_packed = range.read16();
  324|  1.03k|  m_language[0] = ((language_packed >> 10) & 0x1F) + 0x60;
  325|  1.03k|  m_language[1] = ((language_packed >> 5) & 0x1F) + 0x60;
  326|  1.03k|  m_language[2] = ((language_packed >> 0) & 0x1F) + 0x60;
  327|  1.03k|  m_language[3] = 0;
  328|       |
  329|  1.03k|  range.skip(2);
  330|       |
  331|  1.03k|  return range.get_error();
  332|  1.04k|}
_ZNK8Box_mdhd4dumpER6Indent:
  336|    929|{
  337|    929|  std::ostringstream sstr;
  338|    929|  sstr << FullBox::dump(indent);
  339|    929|  sstr << indent << "creation time:     " << m_creation_time << "\n"
  340|    929|      << indent << "modification time: " << m_modification_time << "\n"
  341|    929|      << indent << "timescale: " << m_timescale << "\n"
  342|    929|      << indent << "duration: " << m_duration << "\n";
  343|    929|  sstr << indent << "language: " << m_language << "\n";
  344|       |
  345|    929|  return sstr.str();
  346|    929|}
_ZN8Box_vmhd5parseER14BitstreamRangePK20heif_security_limits:
  394|    759|{
  395|    759|  parse_full_box_header(range);
  396|       |
  397|    759|  if (get_version() > 0) {
  ------------------
  |  Branch (397:7): [True: 7, False: 752]
  ------------------
  398|      7|    return unsupported_version_error("vmhd");
  399|      7|  }
  400|       |
  401|    752|  m_graphics_mode = range.read16();
  402|  2.25k|  for (uint16_t& c : m_op_color) {
  ------------------
  |  Branch (402:20): [True: 2.25k, False: 752]
  ------------------
  403|  2.25k|    c = range.read16();
  404|  2.25k|  }
  405|       |
  406|    752|  return range.get_error();
  407|    759|}
_ZNK8Box_vmhd4dumpER6Indent:
  411|    650|{
  412|    650|  std::ostringstream sstr;
  413|    650|  sstr << FullBox::dump(indent);
  414|    650|  sstr << indent << "graphics mode: " << m_graphics_mode;
  415|    650|  if (m_graphics_mode == 0) {
  ------------------
  |  Branch (415:7): [True: 305, False: 345]
  ------------------
  416|    305|    sstr << " (copy)";
  417|    305|  }
  418|    650|  sstr << "\n"
  419|    650|       << indent << "op color: " << m_op_color[0] << "; " << m_op_color[1] << "; " << m_op_color[2] << "\n";
  420|       |
  421|    650|  return sstr.str();
  422|    650|}
_ZN8Box_nmhd5parseER14BitstreamRangePK20heif_security_limits:
  441|    448|{
  442|    448|  parse_full_box_header(range);
  443|       |
  444|    448|  if (get_version() > 0) {
  ------------------
  |  Branch (444:7): [True: 1, False: 447]
  ------------------
  445|      1|    return unsupported_version_error("nmhd");
  446|      1|  }
  447|       |
  448|    447|  return range.get_error();
  449|    448|}
_ZNK8Box_nmhd4dumpER6Indent:
  453|    402|{
  454|    402|  std::ostringstream sstr;
  455|    402|  sstr << FullBox::dump(indent);
  456|       |
  457|    402|  return sstr.str();
  458|    402|}
_ZN8Box_stsd5parseER14BitstreamRangePK20heif_security_limits:
  472|  1.16k|{
  473|  1.16k|  parse_full_box_header(range);
  474|       |
  475|  1.16k|  if (get_version() > 0) {
  ------------------
  |  Branch (475:7): [True: 8, False: 1.15k]
  ------------------
  476|      8|    return unsupported_version_error("stsd");
  477|      8|  }
  478|       |
  479|  1.15k|  uint32_t entry_count = range.read32();
  480|       |
  481|  1.15k|  if (limits->max_sample_description_box_entries &&
  ------------------
  |  Branch (481:7): [True: 1.15k, False: 0]
  ------------------
  482|  1.15k|      entry_count > limits->max_sample_description_box_entries) {
  ------------------
  |  Branch (482:7): [True: 23, False: 1.13k]
  ------------------
  483|     23|    std::stringstream sstr;
  484|     23|    sstr << "Allocating " << static_cast<uint64_t>(entry_count) << " sample description items exceeds the security limit of "
  485|     23|         << limits->max_sample_description_box_entries << " items";
  486|       |
  487|     23|    return {heif_error_Memory_allocation_error,
  488|     23|            heif_suberror_Security_limit_exceeded,
  489|     23|            sstr.str()};
  490|       |
  491|     23|  }
  492|       |
  493|  3.16k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (493:24): [True: 2.11k, False: 1.04k]
  ------------------
  494|  2.11k|    std::shared_ptr<Box> entrybox;
  495|  2.11k|    Error err = Box::read(range, &entrybox, limits);
  496|  2.11k|    if (err) {
  ------------------
  |  Branch (496:9): [True: 89, False: 2.02k]
  ------------------
  497|     89|      return err;
  498|     89|    }
  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|  2.02k|    m_sample_entries.push_back(entrybox);
  510|  2.02k|  }
  511|       |
  512|  1.04k|  return range.get_error();
  513|  1.13k|}
_ZNK8Box_stsd4dumpER6Indent:
  517|    782|{
  518|    782|  std::ostringstream sstr;
  519|    782|  sstr << FullBox::dump(indent);
  520|  2.33k|  for (size_t i = 0; i < m_sample_entries.size(); i++) {
  ------------------
  |  Branch (520:22): [True: 1.55k, False: 782]
  ------------------
  521|  1.55k|    sstr << indent << "[" << i << "]\n";
  522|  1.55k|    indent++;
  523|  1.55k|    sstr << m_sample_entries[i]->dump(indent);
  524|  1.55k|    indent--;
  525|  1.55k|  }
  526|       |
  527|    782|  return sstr.str();
  528|    782|}
_ZN8Box_stts5parseER14BitstreamRangePK20heif_security_limits:
  547|    873|{
  548|    873|  parse_full_box_header(range);
  549|       |
  550|    873|  if (get_version() > 0) {
  ------------------
  |  Branch (550:7): [True: 1, False: 872]
  ------------------
  551|      1|    return unsupported_version_error("stts");
  552|      1|  }
  553|       |
  554|    872|  uint32_t entry_count = range.read32();
  555|       |
  556|    872|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (556:7): [True: 872, False: 0]
  |  Branch (556:42): [True: 38, False: 834]
  ------------------
  557|     38|    return {
  558|     38|      heif_error_Memory_allocation_error,
  559|     38|      heif_suberror_Security_limit_exceeded,
  560|     38|      "Security limit for maximum number of sequence frames exceeded"
  561|     38|    };
  562|     38|  }
  563|       |
  564|    834|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(TimeToSample),
  ------------------
  |  Branch (564:12): [True: 0, False: 834]
  ------------------
  565|    834|                                       limits, "the 'stts' table")) {
  566|      0|    return err;
  567|      0|  }
  568|       |
  569|    834|  m_entries.resize(entry_count);
  570|       |
  571|   239k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (571:24): [True: 238k, False: 796]
  ------------------
  572|   238k|    if (range.eof()) {
  ------------------
  |  Branch (572:9): [True: 38, False: 238k]
  ------------------
  573|     38|      std::stringstream sstr;
  574|     38|      sstr << "stts box should contain " << entry_count << " entries, but box only contained "
  575|     38|          << i << " entries";
  576|       |
  577|     38|      return {
  578|     38|        heif_error_Invalid_input,
  579|     38|        heif_suberror_End_of_data,
  580|     38|        sstr.str()
  581|     38|      };
  582|     38|    }
  583|       |
  584|   238k|    TimeToSample entry{};
  585|   238k|    entry.sample_count = range.read32();
  586|   238k|    entry.sample_delta = range.read32();
  587|   238k|    m_entries[i] = entry;
  588|   238k|  }
  589|       |
  590|    796|  return range.get_error();
  591|    834|}
_ZNK8Box_stts4dumpER6Indent:
  595|    785|{
  596|    785|  std::ostringstream sstr;
  597|    785|  sstr << FullBox::dump(indent);
  598|   237k|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (598:22): [True: 236k, False: 785]
  ------------------
  599|   236k|    sstr << indent << "[" << i << "] : cnt=" << m_entries[i].sample_count << ", delta=" << m_entries[i].sample_delta << "\n";
  600|   236k|  }
  601|       |
  602|    785|  return sstr.str();
  603|    785|}
_ZN8Box_ctts5parseER14BitstreamRangePK20heif_security_limits:
  677|  1.07k|{
  678|  1.07k|  parse_full_box_header(range);
  679|       |
  680|  1.07k|  uint8_t version = get_version();
  681|       |
  682|  1.07k|  if (version > 1) {
  ------------------
  |  Branch (682:7): [True: 7, False: 1.07k]
  ------------------
  683|      7|    return unsupported_version_error("ctts");
  684|      7|  }
  685|       |
  686|  1.07k|  uint32_t entry_count = range.read32();
  687|       |
  688|  1.07k|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (688:7): [True: 1.07k, False: 0]
  |  Branch (688:42): [True: 40, False: 1.03k]
  ------------------
  689|     40|    return {
  690|     40|      heif_error_Memory_allocation_error,
  691|     40|      heif_suberror_Security_limit_exceeded,
  692|     40|      "Security limit for maximum number of sequence frames exceeded"
  693|     40|    };
  694|     40|  }
  695|       |
  696|  1.03k|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(OffsetToSample),
  ------------------
  |  Branch (696:12): [True: 0, False: 1.03k]
  ------------------
  697|  1.03k|                                       limits, "the 'ctts' table")) {
  698|      0|    return err;
  699|      0|  }
  700|       |
  701|  1.03k|  m_entries.resize(entry_count);
  702|       |
  703|  71.0k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (703:24): [True: 70.0k, False: 989]
  ------------------
  704|  70.0k|    if (range.eof()) {
  ------------------
  |  Branch (704:9): [True: 41, False: 70.0k]
  ------------------
  705|     41|      std::stringstream sstr;
  706|     41|      sstr << "ctts box should contain " << entry_count << " entries, but box only contained "
  707|     41|          << i << " entries";
  708|       |
  709|     41|      return {
  710|     41|        heif_error_Invalid_input,
  711|     41|        heif_suberror_End_of_data,
  712|     41|        sstr.str()
  713|     41|      };
  714|     41|    }
  715|       |
  716|  70.0k|    OffsetToSample entry{};
  717|  70.0k|    entry.sample_count = range.read32();
  718|  70.0k|    if (version == 0) {
  ------------------
  |  Branch (718:9): [True: 14.6k, False: 55.3k]
  ------------------
  719|  14.6k|      uint32_t offset = range.read32();
  720|       |#if 0
  721|       |      // TODO: I disabled this because I found several files that seem to
  722|       |      //       have wrong data. Since we are not using the 'ctts' data anyway,
  723|       |      //       let's not care about it now.
  724|       |
  725|       |      if (offset > INT32_MAX) {
  726|       |        return {
  727|       |          heif_error_Unsupported_feature,
  728|       |          heif_suberror_Unsupported_parameter,
  729|       |          "We don't support offsets > 0x7fff in 'ctts' box."
  730|       |        };
  731|       |      }
  732|       |#endif
  733|       |
  734|  14.6k|      entry.sample_offset = static_cast<int32_t>(offset);
  735|  14.6k|    }
  736|  55.3k|    else if (version == 1) {
  ------------------
  |  Branch (736:14): [True: 55.3k, False: 0]
  ------------------
  737|  55.3k|      entry.sample_offset = range.read32s();
  738|  55.3k|    }
  739|      0|    else {
  740|      0|      assert(false);
  ------------------
  |  Branch (740:7): [Folded, False: 0]
  ------------------
  741|      0|    }
  742|       |
  743|  70.0k|    m_entries[i] = entry;
  744|  70.0k|  }
  745|       |
  746|    989|  return range.get_error();
  747|  1.03k|}
_ZNK8Box_ctts4dumpER6Indent:
  751|    889|{
  752|    889|  std::ostringstream sstr;
  753|    889|  sstr << FullBox::dump(indent);
  754|  70.5k|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (754:22): [True: 69.6k, False: 889]
  ------------------
  755|  69.6k|    sstr << indent << "[" << i << "] : cnt=" << m_entries[i].sample_count << ", offset=" << m_entries[i].sample_offset << "\n";
  756|  69.6k|  }
  757|       |
  758|    889|  return sstr.str();
  759|    889|}
_ZN8Box_stsc5parseER14BitstreamRangePK20heif_security_limits:
  850|    387|{
  851|    387|  parse_full_box_header(range);
  852|       |
  853|    387|  if (get_version() > 0) {
  ------------------
  |  Branch (853:7): [True: 1, False: 386]
  ------------------
  854|      1|    return unsupported_version_error("stsc");
  855|      1|  }
  856|       |
  857|    386|  uint32_t entry_count = range.read32();
  858|    386|  if (entry_count == 0) {
  ------------------
  |  Branch (858:7): [True: 1, False: 385]
  ------------------
  859|      1|    return {
  860|      1|      heif_error_Invalid_input,
  861|      1|      heif_suberror_Unspecified,
  862|      1|      "'stsc' box with zero entries."};
  863|      1|  }
  864|       |
  865|       |  // Note: test against maximum number of frames (upper limit) since we have no limit on maximum number of chunks
  866|    385|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (866:7): [True: 385, False: 0]
  |  Branch (866:42): [True: 40, False: 345]
  ------------------
  867|     40|    return {
  868|     40|      heif_error_Invalid_input,
  869|     40|      heif_suberror_Unspecified,
  870|     40|      "Number of chunks in `stsc` box exceeds security limits of maximum number of frames."};
  871|     40|  }
  872|       |
  873|       |
  874|    345|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(SampleToChunk),
  ------------------
  |  Branch (874:12): [True: 0, False: 345]
  ------------------
  875|    345|                                       limits, "the 'stsc' table")) {
  876|      0|    return err;
  877|      0|  }
  878|       |
  879|    345|  m_entries.resize(entry_count);
  880|       |
  881|  1.02k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (881:24): [True: 821, False: 200]
  ------------------
  882|    821|    SampleToChunk entry{};
  883|    821|    entry.first_chunk = range.read32();
  884|    821|    entry.samples_per_chunk = range.read32();
  885|    821|    entry.sample_description_index = range.read32();
  886|       |
  887|    821|    if (entry.samples_per_chunk == 0) {
  ------------------
  |  Branch (887:9): [True: 42, False: 779]
  ------------------
  888|     42|      return {
  889|     42|        heif_error_Invalid_input,
  890|     42|        heif_suberror_Unspecified,
  891|     42|        "'stsc' box with zero samples per chunk entry."};
  892|     42|    }
  893|       |
  894|    779|    if (entry.sample_description_index == 0) {
  ------------------
  |  Branch (894:9): [True: 43, False: 736]
  ------------------
  895|     43|      return {
  896|     43|      heif_error_Invalid_input,
  897|     43|      heif_suberror_Unspecified,
  898|     43|      "'sample_description_index' in 'stsc' must not be 0."};
  899|     43|    }
  900|       |
  901|    736|    if (limits->max_sequence_frames > 0 && entry.samples_per_chunk > limits->max_sequence_frames) {
  ------------------
  |  Branch (901:9): [True: 736, False: 0]
  |  Branch (901:44): [True: 60, False: 676]
  ------------------
  902|     60|      return {
  903|     60|        heif_error_Invalid_input,
  904|     60|        heif_suberror_Unspecified,
  905|     60|        "Number of chunk samples in `stsc` box exceeds security limits of maximum number of frames."};
  906|     60|    }
  907|       |
  908|    676|    m_entries[i] = entry;
  909|    676|  }
  910|       |
  911|    200|  return range.get_error();
  912|    345|}
_ZNK8Box_stsc4dumpER6Indent:
  916|    150|{
  917|    150|  std::ostringstream sstr;
  918|    150|  sstr << FullBox::dump(indent);
  919|    708|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (919:22): [True: 558, False: 150]
  ------------------
  920|    558|    sstr << indent << "[" << i << "]\n"
  921|    558|        << indent << "  first chunk: " << m_entries[i].first_chunk << "\n"
  922|    558|        << indent << "  samples per chunk: " << m_entries[i].samples_per_chunk << "\n"
  923|    558|        << indent << "  sample description index: " << m_entries[i].sample_description_index << "\n";
  924|    558|  }
  925|       |
  926|    150|  return sstr.str();
  927|    150|}
_ZN8Box_stco5parseER14BitstreamRangePK20heif_security_limits:
  979|    541|{
  980|    541|  parse_full_box_header(range);
  981|       |
  982|    541|  if (get_version() > 0) {
  ------------------
  |  Branch (982:7): [True: 7, False: 534]
  ------------------
  983|      7|    return unsupported_version_error("stco");
  984|      7|  }
  985|       |
  986|    534|  uint32_t entry_count = range.read32();
  987|       |
  988|       |  // Note: test against maximum number of frames (upper limit) since we have no limit on maximum number of chunks
  989|    534|  if (limits->max_sequence_frames > 0 && entry_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (989:7): [True: 534, False: 0]
  |  Branch (989:42): [True: 39, False: 495]
  ------------------
  990|     39|    return {
  991|     39|      heif_error_Invalid_input,
  992|     39|      heif_suberror_Unspecified,
  993|     39|      "Number of chunks in 'stco' box exceeds security limits of maximum number of frames."
  994|     39|    };
  995|     39|  }
  996|       |
  997|       |  // check required memory
  998|       |
  999|    495|  uint64_t mem_size = static_cast<uint64_t>(entry_count) * sizeof(uint32_t);
 1000|    495|  if (auto err = m_memory_handle.alloc(mem_size,
  ------------------
  |  Branch (1000:12): [True: 0, False: 495]
  ------------------
 1001|    495|                                       limits, "the 'stco' table")) {
 1002|      0|    return err;
 1003|      0|  }
 1004|       |
 1005|   140k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (1005:24): [True: 140k, False: 459]
  ------------------
 1006|   140k|    m_offsets.push_back(range.read32());
 1007|       |
 1008|   140k|    if (range.error()) {
  ------------------
  |  Branch (1008:9): [True: 36, False: 140k]
  ------------------
 1009|     36|      return range.get_error();
 1010|     36|    }
 1011|   140k|  }
 1012|       |
 1013|    459|  return range.get_error();
 1014|    495|}
_ZNK8Box_stco4dumpER6Indent:
 1018|    455|{
 1019|    455|  std::ostringstream sstr;
 1020|    455|  sstr << FullBox::dump(indent);
 1021|   122k|  for (size_t i = 0; i < m_offsets.size(); i++) {
  ------------------
  |  Branch (1021:22): [True: 122k, False: 455]
  ------------------
 1022|   122k|    sstr << indent << "[" << i << "] : 0x" << std::hex << m_offsets[i] << std::dec << "\n";
 1023|   122k|  }
 1024|       |
 1025|    455|  return sstr.str();
 1026|    455|}
_ZN8Box_stsz5parseER14BitstreamRangePK20heif_security_limits:
 1068|    754|{
 1069|    754|  parse_full_box_header(range);
 1070|       |
 1071|    754|  if (get_version() > 0) {
  ------------------
  |  Branch (1071:7): [True: 6, False: 748]
  ------------------
 1072|      6|    return unsupported_version_error("stsz");
 1073|      6|  }
 1074|       |
 1075|    748|  m_fixed_sample_size = range.read32();
 1076|    748|  m_sample_count = range.read32();
 1077|       |
 1078|    748|  if (limits->max_sequence_frames > 0 && m_sample_count > limits->max_sequence_frames) {
  ------------------
  |  Branch (1078:7): [True: 748, False: 0]
  |  Branch (1078:42): [True: 24, False: 724]
  ------------------
 1079|     24|    return {
 1080|     24|      heif_error_Memory_allocation_error,
 1081|     24|      heif_suberror_Security_limit_exceeded,
 1082|     24|      "Security limit for maximum number of sequence frames exceeded"
 1083|     24|    };
 1084|     24|  }
 1085|       |
 1086|    724|  if (m_fixed_sample_size == 0) {
  ------------------
  |  Branch (1086:7): [True: 365, False: 359]
  ------------------
 1087|       |    // check required memory
 1088|       |
 1089|    365|    if (auto err = m_memory_handle.alloc(m_sample_count, sizeof(uint32_t),
  ------------------
  |  Branch (1089:14): [True: 0, False: 365]
  ------------------
 1090|    365|                                         limits, "the 'stsz' table")) {
 1091|      0|      return err;
 1092|      0|    }
 1093|       |
 1094|   103k|    for (uint32_t i = 0; i < m_sample_count; i++) {
  ------------------
  |  Branch (1094:26): [True: 102k, False: 331]
  ------------------
 1095|   102k|      if (range.eof()) {
  ------------------
  |  Branch (1095:11): [True: 17, False: 102k]
  ------------------
 1096|     17|        std::stringstream sstr;
 1097|     17|        sstr << "stsz box should contain " << m_sample_count << " entries, but box only contained "
 1098|     17|            << i << " entries";
 1099|       |
 1100|     17|        return {
 1101|     17|          heif_error_Invalid_input,
 1102|     17|          heif_suberror_End_of_data,
 1103|     17|          sstr.str()
 1104|     17|        };
 1105|     17|      }
 1106|       |
 1107|   102k|      m_sample_sizes.push_back(range.read32());
 1108|       |
 1109|   102k|      if (range.error()) {
  ------------------
  |  Branch (1109:11): [True: 17, False: 102k]
  ------------------
 1110|     17|        return range.get_error();
 1111|     17|      }
 1112|   102k|    }
 1113|    365|  }
 1114|       |
 1115|    690|  return range.get_error();
 1116|    724|}
_ZNK8Box_stsz4dumpER6Indent:
 1120|    629|{
 1121|    629|  std::ostringstream sstr;
 1122|    629|  sstr << FullBox::dump(indent);
 1123|    629|  sstr << indent << "sample count: " << m_sample_count << "\n";
 1124|    629|  if (m_fixed_sample_size == 0) {
  ------------------
  |  Branch (1124:7): [True: 311, False: 318]
  ------------------
 1125|  90.2k|    for (size_t i = 0; i < m_sample_sizes.size(); i++) {
  ------------------
  |  Branch (1125:24): [True: 89.9k, False: 311]
  ------------------
 1126|  89.9k|      sstr << indent << "[" << i << "] : " << m_sample_sizes[i] << "\n";
 1127|  89.9k|    }
 1128|    311|  }
 1129|    318|  else {
 1130|    318|    sstr << indent << "fixed sample size: " << m_fixed_sample_size << "\n";
 1131|    318|  }
 1132|       |
 1133|    629|  return sstr.str();
 1134|    629|}
_ZN8Box_stss5parseER14BitstreamRangePK20heif_security_limits:
 1186|    567|{
 1187|    567|  parse_full_box_header(range);
 1188|       |
 1189|    567|  if (get_version() > 0) {
  ------------------
  |  Branch (1189:7): [True: 2, False: 565]
  ------------------
 1190|      2|    return unsupported_version_error("stss");
 1191|      2|  }
 1192|       |
 1193|    565|  uint32_t sample_count = range.read32();
 1194|       |
 1195|       |  // check required memory
 1196|       |
 1197|    565|  if (auto err = m_memory_handle.alloc(sample_count, sizeof(uint32_t),
  ------------------
  |  Branch (1197:12): [True: 59, False: 506]
  ------------------
 1198|    565|                                       limits, "the 'stss' table")) {
 1199|     59|    return err;
 1200|     59|  }
 1201|       |
 1202|   418k|  for (uint32_t i = 0; i < sample_count; i++) {
  ------------------
  |  Branch (1202:24): [True: 418k, False: 456]
  ------------------
 1203|   418k|    m_sync_samples.push_back(range.read32());
 1204|       |
 1205|   418k|    if (range.error()) {
  ------------------
  |  Branch (1205:9): [True: 50, False: 418k]
  ------------------
 1206|     50|      return range.get_error();
 1207|     50|    }
 1208|   418k|  }
 1209|       |
 1210|    456|  return range.get_error();
 1211|    506|}
_ZNK8Box_stss4dumpER6Indent:
 1215|    366|{
 1216|    366|  std::ostringstream sstr;
 1217|    366|  sstr << FullBox::dump(indent);
 1218|   186k|  for (size_t i = 0; i < m_sync_samples.size(); i++) {
  ------------------
  |  Branch (1218:22): [True: 186k, False: 366]
  ------------------
 1219|   186k|    sstr << indent << "[" << i << "] : " << m_sync_samples[i] << "\n";
 1220|   186k|  }
 1221|       |
 1222|    366|  return sstr.str();
 1223|    366|}
_ZN17VisualSampleEntry5parseER14BitstreamRangePK20heif_security_limits:
 1253|  1.17k|{
 1254|  1.17k|  (void)limits;
 1255|       |
 1256|  1.17k|  range.skip(6);
 1257|  1.17k|  data_reference_index = range.read16();
 1258|       |
 1259|  1.17k|  pre_defined = range.read16();
 1260|  1.17k|  range.skip(2);
 1261|  3.52k|  for (uint32_t& p : pre_defined2) {
  ------------------
  |  Branch (1261:20): [True: 3.52k, False: 1.17k]
  ------------------
 1262|  3.52k|    p = range.read32();
 1263|  3.52k|  }
 1264|  1.17k|  width = range.read16();
 1265|  1.17k|  height = range.read16();
 1266|  1.17k|  horizresolution = range.read32();
 1267|  1.17k|  vertresolution = range.read32();
 1268|  1.17k|  range.skip(4);
 1269|  1.17k|  frame_count = range.read16();
 1270|  1.17k|  compressorname = range.read_fixed_string(32);
 1271|  1.17k|  depth = range.read16();
 1272|  1.17k|  pre_defined3 = range.read16s();
 1273|       |
 1274|       |  // other boxes from derived specifications
 1275|       |  //std::shared_ptr<Box_clap> clap; // optional // TODO
 1276|       |  //std::shared_ptr<Box_pixi> pixi; // optional // TODO
 1277|       |
 1278|  1.17k|  return Error::Ok;
 1279|  1.17k|}
_ZNK17VisualSampleEntry4dumpER6Indent:
 1309|    624|{
 1310|    624|  std::stringstream sstr;
 1311|    624|  sstr << indent << "data reference index: " << data_reference_index << "\n"
 1312|    624|       << indent << "width: " << width << "\n"
 1313|    624|       << indent << "height: " << height << "\n"
 1314|    624|       << indent << "horiz. resolution: " << get_horizontal_resolution() << "\n"
 1315|    624|       << indent << "vert. resolution: " << get_vertical_resolution() << "\n"
 1316|    624|       << indent << "frame count: " << frame_count << "\n"
 1317|    624|       << indent << "compressorname: " << compressorname << "\n"
 1318|    624|       << indent << "depth: " << depth << "\n";
 1319|       |
 1320|    624|  return sstr.str();
 1321|    624|}
_ZNK22Box_URIMetaSampleEntry4dumpER6Indent:
 1341|  1.12k|{
 1342|  1.12k|  std::stringstream sstr;
 1343|  1.12k|  sstr << Box::dump(indent);
 1344|  1.12k|  sstr << indent << "data reference index: " << data_reference_index << "\n";
 1345|  1.12k|  sstr << dump_children(indent);
 1346|  1.12k|  return sstr.str();
 1347|  1.12k|}
_ZN22Box_URIMetaSampleEntry5parseER14BitstreamRangePK20heif_security_limits:
 1351|  1.37k|{
 1352|  1.37k|  range.skip(6);
 1353|  1.37k|  data_reference_index = range.read16();
 1354|       |
 1355|  1.37k|  Error err = read_children(range, READ_CHILDREN_ALL, limits);
 1356|  1.37k|  if (err) {
  ------------------
  |  Branch (1356:7): [True: 99, False: 1.28k]
  ------------------
 1357|     99|    return err;
 1358|     99|  }
 1359|       |
 1360|  1.28k|  return Error::Ok;
 1361|  1.37k|}
_ZN7Box_uri5parseER14BitstreamRangePK20heif_security_limits:
 1365|    827|{
 1366|    827|  parse_full_box_header(range);
 1367|       |
 1368|    827|  if (get_version() > 0) {
  ------------------
  |  Branch (1368:7): [True: 6, False: 821]
  ------------------
 1369|      6|    return unsupported_version_error("uri ");
 1370|      6|  }
 1371|       |
 1372|    821|  m_uri = range.read_string();
 1373|       |
 1374|    821|  return range.get_error();
 1375|    827|}
_ZNK7Box_uri4dumpER6Indent:
 1379|    738|{
 1380|    738|  std::ostringstream sstr;
 1381|    738|  sstr << FullBox::dump(indent);
 1382|    738|  sstr << indent << "uri: " << m_uri << "\n";
 1383|       |
 1384|    738|  return sstr.str();
 1385|    738|}
_ZN8Box_ccst5parseER14BitstreamRangePK20heif_security_limits:
 1402|    674|{
 1403|    674|  parse_full_box_header(range);
 1404|       |
 1405|    674|  if (get_version() > 0) {
  ------------------
  |  Branch (1405:7): [True: 8, False: 666]
  ------------------
 1406|      8|    return unsupported_version_error("ccst");
 1407|      8|  }
 1408|       |
 1409|    666|  uint32_t bits = range.read32();
 1410|       |
 1411|    666|  auto& constraints = m_codingConstraints;
 1412|       |
 1413|    666|  constraints.all_ref_pics_intra = (bits & 0x80000000) != 0;
 1414|    666|  constraints.intra_pred_used = (bits & 0x40000000) != 0;
 1415|    666|  constraints.max_ref_per_pic = (bits >> 26) & 0x0F;
 1416|       |
 1417|    666|  return range.get_error();
 1418|    674|}
_ZNK8Box_ccst4dumpER6Indent:
 1422|    568|{
 1423|    568|  const auto& constraints = m_codingConstraints;
 1424|       |
 1425|    568|  std::ostringstream sstr;
 1426|    568|  sstr << FullBox::dump(indent);
 1427|    568|  sstr << indent << "all ref pics intra: " << std::boolalpha <<constraints.all_ref_pics_intra << "\n"
 1428|    568|       << indent << "intra pred used: " << constraints.intra_pred_used << "\n"
 1429|    568|       << indent << "max ref per pic: " << ((int) constraints.max_ref_per_pic) << "\n";
 1430|       |
 1431|    568|  return sstr.str();
 1432|    568|}
_ZN8Box_auxi5parseER14BitstreamRangePK20heif_security_limits:
 1462|    743|{
 1463|    743|  parse_full_box_header(range);
 1464|       |
 1465|    743|  if (get_version() > 0) {
  ------------------
  |  Branch (1465:7): [True: 5, False: 738]
  ------------------
 1466|      5|    return unsupported_version_error("auxi");
 1467|      5|  }
 1468|       |
 1469|    738|  m_aux_track_type = range.read_string();
 1470|       |
 1471|    738|  return range.get_error();
 1472|    743|}
_ZNK8Box_auxi4dumpER6Indent:
 1476|    696|{
 1477|    696|  std::ostringstream sstr;
 1478|    696|  sstr << FullBox::dump(indent);
 1479|    696|  sstr << indent << "aux track info type: " << m_aux_track_type << "\n";
 1480|       |
 1481|    696|  return sstr.str();
 1482|    696|}
_ZNK21Box_VisualSampleEntry4dumpER6Indent:
 1515|    624|{
 1516|    624|  std::stringstream sstr;
 1517|    624|  sstr << Box::dump(indent);
 1518|    624|  sstr << m_visualSampleEntry.dump(indent);
 1519|    624|  sstr << dump_children(indent);
 1520|    624|  return sstr.str();
 1521|    624|}
_ZN21Box_VisualSampleEntry5parseER14BitstreamRangePK20heif_security_limits:
 1525|  1.17k|{
 1526|  1.17k|  auto err = m_visualSampleEntry.parse(range, limits);
 1527|  1.17k|  if (err) {
  ------------------
  |  Branch (1527:7): [True: 0, False: 1.17k]
  ------------------
 1528|      0|    return err;
 1529|      0|  }
 1530|       |
 1531|  1.17k|  err = read_children(range, READ_CHILDREN_ALL, limits);
 1532|  1.17k|  if (err) {
  ------------------
  |  Branch (1532:7): [True: 502, False: 672]
  ------------------
 1533|    502|    return err;
 1534|    502|  }
 1535|       |
 1536|    672|  return Error::Ok;
 1537|  1.17k|}
_ZNK8Box_sbgp4dumpER6Indent:
 1541|  1.40k|{
 1542|  1.40k|  std::stringstream sstr;
 1543|  1.40k|  sstr << FullBox::dump(indent);
 1544|  1.40k|  sstr << indent << "grouping_type: " << fourcc_to_string(m_grouping_type) << "\n";
 1545|       |
 1546|  1.40k|  if (m_grouping_type_parameter) {
  ------------------
  |  Branch (1546:7): [True: 1.27k, False: 130]
  ------------------
 1547|  1.27k|    sstr << indent << "grouping_type_parameter: " << *m_grouping_type_parameter << "\n";
 1548|  1.27k|  }
 1549|       |
 1550|  1.40k|  uint32_t total_samples = 0;
 1551|  24.4k|  for (size_t i = 0; i < m_entries.size(); i++) {
  ------------------
  |  Branch (1551:22): [True: 23.0k, False: 1.40k]
  ------------------
 1552|  23.0k|    sstr << indent << "[" << std::setw(2) << (i + 1) << "] : " << std::setw(3) << m_entries[i].sample_count << "x " << m_entries[i].group_description_index << "\n";
 1553|  23.0k|    total_samples += m_entries[i].sample_count;
 1554|  23.0k|  }
 1555|  1.40k|  sstr << indent << "total samples: " << total_samples << "\n";
 1556|       |
 1557|  1.40k|  return sstr.str();
 1558|  1.40k|}
_ZN8Box_sbgp5parseER14BitstreamRangePK20heif_security_limits:
 1600|  1.52k|{
 1601|  1.52k|  parse_full_box_header(range);
 1602|       |
 1603|  1.52k|  if (get_version() > 1) {
  ------------------
  |  Branch (1603:7): [True: 5, False: 1.51k]
  ------------------
 1604|      5|    return unsupported_version_error("sbgp");
 1605|      5|  }
 1606|       |
 1607|  1.51k|  m_grouping_type = range.read32();
 1608|       |
 1609|  1.51k|  if (get_version() == 1) {
  ------------------
  |  Branch (1609:7): [True: 1.32k, False: 189]
  ------------------
 1610|  1.32k|    m_grouping_type_parameter = range.read32();
 1611|  1.32k|  }
 1612|       |
 1613|  1.51k|  uint32_t count = range.read32();
 1614|  1.51k|  if (auto err = m_memory_handle.alloc(count, sizeof(Entry),
  ------------------
  |  Branch (1614:12): [True: 7, False: 1.51k]
  ------------------
 1615|  1.51k|                                       limits, "the 'sample to group' table")) {
 1616|      7|    return err;
 1617|      7|  }
 1618|       |
 1619|   156k|  for (uint32_t i = 0; i < count; i++) {
  ------------------
  |  Branch (1619:24): [True: 155k, False: 1.45k]
  ------------------
 1620|   155k|    Entry e{};
 1621|   155k|    e.sample_count = range.read32();
 1622|   155k|    e.group_description_index = range.read32();
 1623|   155k|    m_entries.push_back(e);
 1624|   155k|    if (range.error()) {
  ------------------
  |  Branch (1624:9): [True: 53, False: 155k]
  ------------------
 1625|     53|      return range.get_error();
 1626|     53|    }
 1627|   155k|  }
 1628|       |
 1629|  1.45k|  return range.get_error();
 1630|  1.51k|}
_ZNK21SampleGroupEntry_refs4dumpEv:
 1634|   174k|{
 1635|   174k|  std::stringstream sstr;
 1636|   174k|  if (m_sample_id==0) {
  ------------------
  |  Branch (1636:7): [True: 171k, False: 3.22k]
  ------------------
 1637|   171k|    sstr << "0 (non-ref) refs =";
 1638|   171k|  }
 1639|  3.22k|  else {
 1640|  3.22k|    sstr << m_sample_id << " refs =";
 1641|  3.22k|  }
 1642|   287k|  for (uint32_t ref : m_direct_reference_sample_id) {
  ------------------
  |  Branch (1642:21): [True: 287k, False: 174k]
  ------------------
 1643|   287k|    sstr << ' ' << ref;
 1644|   287k|  }
 1645|       |
 1646|   174k|  return sstr.str();
 1647|   174k|}
_ZN21SampleGroupEntry_refs5parseER14BitstreamRangePK20heif_security_limits:
 1655|   174k|{
 1656|   174k|  m_sample_id = range.read32();
 1657|   174k|  uint8_t cnt = range.read8();
 1658|   462k|  for (uint8_t i = 0; i < cnt; i++) {
  ------------------
  |  Branch (1658:23): [True: 287k, False: 174k]
  ------------------
 1659|   287k|    m_direct_reference_sample_id.push_back(range.read32());
 1660|   287k|  }
 1661|       |
 1662|   174k|  return Error::Ok;
 1663|   174k|}
_ZNK8Box_sgpd4dumpER6Indent:
 1684|  1.38k|{
 1685|  1.38k|  std::stringstream sstr;
 1686|  1.38k|  sstr << FullBox::dump(indent);
 1687|       |
 1688|  1.38k|  sstr << indent << "grouping_type: " << fourcc_to_string(m_grouping_type) << "\n";
 1689|  1.38k|  if (m_default_length) {
  ------------------
  |  Branch (1689:7): [True: 458, False: 927]
  ------------------
 1690|    458|    sstr << indent << "default_length: " << *m_default_length << "\n";
 1691|    458|  }
 1692|  1.38k|  if (m_default_sample_description_index) {
  ------------------
  |  Branch (1692:7): [True: 381, False: 1.00k]
  ------------------
 1693|    381|    sstr << indent << "default_sample_description_index: " << *m_default_sample_description_index << "\n";
 1694|    381|  }
 1695|       |
 1696|   175k|  for (size_t i=0; i<m_entries.size(); i++) {
  ------------------
  |  Branch (1696:20): [True: 174k, False: 1.38k]
  ------------------
 1697|   174k|    sstr << indent << "[" << (i+1) << "] : ";
 1698|   174k|    if (m_entries[i].sample_group_entry) {
  ------------------
  |  Branch (1698:9): [True: 174k, False: 0]
  ------------------
 1699|   174k|      sstr << m_entries[i].sample_group_entry->dump() << "\n";
 1700|   174k|    }
 1701|      0|    else {
 1702|      0|      sstr << "empty (description_length=" << m_entries[i].description_length << ")\n";
 1703|      0|    }
 1704|   174k|  }
 1705|       |
 1706|  1.38k|  return sstr.str();
 1707|  1.38k|}
_ZN8Box_sgpd5parseER14BitstreamRangePK20heif_security_limits:
 1717|  1.43k|{
 1718|  1.43k|  parse_full_box_header(range);
 1719|       |
 1720|  1.43k|  m_grouping_type = range.read32();
 1721|       |
 1722|       |  // Readers are expected to ignore sgpd boxes with grouping_types they don't
 1723|       |  // understand. Skip parsing of unknown types to avoid allocating Entry objects
 1724|       |  // for entries whose payload we wouldn't read anyway (and which, with
 1725|       |  // version==1 + default_length!=0 or version>=2, would consume zero bytes per
 1726|       |  // iteration and allow unbounded allocation from a tiny box).
 1727|  1.43k|  if (m_grouping_type != fourcc("refs")) {
  ------------------
  |  Branch (1727:7): [True: 451, False: 984]
  ------------------
 1728|    451|    return Error::Ok;
 1729|    451|  }
 1730|       |
 1731|    984|  if (get_version() == 1) {
  ------------------
  |  Branch (1731:7): [True: 470, False: 514]
  ------------------
 1732|    470|    m_default_length = range.read32();
 1733|    470|  }
 1734|       |
 1735|    984|  if (get_version() >= 2) {
  ------------------
  |  Branch (1735:7): [True: 386, False: 598]
  ------------------
 1736|    386|    m_default_sample_description_index = range.read32();
 1737|    386|  }
 1738|       |
 1739|    984|  uint32_t entry_count = range.read32();
 1740|       |
 1741|    984|  if (limits->max_sample_group_description_box_entries &&
  ------------------
  |  Branch (1741:7): [True: 984, False: 0]
  ------------------
 1742|    984|      entry_count > limits->max_sample_group_description_box_entries) {
  ------------------
  |  Branch (1742:7): [True: 50, False: 934]
  ------------------
 1743|     50|    std::stringstream sstr;
 1744|     50|    sstr << "Allocating " << static_cast<uint64_t>(entry_count) << " sample group description items exceeds the security limit of "
 1745|     50|         << limits->max_sample_group_description_box_entries << " items";
 1746|       |
 1747|     50|    return {heif_error_Memory_allocation_error,
 1748|     50|            heif_suberror_Security_limit_exceeded,
 1749|     50|            sstr.str()};
 1750|       |
 1751|     50|  }
 1752|       |
 1753|    934|  if (auto err = m_memory_handle.alloc(entry_count, sizeof(Entry),
  ------------------
  |  Branch (1753:12): [True: 0, False: 934]
  ------------------
 1754|    934|                                       limits, "the 'sgpd' table")) {
 1755|      0|    return err;
 1756|      0|  }
 1757|       |
 1758|   175k|  for (uint32_t i = 0; i < entry_count; i++) {
  ------------------
  |  Branch (1758:24): [True: 174k, False: 934]
  ------------------
 1759|   174k|    Entry entry;
 1760|       |
 1761|   174k|    if (get_version() == 1) {
  ------------------
  |  Branch (1761:9): [True: 46.7k, False: 127k]
  ------------------
 1762|  46.7k|      if (*m_default_length == 0) {
  ------------------
  |  Branch (1762:11): [True: 1.16k, False: 45.6k]
  ------------------
 1763|  1.16k|        entry.description_length = range.read32();
 1764|  1.16k|      }
 1765|  46.7k|    }
 1766|       |
 1767|   174k|    switch (m_grouping_type) {
 1768|   174k|      case fourcc("refs"): {
  ------------------
  |  Branch (1768:7): [True: 174k, False: 0]
  ------------------
 1769|   174k|        entry.sample_group_entry = std::make_shared<SampleGroupEntry_refs>();
 1770|   174k|        Error err = entry.sample_group_entry->parse(range, limits);
 1771|   174k|        if (err) {
  ------------------
  |  Branch (1771:13): [True: 0, False: 174k]
  ------------------
 1772|      0|          return err;
 1773|      0|        }
 1774|       |
 1775|   174k|        break;
 1776|   174k|      }
 1777|       |
 1778|   174k|      default:
  ------------------
  |  Branch (1778:7): [True: 0, False: 174k]
  ------------------
 1779|      0|        break;
 1780|   174k|    }
 1781|       |
 1782|   174k|    m_entries.emplace_back(std::move(entry));
 1783|   174k|  }
 1784|       |
 1785|    934|  return Error::Ok;
 1786|    934|}
_ZNK8Box_btrt4dumpER6Indent:
 1790|    773|{
 1791|    773|  std::stringstream sstr;
 1792|    773|  sstr << FullBox::dump(indent);
 1793|       |
 1794|    773|  sstr << indent << "bufferSizeDB: " << m_bufferSizeDB << " bytes\n";
 1795|    773|  sstr << indent << "max bitrate: " << m_maxBitrate << " bits/sec\n";
 1796|    773|  sstr << indent << "avg bitrate: " << m_avgBitrate << " bits/sec\n";
 1797|       |
 1798|    773|  return sstr.str();
 1799|    773|}
_ZN8Box_btrt5parseER14BitstreamRangePK20heif_security_limits:
 1817|    789|{
 1818|    789|  m_bufferSizeDB = range.read32();
 1819|    789|  m_maxBitrate = range.read32();
 1820|    789|  m_avgBitrate = range.read32();
 1821|       |
 1822|    789|  return Error::Ok;
 1823|    789|}
_ZNK8Box_saiz4dumpER6Indent:
 1888|  1.19k|{
 1889|  1.19k|  std::stringstream sstr;
 1890|  1.19k|  sstr << FullBox::dump(indent);
 1891|       |
 1892|  1.19k|  sstr << indent << "aux_info_type: ";
 1893|  1.19k|  if (m_aux_info_type == 0) {
  ------------------
  |  Branch (1893:7): [True: 584, False: 615]
  ------------------
 1894|    584|    sstr << "0\n";
 1895|    584|  }
 1896|    615|  else {
 1897|    615|    sstr << fourcc_to_string(m_aux_info_type) << "\n";
 1898|    615|  }
 1899|       |
 1900|  1.19k|  sstr << indent << "aux_info_type_parameter: ";
 1901|  1.19k|  if (m_aux_info_type_parameter == 0) {
  ------------------
  |  Branch (1901:7): [True: 584, False: 615]
  ------------------
 1902|    584|    sstr << "0\n";
 1903|    584|  }
 1904|    615|  else {
 1905|    615|    sstr << fourcc_to_string(m_aux_info_type_parameter) << "\n";
 1906|    615|  }
 1907|       |
 1908|  1.19k|  sstr << indent << "default sample size: ";
 1909|  1.19k|  if (m_default_sample_info_size == 0) {
  ------------------
  |  Branch (1909:7): [True: 761, False: 438]
  ------------------
 1910|    761|    sstr << "0 (variable)\n";
 1911|    761|  }
 1912|    438|  else {
 1913|    438|    sstr << ((int)m_default_sample_info_size) << "\n";
 1914|    438|  }
 1915|       |
 1916|  1.19k|  if (m_default_sample_info_size == 0) {
  ------------------
  |  Branch (1916:7): [True: 761, False: 438]
  ------------------
 1917|   323k|    for (size_t i = 0; i < m_sample_sizes.size(); i++) {
  ------------------
  |  Branch (1917:24): [True: 322k, False: 761]
  ------------------
 1918|   322k|      sstr << indent << "[" << i << "] : " << ((int) m_sample_sizes[i]) << "\n";
 1919|   322k|    }
 1920|    761|  }
 1921|       |
 1922|  1.19k|  return sstr.str();
 1923|  1.19k|}
_ZN8Box_saiz5parseER14BitstreamRangePK20heif_security_limits:
 1962|  1.44k|{
 1963|  1.44k|  parse_full_box_header(range);
 1964|       |
 1965|  1.44k|  if (get_flags() & 1) {
  ------------------
  |  Branch (1965:7): [True: 636, False: 813]
  ------------------
 1966|    636|    m_aux_info_type = range.read32();
 1967|    636|    m_aux_info_type_parameter = range.read32();
 1968|    636|  }
 1969|       |
 1970|  1.44k|  m_default_sample_info_size = range.read8();
 1971|  1.44k|  m_num_samples = range.read32();
 1972|       |
 1973|  1.44k|  if (limits && limits->max_sequence_frames > 0 && m_num_samples > limits->max_sequence_frames) {
  ------------------
  |  Branch (1973:7): [True: 1.44k, False: 0]
  |  Branch (1973:17): [True: 1.44k, False: 0]
  |  Branch (1973:52): [True: 41, False: 1.40k]
  ------------------
 1974|     41|    return {
 1975|     41|      heif_error_Memory_allocation_error,
 1976|     41|      heif_suberror_Security_limit_exceeded,
 1977|     41|      "Number of 'saiz' samples exceeds the maximum number of sequence frames."
 1978|     41|    };
 1979|     41|  }
 1980|       |
 1981|  1.40k|  if (m_default_sample_info_size == 0) {
  ------------------
  |  Branch (1981:7): [True: 964, False: 444]
  ------------------
 1982|       |    // check required memory
 1983|       |
 1984|    964|    uint64_t mem_size = m_num_samples;
 1985|    964|    if (auto err = m_memory_handle.alloc(mem_size, limits, "the 'sample aux info sizes' (saiz) table")) {
  ------------------
  |  Branch (1985:14): [True: 0, False: 964]
  ------------------
 1986|      0|      return err;
 1987|      0|    }
 1988|       |
 1989|       |    // read whole table at once
 1990|       |
 1991|    964|    m_sample_sizes.resize(m_num_samples);
 1992|    964|    range.read(m_sample_sizes.data(), m_num_samples);
 1993|    964|  }
 1994|       |
 1995|  1.40k|  return range.get_error();
 1996|  1.40k|}
_ZNK8Box_saio4dumpER6Indent:
 2033|  1.55k|{
 2034|  1.55k|  std::stringstream sstr;
 2035|  1.55k|  sstr << FullBox::dump(indent);
 2036|       |
 2037|  1.55k|  sstr << indent << "aux_info_type: ";
 2038|  1.55k|  if (m_aux_info_type == 0) {
  ------------------
  |  Branch (2038:7): [True: 1.12k, False: 435]
  ------------------
 2039|  1.12k|    sstr << "0\n";
 2040|  1.12k|  }
 2041|    435|  else {
 2042|    435|    sstr << fourcc_to_string(m_aux_info_type) << "\n";
 2043|    435|  }
 2044|       |
 2045|  1.55k|  sstr << indent << "aux_info_type_parameter: ";
 2046|  1.55k|  if (m_aux_info_type_parameter == 0) {
  ------------------
  |  Branch (2046:7): [True: 1.09k, False: 466]
  ------------------
 2047|  1.09k|    sstr << "0\n";
 2048|  1.09k|  }
 2049|    466|  else {
 2050|    466|    sstr << fourcc_to_string(m_aux_info_type_parameter) << "\n";
 2051|    466|  }
 2052|       |
 2053|   201k|  for (size_t i = 0; i < m_chunk_offset.size(); i++) {
  ------------------
  |  Branch (2053:22): [True: 199k, False: 1.55k]
  ------------------
 2054|   199k|    sstr << indent << "[" << i << "] : 0x" << std::hex << m_chunk_offset[i] << "\n";
 2055|   199k|  }
 2056|       |
 2057|  1.55k|  return sstr.str();
 2058|  1.55k|}
_ZN8Box_saio5parseER14BitstreamRangePK20heif_security_limits:
 2114|  1.74k|{
 2115|  1.74k|  parse_full_box_header(range);
 2116|       |
 2117|  1.74k|  if (get_flags() & 1) {
  ------------------
  |  Branch (2117:7): [True: 699, False: 1.04k]
  ------------------
 2118|    699|    m_aux_info_type = range.read32();
 2119|    699|    m_aux_info_type_parameter = range.read32();
 2120|    699|  }
 2121|       |
 2122|  1.74k|  uint32_t num_chunks = range.read32();
 2123|       |
 2124|       |  // We have no explicit maximum on the number of chunks.
 2125|       |  // Use the maximum number of frames as an upper limit.
 2126|  1.74k|  if (limits && limits->max_sequence_frames > 0 && num_chunks > limits->max_sequence_frames) {
  ------------------
  |  Branch (2126:7): [True: 1.74k, False: 0]
  |  Branch (2126:17): [True: 1.74k, False: 0]
  |  Branch (2126:52): [True: 40, False: 1.70k]
  ------------------
 2127|     40|    return {
 2128|     40|      heif_error_Memory_allocation_error,
 2129|     40|      heif_suberror_Security_limit_exceeded,
 2130|     40|      "Number of 'saio' chunks exceeds the maximum number of sequence frames."
 2131|     40|    };
 2132|     40|  }
 2133|       |
 2134|  1.70k|  if (auto err = m_memory_handle.alloc(num_chunks, sizeof(uint64_t),
  ------------------
  |  Branch (2134:12): [True: 0, False: 1.70k]
  ------------------
 2135|  1.70k|                                       limits, "the 'saio' table")) {
 2136|      0|    return err;
 2137|      0|  }
 2138|       |
 2139|  1.70k|  m_chunk_offset.resize(num_chunks);
 2140|       |
 2141|   202k|  for (uint32_t i = 0; i < num_chunks; i++) {
  ------------------
  |  Branch (2141:24): [True: 200k, False: 1.65k]
  ------------------
 2142|   200k|    uint64_t offset;
 2143|   200k|    if (get_version() == 1) {
  ------------------
  |  Branch (2143:9): [True: 424, False: 200k]
  ------------------
 2144|    424|      offset = range.read64();
 2145|    424|    }
 2146|   200k|    else {
 2147|   200k|      offset = range.read32();
 2148|   200k|    }
 2149|       |
 2150|   200k|    m_chunk_offset[i] = offset;
 2151|       |
 2152|   200k|    if (range.error()) {
  ------------------
  |  Branch (2152:9): [True: 50, False: 200k]
  ------------------
 2153|     50|      return range.get_error();
 2154|     50|    }
 2155|   200k|  }
 2156|       |
 2157|  1.65k|  return Error::Ok;
 2158|  1.70k|}
_ZNK8Box_sdtp4dumpER6Indent:
 2162|    563|{
 2163|    563|  std::stringstream sstr;
 2164|    563|  sstr << FullBox::dump(indent);
 2165|       |
 2166|    563|  assert(m_sample_information.size() <= UINT32_MAX);
  ------------------
  |  Branch (2166:3): [True: 563, False: 0]
  ------------------
 2167|       |
 2168|  5.73M|  for (uint32_t i = 0; i < static_cast<uint32_t>(m_sample_information.size()); i++) {
  ------------------
  |  Branch (2168:24): [True: 5.73M, False: 563]
  ------------------
 2169|  5.73M|    const char* spaces = "            ";
 2170|  5.73M|    int nSpaces = 6;
 2171|  5.73M|    int k = i;
 2172|  30.8M|    while (k >= 10 && nSpaces < 12) {
  ------------------
  |  Branch (2172:12): [True: 25.1M, False: 5.73M]
  |  Branch (2172:23): [True: 25.1M, False: 0]
  ------------------
 2173|  25.1M|      k /= 10;
 2174|  25.1M|      nSpaces++;
 2175|  25.1M|    }
 2176|       |
 2177|  5.73M|    spaces = spaces + 12 - nSpaces;
 2178|       |
 2179|  5.73M|    sstr << indent << "[" << i << "] : is_leading=" << (int) get_is_leading(i) << "\n"
 2180|  5.73M|        << indent << spaces << "depends_on=" << (int) get_depends_on(i) << "\n"
 2181|  5.73M|        << indent << spaces << "is_depended_on=" << (int) get_is_depended_on(i) << "\n"
 2182|  5.73M|        << indent << spaces << "has_redundancy=" << (int) get_has_redundancy(i) << "\n";
 2183|  5.73M|  }
 2184|       |
 2185|    563|  return sstr.str();
 2186|    563|}
_ZN8Box_sdtp5parseER14BitstreamRangePK20heif_security_limits:
 2190|    563|{
 2191|    563|  parse_full_box_header(range);
 2192|       |
 2193|       |  // We have no easy way to get the number of samples from 'saiz' or 'stz2' as specified
 2194|       |  // in the standard. Instead, we read until the end of the box.
 2195|    563|  size_t nSamples = range.get_remaining_bytes();
 2196|       |
 2197|    563|  m_sample_information.resize(nSamples);
 2198|    563|  range.read(m_sample_information.data(), nSamples);
 2199|       |
 2200|    563|  return Error::Ok;
 2201|    563|}
_ZN8Box_tref5parseER14BitstreamRangePK20heif_security_limits:
 2205|  1.22k|{
 2206|  3.54k|  while (!range.eof()) {
  ------------------
  |  Branch (2206:10): [True: 2.46k, False: 1.07k]
  ------------------
 2207|  2.46k|    BoxHeader header;
 2208|  2.46k|    Error err = header.parse_header(range);
 2209|  2.46k|    if (err != Error::Ok) {
  ------------------
  |  Branch (2209:9): [True: 7, False: 2.45k]
  ------------------
 2210|      7|      return err;
 2211|      7|    }
 2212|       |
 2213|  2.45k|    if (header.get_box_size() < header.get_header_size()) {
  ------------------
  |  Branch (2213:9): [True: 3, False: 2.45k]
  ------------------
 2214|      3|      return {heif_error_Invalid_input,
 2215|      3|              heif_suberror_Unspecified,
 2216|      3|              "Invalid box size (smaller than header)"};
 2217|      3|    }
 2218|       |
 2219|  2.45k|    uint64_t dataSize = (header.get_box_size() - header.get_header_size());
 2220|       |
 2221|  2.45k|    if (dataSize % 4 != 0 || dataSize < 4) {
  ------------------
  |  Branch (2221:9): [True: 22, False: 2.43k]
  |  Branch (2221:30): [True: 3, False: 2.43k]
  ------------------
 2222|     25|      return {heif_error_Invalid_input,
 2223|     25|              heif_suberror_Unspecified,
 2224|     25|              "Input file has a 'tref' TrackReferenceTypeBox with invalid size."};
 2225|     25|    }
 2226|       |
 2227|  2.43k|    uint64_t nRefs = dataSize / 4;
 2228|       |
 2229|  2.43k|    if (limits->max_items && nRefs > limits->max_items) {
  ------------------
  |  Branch (2229:9): [True: 2.43k, False: 0]
  |  Branch (2229:30): [True: 96, False: 2.33k]
  ------------------
 2230|     96|      std::stringstream sstr;
 2231|     96|      sstr << "Number of references in tref box (" << nRefs << ") exceeds the security limits of " << limits->max_items << " references.";
 2232|       |
 2233|     96|      return {heif_error_Invalid_input,
 2234|     96|              heif_suberror_Security_limit_exceeded,
 2235|     96|              sstr.str()};
 2236|     96|    }
 2237|       |
 2238|  2.33k|    Reference ref;
 2239|  2.33k|    ref.reference_type = header.get_short_type();
 2240|       |
 2241|  14.0k|    for (uint64_t i = 0; i < nRefs; i++) {
  ------------------
  |  Branch (2241:26): [True: 11.7k, False: 2.31k]
  ------------------
 2242|  11.7k|      if (range.eof()) {
  ------------------
  |  Branch (2242:11): [True: 22, False: 11.7k]
  ------------------
 2243|     22|        std::stringstream sstr;
 2244|     22|        sstr << "tref box should contain " << nRefs << " references, but we can only read " << i << " references.";
 2245|       |
 2246|     22|        return {heif_error_Invalid_input,
 2247|     22|                heif_suberror_End_of_data,
 2248|     22|                sstr.str()};
 2249|     22|      }
 2250|       |
 2251|  11.7k|      ref.to_track_id.push_back(static_cast<uint32_t>(range.read32()));
 2252|  11.7k|    }
 2253|       |
 2254|  2.31k|    m_references.push_back(ref);
 2255|  2.31k|  }
 2256|       |
 2257|       |
 2258|       |  // --- check for duplicate references
 2259|       |
 2260|  1.07k|  if (auto error = check_for_double_references()) {
  ------------------
  |  Branch (2260:12): [True: 19, False: 1.05k]
  ------------------
 2261|     19|    return error;
 2262|     19|  }
 2263|       |
 2264|  1.05k|  return range.get_error();
 2265|  1.07k|}
_ZNK8Box_tref27check_for_double_referencesEv:
 2269|  1.07k|{
 2270|  2.28k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (2270:24): [True: 2.28k, False: 1.05k]
  ------------------
 2271|  2.28k|    std::set<uint32_t> to_ids;
 2272|  9.29k|    for (const auto to_id : ref.to_track_id) {
  ------------------
  |  Branch (2272:27): [True: 9.29k, False: 2.26k]
  ------------------
 2273|  9.29k|      if (to_ids.find(to_id) == to_ids.end()) {
  ------------------
  |  Branch (2273:11): [True: 9.27k, False: 19]
  ------------------
 2274|  9.27k|        to_ids.insert(to_id);
 2275|  9.27k|      }
 2276|     19|      else {
 2277|     19|        return {heif_error_Invalid_input,
 2278|     19|                heif_suberror_Unspecified,
 2279|     19|                "'tref' has double references"};
 2280|     19|      }
 2281|  9.29k|    }
 2282|  2.28k|  }
 2283|       |
 2284|  1.05k|  return Error::Ok;
 2285|  1.07k|}
_ZNK8Box_tref4dumpER6Indent:
 2315|    850|{
 2316|    850|  std::ostringstream sstr;
 2317|    850|  sstr << Box::dump(indent);
 2318|       |
 2319|  1.69k|  for (const auto& ref : m_references) {
  ------------------
  |  Branch (2319:24): [True: 1.69k, False: 850]
  ------------------
 2320|  1.69k|    sstr << indent << "reference with type '" << fourcc_to_string(ref.reference_type) << "'"
 2321|  1.69k|         << " to track IDs: ";
 2322|  7.34k|    for (uint32_t id : ref.to_track_id) {
  ------------------
  |  Branch (2322:22): [True: 7.34k, False: 1.69k]
  ------------------
 2323|  7.34k|      sstr << id << " ";
 2324|  7.34k|    }
 2325|  1.69k|    sstr << "\n";
 2326|  1.69k|  }
 2327|       |
 2328|    850|  return sstr.str();
 2329|    850|}
_ZN8Box_elst5parseER14BitstreamRangePK20heif_security_limits:
 2386|  1.02k|{
 2387|  1.02k|  Error err = parse_full_box_header(range);
 2388|  1.02k|  if (err != Error::Ok) {
  ------------------
  |  Branch (2388:7): [True: 2, False: 1.02k]
  ------------------
 2389|      2|    return err;
 2390|      2|  }
 2391|       |
 2392|  1.02k|  if (get_version() > 1) {
  ------------------
  |  Branch (2392:7): [True: 8, False: 1.01k]
  ------------------
 2393|      8|    return unsupported_version_error("edts");
 2394|      8|  }
 2395|       |
 2396|  1.01k|  uint32_t nEntries = range.read32();
 2397|  1.01k|  m_entries.clear();
 2398|       |
 2399|   272k|  for (uint64_t i = 0; i < nEntries; i++) {
  ------------------
  |  Branch (2399:24): [True: 272k, False: 934]
  ------------------
 2400|   272k|    if (range.eof()) {
  ------------------
  |  Branch (2400:9): [True: 79, False: 271k]
  ------------------
 2401|     79|      std::stringstream sstr;
 2402|     79|      sstr << "edts box should contain " << nEntries << " entries, but we can only read " << i << " entries.";
 2403|       |
 2404|     79|      return {heif_error_Invalid_input,
 2405|     79|              heif_suberror_End_of_data,
 2406|     79|              sstr.str()};
 2407|     79|    }
 2408|       |
 2409|   271k|    Entry entry{};
 2410|   271k|    if (get_version() == 1) {
  ------------------
  |  Branch (2410:9): [True: 1.35k, False: 270k]
  ------------------
 2411|  1.35k|      entry.segment_duration = range.read64();
 2412|  1.35k|      entry.media_time = range.read64s();
 2413|  1.35k|    }
 2414|   270k|    else {
 2415|   270k|      entry.segment_duration = range.read32();
 2416|   270k|      entry.media_time = range.read32s();
 2417|   270k|    }
 2418|       |
 2419|   271k|    entry.media_rate_integer = range.read16s();
 2420|   271k|    entry.media_rate_fraction = range.read16s();
 2421|       |
 2422|   271k|    m_entries.push_back(entry);
 2423|   271k|  }
 2424|       |
 2425|    934|  return range.get_error();
 2426|  1.01k|}
_ZNK8Box_elst4dumpER6Indent:
 2466|    823|{
 2467|    823|  std::ostringstream sstr;
 2468|    823|  sstr << FullBox::dump(indent);
 2469|       |
 2470|    823|  sstr << indent << "repeat list: " << ((get_flags() & Flags::Repeat_EditList) ? "yes" : "no") << "\n";
  ------------------
  |  Branch (2470:41): [True: 294, False: 529]
  ------------------
 2471|       |
 2472|  60.9k|  for (const auto& entry : m_entries) {
  ------------------
  |  Branch (2472:26): [True: 60.9k, False: 823]
  ------------------
 2473|  60.9k|    sstr << indent << "segment duration: " << entry.segment_duration << "\n";
 2474|  60.9k|    sstr << indent << "media time: " << entry.media_time << "\n";
 2475|  60.9k|    sstr << indent << "media rate integer: " << entry.media_rate_integer << "\n";
 2476|  60.9k|    sstr << indent << "media rate fraction: " << entry.media_rate_fraction << "\n";
 2477|  60.9k|  }
 2478|       |
 2479|    823|  return sstr.str();
 2480|    823|}

_ZN13Box_containerC2EPKc:
   36|  2.16k|  {
   37|  2.16k|    set_short_type(fourcc(type));
   38|  2.16k|  }
_ZN8Box_moovC2Ev:
   50|    419|  Box_moov() : Box_container("moov") {}
_ZNK8Box_moov14debug_box_nameEv:
   52|    376|  const char* debug_box_name() const override { return "Movie"; }
_ZN8Box_mvhdC2Ev:
   60|  1.15k|  {
   61|  1.15k|    set_short_type(fourcc("mvhd"));
   62|  1.15k|  }
_ZNK8Box_mvhd14debug_box_nameEv:
   66|  1.04k|  const char* debug_box_name() const override { return "Movie Header"; }
_ZNK8Box_mvhd8get_rateEv:
   72|  1.04k|  double get_rate() const { return m_rate / double(0x10000); }
_ZNK8Box_mvhd10get_volumeEv:
   74|  1.04k|  float get_volume() const { return float(m_volume) / float(0x100); }
_ZN8Box_trakC2Ev:
  120|    519|  Box_trak() : Box_container("trak") {}
_ZNK8Box_trak14debug_box_nameEv:
  122|    517|  const char* debug_box_name() const override { return "Track"; }
_ZN8Box_tkhdC2Ev:
  130|  1.35k|  {
  131|  1.35k|    set_short_type(fourcc("tkhd"));
  132|       |
  133|       |    // set default flags according to ISO 14496-12
  134|  1.35k|    set_flags(Track_enabled | Track_in_movie | Track_in_preview);
  135|  1.35k|  }
_ZNK8Box_tkhd14debug_box_nameEv:
  146|  1.20k|  const char* debug_box_name() const override { return "Track Header"; }
_ZNK8Box_tkhd10get_volumeEv:
  152|  1.20k|  float get_volume() const { return float(m_volume) / float(0x100); }
_ZNK8Box_tkhd9get_widthEv:
  156|  1.20k|  double get_width() const { return float(m_width) / double(0x10000); }
_ZNK8Box_tkhd10get_heightEv:
  158|  1.20k|  double get_height() const { return float(m_height) / double(0x10000); }
_ZN8Box_mdiaC2Ev:
  197|     77|  Box_mdia() : Box_container("mdia") {}
_ZNK8Box_mdia14debug_box_nameEv:
  199|     75|  const char* debug_box_name() const override { return "Media"; }
_ZN8Box_mdhdC2Ev:
  207|  1.04k|  {
  208|  1.04k|    set_short_type(fourcc("mdhd"));
  209|  1.04k|  }
_ZNK8Box_mdhd14debug_box_nameEv:
  213|    929|  const char* debug_box_name() const override { return "Media Header"; }
_ZN8Box_minfC2Ev:
  245|    293|  Box_minf() : Box_container("minf") {}
_ZNK8Box_minf14debug_box_nameEv:
  247|    259|  const char* debug_box_name() const override { return "Media Information"; }
_ZN8Box_vmhdC2Ev:
  255|    762|  {
  256|    762|    set_short_type(fourcc("vmhd"));
  257|    762|    set_flags(1);
  258|    762|  }
_ZNK8Box_vmhd14debug_box_nameEv:
  262|    650|  const char* debug_box_name() const override { return "Video Media Header"; }
_ZN8Box_nmhdC2Ev:
  279|    453|  {
  280|    453|    set_short_type(fourcc("nmhd"));
  281|    453|    set_flags(1);
  282|    453|  }
_ZNK8Box_nmhd14debug_box_nameEv:
  286|    402|  const char* debug_box_name() const override { return "Null Media Header"; }
_ZN8Box_stblC2Ev:
  298|    521|  Box_stbl() : Box_container("stbl") {}
_ZNK8Box_stbl14debug_box_nameEv:
  300|    494|  const char* debug_box_name() const override { return "Sample Table"; }
_ZN8Box_stsdC2Ev:
  308|  1.16k|  {
  309|  1.16k|    set_short_type(fourcc("stsd"));
  310|  1.16k|  }
_ZNK8Box_stsd14debug_box_nameEv:
  314|    782|  const char* debug_box_name() const override { return "Sample Description"; }
_ZN8Box_sttsC2Ev:
  346|    878|  {
  347|    878|    set_short_type(fourcc("stts"));
  348|    878|  }
_ZNK8Box_stts14debug_box_nameEv:
  352|    785|  const char* debug_box_name() const override { return "Decoding Time to Sample"; }
_ZN8Box_cttsC2Ev:
  382|  1.08k|  {
  383|  1.08k|    set_short_type(fourcc("ctts"));
  384|  1.08k|  }
_ZNK8Box_ctts14debug_box_nameEv:
  388|    889|  const char* debug_box_name() const override { return "Composition Time to Sample"; }
_ZN8Box_stscC2Ev:
  422|    391|  {
  423|    391|    set_short_type(fourcc("stsc"));
  424|    391|  }
_ZNK8Box_stsc14debug_box_nameEv:
  428|    150|  const char* debug_box_name() const override { return "Sample to Chunk"; }
_ZN8Box_stcoC2Ev:
  466|    544|  {
  467|    544|    set_short_type(fourcc("stco"));
  468|    544|  }
_ZNK8Box_stco14debug_box_nameEv:
  472|    455|  const char* debug_box_name() const override { return "Sample Offset"; }
_ZN8Box_stszC2Ev:
  499|    759|  {
  500|    759|    set_short_type(fourcc("stsz"));
  501|    759|  }
_ZNK8Box_stsz14debug_box_nameEv:
  505|    629|  const char* debug_box_name() const override { return "Sample Size"; }
_ZN8Box_stssC2Ev:
  534|    570|  {
  535|    570|    set_short_type(fourcc("stss"));
  536|    570|  }
_ZNK8Box_stss14debug_box_nameEv:
  540|    366|  const char* debug_box_name() const override { return "Sync Sample"; }
_ZN8Box_ccstC2Ev:
  573|    678|  {
  574|    678|    set_short_type(fourcc("ccst"));
  575|    678|  }
_ZNK8Box_ccst14debug_box_nameEv:
  579|    568|  const char* debug_box_name() const override { return "Coding Constraints"; }
_ZN8Box_auxiC2Ev:
  598|    747|  {
  599|    747|    set_short_type(fourcc("auxi"));
  600|    747|  }
_ZNK8Box_auxi14debug_box_nameEv:
  604|    696|  const char* debug_box_name() const override { return "Auxiliary Info Type"; }
_ZNK17VisualSampleEntry25get_horizontal_resolutionEv:
  643|    624|  double get_horizontal_resolution() const { return horizresolution / double(0x10000); }
_ZNK17VisualSampleEntry23get_vertical_resolutionEv:
  645|    624|  double get_vertical_resolution() const { return vertresolution / double(0x10000); }
_ZN22Box_URIMetaSampleEntryC2Ev:
  676|  1.37k|  {
  677|  1.37k|    set_short_type(fourcc("urim"));
  678|  1.37k|  }
_ZNK22Box_URIMetaSampleEntry14debug_box_nameEv:
  684|  1.12k|  const char* debug_box_name() const override { return "URI Meta Sample Entry"; }
_ZN7Box_uriC2Ev:
  699|    829|  {
  700|    829|    set_short_type(fourcc("uri "));
  701|    829|  }
_ZNK7Box_uri14debug_box_nameEv:
  711|    738|  const char* debug_box_name() const override { return "URI"; }
_ZN8Box_sbgpC2Ev:
  725|  1.52k|  {
  726|  1.52k|    set_short_type(fourcc("sbgp"));
  727|  1.52k|  }
_ZNK8Box_sbgp14debug_box_nameEv:
  733|  1.40k|  const char* debug_box_name() const override { return "Sample to Group"; }
_ZN8Box_sgpdC2Ev:
  786|  1.43k|  {
  787|  1.43k|    set_short_type(fourcc("sgpd"));
  788|  1.43k|  }
_ZNK8Box_sgpd14debug_box_nameEv:
  794|  1.38k|  const char* debug_box_name() const override { return "Sample Group Description"; }
_ZN8Box_btrtC2Ev:
  819|    791|  {
  820|    791|    set_short_type(fourcc("btrt"));
  821|    791|  }
_ZNK8Box_btrt14debug_box_nameEv:
  825|    773|  const char* debug_box_name() const override { return "Bitrate"; }
_ZN8Box_saizC2Ev:
  842|  1.45k|  {
  843|  1.45k|    set_short_type(fourcc("saiz"));
  844|  1.45k|  }
_ZNK8Box_saiz14debug_box_nameEv:
  864|  1.19k|  const char* debug_box_name() const override { return "Sample Auxiliary Information Sizes"; }
_ZN8Box_saioC2Ev:
  885|  1.75k|  {
  886|  1.75k|    set_short_type(fourcc("saio"));
  887|  1.75k|  }
_ZNK8Box_saio14debug_box_nameEv:
  904|  1.55k|  const char* debug_box_name() const override { return "Sample Auxiliary Information Offsets"; }
_ZN8Box_sdtpC2Ev:
  930|    565|  {
  931|    565|    set_short_type(fourcc("sdtp"));
  932|    565|  }
_ZNK8Box_sdtp14debug_box_nameEv:
  936|    563|  const char* debug_box_name() const override { return "Independent and Disposable Samples"; }
_ZNK8Box_sdtp14get_is_leadingEj:
  940|  5.73M|  uint8_t get_is_leading(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 6) & 3; }
_ZNK8Box_sdtp14get_depends_onEj:
  942|  5.73M|  uint8_t get_depends_on(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 4) & 3; }
_ZNK8Box_sdtp18get_is_depended_onEj:
  944|  5.73M|  uint8_t get_is_depended_on(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 2) & 3; }
_ZNK8Box_sdtp18get_has_redundancyEj:
  946|  5.73M|  uint8_t get_has_redundancy(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx]) & 3; }
_ZN8Box_trefC2Ev:
  960|  1.22k|  {
  961|  1.22k|    set_short_type(fourcc("tref"));
  962|  1.22k|  }
_ZNK8Box_tref14debug_box_nameEv:
  971|    850|  const char* debug_box_name() const override { return "Track Reference"; }
_ZN8Box_edtsC2Ev:
  998|    332|  Box_edts() : Box_container("edts") {}
_ZNK8Box_edts14debug_box_nameEv:
 1000|    269|  const char* debug_box_name() const override { return "Edit List Container"; }
_ZN8Box_elstC2Ev:
 1008|  1.02k|  {
 1009|  1.02k|    set_short_type(fourcc("elst"));
 1010|  1.02k|  }
_ZNK8Box_elst14debug_box_nameEv:
 1018|    823|  const char* debug_box_name() const override { return "Edit List"; }
_ZN16SampleGroupEntryD2Ev:
  757|   174k|  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:
  209|      2|{
  210|      2|  std::lock_guard<std::mutex> lock(de265_init_mutex());
  211|       |
  212|      2|  de265_init_count++;
  213|       |
  214|      2|  if (de265_init_count > 1) {
  ------------------
  |  Branch (214:7): [True: 0, False: 2]
  ------------------
  215|       |    // we are not the first -> already initialized
  216|       |
  217|      0|    return DE265_OK;
  218|      0|  }
  219|       |
  220|       |
  221|       |  // do initializations
  222|       |
  223|      2|  init_scan_orders();
  224|      2|  pps_scan_cache_init();
  225|       |
  226|      2|  if (!alloc_and_init_significant_coeff_ctxIdx_lookupTable()) {
  ------------------
  |  Branch (226:7): [True: 0, False: 2]
  ------------------
  227|      0|    pps_scan_cache_free();
  228|      0|    de265_init_count--;
  229|      0|    return DE265_ERROR_LIBRARY_INITIALIZATION_FAILED;
  230|      0|  }
  231|       |
  232|      2|  return DE265_OK;
  233|      2|}
de265.cc:_ZL16de265_init_mutexv:
  202|      2|{
  203|      2|  static std::mutex de265_init_mutex;
  204|      2|  return de265_init_mutex;
  205|      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:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_codestream_local.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_params.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_tile.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_tile_comp.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_file.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_mem.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_message.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_colour.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_transform.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_colour_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_transform_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_colour_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_transform_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_colour_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_transform_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_colour_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_transform_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_transform_avx512.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_resolution.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_subband.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_arch.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_codeblock.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_codeblock_fun.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_codestream_gen.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_precinct.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_block_decoder32.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_block_decoder64.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_block_encoder.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_codestream_sse.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_codestream_sse2.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_block_decoder_ssse3.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_codestream_avx.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_codestream_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_block_decoder_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_block_encoder_avx2.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      2|  }
ojph_block_encoder_avx512.cpp:_ZN4ojphL19count_leading_zerosEj:
  207|      2|  {
  208|       |  #ifdef OJPH_COMPILER_MSVC
  209|       |    unsigned long result = 0;
  210|       |    _BitScanReverse(&result, val);
  211|       |    return 31 ^ (ui32)result;
  212|       |  #elif (defined OJPH_COMPILER_GNUC)
  213|       |    return (ui32)__builtin_clz(val);
  214|       |  #else
  215|       |    val |= (val >> 1);
  216|       |    val |= (val >> 2);
  217|       |    val |= (val >> 4);
  218|       |    val |= (val >> 8);
  219|       |    val |= (val >> 16);
  220|       |    return 32 - population_count(val);
  221|       |  #endif
  222|      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:
  449|      2|{
  450|      2|  addAvg            = addAvgCore<Pel>;
  451|      2|  reco              = recoCore<Pel>;
  452|      2|  copyClip          = copyClipCore<Pel>;
  453|      2|  roundGeo          = roundGeoCore<Pel>;
  454|       |
  455|      2|  addAvg4           = addAvgCore<Pel>;
  456|      2|  addAvg8           = addAvgCore<Pel>;
  457|      2|  addAvg16          = addAvgCore<Pel>;
  458|       |
  459|      2|  sub4              = subsCore<Pel>;
  460|      2|  sub8              = subsCore<Pel>;
  461|       |
  462|      2|  wghtAvg4          = addWeightedAvgCore<Pel>;
  463|      2|  wghtAvg8          = addWeightedAvgCore<Pel>;
  464|       |
  465|      2|  copyClip4         = copyClipCore<Pel>;
  466|      2|  copyClip8         = copyClipCore<Pel>;
  467|       |
  468|      2|  reco4             = reconstructCore<Pel>;
  469|      2|  reco8             = reconstructCore<Pel>;
  470|       |
  471|      2|  linTf4            = linTfCore<Pel>;
  472|      2|  linTf8            = linTfCore<Pel>;
  473|       |
  474|      2|  copyBuffer        = copyBufferCore;
  475|       |
  476|      2|  removeHighFreq8   = removeHighFreq;
  477|      2|  removeHighFreq4   = removeHighFreq;
  478|       |
  479|      2|  transpose4x4      = transposeNxNCore<Pel,4>;
  480|      2|  transpose8x8      = transposeNxNCore<Pel,8>;
  481|      2|  mipMatrixMul_4_4  = mipMatrixMulCore<4,4>;
  482|      2|  mipMatrixMul_8_4  = mipMatrixMulCore<8,4>;
  483|      2|  mipMatrixMul_8_8  = mipMatrixMulCore<8,8>;
  484|      2|  weightCiip        = weightCiipCore;
  485|      2|  roundIntVector    = nullptr;
  486|       |
  487|      2|  applyLut          = applyLutCore;
  488|       |
  489|      2|  fillPtrMap        = fillMapPtr_Core;
  490|      2|  AvgHighPassWithDownsampling = AvgHighPassWithDownsamplingCore;
  491|      2|  AvgHighPass = AvgHighPassCore;
  492|      2|  AvgHighPassWithDownsamplingDiff1st = AvgHighPassWithDownsamplingDiff1stCore;
  493|      2|  AvgHighPassWithDownsamplingDiff2nd = AvgHighPassWithDownsamplingDiff2ndCore;
  494|      2|  HDHighPass = HDHighPassCore;
  495|      2|  HDHighPass2 = HDHighPass2Core;
  496|      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,
  ------------------
  |  |  647|    656|#define CHECK(c,x)          if(c){ THROW(x); }
  |  |  ------------------
  |  |  |  |  646|      0|#define THROW(x)            throw( Exception( "ERROR: In function \"" ) << __FUNCTION__ << "\" in " << __FILE__ << ":" << __LINE__ << ": " << x )
  |  |  ------------------
  |  |  |  Branch (647: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)  {}

