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

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

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

_ZN19StreamReader_memoryC2EPKhmb:
   78|  15.8k|    : m_length(size),
   79|  15.8k|      m_position(0)
   80|  15.8k|{
   81|  15.8k|  if (copy) {
  ------------------
  |  Branch (81:7): [True: 0, False: 15.8k]
  ------------------
   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|  15.8k|  else {
   88|  15.8k|    m_data = data;
   89|  15.8k|  }
   90|  15.8k|}
_ZN19StreamReader_memoryD2Ev:
   93|  15.8k|{
   94|  15.8k|  if (m_owned_data) {
  ------------------
  |  Branch (94:7): [True: 0, False: 15.8k]
  ------------------
   95|      0|    delete[] m_owned_data;
   96|      0|  }
   97|  15.8k|}
_ZNK19StreamReader_memory12get_positionEv:
  100|  1.08M|{
  101|  1.08M|  return m_position;
  102|  1.08M|}
_ZN19StreamReader_memory18wait_for_file_sizeEm:
  105|   970k|{
  106|   970k|  return (target_size > m_length) ? grow_status::size_beyond_eof : grow_status::size_reached;
  ------------------
  |  Branch (106:10): [True: 10.7k, False: 959k]
  ------------------
  107|   970k|}
_ZN19StreamReader_memory4readEPvm:
  110|  59.6M|{
  111|  59.6M|  uint64_t end_pos = m_position + size;
  112|  59.6M|  if (end_pos > m_length) {
  ------------------
  |  Branch (112:7): [True: 0, False: 59.6M]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|  59.6M|  memcpy(data, &m_data[m_position], size);
  117|  59.6M|  m_position += size;
  118|       |
  119|  59.6M|  return true;
  120|  59.6M|}
_ZN19StreamReader_memory4seekEm:
  123|  94.8k|{
  124|  94.8k|  if (position > m_length)
  ------------------
  |  Branch (124:7): [True: 0, False: 94.8k]
  ------------------
  125|      0|    return false;
  126|       |
  127|  94.8k|  m_position = position;
  128|  94.8k|  return true;
  129|  94.8k|}
_ZN14BitstreamRangeC2ENSt3__110shared_ptrI12StreamReaderEEmPS_:
  157|   497k|    : m_istr(std::move(istr)), m_parent_range(parent), m_remaining(length)
  158|   497k|{
  159|   497k|  if (parent) {
  ------------------
  |  Branch (159:7): [True: 481k, False: 15.8k]
  ------------------
  160|   481k|    m_nesting_level = parent->m_nesting_level + 1;
  161|   481k|  }
  162|   497k|}
_ZN14BitstreamRange5read8Ev:
  185|  19.7M|{
  186|  19.7M|  if (!prepare_read(1)) {
  ------------------
  |  Branch (186:7): [True: 165k, False: 19.5M]
  ------------------
  187|   165k|    return 0;
  188|   165k|  }
  189|       |
  190|  19.5M|  uint8_t buf;
  191|       |
  192|  19.5M|  auto istr = get_istream();
  193|  19.5M|  bool success = istr->read((char*) &buf, 1);
  194|       |
  195|  19.5M|  if (!success) {
  ------------------
  |  Branch (195:7): [True: 0, False: 19.5M]
  ------------------
  196|      0|    set_eof_while_reading();
  197|      0|    return 0;
  198|      0|  }
  199|       |
  200|  19.5M|  return buf;
  201|  19.5M|}
_ZN14BitstreamRange6read16Ev:
  205|  8.07M|{
  206|  8.07M|  if (!prepare_read(2)) {
  ------------------
  |  Branch (206:7): [True: 18.0k, False: 8.05M]
  ------------------
  207|  18.0k|    return 0;
  208|  18.0k|  }
  209|       |
  210|  8.05M|  uint8_t buf[2];
  211|       |
  212|  8.05M|  auto istr = get_istream();
  213|  8.05M|  bool success = istr->read((char*) buf, 2);
  214|       |
  215|  8.05M|  if (!success) {
  ------------------
  |  Branch (215:7): [True: 0, False: 8.05M]
  ------------------
  216|      0|    set_eof_while_reading();
  217|      0|    return 0;
  218|      0|  }
  219|       |
  220|  8.05M|  return static_cast<uint16_t>((buf[0] << 8) | (buf[1]));
  221|  8.05M|}
_ZN14BitstreamRange7read16sEv:
  225|   545k|{
  226|   545k|  uint16_t v = read16();
  227|       |
  228|   545k|  if (v & 0x8000) {
  ------------------
  |  Branch (228:7): [True: 58.2k, False: 487k]
  ------------------
  229|  58.2k|    auto val = static_cast<int16_t>((~v) & 0x7fff);
  230|  58.2k|    return static_cast<int16_t>(-val - 1);
  231|  58.2k|  }
  232|   487k|  else {
  233|   487k|    return static_cast<int16_t>(v);
  234|   487k|  }
  235|   545k|}
_ZN14BitstreamRange6read24Ev:
  239|    206|{
  240|    206|  if (!prepare_read(3)) {
  ------------------
  |  Branch (240:7): [True: 0, False: 206]
  ------------------
  241|      0|    return 0;
  242|      0|  }
  243|       |
  244|    206|  uint8_t buf[3];
  245|       |
  246|    206|  auto istr = get_istream();
  247|    206|  bool success = istr->read((char*) buf, 3);
  248|       |
  249|    206|  if (!success) {
  ------------------
  |  Branch (249:7): [True: 0, False: 206]
  ------------------
  250|      0|    set_eof_while_reading();
  251|      0|    return 0;
  252|      0|  }
  253|       |
  254|    206|  return (uint32_t) ((buf[0] << 16) |
  255|    206|                     (buf[1] << 8) |
  256|    206|                     (buf[2]));
  257|    206|}
_ZN14BitstreamRange6read32Ev:
  260|   973M|{
  261|   973M|  if (!prepare_read(4)) {
  ------------------
  |  Branch (261:7): [True: 969M, False: 4.27M]
  ------------------
  262|   969M|    return 0;
  263|   969M|  }
  264|       |
  265|  4.27M|  uint8_t buf[4];
  266|       |
  267|  4.27M|  auto istr = get_istream();
  268|  4.27M|  bool success = istr->read((char*) buf, 4);
  269|       |
  270|  4.27M|  if (!success) {
  ------------------
  |  Branch (270:7): [True: 0, False: 4.27M]
  ------------------
  271|      0|    set_eof_while_reading();
  272|      0|    return 0;
  273|      0|  }
  274|       |
  275|  4.27M|  return four_bytes_to_uint32(buf[0], buf[1], buf[2], buf[3]);
  276|  4.27M|}
_ZN14BitstreamRange9read_uintEi:
  280|  1.92M|{
  281|  1.92M|  switch (len)
  282|  1.92M|  {
  283|  1.78M|    case 8:
  ------------------
  |  Branch (283:5): [True: 1.78M, False: 138k]
  ------------------
  284|  1.78M|      return read8();
  285|  83.5k|    case 16:
  ------------------
  |  Branch (285:5): [True: 83.5k, False: 1.83M]
  ------------------
  286|  83.5k|      return read16();
  287|    206|    case 24:
  ------------------
  |  Branch (287:5): [True: 206, False: 1.92M]
  ------------------
  288|    206|      return read24();
  289|  54.7k|    case 32:
  ------------------
  |  Branch (289:5): [True: 54.7k, False: 1.86M]
  ------------------
  290|  54.7k|      return read32();
  291|    329|    case 64:
  ------------------
  |  Branch (291:5): [True: 329, False: 1.92M]
  ------------------
  292|    329|      return read64();
  293|      0|    default:
  ------------------
  |  Branch (293:5): [True: 0, False: 1.92M]
  ------------------
  294|      0|      assert(false);
  ------------------
  |  Branch (294:7): [Folded, False: 0]
  ------------------
  295|      0|      return 0;
  296|  1.92M|  }
  297|  1.92M|}
_ZN14BitstreamRange7read32sEv:
  301|   349k|{
  302|   349k|  uint32_t v = read32();
  303|       |
  304|   349k|  if (v & 0x80000000) {
  ------------------
  |  Branch (304:7): [True: 64.6k, False: 284k]
  ------------------
  305|  64.6k|    return -static_cast<int32_t>((~v) & 0x7fffffff) -1;
  306|  64.6k|  }
  307|   284k|  else {
  308|   284k|    return static_cast<int32_t>(v);
  309|   284k|  }
  310|   349k|}
_ZN14BitstreamRange6read64Ev:
  314|  5.82k|{
  315|  5.82k|  if (!prepare_read(8)) {
  ------------------
  |  Branch (315:7): [True: 81, False: 5.74k]
  ------------------
  316|     81|    return 0;
  317|     81|  }
  318|       |
  319|  5.74k|  uint8_t buf[8];
  320|       |
  321|  5.74k|  auto istr = get_istream();
  322|  5.74k|  bool success = istr->read((char*) buf, 8);
  323|       |
  324|  5.74k|  if (!success) {
  ------------------
  |  Branch (324:7): [True: 0, False: 5.74k]
  ------------------
  325|      0|    set_eof_while_reading();
  326|      0|    return 0;
  327|      0|  }
  328|       |
  329|  5.74k|  return ((static_cast<uint64_t>(buf[0]) << 56) |
  330|  5.74k|          (static_cast<uint64_t>(buf[1]) << 48) |
  331|  5.74k|          (static_cast<uint64_t>(buf[2]) << 40) |
  332|  5.74k|          (static_cast<uint64_t>(buf[3]) << 32) |
  333|  5.74k|          (static_cast<uint64_t>(buf[4]) << 24) |
  334|  5.74k|          (static_cast<uint64_t>(buf[5]) << 16) |
  335|  5.74k|          (static_cast<uint64_t>(buf[6]) << 8) |
  336|  5.74k|          (static_cast<uint64_t>(buf[7])));
  337|  5.74k|}
_ZN14BitstreamRange7read64sEv:
  341|  1.34k|{
  342|  1.34k|  uint64_t v = read64();
  343|       |
  344|  1.34k|  if (v & 0x8000000000000000) {
  ------------------
  |  Branch (344:7): [True: 223, False: 1.11k]
  ------------------
  345|    223|    return -static_cast<int64_t >((~v) & 0x7fffffffffffffff) -1;
  346|    223|  }
  347|  1.11k|  else {
  348|  1.11k|    return static_cast<int64_t >(v);
  349|  1.11k|  }
  350|  1.34k|}
_ZN14BitstreamRange12read_float32Ev:
  354|   969M|{
  355|   969M|#if __cpp_lib_bit_cast >= 201806L
  356|   969M|  uint32_t i = read32();
  357|   969M|  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|   969M|}
_ZN14BitstreamRange11read_stringEv:
  390|  28.8k|{
  391|  28.8k|  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|  28.8k|  if (eof()) {
  ------------------
  |  Branch (395:7): [True: 5.99k, False: 22.8k]
  ------------------
  396|  5.99k|    return std::string();
  397|  5.99k|  }
  398|       |
  399|  22.8k|  auto istr = get_istream();
  400|       |
  401|  27.4M|  for (;;) {
  402|  27.4M|    if (!prepare_read(1)) {
  ------------------
  |  Branch (402:9): [True: 0, False: 27.4M]
  ------------------
  403|      0|      return std::string();
  404|      0|    }
  405|       |
  406|  27.4M|    char c;
  407|  27.4M|    bool success = istr->read(&c, 1);
  408|       |
  409|  27.4M|    if (!success) {
  ------------------
  |  Branch (409:9): [True: 0, False: 27.4M]
  ------------------
  410|      0|      set_eof_while_reading();
  411|      0|      return std::string();
  412|      0|    }
  413|       |
  414|  27.4M|    if (c == 0 || m_remaining==0) {
  ------------------
  |  Branch (414:9): [True: 22.4k, False: 27.4M]
  |  Branch (414:19): [True: 450, False: 27.4M]
  ------------------
  415|  22.8k|      break;
  416|  22.8k|    }
  417|  27.4M|    else {
  418|  27.4M|      str += (char) c;
  419|  27.4M|    }
  420|  27.4M|  }
  421|       |
  422|  22.8k|  return str;
  423|  22.8k|}
_ZN14BitstreamRange17read_fixed_stringEi:
  427|  1.11k|{
  428|  1.11k|  std::string str;
  429|       |
  430|  1.11k|  if (!prepare_read(len)) {
  ------------------
  |  Branch (430:7): [True: 55, False: 1.05k]
  ------------------
  431|     55|    return std::string();
  432|     55|  }
  433|       |
  434|  1.05k|  auto istr = get_istream();
  435|       |
  436|  1.05k|  uint8_t n;
  437|  1.05k|  bool success = istr->read(&n, 1);
  438|  1.05k|  if (!success || n > len - 1) {
  ------------------
  |  Branch (438:7): [True: 0, False: 1.05k]
  |  Branch (438:19): [True: 337, False: 718]
  ------------------
  439|    337|    return {};
  440|    337|  }
  441|       |
  442|  6.42k|  for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (442:19): [True: 5.70k, False: 718]
  ------------------
  443|  5.70k|    char c;
  444|  5.70k|    success = istr->read(&c, 1);
  445|       |
  446|  5.70k|    if (!success) {
  ------------------
  |  Branch (446:9): [True: 0, False: 5.70k]
  ------------------
  447|      0|      set_eof_while_reading();
  448|      0|      return std::string();
  449|      0|    }
  450|       |
  451|  5.70k|    str += (char) c;
  452|  5.70k|  }
  453|       |
  454|    718|  istr->seek_cur(len-n-1);
  455|       |
  456|    718|  return str;
  457|    718|}
_ZN14BitstreamRange21read_string_until_eofEv:
  461|  1.70k|{
  462|  1.70k|  size_t n = get_remaining_bytes();
  463|       |
  464|  1.70k|  [[maybe_unused]] bool success = prepare_read(n);
  465|  1.70k|  assert(success); // we are reading exactly the rest of the box
  ------------------
  |  Branch (465:3): [True: 1.70k, False: 0]
  ------------------
  466|       |
  467|  1.70k|  std::string str;
  468|  1.70k|  str.resize(n);
  469|  1.70k|  get_istream()->read(str.data(), n);
  470|       |
  471|  1.70k|  return str;
  472|  1.70k|}
_ZN14BitstreamRange4readEPhm:
  476|   173k|{
  477|   173k|  if (!prepare_read(n)) {
  ------------------
  |  Branch (477:7): [True: 64, False: 173k]
  ------------------
  478|     64|    return false;
  479|     64|  }
  480|       |
  481|   173k|  auto istr = get_istream();
  482|   173k|  bool success = istr->read(data, n);
  483|       |
  484|   173k|  if (!success) {
  ------------------
  |  Branch (484:7): [True: 0, False: 173k]
  ------------------
  485|      0|    set_eof_while_reading();
  486|      0|  }
  487|       |
  488|   173k|  return success;
  489|   173k|}
_ZN14BitstreamRange12prepare_readEm:
  493|  1.35G|{
  494|       |  // Note: we do not test for negative nBytes anymore because we now use the unsigned size_t
  495|       |
  496|  1.35G|  if (m_remaining < nBytes) {
  ------------------
  |  Branch (496:7): [True: 969M, False: 385M]
  ------------------
  497|       |    // --- not enough data left in box -> move to end of box and set error flag
  498|       |
  499|   969M|    skip_to_end_of_box();
  500|       |
  501|   969M|    m_error = true;
  502|   969M|    return false;
  503|   969M|  }
  504|   385M|  else {
  505|       |    // --- this is the normal case (m_remaining >= nBytes)
  506|       |
  507|   385M|    if (m_parent_range) {
  ------------------
  |  Branch (507:9): [True: 326M, False: 59.6M]
  ------------------
  508|   326M|      if (!m_parent_range->prepare_read(nBytes)) {
  ------------------
  |  Branch (508:11): [True: 0, False: 326M]
  ------------------
  509|      0|        return false;
  510|      0|      }
  511|   326M|    }
  512|       |
  513|   385M|    m_remaining -= nBytes;
  514|       |
  515|   385M|    return true;
  516|   385M|  }
  517|  1.35G|}
_ZN14BitstreamRange24wait_for_available_bytesEm:
  521|   970k|{
  522|   970k|  int64_t target_size = m_istr->get_position() + nBytes;
  523|       |
  524|   970k|  return m_istr->wait_for_file_size(target_size);
  525|   970k|}
_ZN14BitstreamRange31skip_without_advancing_file_posEm:
  529|   706k|{
  530|   706k|  assert(n <= m_remaining);
  ------------------
  |  Branch (530:3): [True: 706k, False: 0]
  ------------------
  531|       |
  532|   706k|  m_remaining -= n;
  533|       |
  534|   706k|  if (m_parent_range) {
  ------------------
  |  Branch (534:7): [True: 614k, False: 91.5k]
  ------------------
  535|   614k|    m_parent_range->skip_without_advancing_file_pos(n);
  536|   614k|  }
  537|   706k|}
_ZN9BitReaderC2EPKhm:
  541|  6.46k|  : data_start(buffer),
  542|  6.46k|    data_length(len)
  543|  6.46k|{
  544|  6.46k|  data = buffer;
  545|  6.46k|  bytes_remaining = len;
  546|       |
  547|  6.46k|  nextbits = 0;
  548|  6.46k|  nextbits_cnt = 0;
  549|       |
  550|  6.46k|  refill();
  551|  6.46k|}
_ZN9BitReader8get_bitsEi:
  567|   341k|{
  568|   341k|  assert(n <= 32);
  ------------------
  |  Branch (568:3): [True: 341k, False: 0]
  ------------------
  569|       |
  570|   341k|  if (nextbits_cnt < n) {
  ------------------
  |  Branch (570:7): [True: 34.2k, False: 307k]
  ------------------
  571|  34.2k|    refill();
  572|  34.2k|  }
  573|       |
  574|   341k|  uint64_t val = nextbits;
  575|   341k|  val >>= 64 - n;
  576|       |
  577|   341k|#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|   341k|  nextbits &= (0xffffffffffffffffULL >> n);
  580|   341k|#endif
  581|       |
  582|   341k|  nextbits <<= n;
  583|   341k|  nextbits_cnt -= n;
  584|       |
  585|   341k|  return static_cast<uint32_t>(val);
  586|   341k|}
_ZN9BitReader9get_bits8Ei:
  590|  67.1k|{
  591|  67.1k|  assert(n>0 && n <= 8);
  ------------------
  |  Branch (591:3): [True: 67.1k, False: 0]
  |  Branch (591:3): [True: 67.1k, False: 0]
  |  Branch (591:3): [True: 67.1k, False: 0]
  ------------------
  592|  67.1k|  return static_cast<uint8_t>(get_bits(n));
  593|  67.1k|}
_ZN9BitReader10get_bits16Ei:
  596|  16.1k|{
  597|  16.1k|  assert(n>0 && n <= 16);
  ------------------
  |  Branch (597:3): [True: 16.1k, False: 0]
  |  Branch (597:3): [True: 16.1k, False: 0]
  |  Branch (597:3): [True: 16.1k, False: 0]
  ------------------
  598|  16.1k|  return static_cast<uint16_t>(get_bits(n));
  599|  16.1k|}
_ZN9BitReader10get_bits32Ei:
  602|  62.5k|{
  603|  62.5k|  assert(n>0 && n <= 32);
  ------------------
  |  Branch (603:3): [True: 62.5k, False: 0]
  |  Branch (603:3): [True: 62.5k, False: 0]
  |  Branch (603:3): [True: 62.5k, False: 0]
  ------------------
  604|  62.5k|  return static_cast<uint32_t>(get_bits(n));
  605|  62.5k|}
_ZN9BitReader11get_bits32sEv:
  608|  1.71k|{
  609|  1.71k|  uint32_t bits = get_bits(32);
  610|  1.71k|  return static_cast<int32_t>(bits);
  611|  1.71k|}
_ZN9BitReader8get_flagEv:
  615|   194k|{
  616|   194k|  return (get_bits(1) == 0x01);
  617|   194k|}
_ZN9BitReader10read_bytesEj:
  620|  3.56k|{
  621|       |  // TODO: this implementation isn't very efficient
  622|  3.56k|  std::vector<uint8_t> bytes;
  623|  29.1k|  for (uint32_t i = 0; i < n; i++) {
  ------------------
  |  Branch (623:24): [True: 25.6k, False: 3.56k]
  ------------------
  624|  25.6k|    bytes.push_back(get_bits8(8));
  625|  25.6k|  }
  626|  3.56k|  return bytes;
  627|  3.56k|}
_ZN9BitReader10skip_bytesEj:
  655|  11.5k|{
  656|       |  // TODO: this is slow
  657|   478k|  while (nBytes) {
  ------------------
  |  Branch (657:10): [True: 466k, False: 11.5k]
  ------------------
  658|   466k|    nBytes--;
  659|   466k|    skip_bits(8);
  660|   466k|  }
  661|  11.5k|}
_ZN9BitReader9skip_bitsEi:
  664|   477k|{
  665|   477k|  if (nextbits_cnt < n) {
  ------------------
  |  Branch (665:7): [True: 63.1k, False: 413k]
  ------------------
  666|  63.1k|    refill();
  667|  63.1k|  }
  668|       |
  669|   477k|#if AVOID_FUZZER_FALSE_POSITIVE
  670|   477k|  nextbits &= (0xffffffffffffffffULL >> n);
  671|   477k|#endif
  672|       |
  673|   477k|  nextbits <<= n;
  674|   477k|  nextbits_cnt -= n;
  675|   477k|}
_ZN9BitReader21skip_to_byte_boundaryEv:
  688|  6.45k|{
  689|  6.45k|  int nskip = (nextbits_cnt & 7);
  690|       |
  691|  6.45k|#if AVOID_FUZZER_FALSE_POSITIVE
  692|  6.45k|  nextbits &= (0xffffffffffffffffULL >> nskip);
  693|  6.45k|#endif
  694|       |
  695|  6.45k|  nextbits <<= nskip;
  696|  6.45k|  nextbits_cnt -= nskip;
  697|  6.45k|}
_ZN9BitReader6refillEv:
  738|   103k|{
  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|   103k|  int shift = 64 - nextbits_cnt;
  751|       |
  752|   838k|  while (shift >= 8 && bytes_remaining) {
  ------------------
  |  Branch (752:10): [True: 740k, False: 98.1k]
  |  Branch (752:24): [True: 735k, False: 5.74k]
  ------------------
  753|   735k|    uint64_t newval = *data++;
  754|   735k|    bytes_remaining--;
  755|       |
  756|   735k|    shift -= 8;
  757|   735k|    newval <<= shift;
  758|   735k|    nextbits |= newval;
  759|   735k|  }
  760|       |
  761|   103k|  nextbits_cnt = 64 - shift;
  762|   103k|#endif
  763|   103k|}

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

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

_ZNK9BoxHeader12get_box_sizeEv:
  119|  2.73M|  uint64_t get_box_size() const { return m_size; }
_ZNK9BoxHeader18has_fixed_box_sizeEv:
  121|  1.13M|  bool has_fixed_box_size() const { return m_size != 0; }
_ZNK9BoxHeader15get_header_sizeEv:
  123|  2.24M|  uint32_t get_header_size() const { return m_header_size; }
_ZNK9BoxHeader14get_short_typeEv:
  125|   790k|  uint32_t get_short_type() const { return m_type; }
_ZNK9BoxHeader14debug_box_nameEv:
  131|   196k|  virtual const char* debug_box_name() const { return nullptr; }
_ZN9BoxHeader14set_short_typeEj:
  133|   542k|  void set_short_type(uint32_t type) { m_type = type; }
_ZN3Box16set_short_headerERK9BoxHeader:
  183|   485k|  {
  184|   485k|    *(BoxHeader*) this = hdr;
  185|   485k|  }
_ZN3Box19set_output_positionEm:
  262|  15.8k|  void set_output_position(uint64_t pos) { m_output_position = pos; }
_ZNK3Box24get_parse_error_fatalityEv:
  264|  7.43k|  virtual parse_error_fatality get_parse_error_fatality() const { return parse_error_fatality::fatal; }
_ZNK7FullBox11get_versionEv:
  322|   797k|  uint8_t get_version() const { return m_version; }
_ZNK7FullBox9get_flagsEv:
  326|  1.02M|  uint32_t get_flags() const { return m_flags; }
_ZN7FullBox9set_flagsEj:
  328|  4.02k|  void set_flags(uint32_t flags) { m_flags = flags; }
_ZN9Box_otherC2Ej:
  350|   152k|  {
  351|   152k|    set_short_type(short_type);
  352|   152k|  }
_ZN9Box_ErrorC2Ej5Error20parse_error_fatality:
  374|  31.6k|  {
  375|  31.6k|    set_short_type(fourcc("ERR "));
  376|       |
  377|  31.6k|    m_box_type_with_parse_error = box4cc;
  378|  31.6k|    m_error = std::move(err);
  379|  31.6k|    m_fatality = fatality;
  380|  31.6k|  }
_ZN8Box_ftypC2Ev:
  405|  43.4k|  {
  406|  43.4k|    set_short_type(fourcc("ftyp"));
  407|  43.4k|  }
_ZNK8Box_ftyp14debug_box_nameEv:
  411|  10.4k|  const char* debug_box_name() const override { return "File Type"; }
_ZN8Box_freeC2Ev:
  445|  1.23k|  {
  446|  1.23k|    set_short_type(fourcc("free"));
  447|  1.23k|  }
_ZNK8Box_free14debug_box_nameEv:
  451|    954|  const char* debug_box_name() const override { return "Free Space"; }
_ZN8Box_metaC2Ev:
  464|  3.53k|  {
  465|  3.53k|    set_short_type(fourcc("meta"));
  466|  3.53k|  }
_ZNK8Box_meta14debug_box_nameEv:
  470|  3.25k|  const char* debug_box_name() const override { return "Metadata"; }
_ZN8Box_hdlrC2Ev:
  481|  4.06k|  {
  482|  4.06k|    set_short_type(fourcc("hdlr"));
  483|  4.06k|  }
_ZNK8Box_hdlr14debug_box_nameEv:
  487|  2.97k|  const char* debug_box_name() const override { return "Handler Reference"; }
_ZN8Box_pitmC2Ev:
  512|  3.53k|  {
  513|  3.53k|    set_short_type(fourcc("pitm"));
  514|  3.53k|  }
_ZNK8Box_pitm14debug_box_nameEv:
  518|  2.99k|  const char* debug_box_name() const override { return "Primary Item"; }
_ZNK8Box_iloc14debug_box_nameEv:
  547|  1.75k|  const char* debug_box_name() const override { return "Item Location"; }
_ZN8Box_infeC2Ev:
  642|  4.48k|  {
  643|  4.48k|    set_short_type(fourcc("infe"));
  644|  4.48k|  }
_ZNK8Box_infe14debug_box_nameEv:
  648|  3.87k|  const char* debug_box_name() const override { return "Item Info Entry"; }
_ZN8Box_iinfC2Ev:
  704|  4.05k|  {
  705|  4.05k|    set_short_type(fourcc("iinf"));
  706|  4.05k|  }
_ZNK8Box_iinf14debug_box_nameEv:
  710|  3.46k|  const char* debug_box_name() const override { return "Item Information"; }
_ZN8Box_iprpC2Ev:
  728|  29.4k|  {
  729|  29.4k|    set_short_type(fourcc("iprp"));
  730|  29.4k|  }
_ZNK8Box_iprp14debug_box_nameEv:
  734|  27.4k|  const char* debug_box_name() const override { return "Item Properties"; }
_ZN8Box_ipcoC2Ev:
  745|  13.4k|  {
  746|  13.4k|    set_short_type(fourcc("ipco"));
  747|  13.4k|  }
_ZNK8Box_ipco14debug_box_nameEv:
  765|  11.7k|  const char* debug_box_name() const override { return "Item Property Container"; }
_ZN8Box_ispeC2Ev:
  776|  2.94k|  {
  777|  2.94k|    set_short_type(fourcc("ispe"));
  778|  2.94k|  }
_ZNK8Box_ispe14debug_box_nameEv:
  792|  2.43k|  const char* debug_box_name() const override { return "Image Spatial Extents"; }
_ZN8Box_ipmaC2Ev:
  814|  3.19k|  {
  815|  3.19k|    set_short_type(fourcc("ipma"));
  816|  3.19k|  }
_ZNK8Box_ipma14debug_box_nameEv:
  820|  2.65k|  const char* debug_box_name() const override { return "Item Property Association"; }
_ZN8Box_auxCC2Ev:
  861|    771|  {
  862|    771|    set_short_type(fourcc("auxC"));
  863|    771|  }
_ZNK8Box_auxC14debug_box_nameEv:
  875|    544|  const char* debug_box_name() const override { return "Image Properties for Auxiliary Images"; }
_ZN8Box_irotC2Ev:
  892|  10.0k|  {
  893|  10.0k|    set_short_type(fourcc("irot"));
  894|  10.0k|  }
_ZNK8Box_irot14debug_box_nameEv:
  902|  7.45k|  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.61k|  {
  926|  2.61k|    set_short_type(fourcc("imir"));
  927|  2.61k|  }
_ZNK8Box_imir14debug_box_nameEv:
  939|  1.77k|  const char* debug_box_name() const override { return "Image Mirroring"; }
_ZNK8Box_imir24get_parse_error_fatalityEv:
  941|    608|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_isclC2Ev:
  957|    596|  {
  958|    596|    set_short_type(fourcc("iscl"));
  959|    596|  }
_ZNK8Box_iscl14debug_box_nameEv:
  980|    206|  const char* debug_box_name() const override { return "Image Scaling"; }
_ZNK8Box_iscl24get_parse_error_fatalityEv:
  982|    367|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_clapC2Ev:
 1001|  18.2k|  {
 1002|  18.2k|    set_short_type(fourcc("clap"));
 1003|  18.2k|  }
_ZNK8Box_clap14debug_box_nameEv:
 1011|    513|  const char* debug_box_name() const override { return "Clean Aperture"; }
_ZNK8Box_clap24get_parse_error_fatalityEv:
 1028|  17.5k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_irefC2Ev:
 1047|  15.0k|  {
 1048|  15.0k|    set_short_type(fourcc("iref"));
 1049|  15.0k|  }
_ZNK8Box_iref14debug_box_nameEv:
 1062|  13.6k|  const char* debug_box_name() const override { return "Item Reference"; }
_ZN8Box_rrefC2Ev:
 1092|    642|  {
 1093|    642|    set_short_type(fourcc("rref"));
 1094|    642|  }
_ZNK8Box_rref14debug_box_nameEv:
 1100|    609|  const char* debug_box_name() const override { return "Required Reference Types"; }
_ZNK8Box_idat14debug_box_nameEv:
 1125|  7.15k|  const char* debug_box_name() const override { return "Item Data"; }
_ZN8Box_grplC2Ev:
 1158|  1.58k|  {
 1159|  1.58k|    set_short_type(fourcc("grpl"));
 1160|  1.58k|  }
_ZNK8Box_grpl14debug_box_nameEv:
 1164|  1.14k|  const char* debug_box_name() const override { return "Groups List"; }
_ZN8Box_sterC2Ev:
 1200|  1.28k|  {
 1201|  1.28k|    set_short_type(fourcc("ster"));
 1202|  1.28k|  }
_ZNK8Box_ster14debug_box_nameEv:
 1206|    907|  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.03k|  const char* debug_box_name() const override { return "Image pyramid group"; }
_ZNK8Box_pymd24get_parse_error_fatalityEv:
 1250|    320|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::ignorable; }
_ZN8Box_dinfC2Ev:
 1268|  7.66k|  {
 1269|  7.66k|    set_short_type(fourcc("dinf"));
 1270|  7.66k|  }
_ZNK8Box_dinf14debug_box_nameEv:
 1274|  6.68k|  const char* debug_box_name() const override { return "Data Information"; }
_ZN8Box_drefC2Ev:
 1285|  1.62k|  {
 1286|  1.62k|    set_short_type(fourcc("dref"));
 1287|  1.62k|  }
_ZNK8Box_dref14debug_box_nameEv:
 1291|  1.34k|  const char* debug_box_name() const override { return "Data Reference"; }
_ZN7Box_urlC2Ev:
 1304|  1.92k|  {
 1305|  1.92k|    set_short_type(fourcc("url "));
 1306|  1.92k|    set_flags(1);
 1307|  1.92k|  }
_ZNK7Box_url14debug_box_nameEv:
 1311|  1.85k|  const char* debug_box_name() const override { return "Data Entry URL"; }
_ZN8Box_pixiC2Ev:
 1331|  4.23k|  {
 1332|  4.23k|    set_short_type(fourcc("pixi"));
 1333|  4.23k|  }
_ZNK8Box_pixi14debug_box_nameEv:
 1352|  2.72k|  const char* debug_box_name() const override { return "Pixel Information"; }
_ZNK8Box_pixi24get_parse_error_fatalityEv:
 1356|    674|  [[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|  13.5k|  const char* debug_box_name() const override { return "Pixel Aspect Ratio"; }
_ZNK8Box_pasp24get_parse_error_fatalityEv:
 1383|     75|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_lselC2Ev:
 1394|  7.85k|  {
 1395|  7.85k|    set_short_type(fourcc("lsel"));
 1396|  7.85k|  }
_ZNK8Box_lsel14debug_box_nameEv:
 1402|  6.44k|  const char* debug_box_name() const override { return "Layer Selection"; }
_ZNK8Box_lsel24get_parse_error_fatalityEv:
 1406|    504|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_clliC2Ev:
 1417|  5.72k|  {
 1418|  5.72k|    set_short_type(fourcc("clli"));
 1419|       |
 1420|  5.72k|    clli.max_content_light_level = 0;
 1421|  5.72k|    clli.max_pic_average_light_level = 0;
 1422|  5.72k|  }
_ZNK8Box_clli14debug_box_nameEv:
 1428|  2.61k|  const char* debug_box_name() const override { return "Content Light Level Information"; }
_ZNK8Box_clli24get_parse_error_fatalityEv:
 1432|    133|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_mdcv14debug_box_nameEv:
 1448|  3.08k|  const char* debug_box_name() const override { return "Master Display Colour Volume"; }
_ZNK8Box_mdcv24get_parse_error_fatalityEv:
 1452|    202|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_amve14debug_box_nameEv:
 1468|    528|  const char* debug_box_name() const override { return "Ambient Viewing Environment"; }
_ZNK8Box_amve24get_parse_error_fatalityEv:
 1472|    431|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_ndwtC2Ev:
 1483|  2.37k|  {
 1484|  2.37k|    set_short_type(fourcc("ndwt"));
 1485|  2.37k|  }
_ZNK8Box_ndwt27get_diffuse_white_luminanceEv:
 1489|  1.46k|  uint32_t get_diffuse_white_luminance() const { return m_diffuse_white_luminance; }
_ZN8Box_ndwt27set_diffuse_white_luminanceEj:
 1491|  1.92k|  void set_diffuse_white_luminance(uint32_t luminance) { m_diffuse_white_luminance = luminance; }
_ZNK8Box_ndwt14debug_box_nameEv:
 1495|    402|  const char* debug_box_name() const override { return "Nominal Diffuse White"; }
_ZNK8Box_ndwt24get_parse_error_fatalityEv:
 1499|     46|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZNK8Box_cclv23ccv_primaries_are_validEv:
 1514|  3.45k|  bool ccv_primaries_are_valid() const { return m_ccv_primaries_valid; }
_ZNK8Box_cclv18get_ccv_primary_x0Ev:
 1515|    187|  int32_t get_ccv_primary_x0() const { return m_ccv_primaries_x[0]; }
_ZNK8Box_cclv18get_ccv_primary_y0Ev:
 1516|    187|  int32_t get_ccv_primary_y0() const { return m_ccv_primaries_y[0]; }
_ZNK8Box_cclv18get_ccv_primary_x1Ev:
 1517|    187|  int32_t get_ccv_primary_x1() const { return m_ccv_primaries_x[1]; }
_ZNK8Box_cclv18get_ccv_primary_y1Ev:
 1518|    187|  int32_t get_ccv_primary_y1() const { return m_ccv_primaries_y[1]; }
_ZNK8Box_cclv18get_ccv_primary_x2Ev:
 1519|    187|  int32_t get_ccv_primary_x2() const { return m_ccv_primaries_x[2]; }
_ZNK8Box_cclv18get_ccv_primary_y2Ev:
 1520|    187|  int32_t get_ccv_primary_y2() const { return m_ccv_primaries_y[2]; }
_ZNK8Box_cclv22min_luminance_is_validEv:
 1523|  3.45k|  bool min_luminance_is_valid() const { return m_ccv_min_luminance_value.has_value(); }
_ZNK8Box_cclv17get_min_luminanceEv:
 1524|    337|  uint32_t get_min_luminance() const { return *m_ccv_min_luminance_value; }
_ZN8Box_cclv17set_min_luminanceEj:
 1525|    424|  void set_min_luminance(uint32_t luminance) { m_ccv_min_luminance_value = luminance; }
_ZNK8Box_cclv22max_luminance_is_validEv:
 1527|  3.45k|  bool max_luminance_is_valid() const { return m_ccv_max_luminance_value.has_value(); }
_ZNK8Box_cclv17get_max_luminanceEv:
 1528|    385|  uint32_t get_max_luminance() const { return *m_ccv_max_luminance_value; }
_ZN8Box_cclv17set_max_luminanceEj:
 1529|    490|  void set_max_luminance(uint32_t luminance) { m_ccv_max_luminance_value = luminance; }
_ZNK8Box_cclv22avg_luminance_is_validEv:
 1531|  3.45k|  bool avg_luminance_is_valid() const { return m_ccv_avg_luminance_value.has_value(); }
_ZNK8Box_cclv17get_avg_luminanceEv:
 1532|    224|  uint32_t get_avg_luminance() const { return *m_ccv_avg_luminance_value; }
_ZN8Box_cclv17set_avg_luminanceEj:
 1533|    310|  void set_avg_luminance(uint32_t luminance) { m_ccv_avg_luminance_value = luminance; }
_ZN8Box_cminC2Ev:
 1561|  3.99k|  {
 1562|  3.99k|    set_short_type(fourcc("cmin"));
 1563|  3.99k|  }
_ZNK8Box_cmin14debug_box_nameEv:
 1618|  2.70k|  const char* debug_box_name() const override { return "Camera Intrinsic Matrix"; }
_ZNK8Box_cmin24get_parse_error_fatalityEv:
 1624|    850|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_cmexC2Ev:
 1643|  6.53k|  {
 1644|  6.53k|    set_short_type(fourcc("cmex"));
 1645|  6.53k|  }
_ZNK8Box_cmex14debug_box_nameEv:
 1675|  4.00k|  const char* debug_box_name() const override { return "Camera Extrinsic Matrix"; }
_ZNK8Box_cmex24get_parse_error_fatalityEv:
 1681|  1.84k|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_udesC2Ev:
 1723|  1.62k|  {
 1724|  1.62k|    set_short_type(fourcc("udes"));
 1725|  1.62k|  }
_ZNK8Box_udes14debug_box_nameEv:
 1729|  1.20k|  const char* debug_box_name() const override { return "User Description"; }
_ZNK8Box_udes24get_parse_error_fatalityEv:
 1795|    175|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN8Box_taicC2Ev:
 1816|  1.33k|  {
 1817|  1.33k|    set_short_type(fourcc("taic"));
 1818|  1.33k|    initialize_heif_tai_clock_info(&m_info);
 1819|  1.33k|  }
_ZNK8Box_taic14debug_box_nameEv:
 1825|  1.17k|  const char* debug_box_name() const override { return "TAI Clock Information"; }
_ZN8Box_itaiC2Ev:
 1896|    539|  {
 1897|    539|    set_short_type(fourcc("itai"));
 1898|    539|    initialize_heif_tai_timestamp_packet(&m_timestamp);
 1899|    539|  }
_ZNK8Box_itai14debug_box_nameEv:
 1903|    442|  const char* debug_box_name() const override { return "Item TAI Timestamp"; }
_ZN19Box_gimi_content_idC2Ev:
 1961|  1.70k|  {
 1962|  1.70k|    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.70k|  }
_ZNK19Box_gimi_content_id14debug_box_nameEv:
 1971|  1.48k|  const char* debug_box_name() const override { return "GIMI Content ID"; }
_ZN8Box_elngC2Ev:
 2004|    894|  {
 2005|    894|    set_short_type(fourcc("elng"));
 2006|    894|  }
_ZNK8Box_elng14debug_box_nameEv:
 2010|    718|  const char* debug_box_name() const override { return "Extended language"; }
_ZNK8Box_elng24get_parse_error_fatalityEv:
 2030|     40|  [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; }
_ZN9BoxHeaderD2Ev:
  115|  1.08M|  virtual ~BoxHeader() = default;
_ZN3BoxC2Ev:
  180|   557k|  Box() = default;
_ZN8FractionC2Ev:
   66|  73.1k|  Fraction() = default;

_ZN8Box_avcC5parseER14BitstreamRangePK20heif_security_limits:
   35|  4.26k|{
   36|  4.26k|  m_configuration.configuration_version = range.read8();
   37|  4.26k|  m_configuration.AVCProfileIndication = range.read8();
   38|  4.26k|  m_configuration.profile_compatibility = range.read8();
   39|  4.26k|  m_configuration.AVCLevelIndication = range.read8();
   40|  4.26k|  uint8_t lengthSizeMinusOneWithReserved = range.read8();
   41|  4.26k|  m_configuration.lengthSize =
   42|  4.26k|      (lengthSizeMinusOneWithReserved & 0b00000011) + 1;
   43|       |
   44|  4.26k|  uint8_t numOfSequenceParameterSets = (range.read8() & 0b00011111);
   45|  6.84k|  for (int i = 0; i < numOfSequenceParameterSets; i++) {
  ------------------
  |  Branch (45:19): [True: 2.58k, False: 4.26k]
  ------------------
   46|  2.58k|    uint16_t sequenceParameterSetLength = range.read16();
   47|  2.58k|    std::vector<uint8_t> sps(sequenceParameterSetLength);
   48|  2.58k|    range.read(sps.data(), sps.size());
   49|  2.58k|    m_sps.push_back(sps);
   50|  2.58k|  }
   51|       |
   52|  4.26k|  uint8_t numOfPictureParameterSets = range.read8();
   53|  8.92k|  for (int i = 0; i < numOfPictureParameterSets; i++) {
  ------------------
  |  Branch (53:19): [True: 4.66k, False: 4.26k]
  ------------------
   54|  4.66k|    uint16_t pictureParameterSetLength = range.read16();
   55|  4.66k|    std::vector<uint8_t> pps(pictureParameterSetLength);
   56|  4.66k|    range.read(pps.data(), pps.size());
   57|  4.66k|    m_pps.push_back(pps);
   58|  4.66k|  }
   59|       |
   60|       |  // See ISO/IEC 14496-15 2017 Section 5.3.3.1.2
   61|  4.26k|  if (range.get_remaining_bytes() > 0) {
  ------------------
  |  Branch (61:7): [True: 2.06k, False: 2.19k]
  ------------------
   62|  2.06k|    if ((m_configuration.AVCProfileIndication != 66) &&
  ------------------
  |  Branch (62:9): [True: 1.79k, False: 270]
  ------------------
   63|  1.79k|        (m_configuration.AVCProfileIndication != 77) &&
  ------------------
  |  Branch (63:9): [True: 1.31k, False: 482]
  ------------------
   64|  1.31k|        (m_configuration.AVCProfileIndication != 88)) {
  ------------------
  |  Branch (64:9): [True: 1.08k, False: 233]
  ------------------
   65|  1.08k|      m_configuration.chroma_format = (heif_chroma) (range.read8() & 0b00000011);
   66|  1.08k|      m_configuration.bit_depth_luma = 8 + (range.read8() & 0b00000111);
   67|  1.08k|      m_configuration.bit_depth_chroma = 8 + (range.read8() & 0b00000111);
   68|  1.08k|      uint8_t numOfSequenceParameterSetExt = range.read8();
   69|  6.31k|      for (int i = 0; i < numOfSequenceParameterSetExt; i++) {
  ------------------
  |  Branch (69:23): [True: 5.22k, False: 1.08k]
  ------------------
   70|  5.22k|        uint16_t sequenceParameterSetExtLength = range.read16();
   71|  5.22k|        std::vector<uint8_t> sps_ext(sequenceParameterSetExtLength);
   72|  5.22k|        range.read(sps_ext.data(), sps_ext.size());
   73|  5.22k|        m_sps_ext.push_back(sps_ext);
   74|  5.22k|      }
   75|  1.08k|    }
   76|  2.06k|  }
   77|       |
   78|  4.26k|  return range.get_error();
   79|  4.26k|}
_ZNK8Box_avcC4dumpER6Indent:
  170|  3.62k|{
  171|  3.62k|  std::ostringstream sstr;
  172|  3.62k|  sstr << Box::dump(indent);
  173|  3.62k|  sstr << indent << "configuration_version: " << ((int) m_configuration.configuration_version) << "\n"
  174|  3.62k|      << indent << "AVCProfileIndication: " << ((int) m_configuration.AVCProfileIndication) << " (" << profileIndicationAsText() << ")\n"
  175|  3.62k|      << indent << "profile_compatibility: " << ((int) m_configuration.profile_compatibility) << "\n"
  176|  3.62k|      << indent << "AVCLevelIndication: " << ((int) m_configuration.AVCLevelIndication) << "\n"
  177|  3.62k|      << indent << "Chroma format: ";
  178|       |
  179|  3.62k|  switch (m_configuration.chroma_format) {
  180|    963|    case heif_chroma_monochrome:
  ------------------
  |  |   75|    963|#define heif_chroma_monochrome heif_chroma_planar
  ------------------
  |  Branch (180:5): [True: 963, False: 2.66k]
  ------------------
  181|    963|      sstr << "4:0:0\n";
  182|    963|      break;
  183|  2.61k|    case heif_chroma_420:
  ------------------
  |  Branch (183:5): [True: 2.61k, False: 1.01k]
  ------------------
  184|  2.61k|      sstr << "4:2:0\n";
  185|  2.61k|      break;
  186|     24|    case heif_chroma_422:
  ------------------
  |  Branch (186:5): [True: 24, False: 3.60k]
  ------------------
  187|     24|      sstr << "4:2:2\n";
  188|     24|      break;
  189|     24|    case heif_chroma_444:
  ------------------
  |  Branch (189:5): [True: 24, False: 3.60k]
  ------------------
  190|     24|      sstr << "4:4:4\n";
  191|     24|      break;
  192|      0|    default:
  ------------------
  |  Branch (192:5): [True: 0, False: 3.62k]
  ------------------
  193|      0|      sstr << "unsupported\n";
  194|      0|      break;
  195|  3.62k|  }
  196|       |
  197|  3.62k|  sstr << indent << "Bit depth luma: " << ((int) m_configuration.bit_depth_luma) << "\n"
  198|  3.62k|      << indent << "Bit depth chroma: " << ((int) m_configuration.bit_depth_chroma) << "\n";
  199|       |
  200|  3.62k|  for (const auto& sps : m_sps) {
  ------------------
  |  Branch (200:24): [True: 1.90k, False: 3.62k]
  ------------------
  201|  1.90k|    sstr << indent << "SPS: ";
  202|   870k|    for (uint8_t b : sps) {
  ------------------
  |  Branch (202:20): [True: 870k, False: 1.90k]
  ------------------
  203|   870k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  204|   870k|    }
  205|  1.90k|    sstr << "\n";
  206|  1.90k|    sstr << std::dec;
  207|  1.90k|  }
  208|       |
  209|  3.62k|  for (const auto& spsext : m_sps_ext) {
  ------------------
  |  Branch (209:27): [True: 2.28k, False: 3.62k]
  ------------------
  210|  2.28k|    sstr << indent << "SPS-EXT: ";
  211|   150k|    for (uint8_t b : spsext) {
  ------------------
  |  Branch (211:20): [True: 150k, False: 2.28k]
  ------------------
  212|   150k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  213|   150k|    }
  214|  2.28k|    sstr << "\n";
  215|  2.28k|    sstr << std::dec;
  216|  2.28k|  }
  217|       |
  218|  3.62k|  for (const auto& pps : m_pps) {
  ------------------
  |  Branch (218:24): [True: 2.43k, False: 3.62k]
  ------------------
  219|  2.43k|    sstr << indent << "PPS: ";
  220|   341k|    for (uint8_t b : pps) {
  ------------------
  |  Branch (220:20): [True: 341k, False: 2.43k]
  ------------------
  221|   341k|      sstr << std::setfill('0') << std::setw(2) << std::hex << ((int) b) << " ";
  222|   341k|    }
  223|  2.43k|    sstr << "\n";
  224|  2.43k|    sstr << std::dec;
  225|  2.43k|  }
  226|       |
  227|  3.62k|  return sstr.str();
  228|  3.62k|}
_ZNK8Box_avcC23profileIndicationAsTextEv:
  231|  3.62k|{
  232|       |  // See ISO/IEC 14496-10:2022 Annex A
  233|  3.62k|  switch (m_configuration.AVCProfileIndication) {
  234|    390|    case 44:
  ------------------
  |  Branch (234:5): [True: 390, False: 3.23k]
  ------------------
  235|    390|      return "CALVC 4:4:4";
  236|    702|    case 66:
  ------------------
  |  Branch (236:5): [True: 702, False: 2.92k]
  ------------------
  237|    702|      return "Constrained Baseline";
  238|  1.23k|    case 77:
  ------------------
  |  Branch (238:5): [True: 1.23k, False: 2.39k]
  ------------------
  239|  1.23k|      return "Main";
  240|    460|    case 88:
  ------------------
  |  Branch (240:5): [True: 460, False: 3.16k]
  ------------------
  241|    460|      return "Extended";
  242|     49|    case 100:
  ------------------
  |  Branch (242:5): [True: 49, False: 3.57k]
  ------------------
  243|     49|      return "High variant";
  244|    203|    case 110:
  ------------------
  |  Branch (244:5): [True: 203, False: 3.42k]
  ------------------
  245|    203|      return "High 10";
  246|     70|    case 122:
  ------------------
  |  Branch (246:5): [True: 70, False: 3.55k]
  ------------------
  247|     70|      return "High 4:2:2";
  248|    205|    case 244:
  ------------------
  |  Branch (248:5): [True: 205, False: 3.42k]
  ------------------
  249|    205|      return "High 4:4:4";
  250|    316|    default:
  ------------------
  |  Branch (250:5): [True: 316, False: 3.31k]
  ------------------
  251|    316|      return "Unknown";
  252|  3.62k|  }
  253|  3.62k|}

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

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

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

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

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

_ZN8Box_cdef5parseER14BitstreamRangePK20heif_security_limits:
   33|  9.21k|{
   34|  9.21k|  uint16_t channel_count = range.read16();
   35|       |
   36|  9.21k|  if (limits->max_components && channel_count > limits->max_components) {
  ------------------
  |  Branch (36:7): [True: 9.21k, False: 0]
  |  Branch (36:33): [True: 12, False: 9.20k]
  ------------------
   37|     12|    std::stringstream sstr;
   38|     12|    sstr << "cdef box wants to define " << channel_count << " JPEG-2000 channels, but the security limit is set to "
   39|     12|         << limits->max_components << " components";
   40|     12|    return {heif_error_Invalid_input,
   41|     12|            heif_suberror_Security_limit_exceeded,
   42|     12|            sstr.str()};
   43|     12|  }
   44|       |
   45|  9.20k|  if (channel_count > range.get_remaining_bytes() / 6) {
  ------------------
  |  Branch (45:7): [True: 7, False: 9.19k]
  ------------------
   46|      7|    std::stringstream sstr;
   47|      7|    sstr << "cdef box wants to define " << channel_count << " JPEG-2000 channels, but file only contains "
   48|      7|         << range.get_remaining_bytes() / 6 << " components";
   49|      7|    return {heif_error_Invalid_input,
   50|      7|            heif_suberror_End_of_data,
   51|      7|            sstr.str()};
   52|      7|  }
   53|       |
   54|  9.19k|  m_channels.resize(channel_count);
   55|       |
   56|  16.8k|  for (uint16_t i = 0; i < channel_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (56:24): [True: 7.70k, False: 9.19k]
  |  Branch (56:45): [True: 7.70k, False: 0]
  |  Branch (56:63): [True: 7.70k, False: 0]
  ------------------
   57|  7.70k|    Channel channel;
   58|  7.70k|    channel.channel_index = range.read16();
   59|  7.70k|    channel.channel_type = range.read16();
   60|  7.70k|    channel.channel_association = range.read16();
   61|  7.70k|    m_channels[i] = channel;
   62|  7.70k|  }
   63|       |
   64|  9.19k|  return range.get_error();
   65|  9.20k|}
_ZNK8Box_cdef4dumpER6Indent:
   68|  8.44k|{
   69|  8.44k|  std::ostringstream sstr;
   70|  8.44k|  sstr << Box::dump(indent);
   71|       |
   72|  8.44k|  for (const auto& channel : m_channels) {
  ------------------
  |  Branch (72:28): [True: 7.49k, False: 8.44k]
  ------------------
   73|  7.49k|    sstr << indent << "channel_index: " << channel.channel_index
   74|  7.49k|         << ", channel_type: " << channel.channel_type
   75|  7.49k|         << ", channel_association: " << channel.channel_association << "\n";
   76|  7.49k|  }
   77|       |
   78|  8.44k|  return sstr.str();
   79|  8.44k|}
_ZN8Box_cmap5parseER14BitstreamRangePK20heif_security_limits:
  136|  3.02k|{
  137|  5.59M|  while (!range.eof() && !range.error()) {
  ------------------
  |  Branch (137:10): [True: 5.58M, False: 3.02k]
  |  Branch (137:26): [True: 5.58M, False: 0]
  ------------------
  138|  5.58M|    Component component;
  139|  5.58M|    component.component_index = range.read16();
  140|  5.58M|    component.mapping_type = range.read8();
  141|  5.58M|    component.palette_colour = range.read8();
  142|  5.58M|    m_components.push_back(component);
  143|  5.58M|  }
  144|       |
  145|  3.02k|  return range.get_error();
  146|  3.02k|}
_ZNK8Box_cmap4dumpER6Indent:
  150|  1.25k|{
  151|  1.25k|  std::ostringstream sstr;
  152|  1.25k|  sstr << Box::dump(indent);
  153|       |
  154|  5.25M|  for (const auto& component : m_components) {
  ------------------
  |  Branch (154:30): [True: 5.25M, False: 1.25k]
  ------------------
  155|  5.25M|    sstr << indent << "component_index: " << component.component_index
  156|  5.25M|         << ", mapping_type: " << (int) (component.mapping_type)
  157|  5.25M|         << ", palette_colour: " << (int) (component.palette_colour) << "\n";
  158|  5.25M|  }
  159|       |
  160|  1.25k|  return sstr.str();
  161|  1.25k|}
_ZN8Box_pclr5parseER14BitstreamRangePK20heif_security_limits:
  181|  1.75k|{
  182|  1.75k|  uint16_t num_entries = range.read16();
  183|  1.75k|  uint8_t num_palette_columns = range.read8();
  184|  7.50k|  for (uint8_t i = 0; i < num_palette_columns; i++) {
  ------------------
  |  Branch (184:23): [True: 5.76k, False: 1.74k]
  ------------------
  185|  5.76k|    uint8_t bit_depth = range.read8();
  186|  5.76k|    if (bit_depth & 0x80) {
  ------------------
  |  Branch (186:9): [True: 8, False: 5.75k]
  ------------------
  187|      8|      return Error(heif_error_Unsupported_feature,
  188|      8|                   heif_suberror_Unsupported_data_version,
  189|      8|                   "pclr with signed data is not supported");
  190|      8|    }
  191|  5.75k|    if (bit_depth > 16) {
  ------------------
  |  Branch (191:9): [True: 5, False: 5.75k]
  ------------------
  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|  5.75k|    m_bitDepths.push_back(bit_depth);
  197|  5.75k|  }
  198|  26.7M|  for (uint16_t j = 0; j < num_entries; j++) {
  ------------------
  |  Branch (198:24): [True: 26.7M, False: 1.74k]
  ------------------
  199|  26.7M|    PaletteEntry entry;
  200|  26.7M|    for (unsigned long int i = 0; i < entry.columns.size(); i++) {
  ------------------
  |  Branch (200:35): [True: 0, False: 26.7M]
  ------------------
  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|  26.7M|    m_entries.push_back(entry);
  209|  26.7M|  }
  210|       |
  211|  1.74k|  return range.get_error();
  212|  1.75k|}
_ZNK8Box_pclr4dumpER6Indent:
  216|  1.64k|{
  217|  1.64k|  std::ostringstream sstr;
  218|  1.64k|  sstr << Box::dump(indent);
  219|       |
  220|  1.64k|  sstr << indent << "NE: " << m_entries.size();
  221|  1.64k|  sstr << ", NPC: " << (int) get_num_columns();
  222|  1.64k|  sstr << ", B: ";
  223|  3.94k|  for (uint8_t b : m_bitDepths) {
  ------------------
  |  Branch (223:18): [True: 3.94k, False: 1.64k]
  ------------------
  224|  3.94k|    sstr << (int) b << ", ";
  225|  3.94k|  }
  226|       |  // TODO: maybe dump entries too?
  227|  1.64k|  sstr << "\n";
  228|       |
  229|  1.64k|  return sstr.str();
  230|  1.64k|}
_ZN8Box_j2kL5parseER14BitstreamRangePK20heif_security_limits:
  273|    536|{
  274|    536|  uint16_t layer_count = range.read16();
  275|       |
  276|    536|  if (layer_count > range.get_remaining_bytes() / (2+1+2)) {
  ------------------
  |  Branch (276:7): [True: 16, False: 520]
  ------------------
  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|    520|  m_layers.resize(layer_count);
  286|       |
  287|   732k|  for (int i = 0; i < layer_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (287:19): [True: 731k, False: 520]
  |  Branch (287:38): [True: 731k, False: 0]
  |  Branch (287:56): [True: 731k, False: 0]
  ------------------
  288|   731k|    Layer layer;
  289|   731k|    layer.layer_id = range.read16();
  290|   731k|    layer.discard_levels = range.read8();
  291|   731k|    layer.decode_layers = range.read16();
  292|   731k|    m_layers[i] = layer;
  293|   731k|  }
  294|       |
  295|    520|  if (range.get_error()) {
  ------------------
  |  Branch (295:7): [True: 2, False: 518]
  ------------------
  296|      2|    m_layers.clear();
  297|      2|  }
  298|       |
  299|    520|  return range.get_error();
  300|    536|}
_ZNK8Box_j2kL4dumpER6Indent:
  303|    421|{
  304|    421|  std::ostringstream sstr;
  305|    421|  sstr << Box::dump(indent);
  306|       |
  307|   731k|  for (const auto& layer : m_layers) {
  ------------------
  |  Branch (307:26): [True: 731k, False: 421]
  ------------------
  308|   731k|    sstr << indent << "layer_id: " << layer.layer_id
  309|   731k|         << ", discard_levels: " << (int) (layer.discard_levels)
  310|   731k|         << ", decode_layers: " << layer.decode_layers << "\n";
  311|   731k|  }
  312|       |
  313|    421|  return sstr.str();
  314|    421|}
_ZN8Box_j2kH5parseER14BitstreamRangePK20heif_security_limits:
  335|  7.56k|{
  336|  7.56k|  return read_children(range, READ_CHILDREN_ALL, limits);
  337|  7.56k|}
_ZNK8Box_j2kH4dumpER6Indent:
  340|  6.82k|{
  341|  6.82k|  std::ostringstream sstr;
  342|  6.82k|  sstr << Box::dump(indent);
  343|       |
  344|  6.82k|  sstr << dump_children(indent);
  345|       |
  346|  6.82k|  return sstr.str();
  347|  6.82k|}

_ZN8Box_j2kHC2Ev:
  314|  7.56k|    Box_j2kH() { set_short_type(fourcc("j2kH")); }
_ZN8Box_cdefC2Ev:
   57|  9.21k|    Box_cdef() { set_short_type(fourcc("cdef")); }
_ZN8Box_cmapC2Ev:
  141|  3.02k|    Box_cmap() { set_short_type(fourcc("cmap")); }
_ZN8Box_pclrC2Ev:
  186|  1.75k|    {
  187|  1.75k|        set_short_type(fourcc("pclr"));
  188|  1.75k|    }
_ZN8Box_j2kLC2Ev:
  269|    537|    Box_j2kL() { set_short_type(fourcc("j2kL")); }
_ZN8Box_j2kiC2Ev:
  527|     47|  {
  528|     47|    set_short_type(fourcc("j2ki"));
  529|     47|  }
_ZNK8Box_pclr15get_num_columnsEv:
  227|  1.64k|    {
  228|  1.64k|        return (uint8_t)(m_bitDepths.size());
  229|  1.64k|    }

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

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

_Z25is_valid_component_formath:
   43|  2.55k|{
   44|  2.55k|  return format <= component_format_max_valid;
   45|  2.55k|}
_Z24is_valid_interleave_modeh:
   62|    395|{
   63|    395|  return interleave <= interleave_mode_max_valid;
   64|    395|}
_Z22is_valid_sampling_modeh:
   83|    401|{
   84|    401|  return sampling <= sampling_mode_max_valid;
   85|    401|}
_Z28is_predefined_component_typet:
   96|  9.25k|{
   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|  9.25k|  return type <= heif_cmpd_component_type_max_valid;
  ------------------
  |  |   29|  9.25k|#define heif_cmpd_component_type_max_valid heif_cmpd_component_type_key_black
  ------------------
  100|  9.25k|}
_ZN8Box_cmpd5parseER14BitstreamRangePK20heif_security_limits:
  144|    920|{
  145|    920|  uint32_t component_count = range.read32();
  146|       |
  147|    920|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (147:7): [True: 920, False: 0]
  |  Branch (147:33): [True: 47, False: 873]
  ------------------
  148|     47|    std::stringstream sstr;
  149|     47|    sstr << "cmpd box should contain " << component_count << " components, but security limit is set to "
  150|     47|         << limits->max_components << " components";
  151|       |
  152|     47|    return {heif_error_Invalid_input,
  153|     47|            heif_suberror_Security_limit_exceeded,
  154|     47|            sstr.str()
  155|     47|    };
  156|     47|  }
  157|       |
  158|  12.0k|  for (unsigned int i = 0; i < component_count ; i++) {
  ------------------
  |  Branch (158:28): [True: 11.2k, False: 799]
  ------------------
  159|  11.2k|    if (range.eof()) {
  ------------------
  |  Branch (159:9): [True: 74, False: 11.2k]
  ------------------
  160|     74|      std::stringstream sstr;
  161|     74|      sstr << "cmpd box should contain " << component_count << " components, but box only contained "
  162|     74|           << i << " components";
  163|       |
  164|     74|      return {heif_error_Invalid_input,
  165|     74|              heif_suberror_End_of_data,
  166|     74|              sstr.str()
  167|     74|      };
  168|     74|    }
  169|       |
  170|  11.2k|    Component component;
  171|  11.2k|    component.component_type = range.read16();
  172|  11.2k|    if (component.component_type >= 0x8000) {
  ------------------
  |  Branch (172:9): [True: 2.14k, False: 9.05k]
  ------------------
  173|  2.14k|      component.component_type_uri = range.read_string();
  174|  2.14k|    }
  175|  9.05k|    else {
  176|  9.05k|      component.component_type_uri = std::string();
  177|  9.05k|    }
  178|  11.2k|    m_components.push_back(component);
  179|  11.2k|  }
  180|       |
  181|    799|  return range.get_error();
  182|    873|}
_ZN8Box_cmpd9Component23get_component_type_nameEt:
  185|  9.25k|{
  186|  9.25k|  std::stringstream sstr;
  187|       |
  188|  9.25k|  if (is_predefined_component_type(component_type)) {
  ------------------
  |  Branch (188:7): [True: 3.78k, False: 5.46k]
  ------------------
  189|  3.78k|    sstr << get_name(heif_cmpd_component_type(component_type), sNames_uncompressed_component_type) << "\n";
  190|  3.78k|  }
  191|  5.46k|  else {
  192|  5.46k|    sstr << "0x" << std::hex << component_type << std::dec << "\n";
  193|  5.46k|  }
  194|       |
  195|  9.25k|  return sstr.str();
  196|  9.25k|}
_ZNK8Box_cmpd4dumpER6Indent:
  207|    687|{
  208|    687|  std::ostringstream sstr;
  209|    687|  sstr << Box::dump(indent);
  210|       |
  211|  9.25k|  for (const auto& component : m_components) {
  ------------------
  |  Branch (211:30): [True: 9.25k, False: 687]
  ------------------
  212|  9.25k|    sstr << indent << "component_type: " << component.get_component_type_name();
  213|       |
  214|  9.25k|    if (component.component_type >= 0x8000) {
  ------------------
  |  Branch (214:9): [True: 1.40k, False: 7.85k]
  ------------------
  215|  1.40k|      sstr << indent << "| component_type_uri: " << component.component_type_uri << "\n";
  216|  1.40k|    }
  217|  9.25k|  }
  218|       |
  219|    687|  return sstr.str();
  220|    687|}
_ZN8Box_uncC5parseER14BitstreamRangePK20heif_security_limits:
  240|  5.34k|{
  241|  5.34k|  parse_full_box_header(range);
  242|       |
  243|  5.34k|  m_profile = range.read32();
  244|       |
  245|  5.34k|  if (get_version() == 1) {
  ------------------
  |  Branch (245:7): [True: 2.45k, False: 2.89k]
  ------------------
  246|  2.45k|    switch (m_profile) {
  247|    203|      case fourcc("rgb3"):
  ------------------
  |  Branch (247:7): [True: 203, False: 2.24k]
  ------------------
  248|    237|      case fourcc("rgba"):
  ------------------
  |  Branch (248:7): [True: 34, False: 2.41k]
  ------------------
  249|    489|      case fourcc("abgr"):
  ------------------
  |  Branch (249:7): [True: 252, False: 2.20k]
  ------------------
  250|    771|      case fourcc("2vuy"):
  ------------------
  |  Branch (250:7): [True: 282, False: 2.17k]
  ------------------
  251|    872|      case fourcc("yuv2"):
  ------------------
  |  Branch (251:7): [True: 101, False: 2.35k]
  ------------------
  252|    884|      case fourcc("yvyu"):
  ------------------
  |  Branch (252:7): [True: 12, False: 2.44k]
  ------------------
  253|  1.15k|      case fourcc("vyuy"):
  ------------------
  |  Branch (253:7): [True: 270, False: 2.18k]
  ------------------
  254|  1.19k|      case fourcc("yuv1"):
  ------------------
  |  Branch (254:7): [True: 43, False: 2.40k]
  ------------------
  255|  1.23k|      case fourcc("v308"):
  ------------------
  |  Branch (255:7): [True: 41, False: 2.41k]
  ------------------
  256|  1.30k|      case fourcc("v408"):
  ------------------
  |  Branch (256:7): [True: 67, False: 2.38k]
  ------------------
  257|  1.37k|      case fourcc("y210"):
  ------------------
  |  Branch (257:7): [True: 67, False: 2.38k]
  ------------------
  258|  1.38k|      case fourcc("v410"):
  ------------------
  |  Branch (258:7): [True: 11, False: 2.44k]
  ------------------
  259|  1.42k|      case fourcc("v210"):
  ------------------
  |  Branch (259:7): [True: 38, False: 2.41k]
  ------------------
  260|  1.45k|      case fourcc("i420"):
  ------------------
  |  Branch (260:7): [True: 36, False: 2.41k]
  ------------------
  261|  1.52k|      case fourcc("nv12"):
  ------------------
  |  Branch (261:7): [True: 69, False: 2.38k]
  ------------------
  262|  1.56k|      case fourcc("nv21"):
  ------------------
  |  Branch (262:7): [True: 41, False: 2.41k]
  ------------------
  263|  1.58k|      case fourcc("yu22"):
  ------------------
  |  Branch (263:7): [True: 21, False: 2.43k]
  ------------------
  264|  1.87k|      case fourcc("yv22"):
  ------------------
  |  Branch (264:7): [True: 283, False: 2.16k]
  ------------------
  265|  1.93k|      case fourcc("yv20"):
  ------------------
  |  Branch (265:7): [True: 68, False: 2.38k]
  ------------------
  266|  1.93k|        break;
  267|    513|      default:
  ------------------
  |  Branch (267:7): [True: 513, False: 1.93k]
  ------------------
  268|    513|        return Error{heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Unknown uncC v1 profile"};
  269|  2.45k|    }
  270|  2.89k|  } else if (get_version() == 0) {
  ------------------
  |  Branch (270:14): [True: 459, False: 2.43k]
  ------------------
  271|       |
  272|    459|    uint32_t component_count = range.read32();
  273|       |
  274|    459|    if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (274:9): [True: 459, False: 0]
  |  Branch (274:35): [True: 46, False: 413]
  ------------------
  275|     46|      std::stringstream sstr;
  276|     46|      sstr << "Number of image components (" << component_count << ") exceeds security limit ("
  277|     46|           << limits->max_components << ")";
  278|       |
  279|     46|      return {heif_error_Invalid_input,
  280|     46|              heif_suberror_Security_limit_exceeded,
  281|     46|              sstr.str()};
  282|     46|    }
  283|       |
  284|  2.95k|    for (uint32_t i = 0; i < component_count && !range.error() && !range.eof(); i++) {
  ------------------
  |  Branch (284:26): [True: 2.58k, False: 367]
  |  Branch (284:49): [True: 2.56k, False: 20]
  |  Branch (284:67): [True: 2.55k, False: 14]
  ------------------
  285|  2.55k|      Component component;
  286|  2.55k|      component.component_index = range.read16();
  287|  2.55k|      component.component_bit_depth = uint16_t(range.read8() + 1);
  288|  2.55k|      component.component_format = range.read8();
  289|  2.55k|      component.component_align_size = range.read8();
  290|  2.55k|      m_components.push_back(component);
  291|       |
  292|  2.55k|      if (!is_valid_component_format(component.component_format)) {
  ------------------
  |  Branch (292:11): [True: 9, False: 2.54k]
  ------------------
  293|      9|        return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid component format"};
  294|      9|      }
  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.54k|      if (component.component_align_size != 0 &&
  ------------------
  |  Branch (299:11): [True: 561, False: 1.98k]
  ------------------
  300|    561|          uint32_t(component.component_align_size) * 8 < component.component_bit_depth) {
  ------------------
  |  Branch (300:11): [True: 3, False: 558]
  ------------------
  301|      3|        std::stringstream sstr;
  302|      3|        sstr << "Component alignment (" << int(component.component_align_size)
  303|      3|             << " bytes) is too small for component bit depth (" << component.component_bit_depth << " bits)";
  304|      3|        return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, sstr.str()};
  305|      3|      }
  306|  2.54k|    }
  307|       |
  308|    401|    m_sampling_type = range.read8();
  309|    401|    if (!is_valid_sampling_mode(m_sampling_type)) {
  ------------------
  |  Branch (309:9): [True: 6, False: 395]
  ------------------
  310|      6|      return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid sampling mode"};
  311|      6|    }
  312|       |
  313|    395|    m_interleave_type = range.read8();
  314|    395|    if (!is_valid_interleave_mode(m_interleave_type)) {
  ------------------
  |  Branch (314:9): [True: 2, False: 393]
  ------------------
  315|      2|      return {heif_error_Invalid_input, heif_suberror_Invalid_parameter_value, "Invalid interleave mode"};
  316|      2|    }
  317|       |
  318|    393|    m_block_size = range.read8();
  319|       |
  320|    393|    uint8_t flags = range.read8();
  321|    393|    m_components_little_endian = !!(flags & 0x80);
  322|    393|    m_block_pad_lsb = !!(flags & 0x40);
  323|    393|    m_block_little_endian = !!(flags & 0x20);
  324|    393|    m_block_reversed = !!(flags & 0x10);
  325|    393|    m_pad_unknown = !!(flags & 0x08);
  326|       |
  327|    393|    m_pixel_size = range.read32();
  328|       |
  329|    393|    if (limits->version >= 4 &&
  ------------------
  |  Branch (329:9): [True: 393, False: 0]
  ------------------
  330|    393|        limits->max_iso23001_17_pixel_size_bytes != 0 &&
  ------------------
  |  Branch (330:9): [True: 393, False: 0]
  ------------------
  331|    393|        m_pixel_size > limits->max_iso23001_17_pixel_size_bytes) {
  ------------------
  |  Branch (331:9): [True: 31, False: 362]
  ------------------
  332|     31|      std::stringstream sstr;
  333|     31|      sstr << "uncC pixel_size (" << m_pixel_size << " bytes) exceeds security limit of "
  334|     31|           << limits->max_iso23001_17_pixel_size_bytes << " bytes";
  335|     31|      return {heif_error_Memory_allocation_error,
  336|     31|              heif_suberror_Security_limit_exceeded,
  337|     31|              sstr.str()};
  338|     31|    }
  339|       |
  340|    362|    m_row_align_size = range.read32();
  341|       |
  342|    362|    m_tile_align_size = range.read32();
  343|       |
  344|    362|    uint32_t num_tile_cols_minus_one = range.read32();
  345|    362|    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|    362|    if (num_tile_cols_minus_one == 0xFFFFFFFF || num_tile_rows_minus_one == 0xFFFFFFFF) {
  ------------------
  |  Branch (351:9): [True: 1, False: 361]
  |  Branch (351:50): [True: 2, False: 359]
  ------------------
  352|      3|      return {heif_error_Unsupported_feature,
  353|      3|              heif_suberror_Invalid_parameter_value,
  354|      3|              "uncC num_tile_cols/rows_minus_one of 0xFFFFFFFF (2^32 tiles) exceeds the supported range"};
  355|      3|    }
  356|       |
  357|    359|    if (limits->max_number_of_tiles &&
  ------------------
  |  Branch (357:9): [True: 359, False: 0]
  ------------------
  358|    359|        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: 42, False: 317]
  ------------------
  359|     42|      std::stringstream sstr;
  360|     42|      sstr << "Tiling size "
  361|     42|           << ((uint64_t)num_tile_cols_minus_one + 1) << " x " << ((uint64_t)num_tile_rows_minus_one + 1)
  362|     42|           << " exceeds the maximum allowed number " << limits->max_number_of_tiles << " set as security limit";
  363|     42|      return {heif_error_Memory_allocation_error,
  364|     42|              heif_suberror_Security_limit_exceeded,
  365|     42|              sstr.str()};
  366|     42|    }
  367|       |
  368|    317|    m_num_tile_cols = num_tile_cols_minus_one + 1;
  369|    317|    m_num_tile_rows = num_tile_rows_minus_one + 1;
  370|    317|  }
  371|       |
  372|  4.69k|  return range.get_error();
  373|  5.34k|}
_ZNK8Box_uncC4dumpER6Indent:
  378|  3.12k|{
  379|  3.12k|  std::ostringstream sstr;
  380|  3.12k|  sstr << Box::dump(indent);
  381|       |
  382|  3.12k|  sstr << indent << "profile: " << m_profile;
  383|  3.12k|  if (m_profile != 0) {
  ------------------
  |  Branch (383:7): [True: 2.68k, False: 441]
  ------------------
  384|  2.68k|    sstr << " (" << fourcc_to_string(m_profile) << ")";
  385|  2.68k|  }
  386|  3.12k|  sstr << "\n";
  387|  3.12k|  if (get_version() == 0) {
  ------------------
  |  Branch (387:7): [True: 254, False: 2.87k]
  ------------------
  388|  1.65k|    for (const auto& component : m_components) {
  ------------------
  |  Branch (388:32): [True: 1.65k, False: 254]
  ------------------
  389|  1.65k|      sstr << indent << "component_index: " << component.component_index << "\n";
  390|  1.65k|      indent++;
  391|  1.65k|      sstr << indent << "component_bit_depth: " << (int) component.component_bit_depth << "\n";
  392|  1.65k|      sstr << indent << "component_format: " << get_name(heif_uncompressed_component_format(component.component_format), sNames_uncompressed_component_format) << "\n";
  393|  1.65k|      sstr << indent << "component_align_size: " << (int) component.component_align_size << "\n";
  394|  1.65k|      indent--;
  395|  1.65k|    }
  396|       |
  397|    254|    sstr << indent << "sampling_type: " << get_name(heif_uncompressed_sampling_mode(m_sampling_type), sNames_uncompressed_sampling_mode) << "\n";
  398|       |
  399|    254|    sstr << indent << "interleave_type: " << get_name(heif_uncompressed_interleave_mode(m_interleave_type), sNames_uncompressed_interleave_mode) << "\n";
  400|       |
  401|    254|    sstr << indent << "block_size: " << (int) m_block_size << "\n";
  402|       |
  403|    254|    sstr << indent << "components_little_endian: " << m_components_little_endian << "\n";
  404|    254|    sstr << indent << "block_pad_lsb: " << m_block_pad_lsb << "\n";
  405|    254|    sstr << indent << "block_little_endian: " << m_block_little_endian << "\n";
  406|    254|    sstr << indent << "block_reversed: " << m_block_reversed << "\n";
  407|    254|    sstr << indent << "pad_unknown: " << m_pad_unknown << "\n";
  408|       |
  409|    254|    sstr << indent << "pixel_size: " << m_pixel_size << "\n";
  410|       |
  411|    254|    sstr << indent << "row_align_size: " << m_row_align_size << "\n";
  412|       |
  413|    254|    sstr << indent << "tile_align_size: " << m_tile_align_size << "\n";
  414|       |
  415|    254|    sstr << indent << "num_tile_cols: " << m_num_tile_cols << "\n";
  416|       |
  417|    254|    sstr << indent << "num_tile_rows: " << m_num_tile_rows << "\n";
  418|    254|  }
  419|  3.12k|  return sstr.str();
  420|  3.12k|}
_ZN8Box_cmpC5parseER14BitstreamRangePK20heif_security_limits:
  750|    635|{
  751|    635|  parse_full_box_header(range);
  752|       |
  753|    635|  if (get_version() != 0) {
  ------------------
  |  Branch (753:7): [True: 6, False: 629]
  ------------------
  754|      6|    return unsupported_version_error("cmpC");
  755|      6|  }
  756|       |
  757|    629|  m_compression_type = range.read32();
  758|       |
  759|    629|  uint8_t unit_type = range.read8();
  760|    629|  if (unit_type > heif_cmpC_compressed_unit_type_image_pixel) {
  ------------------
  |  Branch (760:7): [True: 3, False: 626]
  ------------------
  761|      3|    return {heif_error_Invalid_input,
  762|      3|            heif_suberror_Unsupported_parameter,
  763|      3|            "Unsupported cmpC compressed unit type"};
  764|    626|  };
  765|       |
  766|    626|  m_compressed_unit_type = static_cast<heif_cmpC_compressed_unit_type>(unit_type);
  767|       |
  768|    626|  return range.get_error();
  769|    629|}
_ZNK8Box_cmpC4dumpER6Indent:
  773|    498|{
  774|    498|  std::ostringstream sstr;
  775|    498|  sstr << Box::dump(indent);
  776|    498|  sstr << indent << "compression_type: " << fourcc_to_string(m_compression_type) << "\n";
  777|    498|  sstr << indent << "compressed_entity_type: " << (int)m_compressed_unit_type << "\n";
  778|    498|  return sstr.str();
  779|    498|}
_ZN8Box_icef5parseER14BitstreamRangePK20heif_security_limits:
  798|    985|{
  799|    985|  parse_full_box_header(range);
  800|       |
  801|    985|  if (get_version() != 0) {
  ------------------
  |  Branch (801:7): [True: 1, False: 984]
  ------------------
  802|      1|    return unsupported_version_error("icef");
  803|      1|  }
  804|    984|  uint8_t codes = range.read8();
  805|    984|  uint8_t unit_offset_code = (codes & 0b11100000) >> 5;
  806|    984|  uint8_t unit_size_code = (codes & 0b00011100) >> 2;
  807|    984|  uint32_t num_compressed_units = range.read32();
  808|    984|  uint64_t implied_offset = 0;
  809|       |
  810|    984|  if (unit_offset_code > 4) {
  ------------------
  |  Branch (810:7): [True: 1, False: 983]
  ------------------
  811|      1|    return {heif_error_Usage_error, heif_suberror_Unsupported_parameter, "Unsupported icef unit offset code"};
  812|      1|  }
  813|       |
  814|    983|  if (unit_size_code > 4) {
  ------------------
  |  Branch (814:7): [True: 4, False: 979]
  ------------------
  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|    979|  uint8_t unit_offset_bits = unit_offset_bits_table[unit_offset_code];
  821|    979|  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|    979|  uint64_t data_size_bytes = static_cast<uint64_t>(num_compressed_units) * (unit_offset_bits + unit_size_bits) / 8;
  835|    979|  if (data_size_bytes > range.get_remaining_bytes()) {
  ------------------
  |  Branch (835:7): [True: 50, False: 929]
  ------------------
  836|     50|    uint64_t contained_units = range.get_remaining_bytes() / ((unit_offset_bits + unit_size_bits) * 8);
  837|     50|    std::stringstream sstr;
  838|     50|    sstr << "icef box declares " << num_compressed_units << " units, but only " << contained_units
  839|     50|         << " were contained in the file";
  840|     50|    return {heif_error_Invalid_input,
  841|     50|            heif_suberror_End_of_data,
  842|     50|            sstr.str()};
  843|     50|  }
  844|       |
  845|       |  // --- read box content
  846|       |
  847|    929|  if (auto err = m_memory_handle.alloc(num_compressed_units, sizeof(CompressedUnitInfo),
  ------------------
  |  Branch (847:12): [True: 0, False: 929]
  ------------------
  848|    929|                                       limits, "icef box compressed unit infos")) {
  849|      0|    return err;
  850|      0|  }
  851|       |
  852|    929|  m_unit_infos.resize(num_compressed_units);
  853|       |
  854|  1.78M|  for (uint32_t r = 0; r < num_compressed_units; r++) {
  ------------------
  |  Branch (854:24): [True: 1.78M, False: 926]
  ------------------
  855|  1.78M|    CompressedUnitInfo unitInfo;
  856|  1.78M|    if (unit_offset_code == 0) {
  ------------------
  |  Branch (856:9): [True: 1.78M, False: 489]
  ------------------
  857|  1.78M|      unitInfo.unit_offset = implied_offset;
  858|  1.78M|    } else {
  859|    489|      unitInfo.unit_offset = range.read_uint(unit_offset_bits);
  860|    489|    }
  861|       |
  862|  1.78M|    unitInfo.unit_size = range.read_uint(unit_size_bits);
  863|       |
  864|       |    // Reject unit_offset + unit_size wrapping past the 64 bit range.
  865|  1.78M|    if (unitInfo.unit_size >= UINT64_MAX - unitInfo.unit_offset) {
  ------------------
  |  Branch (865:9): [True: 3, False: 1.78M]
  ------------------
  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.78M|    if (unit_offset_code == 0) {
  ------------------
  |  Branch (873:9): [True: 1.78M, False: 488]
  ------------------
  874|  1.78M|      implied_offset += unitInfo.unit_size;
  875|  1.78M|    }
  876|       |
  877|  1.78M|    if (range.get_error() != Error::Ok) {
  ------------------
  |  Branch (877:9): [True: 0, False: 1.78M]
  ------------------
  878|      0|      return range.get_error();
  879|      0|    }
  880|       |
  881|  1.78M|    m_unit_infos[r] = unitInfo;
  882|  1.78M|  }
  883|       |
  884|    926|  return range.get_error();
  885|    929|}
_ZNK8Box_icef4dumpER6Indent:
  889|    809|{
  890|    809|  std::ostringstream sstr;
  891|    809|  sstr << Box::dump(indent);
  892|    809|  sstr << indent << "num_compressed_units: " << m_unit_infos.size() << "\n";
  893|  1.78M|  for (CompressedUnitInfo unit_info: m_unit_infos) {
  ------------------
  |  Branch (893:36): [True: 1.78M, False: 809]
  ------------------
  894|  1.78M|    sstr << indent << "unit_offset: " << unit_info.unit_offset << ", unit_size: " << unit_info.unit_size << "\n";
  895|  1.78M|  }
  896|    809|  return sstr.str();
  897|    809|}
_ZN8Box_cpat5parseER14BitstreamRangePK20heif_security_limits:
 1014|    585|{
 1015|    585|  parse_full_box_header(range);
 1016|       |
 1017|    585|  if (get_version() != 0) {
  ------------------
  |  Branch (1017:7): [True: 1, False: 584]
  ------------------
 1018|      1|    return unsupported_version_error("cpat");
 1019|      1|  }
 1020|       |
 1021|    584|  m_pattern.pattern_width = range.read16();
 1022|    584|  m_pattern.pattern_height = range.read16();
 1023|       |
 1024|    584|  if (m_pattern.pattern_width == 0 || m_pattern.pattern_height == 0) {
  ------------------
  |  Branch (1024:7): [True: 4, False: 580]
  |  Branch (1024:39): [True: 8, False: 572]
  ------------------
 1025|     12|    return {heif_error_Invalid_input,
 1026|     12|            heif_suberror_Invalid_parameter_value,
 1027|     12|            "Zero Bayer pattern size."};
 1028|     12|  }
 1029|       |
 1030|    572|  auto max_bayer_pattern_size = limits->max_bayer_pattern_pixels;
 1031|    572|  if (max_bayer_pattern_size && m_pattern.pattern_height > max_bayer_pattern_size / m_pattern.pattern_width) {
  ------------------
  |  Branch (1031:7): [True: 572, False: 0]
  |  Branch (1031:33): [True: 13, False: 559]
  ------------------
 1032|     13|    return {heif_error_Invalid_input,
 1033|     13|            heif_suberror_Security_limit_exceeded,
 1034|     13|            "Maximum Bayer pattern size exceeded."};
 1035|     13|  }
 1036|       |
 1037|    559|  size_t num_pixels = size_t{m_pattern.pattern_width} * m_pattern.pattern_height;
 1038|    559|  m_pattern.pixels.resize(num_pixels);
 1039|       |
 1040|  4.81k|  for (size_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1040:22): [True: 4.25k, False: 559]
  ------------------
 1041|  4.25k|    BayerPatternPixelCmpd pixel{};
 1042|  4.25k|    pixel.cmpd_index = range.read32();
 1043|  4.25k|    pixel.component_gain = range.read_float32();
 1044|  4.25k|    m_pattern.pixels[i] = pixel;
 1045|  4.25k|  }
 1046|       |
 1047|    559|  return range.get_error();
 1048|    572|}
_ZNK8Box_cpat4dumpER6Indent:
 1052|    395|{
 1053|    395|  std::ostringstream sstr;
 1054|       |
 1055|    395|  sstr << FullBox::dump(indent);
 1056|    395|  sstr << indent << "pattern_width: " << get_pattern_width() << "\n";
 1057|    395|  sstr << indent << "pattern_height: " << get_pattern_height() << "\n";
 1058|       |
 1059|  2.53k|  for (const auto& pixel : m_pattern.pixels) {
  ------------------
  |  Branch (1059:26): [True: 2.53k, False: 395]
  ------------------
 1060|  2.53k|    sstr << indent << "component index: " << pixel.cmpd_index << ", gain: " << pixel.component_gain << "\n";
 1061|  2.53k|  }
 1062|    395|  return sstr.str();
 1063|    395|}
_ZN8Box_splz5parseER14BitstreamRangePK20heif_security_limits:
 1091|    535|{
 1092|    535|  parse_full_box_header(range);
 1093|       |
 1094|    535|  if (get_version() != 0) {
  ------------------
  |  Branch (1094:7): [True: 1, False: 534]
  ------------------
 1095|      1|    return unsupported_version_error("splz");
 1096|      1|  }
 1097|       |
 1098|    534|  uint32_t component_count = range.read32();
 1099|    534|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1099:7): [True: 534, False: 0]
  |  Branch (1099:33): [True: 43, False: 491]
  ------------------
 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|    491|  m_pattern.component_ids.resize(component_count);
 1106|  2.38k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1106:24): [True: 1.89k, False: 491]
  ------------------
 1107|  1.89k|    m_pattern.component_ids[i] = range.read32();
 1108|  1.89k|  }
 1109|       |
 1110|    491|  m_pattern.pattern_width = range.read16();
 1111|    491|  m_pattern.pattern_height = range.read16();
 1112|       |
 1113|    491|  if (m_pattern.pattern_width == 0 || m_pattern.pattern_height == 0) {
  ------------------
  |  Branch (1113:7): [True: 11, False: 480]
  |  Branch (1113:39): [True: 1, False: 479]
  ------------------
 1114|     12|    return {heif_error_Invalid_input,
 1115|     12|            heif_suberror_Invalid_parameter_value,
 1116|     12|            "Zero polarization pattern size."};
 1117|     12|  }
 1118|       |
 1119|    479|  auto max_pattern_size = limits->max_bayer_pattern_pixels;
 1120|    479|  if (max_pattern_size && m_pattern.pattern_height > max_pattern_size / m_pattern.pattern_width) {
  ------------------
  |  Branch (1120:7): [True: 479, False: 0]
  |  Branch (1120:27): [True: 9, False: 470]
  ------------------
 1121|      9|    return {heif_error_Invalid_input,
 1122|      9|            heif_suberror_Security_limit_exceeded,
 1123|      9|            "Maximum polarization pattern size exceeded."};
 1124|      9|  }
 1125|       |
 1126|    470|  size_t num_pixels = size_t{m_pattern.pattern_width} * m_pattern.pattern_height;
 1127|    470|  m_pattern.polarization_angles.resize(num_pixels);
 1128|       |
 1129|  34.0k|  for (size_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1129:22): [True: 33.6k, False: 470]
  ------------------
 1130|  33.6k|    m_pattern.polarization_angles[i] = range.read_float32();
 1131|  33.6k|  }
 1132|       |
 1133|    470|  return range.get_error();
 1134|    479|}
_ZNK8Box_splz4dumpER6Indent:
 1138|    388|{
 1139|    388|  std::ostringstream sstr;
 1140|       |
 1141|    388|  sstr << FullBox::dump(indent);
 1142|       |
 1143|    388|  sstr << indent << "component_count: " << m_pattern.component_ids.size() << "\n";
 1144|  1.69k|  for (size_t i = 0; i < m_pattern.component_ids.size(); i++) {
  ------------------
  |  Branch (1144:22): [True: 1.30k, False: 388]
  ------------------
 1145|  1.30k|    sstr << indent << "  component_index[" << i << "]: " << m_pattern.component_ids[i] << "\n";
 1146|  1.30k|  }
 1147|       |
 1148|    388|  sstr << indent << "pattern_width: " << m_pattern.pattern_width << "\n";
 1149|    388|  sstr << indent << "pattern_height: " << m_pattern.pattern_height << "\n";
 1150|       |
 1151|  8.39k|  for (uint16_t y = 0; y < m_pattern.pattern_height; y++) {
  ------------------
  |  Branch (1151:24): [True: 8.00k, False: 388]
  ------------------
 1152|  36.3k|    for (uint16_t x = 0; x < m_pattern.pattern_width; x++) {
  ------------------
  |  Branch (1152:26): [True: 28.3k, False: 8.00k]
  ------------------
 1153|  28.3k|      float angle = m_pattern.polarization_angles[y * m_pattern.pattern_width + x];
 1154|  28.3k|      if (heif_polarization_angle_is_no_filter(angle)) {
  ------------------
  |  Branch (1154:11): [True: 851, False: 27.5k]
  ------------------
 1155|    851|        sstr << indent << "  [" << x << "," << y << "]: no filter\n";
 1156|    851|      }
 1157|  27.5k|      else {
 1158|  27.5k|        sstr << indent << "  [" << x << "," << y << "]: " << angle << " degrees\n";
 1159|  27.5k|      }
 1160|  28.3k|    }
 1161|  8.00k|  }
 1162|       |
 1163|    388|  return sstr.str();
 1164|    388|}
_ZN8Box_sbpm5parseER14BitstreamRangePK20heif_security_limits:
 1196|    409|{
 1197|    409|  parse_full_box_header(range);
 1198|       |
 1199|    409|  if (get_version() != 0) {
  ------------------
  |  Branch (1199:7): [True: 6, False: 403]
  ------------------
 1200|      6|    return unsupported_version_error("sbpm");
 1201|      6|  }
 1202|       |
 1203|    403|  uint32_t component_count = range.read32();
 1204|       |
 1205|    403|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1205:7): [True: 403, False: 0]
  |  Branch (1205:33): [True: 48, False: 355]
  ------------------
 1206|     48|    return {heif_error_Invalid_input,
 1207|     48|            heif_suberror_Security_limit_exceeded,
 1208|     48|            "sbpm component_count exceeds security limit."};
 1209|     48|  }
 1210|       |
 1211|    355|  m_map.component_ids.resize(component_count);
 1212|  2.23k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1212:24): [True: 1.88k, False: 355]
  ------------------
 1213|  1.88k|    m_map.component_ids[i] = range.read32();
 1214|  1.88k|  }
 1215|       |
 1216|    355|  uint8_t flags = range.read8();
 1217|    355|  m_map.correction_applied = !!(flags & 0x80);
 1218|       |
 1219|    355|  uint32_t num_bad_rows = range.read32();
 1220|    355|  uint32_t num_bad_cols = range.read32();
 1221|    355|  uint32_t num_bad_pixels = range.read32();
 1222|       |
 1223|       |  // Security check: limit total number of entries
 1224|    355|  uint64_t total_entries = static_cast<uint64_t>(num_bad_rows) + num_bad_cols + num_bad_pixels;
 1225|    355|  if (limits->max_bad_pixels && total_entries > limits->max_bad_pixels) {
  ------------------
  |  Branch (1225:7): [True: 355, False: 0]
  |  Branch (1225:33): [True: 3, False: 352]
  ------------------
 1226|      3|    return {heif_error_Invalid_input,
 1227|      3|            heif_suberror_Security_limit_exceeded,
 1228|      3|            "sbpm total bad pixel entries exceed security limit."};
 1229|      3|  }
 1230|       |
 1231|    352|  m_map.bad_rows.resize(num_bad_rows);
 1232|  3.96k|  for (uint32_t i = 0; i < num_bad_rows; i++) {
  ------------------
  |  Branch (1232:24): [True: 3.60k, False: 352]
  ------------------
 1233|  3.60k|    m_map.bad_rows[i] = range.read32();
 1234|  3.60k|  }
 1235|       |
 1236|    352|  m_map.bad_columns.resize(num_bad_cols);
 1237|  4.15k|  for (uint32_t i = 0; i < num_bad_cols; i++) {
  ------------------
  |  Branch (1237:24): [True: 3.80k, False: 352]
  ------------------
 1238|  3.80k|    m_map.bad_columns[i] = range.read32();
 1239|  3.80k|  }
 1240|       |
 1241|    352|  m_map.bad_pixels.resize(num_bad_pixels);
 1242|  2.73k|  for (uint32_t i = 0; i < num_bad_pixels; i++) {
  ------------------
  |  Branch (1242:24): [True: 2.38k, False: 352]
  ------------------
 1243|  2.38k|    m_map.bad_pixels[i].row = range.read32();
 1244|  2.38k|    m_map.bad_pixels[i].column = range.read32();
 1245|  2.38k|  }
 1246|       |
 1247|    352|  return range.get_error();
 1248|    355|}
_ZNK8Box_sbpm4dumpER6Indent:
 1252|    255|{
 1253|    255|  std::ostringstream sstr;
 1254|       |
 1255|    255|  sstr << FullBox::dump(indent);
 1256|       |
 1257|    255|  sstr << indent << "component_count: " << m_map.component_ids.size() << "\n";
 1258|  1.44k|  for (size_t i = 0; i < m_map.component_ids.size(); i++) {
  ------------------
  |  Branch (1258:22): [True: 1.19k, False: 255]
  ------------------
 1259|  1.19k|    sstr << indent << "  component_index[" << i << "]: " << m_map.component_ids[i] << "\n";
 1260|  1.19k|  }
 1261|       |
 1262|    255|  sstr << indent << "correction_applied: " << m_map.correction_applied << "\n";
 1263|       |
 1264|    255|  sstr << indent << "num_bad_rows: " << m_map.bad_rows.size() << "\n";
 1265|  1.30k|  for (size_t i = 0; i < m_map.bad_rows.size(); i++) {
  ------------------
  |  Branch (1265:22): [True: 1.05k, False: 255]
  ------------------
 1266|  1.05k|    sstr << indent << "  bad_row[" << i << "]: " << m_map.bad_rows[i] << "\n";
 1267|  1.05k|  }
 1268|       |
 1269|    255|  sstr << indent << "num_bad_columns: " << m_map.bad_columns.size() << "\n";
 1270|  1.14k|  for (size_t i = 0; i < m_map.bad_columns.size(); i++) {
  ------------------
  |  Branch (1270:22): [True: 885, False: 255]
  ------------------
 1271|    885|    sstr << indent << "  bad_column[" << i << "]: " << m_map.bad_columns[i] << "\n";
 1272|    885|  }
 1273|       |
 1274|    255|  sstr << indent << "num_bad_pixels: " << m_map.bad_pixels.size() << "\n";
 1275|    785|  for (size_t i = 0; i < m_map.bad_pixels.size(); i++) {
  ------------------
  |  Branch (1275:22): [True: 530, False: 255]
  ------------------
 1276|    530|    sstr << indent << "  bad_pixel[" << i << "]: row=" << m_map.bad_pixels[i].row
 1277|    530|         << ", column=" << m_map.bad_pixels[i].column << "\n";
 1278|    530|  }
 1279|       |
 1280|    255|  return sstr.str();
 1281|    255|}
_ZN8Box_snuc5parseER14BitstreamRangePK20heif_security_limits:
 1320|    215|{
 1321|    215|  parse_full_box_header(range);
 1322|       |
 1323|    215|  if (get_version() != 0) {
  ------------------
  |  Branch (1323:7): [True: 7, False: 208]
  ------------------
 1324|      7|    return unsupported_version_error("snuc");
 1325|      7|  }
 1326|       |
 1327|    208|  uint32_t component_count = range.read32();
 1328|       |
 1329|    208|  if (limits->max_components && component_count > limits->max_components) {
  ------------------
  |  Branch (1329:7): [True: 208, False: 0]
  |  Branch (1329:33): [True: 26, False: 182]
  ------------------
 1330|     26|    return {heif_error_Invalid_input,
 1331|     26|            heif_suberror_Security_limit_exceeded,
 1332|     26|            "snuc component_count exceeds security limit."};
 1333|     26|  }
 1334|       |
 1335|    182|  m_nuc.component_ids.resize(component_count);
 1336|  1.72k|  for (uint32_t i = 0; i < component_count; i++) {
  ------------------
  |  Branch (1336:24): [True: 1.54k, False: 182]
  ------------------
 1337|  1.54k|    m_nuc.component_ids[i] = range.read32();
 1338|  1.54k|  }
 1339|       |
 1340|    182|  uint8_t flags = range.read8();
 1341|    182|  m_nuc.nuc_is_applied = !!(flags & 0x80);
 1342|       |
 1343|    182|  m_nuc.image_width = range.read32();
 1344|    182|  m_nuc.image_height = range.read32();
 1345|       |
 1346|    182|  if (m_nuc.image_width == 0 || m_nuc.image_height == 0) {
  ------------------
  |  Branch (1346:7): [True: 11, False: 171]
  |  Branch (1346:33): [True: 22, False: 149]
  ------------------
 1347|     33|    return {heif_error_Invalid_input,
 1348|     33|            heif_suberror_Invalid_parameter_value,
 1349|     33|            "snuc image width and height must be non-zero."};
 1350|     33|  }
 1351|       |
 1352|    149|  uint64_t num_pixels = static_cast<uint64_t>(m_nuc.image_width) * m_nuc.image_height;
 1353|       |
 1354|    149|  if (limits->max_image_size_pixels && num_pixels > limits->max_image_size_pixels) {
  ------------------
  |  Branch (1354:7): [True: 149, False: 0]
  |  Branch (1354:40): [True: 68, False: 81]
  ------------------
 1355|     68|    return {heif_error_Invalid_input,
 1356|     68|            heif_suberror_Security_limit_exceeded,
 1357|     68|            "snuc image dimensions exceed security limit."};
 1358|     68|  }
 1359|       |
 1360|     81|  Error err = m_memory_handle.alloc(num_pixels, 2 * sizeof(float), limits, "snuc box");
 1361|     81|  if (err) {
  ------------------
  |  Branch (1361:7): [True: 6, False: 75]
  ------------------
 1362|      6|    return err;
 1363|      6|  }
 1364|       |
 1365|     75|  m_nuc.nuc_gains.resize(num_pixels);
 1366|   484M|  for (uint64_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1366:24): [True: 484M, False: 75]
  ------------------
 1367|   484M|    m_nuc.nuc_gains[i] = range.read_float32();
 1368|   484M|  }
 1369|       |
 1370|     75|  m_nuc.nuc_offsets.resize(num_pixels);
 1371|   484M|  for (uint64_t i = 0; i < num_pixels; i++) {
  ------------------
  |  Branch (1371:24): [True: 484M, False: 75]
  ------------------
 1372|   484M|    m_nuc.nuc_offsets[i] = range.read_float32();
 1373|   484M|  }
 1374|       |
 1375|     75|  return range.get_error();
 1376|     81|}
_ZNK8Box_snuc4dumpER6Indent:
 1380|     45|{
 1381|     45|  std::ostringstream sstr;
 1382|       |
 1383|     45|  sstr << FullBox::dump(indent);
 1384|       |
 1385|     45|  sstr << indent << "component_count: " << m_nuc.component_ids.size() << "\n";
 1386|    792|  for (size_t i = 0; i < m_nuc.component_ids.size(); i++) {
  ------------------
  |  Branch (1386:22): [True: 747, False: 45]
  ------------------
 1387|    747|    sstr << indent << "  component_index[" << i << "]: " << m_nuc.component_ids[i] << "\n";
 1388|    747|  }
 1389|       |
 1390|     45|  sstr << indent << "nuc_is_applied: " << m_nuc.nuc_is_applied << "\n";
 1391|     45|  sstr << indent << "image_width: " << m_nuc.image_width << "\n";
 1392|     45|  sstr << indent << "image_height: " << m_nuc.image_height << "\n";
 1393|       |
 1394|     45|  uint64_t num_pixels = static_cast<uint64_t>(m_nuc.image_width) * m_nuc.image_height;
 1395|     45|  sstr << indent << "nuc_gains: " << num_pixels << " values\n";
 1396|     45|  sstr << indent << "nuc_offsets: " << num_pixels << " values\n";
 1397|       |
 1398|     45|  return sstr.str();
 1399|     45|}
_ZN8Box_cloc5parseER14BitstreamRangePK20heif_security_limits:
 1432|    127|{
 1433|    127|  parse_full_box_header(range);
 1434|       |
 1435|    127|  if (get_version() != 0) {
  ------------------
  |  Branch (1435:7): [True: 8, False: 119]
  ------------------
 1436|      8|    return unsupported_version_error("cloc");
 1437|      8|  }
 1438|       |
 1439|    119|  m_chroma_location = range.read8();
 1440|       |
 1441|    119|  if (m_chroma_location > 6) {
  ------------------
  |  Branch (1441:7): [True: 5, False: 114]
  ------------------
 1442|      5|    return {heif_error_Invalid_input,
 1443|      5|            heif_suberror_Invalid_parameter_value,
 1444|      5|            "cloc chroma_location value out of range (must be 0-6)."};
 1445|      5|  }
 1446|       |
 1447|    114|  return range.get_error();
 1448|    119|}
_ZNK8Box_cloc4dumpER6Indent:
 1452|    113|{
 1453|    113|  std::ostringstream sstr;
 1454|       |
 1455|    113|  sstr << FullBox::dump(indent);
 1456|       |
 1457|    113|  static const char* location_names[] = {
 1458|    113|    "h=0,   v=0.5",   // 0
 1459|    113|    "h=0.5, v=0.5",   // 1
 1460|    113|    "h=0,   v=0",     // 2
 1461|    113|    "h=0.5, v=0",     // 3
 1462|    113|    "h=0,   v=1",     // 4
 1463|    113|    "h=0.5, v=1",     // 5
 1464|    113|    "Cr:0,0 / Cb:1,0" // 6
 1465|    113|  };
 1466|       |
 1467|    113|  sstr << indent << "chroma_location: " << static_cast<int>(m_chroma_location);
 1468|    113|  if (m_chroma_location <= 6) {
  ------------------
  |  Branch (1468:7): [True: 113, False: 0]
  ------------------
 1469|    113|    sstr << " (" << location_names[m_chroma_location] << ")";
 1470|    113|  }
 1471|    113|  sstr << "\n";
 1472|       |
 1473|    113|  return sstr.str();
 1474|    113|}
_ZN30Box_gimi_component_content_ids5parseER14BitstreamRangePK20heif_security_limits:
 1490|    360|{
 1491|    360|  uint32_t number_of_components = range.read32();
 1492|       |
 1493|    360|  if (limits->max_components && number_of_components > limits->max_components) {
  ------------------
  |  Branch (1493:7): [True: 360, False: 0]
  |  Branch (1493:33): [True: 81, False: 279]
  ------------------
 1494|     81|    std::stringstream sstr;
 1495|     81|    sstr << "GIMI component content IDs box contains " << number_of_components
 1496|     81|         << " components, but security limit is set to " << limits->max_components << " components";
 1497|     81|    return {heif_error_Invalid_input,
 1498|     81|            heif_suberror_Security_limit_exceeded,
 1499|     81|            sstr.str()};
 1500|     81|  }
 1501|       |
 1502|  6.10k|  for (uint32_t i = 0; i < number_of_components; i++) {
  ------------------
  |  Branch (1502:24): [True: 5.88k, False: 214]
  ------------------
 1503|  5.88k|    if (range.eof()) {
  ------------------
  |  Branch (1503:9): [True: 65, False: 5.82k]
  ------------------
 1504|     65|      return {heif_error_Invalid_input,
 1505|     65|              heif_suberror_End_of_data,
 1506|     65|              "Not enough data for all component content IDs"};
 1507|     65|    }
 1508|  5.82k|    m_content_ids.push_back(range.read_string());
 1509|  5.82k|  }
 1510|       |
 1511|    214|  return range.get_error();
 1512|    279|}
_ZNK30Box_gimi_component_content_ids4dumpER6Indent:
 1532|    195|{
 1533|    195|  std::ostringstream sstr;
 1534|    195|  sstr << Box::dump(indent);
 1535|       |
 1536|  5.01k|  for (size_t i = 0; i < m_content_ids.size(); i++) {
  ------------------
  |  Branch (1536:22): [True: 4.81k, False: 195]
  ------------------
 1537|  4.81k|    sstr << indent << "[" << i << "] content ID: " << m_content_ids[i] << "\n";
 1538|  4.81k|  }
 1539|       |
 1540|    195|  return sstr.str();
 1541|    195|}
_Z8get_nameI24heif_cmpd_component_typeEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|  3.78k|{
  124|  3.78k|  auto iter = table.find(val);
  125|  3.78k|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 3.78k]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|  3.78k|  else {
  129|  3.78k|    return iter->second;
  130|  3.78k|  }
  131|  3.78k|}
_Z8get_nameI34heif_uncompressed_component_formatEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|  1.65k|{
  124|  1.65k|  auto iter = table.find(val);
  125|  1.65k|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 1.65k]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|  1.65k|  else {
  129|  1.65k|    return iter->second;
  130|  1.65k|  }
  131|  1.65k|}
_Z8get_nameI31heif_uncompressed_sampling_modeEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|    254|{
  124|    254|  auto iter = table.find(val);
  125|    254|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 254]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|    254|  else {
  129|    254|    return iter->second;
  130|    254|  }
  131|    254|}
_Z8get_nameI33heif_uncompressed_interleave_modeEPKcT_RKNSt3__13mapIS3_S2_NS4_4lessIS3_EENS4_9allocatorINS4_4pairIKS3_S2_EEEEEE:
  123|    254|{
  124|    254|  auto iter = table.find(val);
  125|    254|  if (iter == table.end()) {
  ------------------
  |  Branch (125:7): [True: 0, False: 254]
  ------------------
  126|      0|    return "unknown";
  127|      0|  }
  128|    254|  else {
  129|    254|    return iter->second;
  130|    254|  }
  131|    254|}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN8Box_tilC32init_heif_tiled_image_parametersER27heif_tiled_image_parameters:
  115|  1.17k|{
  116|  1.17k|  params.version = 1;
  117|       |
  118|  1.17k|  params.image_width = 0;
  119|  1.17k|  params.image_height = 0;
  120|  1.17k|  params.tile_width = 0;
  121|  1.17k|  params.tile_height = 0;
  122|  1.17k|  params.compression_format_fourcc = 0;
  123|  1.17k|  params.offset_field_length = 40;
  124|  1.17k|  params.size_field_length = 24;
  125|  1.17k|  params.number_of_extra_dimensions = 0;
  126|       |
  127|  9.36k|  for (uint32_t& dim : params.extra_dimensions) {
  ------------------
  |  Branch (127:22): [True: 9.36k, False: 1.17k]
  ------------------
  128|  9.36k|    dim = 0;
  129|  9.36k|  }
  130|       |
  131|  1.17k|  params.tiles_are_sequential = false;
  132|  1.17k|}
_ZNK8Box_tilC4dumpER6Indent:
  222|    618|{
  223|    618|  std::ostringstream sstr;
  224|       |
  225|    618|  sstr << BoxHeader::dump(indent);
  226|       |
  227|    618|  sstr << indent << "version: " << ((int) get_version()) << "\n"
  228|       |       //<< indent << "image size: " << m_parameters.image_width << "x" << m_parameters.image_height << "\n"
  229|    618|       << indent << "tile size: " << m_parameters.tile_width << "x" << m_parameters.tile_height << "\n"
  230|    618|       << indent << "compression: " << fourcc_to_string(m_parameters.compression_format_fourcc) << "\n"
  231|    618|       << indent << "tiles are sequential: " << (m_parameters.tiles_are_sequential ? "yes" : "no") << "\n"
  ------------------
  |  Branch (231:50): [True: 22, False: 596]
  ------------------
  232|    618|       << indent << "offset field length: " << ((int) m_parameters.offset_field_length) << " bits\n"
  233|    618|       << indent << "size field length: " << ((int) m_parameters.size_field_length) << " bits\n"
  234|    618|       << indent << "number of extra dimensions: " << ((int) m_parameters.number_of_extra_dimensions) << "\n";
  235|       |
  236|    618|  sstr << indent << "tile properties:\n"
  237|    618|       << dump_children(indent, true);
  238|       |
  239|    618|  return sstr.str();
  240|       |
  241|    618|}
_ZN8Box_tilC5parseER14BitstreamRangePK20heif_security_limits:
  245|  1.16k|{
  246|  1.16k|  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.16k|  if (get_version() > 1) {
  ------------------
  |  Branch (249:7): [True: 7, False: 1.16k]
  ------------------
  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.16k|  m_parameters.version = get_version();
  259|       |
  260|  1.16k|  uint32_t flags = get_flags();
  261|       |
  262|  1.16k|  switch (flags & 0x03) {
  ------------------
  |  Branch (262:11): [True: 1.16k, False: 0]
  ------------------
  263|    735|    case 0:
  ------------------
  |  Branch (263:5): [True: 735, False: 427]
  ------------------
  264|    735|      m_parameters.offset_field_length = 32;
  265|    735|      break;
  266|     61|    case 1:
  ------------------
  |  Branch (266:5): [True: 61, False: 1.10k]
  ------------------
  267|     61|      m_parameters.offset_field_length = 40;
  268|     61|      break;
  269|    154|    case 2:
  ------------------
  |  Branch (269:5): [True: 154, False: 1.00k]
  ------------------
  270|    154|      m_parameters.offset_field_length = 48;
  271|    154|      break;
  272|    212|    case 3:
  ------------------
  |  Branch (272:5): [True: 212, False: 950]
  ------------------
  273|    212|      m_parameters.offset_field_length = 64;
  274|    212|      break;
  275|  1.16k|  }
  276|       |
  277|  1.16k|  switch (flags & 0x0c) {
  ------------------
  |  Branch (277:11): [True: 1.16k, False: 0]
  ------------------
  278|    495|    case 0x00:
  ------------------
  |  Branch (278:5): [True: 495, False: 667]
  ------------------
  279|    495|      m_parameters.size_field_length = 0;
  280|    495|      break;
  281|     95|    case 0x04:
  ------------------
  |  Branch (281:5): [True: 95, False: 1.06k]
  ------------------
  282|     95|      m_parameters.size_field_length = 24;
  283|     95|      break;
  284|    468|    case 0x08:
  ------------------
  |  Branch (284:5): [True: 468, False: 694]
  ------------------
  285|    468|      m_parameters.size_field_length = 32;
  286|    468|      break;
  287|    104|    case 0x0c:
  ------------------
  |  Branch (287:5): [True: 104, False: 1.05k]
  ------------------
  288|    104|      m_parameters.size_field_length = 64;
  289|    104|      break;
  290|  1.16k|  }
  291|       |
  292|  1.16k|  m_parameters.tiles_are_sequential = !!(flags & 0x10);
  293|       |
  294|       |
  295|  1.16k|  m_parameters.tile_width = range.read32();
  296|  1.16k|  m_parameters.tile_height = range.read32();
  297|  1.16k|  m_parameters.compression_format_fourcc = range.read32();
  298|       |
  299|  1.16k|  if (m_parameters.tile_width == 0 || m_parameters.tile_height == 0) {
  ------------------
  |  Branch (299:7): [True: 5, False: 1.15k]
  |  Branch (299:39): [True: 37, False: 1.12k]
  ------------------
  300|     42|    return {heif_error_Invalid_input,
  301|     42|            heif_suberror_Unspecified,
  302|     42|            "Tile with zero width or height."};
  303|     42|  }
  304|       |
  305|       |
  306|       |  // --- extra dimensions
  307|       |
  308|  1.12k|  m_parameters.number_of_extra_dimensions = range.read8();
  309|       |
  310|  1.86k|  for (int i = 0; i < m_parameters.number_of_extra_dimensions; i++) {
  ------------------
  |  Branch (310:19): [True: 799, False: 1.06k]
  ------------------
  311|    799|    uint32_t size = range.read32();
  312|       |
  313|    799|    if (size == 0) {
  ------------------
  |  Branch (313:9): [True: 51, False: 748]
  ------------------
  314|     51|      return {heif_error_Invalid_input,
  315|     51|              heif_suberror_Unspecified,
  316|     51|              "'tili' extra dimension may not be zero."};
  317|     51|    }
  318|       |
  319|    748|    if (i < 8) {
  ------------------
  |  Branch (319:9): [True: 394, False: 354]
  ------------------
  320|    394|      m_parameters.extra_dimensions[i] = size;
  321|    394|    }
  322|    354|    else {
  323|       |      // TODO: error: too many dimensions (not supported)
  324|    354|    }
  325|    748|  }
  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.06k|  if (get_version() == 0) {
  ------------------
  |  Branch (331:7): [True: 337, False: 732]
  ------------------
  332|    337|    uint8_t num_properties = range.read8();
  333|       |
  334|    337|    Error error = read_children(range, num_properties, limits);
  335|    337|    if (error) {
  ------------------
  |  Branch (335:9): [True: 129, False: 208]
  ------------------
  336|    129|      return error;
  337|    129|    }
  338|    337|  }
  339|       |
  340|    940|  return range.get_error();
  341|  1.06k|}

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

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

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

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

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

_ZN18color_profile_nclx5parseER14BitstreamRange:
  223|    703|{
  224|    703|  StreamReader::grow_status status;
  225|    703|  status = range.wait_for_available_bytes(7);
  226|    703|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (226:7): [True: 2, False: 701]
  ------------------
  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|    701|  m_profile.m_colour_primaries = range.read16();
  233|    701|  m_profile.m_transfer_characteristics = range.read16();
  234|    701|  m_profile.m_matrix_coefficients = range.read16();
  235|    701|  m_profile.m_full_range_flag = (range.read8() & 0x80 ? true : false);
  ------------------
  |  Branch (235:34): [True: 88, False: 613]
  ------------------
  236|       |
  237|    701|  return Error::Ok;
  238|    703|}
_ZN18color_profile_nclx10parse_nclcER14BitstreamRange:
  241|     69|{
  242|     69|  StreamReader::grow_status status;
  243|     69|  status = range.wait_for_available_bytes(6);
  244|     69|  if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (244:7): [True: 1, False: 68]
  ------------------
  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|     68|  m_profile.m_colour_primaries = range.read16();
  251|     68|  m_profile.m_transfer_characteristics = range.read16();
  252|     68|  m_profile.m_matrix_coefficients = range.read16();
  253|       |
  254|       |  // use full range for RGB, limited range otherwise
  255|     68|  m_profile.m_full_range_flag = (m_profile.m_matrix_coefficients == 0);
  256|       |
  257|     68|  return Error::Ok;
  258|     69|}
_ZN12nclx_profile17set_sRGB_defaultsEv:
  315|    772|{
  316|       |  // sRGB defaults
  317|    772|  m_colour_primaries = 1;
  318|    772|  m_transfer_characteristics = 13;
  319|    772|  m_matrix_coefficients = 6;
  320|    772|  m_full_range_flag = true;
  321|    772|}
_ZN8Box_colr5parseER14BitstreamRangePK20heif_security_limits:
  385|  12.1k|{
  386|  12.1k|  StreamReader::grow_status status;
  387|  12.1k|  uint32_t colour_type = range.read32();
  388|       |
  389|  12.1k|  if (colour_type == fourcc("nclx")) {
  ------------------
  |  Branch (389:7): [True: 703, False: 11.4k]
  ------------------
  390|    703|    auto color_profile = std::make_shared<color_profile_nclx>();
  391|    703|    m_color_profile = color_profile;
  392|    703|    Error err = color_profile->parse(range);
  393|    703|    if (err) {
  ------------------
  |  Branch (393:9): [True: 2, False: 701]
  ------------------
  394|      2|      return err;
  395|      2|    }
  396|    703|  }
  397|  11.4k|  else if (colour_type == fourcc("nclc")) {
  ------------------
  |  Branch (397:12): [True: 69, False: 11.3k]
  ------------------
  398|     69|    auto color_profile = std::make_shared<color_profile_nclx>();
  399|     69|    m_color_profile = color_profile;
  400|     69|    Error err = color_profile->parse_nclc(range);
  401|     69|    if (err) {
  ------------------
  |  Branch (401:9): [True: 1, False: 68]
  ------------------
  402|      1|      return err;
  403|      1|    }
  404|     69|  }
  405|  11.3k|  else if (colour_type == fourcc("prof") ||
  ------------------
  |  Branch (405:12): [True: 2.81k, False: 8.58k]
  ------------------
  406|  11.2k|           colour_type == fourcc("rICC")) {
  ------------------
  |  Branch (406:12): [True: 8.46k, False: 115]
  ------------------
  407|  11.2k|    if (!has_fixed_box_size()) {
  ------------------
  |  Branch (407:9): [True: 2, False: 11.2k]
  ------------------
  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.2k|    uint64_t profile_size_64 = get_box_size() - get_header_size() - 4;
  412|  11.2k|    if (limits->max_color_profile_size && profile_size_64 > limits->max_color_profile_size) {
  ------------------
  |  Branch (412:9): [True: 11.2k, False: 0]
  |  Branch (412:43): [True: 0, False: 11.2k]
  ------------------
  413|      0|      return Error(heif_error_Invalid_input, heif_suberror_Security_limit_exceeded, "Color profile exceeds maximum supported size");
  414|      0|    }
  415|       |
  416|  11.2k|    size_t profile_size = static_cast<size_t>(profile_size_64);
  417|       |
  418|  11.2k|    status = range.wait_for_available_bytes(profile_size);
  419|  11.2k|    if (status != StreamReader::grow_status::size_reached) {
  ------------------
  |  Branch (419:9): [True: 0, False: 11.2k]
  ------------------
  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.2k|    std::vector<uint8_t> rawData(profile_size);
  426|  71.5k|    for (size_t i = 0; i < profile_size; i++) {
  ------------------
  |  Branch (426:24): [True: 60.2k, False: 11.2k]
  ------------------
  427|  60.2k|      rawData[i] = range.read8();
  428|  60.2k|    }
  429|       |
  430|  11.2k|    m_color_profile = std::make_shared<color_profile_raw>(colour_type, rawData);
  431|  11.2k|  }
  432|    115|  else {
  433|    115|    return Error(heif_error_Invalid_input,
  434|    115|                 heif_suberror_Unknown_color_profile_type);
  435|    115|  }
  436|       |
  437|  12.0k|  return range.get_error();
  438|  12.1k|}
_ZNK8Box_colr4dumpER6Indent:
  442|  9.52k|{
  443|  9.52k|  std::ostringstream sstr;
  444|  9.52k|  sstr << Box::dump(indent);
  445|       |
  446|  9.52k|  if (m_color_profile) {
  ------------------
  |  Branch (446:7): [True: 9.52k, False: 0]
  ------------------
  447|  9.52k|    sstr << indent << "colour_type: " << fourcc_to_string(get_color_profile_type()) << "\n";
  448|  9.52k|    sstr << m_color_profile->dump(indent);
  449|  9.52k|  }
  450|      0|  else {
  451|      0|    sstr << indent << "colour_type: ---\n";
  452|      0|    sstr << "no color profile\n";
  453|      0|  }
  454|       |
  455|  9.52k|  return sstr.str();
  456|  9.52k|}
_ZNK17color_profile_raw4dumpER6Indent:
  460|  8.80k|{
  461|  8.80k|  std::ostringstream sstr;
  462|  8.80k|  sstr << indent << "profile size: " << m_data.size() << "\n";
  463|  8.80k|  return sstr.str();
  464|  8.80k|}
_ZNK18color_profile_nclx4dumpER6Indent:
  468|    727|{
  469|    727|  std::ostringstream sstr;
  470|    727|  sstr << indent << "colour_primaries: " << m_profile.m_colour_primaries << "\n"
  471|    727|       << indent << "transfer_characteristics: " << m_profile.m_transfer_characteristics << "\n"
  472|    727|       << indent << "matrix_coefficients: " << m_profile.m_matrix_coefficients << "\n"
  473|    727|       << indent << "full_range_flag: " << m_profile.m_full_range_flag << "\n";
  474|    727|  return sstr.str();
  475|    727|}

_ZN17color_profile_rawC2EjRKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  105|  11.2k|      : m_type(type), m_data(data) {}
_ZNK17color_profile_raw8get_typeEv:
  107|  8.80k|  uint32_t get_type() const override { return m_type; }
_ZN18color_profile_nclxC2Ev:
  175|    772|  color_profile_nclx() { m_profile.set_sRGB_defaults(); }
_ZNK18color_profile_nclx8get_typeEv:
  184|    727|  uint32_t get_type() const override { return fourcc("nclx"); }
_ZN8Box_colrC2Ev:
  205|  12.1k|  {
  206|  12.1k|    set_short_type(fourcc("colr"));
  207|  12.1k|  }
_ZNK8Box_colr22get_color_profile_typeEv:
  211|  9.52k|  uint32_t get_color_profile_type() const { return m_color_profile->get_type(); }
_ZN13color_profileD2Ev:
   92|  12.0k|  virtual ~color_profile() = default;

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

_ZN8Box_prfrC2Ev:
   37|    527|  {
   38|    527|    set_short_type(fourcc("prfr"));
   39|    527|  }
_ZNK8Box_prfr14debug_box_nameEv:
   47|    471|  const char* debug_box_name() const override { return "Projection Format"; }
_ZNK8Box_prfr24get_parse_error_fatalityEv:
   49|     47|  [[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|  62.9k|{
  163|  62.9k|  static std::mutex sMutex;
  164|  62.9k|  return sMutex;
  165|  62.9k|}
_ZN18TotalMemoryTrackerC2EPK20heif_security_limits:
  170|  15.8k|{
  171|  15.8k|  std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  172|       |
  173|  15.8k|  sMemoryUsage[limits] = {};
  174|  15.8k|  m_limits_context = limits;
  175|  15.8k|}
_ZN18TotalMemoryTrackerD2Ev:
  178|  15.8k|{
  179|  15.8k|  std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  180|  15.8k|  sMemoryUsage.erase(m_limits_context);
  181|  15.8k|}
_ZN12MemoryHandle5allocEmmPK20heif_security_limitsPKc:
  202|  8.08k|{
  203|  8.08k|  if (element_size != 0 && count > SIZE_MAX / element_size) {
  ------------------
  |  Branch (203:7): [True: 8.08k, False: 0]
  |  Branch (203:28): [True: 0, False: 8.08k]
  ------------------
  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.08k|  return alloc(count * element_size, limits_context, reason_description);
  217|  8.08k|}
_ZN12MemoryHandle5allocEmPK20heif_security_limitsPKc:
  222|  15.7k|{
  223|       |  // --- check whether limits are exceeded
  224|       |
  225|  15.7k|  if (!limits_context) {
  ------------------
  |  Branch (225:7): [True: 0, False: 15.7k]
  ------------------
  226|      0|    return Error::Ok;
  227|      0|  }
  228|       |
  229|       |  // check against maximum memory block size
  230|       |
  231|  15.7k|  if (limits_context->max_memory_block_size != 0 &&
  ------------------
  |  Branch (231:7): [True: 15.7k, False: 0]
  ------------------
  232|  15.7k|      memory_amount > limits_context->max_memory_block_size) {
  ------------------
  |  Branch (232:7): [True: 39, False: 15.6k]
  ------------------
  233|     39|    std::stringstream sstr;
  234|       |
  235|     39|    if (reason_description) {
  ------------------
  |  Branch (235:9): [True: 39, False: 0]
  ------------------
  236|     39|      sstr << "Allocating " << memory_amount << " bytes for " << reason_description <<" exceeds the security limit of "
  237|     39|           << limits_context->max_memory_block_size << " bytes";
  238|     39|    }
  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|     39|    return {heif_error_Memory_allocation_error,
  245|     39|            heif_suberror_Security_limit_exceeded,
  246|     39|            sstr.str()};
  247|     39|  }
  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|  15.6k|  const heif_security_limits* root_limits = limits_context;
  253|  15.6k|  while (root_limits->version >= 4 && root_limits->parent) {
  ------------------
  |  Branch (253:10): [True: 15.6k, False: 0]
  |  Branch (253:39): [True: 0, False: 15.6k]
  ------------------
  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|  15.6k|  if (m_limits_context) {
  ------------------
  |  Branch (258:7): [True: 0, False: 15.6k]
  ------------------
  259|      0|    assert(m_limits_context == root_limits);
  ------------------
  |  Branch (259:5): [True: 0, False: 0]
  ------------------
  260|      0|  }
  261|       |
  262|  15.6k|  if (root_limits == &global_security_limits ||
  ------------------
  |  Branch (262:7): [True: 0, False: 15.6k]
  ------------------
  263|  15.6k|      root_limits == &disabled_security_limits) {
  ------------------
  |  Branch (263:7): [True: 0, False: 15.6k]
  ------------------
  264|      0|    return Error::Ok;
  265|      0|  }
  266|       |
  267|  15.6k|  std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  268|  15.6k|  auto it = sMemoryUsage.find(root_limits);
  269|  15.6k|  if (it == sMemoryUsage.end()) {
  ------------------
  |  Branch (269:7): [True: 0, False: 15.6k]
  ------------------
  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|  15.6k|  if (limits_context->max_total_memory != 0 &&
  ------------------
  |  Branch (277:7): [True: 15.6k, False: 0]
  ------------------
  278|  15.6k|      it->second.total_memory_usage + memory_amount > limits_context->max_total_memory) {
  ------------------
  |  Branch (278:7): [True: 29, False: 15.6k]
  ------------------
  279|     29|    std::stringstream sstr;
  280|       |
  281|     29|    if (reason_description) {
  ------------------
  |  Branch (281:9): [True: 29, False: 0]
  ------------------
  282|     29|      sstr << "Memory usage of " << it->second.total_memory_usage + memory_amount
  283|     29|           << " bytes for " << reason_description << " exceeds the security limit of "
  284|     29|           << limits_context->max_total_memory << " bytes of total memory usage";
  285|     29|    }
  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|     29|    return {heif_error_Memory_allocation_error,
  293|     29|            heif_suberror_Security_limit_exceeded,
  294|     29|            sstr.str()};
  295|     29|  }
  296|       |
  297|       |
  298|       |  // --- register memory usage
  299|       |
  300|  15.6k|  m_limits_context = root_limits;
  301|  15.6k|  m_memory_amount += memory_amount;
  302|       |
  303|  15.6k|  it->second.total_memory_usage += memory_amount;
  304|       |
  305|       |  // remember maximum memory usage (for informational purpose)
  306|  15.6k|  if (it->second.total_memory_usage > it->second.max_memory_usage) {
  ------------------
  |  Branch (306:7): [True: 3.04k, False: 12.6k]
  ------------------
  307|  3.04k|    it->second.max_memory_usage = it->second.total_memory_usage;
  308|  3.04k|  }
  309|       |
  310|  15.6k|  return Error::Ok;
  311|  15.6k|}
_ZN12MemoryHandle4freeEv:
  315|  17.4k|{
  316|  17.4k|  if (m_limits_context) {
  ------------------
  |  Branch (316:7): [True: 15.6k, False: 1.79k]
  ------------------
  317|  15.6k|    std::lock_guard<std::mutex> lock(get_memory_usage_mutex());
  318|       |
  319|  15.6k|    auto it = sMemoryUsage.find(m_limits_context);
  320|  15.6k|    if (it != sMemoryUsage.end()) {
  ------------------
  |  Branch (320:9): [True: 15.6k, False: 0]
  ------------------
  321|  15.6k|      it->second.total_memory_usage -= m_memory_amount;
  322|  15.6k|    }
  323|       |
  324|  15.6k|    m_limits_context = nullptr;
  325|  15.6k|    m_memory_amount = 0;
  326|  15.6k|  }
  327|  17.4k|}

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

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

_ZN13Box_containerC2EPKc:
   36|  1.88k|  {
   37|  1.88k|    set_short_type(fourcc(type));
   38|  1.88k|  }
_ZN8Box_moovC2Ev:
   50|    459|  Box_moov() : Box_container("moov") {}
_ZNK8Box_moov14debug_box_nameEv:
   52|    385|  const char* debug_box_name() const override { return "Movie"; }
_ZN8Box_mvhdC2Ev:
   60|  1.02k|  {
   61|  1.02k|    set_short_type(fourcc("mvhd"));
   62|  1.02k|  }
_ZNK8Box_mvhd14debug_box_nameEv:
   66|    971|  const char* debug_box_name() const override { return "Movie Header"; }
_ZNK8Box_mvhd8get_rateEv:
   72|    971|  double get_rate() const { return m_rate / double(0x10000); }
_ZNK8Box_mvhd10get_volumeEv:
   74|    971|  float get_volume() const { return float(m_volume) / float(0x100); }
_ZN8Box_trakC2Ev:
  120|    348|  Box_trak() : Box_container("trak") {}
_ZNK8Box_trak14debug_box_nameEv:
  122|    242|  const char* debug_box_name() const override { return "Track"; }
_ZN8Box_tkhdC2Ev:
  130|  1.24k|  {
  131|  1.24k|    set_short_type(fourcc("tkhd"));
  132|       |
  133|       |    // set default flags according to ISO 14496-12
  134|  1.24k|    set_flags(Track_enabled | Track_in_movie | Track_in_preview);
  135|  1.24k|  }
_ZNK8Box_tkhd14debug_box_nameEv:
  146|  1.15k|  const char* debug_box_name() const override { return "Track Header"; }
_ZNK8Box_tkhd10get_volumeEv:
  152|  1.15k|  float get_volume() const { return float(m_volume) / float(0x100); }
_ZNK8Box_tkhd9get_widthEv:
  156|  1.15k|  double get_width() const { return float(m_width) / double(0x10000); }
_ZNK8Box_tkhd10get_heightEv:
  158|  1.15k|  double get_height() const { return float(m_height) / double(0x10000); }
_ZN8Box_mdiaC2Ev:
  197|     43|  Box_mdia() : Box_container("mdia") {}
_ZNK8Box_mdia14debug_box_nameEv:
  199|     37|  const char* debug_box_name() const override { return "Media"; }
_ZN8Box_mdhdC2Ev:
  207|  1.13k|  {
  208|  1.13k|    set_short_type(fourcc("mdhd"));
  209|  1.13k|  }
_ZNK8Box_mdhd14debug_box_nameEv:
  213|    995|  const char* debug_box_name() const override { return "Media Header"; }
_ZN8Box_minfC2Ev:
  245|    248|  Box_minf() : Box_container("minf") {}
_ZNK8Box_minf14debug_box_nameEv:
  247|    230|  const char* debug_box_name() const override { return "Media Information"; }
_ZN8Box_vmhdC2Ev:
  255|    652|  {
  256|    652|    set_short_type(fourcc("vmhd"));
  257|    652|    set_flags(1);
  258|    652|  }
_ZNK8Box_vmhd14debug_box_nameEv:
  262|    541|  const char* debug_box_name() const override { return "Video Media Header"; }
_ZN8Box_nmhdC2Ev:
  279|    208|  {
  280|    208|    set_short_type(fourcc("nmhd"));
  281|    208|    set_flags(1);
  282|    208|  }
_ZNK8Box_nmhd14debug_box_nameEv:
  286|    158|  const char* debug_box_name() const override { return "Null Media Header"; }
_ZN8Box_stblC2Ev:
  298|    476|  Box_stbl() : Box_container("stbl") {}
_ZNK8Box_stbl14debug_box_nameEv:
  300|    451|  const char* debug_box_name() const override { return "Sample Table"; }
_ZN8Box_stsdC2Ev:
  308|  1.29k|  {
  309|  1.29k|    set_short_type(fourcc("stsd"));
  310|  1.29k|  }
_ZNK8Box_stsd14debug_box_nameEv:
  314|    773|  const char* debug_box_name() const override { return "Sample Description"; }
_ZN8Box_sttsC2Ev:
  346|  1.04k|  {
  347|  1.04k|    set_short_type(fourcc("stts"));
  348|  1.04k|  }
_ZNK8Box_stts14debug_box_nameEv:
  352|    900|  const char* debug_box_name() const override { return "Decoding Time to Sample"; }
_ZN8Box_cttsC2Ev:
  382|    933|  {
  383|    933|    set_short_type(fourcc("ctts"));
  384|    933|  }
_ZNK8Box_ctts14debug_box_nameEv:
  388|    846|  const char* debug_box_name() const override { return "Composition Time to Sample"; }
_ZN8Box_stscC2Ev:
  422|    328|  {
  423|    328|    set_short_type(fourcc("stsc"));
  424|    328|  }
_ZNK8Box_stsc14debug_box_nameEv:
  428|    130|  const char* debug_box_name() const override { return "Sample to Chunk"; }
_ZN8Box_stcoC2Ev:
  466|    442|  {
  467|    442|    set_short_type(fourcc("stco"));
  468|    442|  }
_ZNK8Box_stco14debug_box_nameEv:
  472|    364|  const char* debug_box_name() const override { return "Sample Offset"; }
_ZN8Box_stszC2Ev:
  499|    792|  {
  500|    792|    set_short_type(fourcc("stsz"));
  501|    792|  }
_ZNK8Box_stsz14debug_box_nameEv:
  505|    625|  const char* debug_box_name() const override { return "Sample Size"; }
_ZN8Box_stssC2Ev:
  534|    534|  {
  535|    534|    set_short_type(fourcc("stss"));
  536|    534|  }
_ZNK8Box_stss14debug_box_nameEv:
  540|    369|  const char* debug_box_name() const override { return "Sync Sample"; }
_ZN8Box_ccstC2Ev:
  573|    319|  {
  574|    319|    set_short_type(fourcc("ccst"));
  575|    319|  }
_ZNK8Box_ccst14debug_box_nameEv:
  579|    209|  const char* debug_box_name() const override { return "Coding Constraints"; }
_ZN8Box_auxiC2Ev:
  598|    865|  {
  599|    865|    set_short_type(fourcc("auxi"));
  600|    865|  }
_ZNK8Box_auxi14debug_box_nameEv:
  604|    668|  const char* debug_box_name() const override { return "Auxiliary Info Type"; }
_ZNK17VisualSampleEntry25get_horizontal_resolutionEv:
  643|    641|  double get_horizontal_resolution() const { return horizresolution / double(0x10000); }
_ZNK17VisualSampleEntry23get_vertical_resolutionEv:
  645|    641|  double get_vertical_resolution() const { return vertresolution / double(0x10000); }
_ZN22Box_URIMetaSampleEntryC2Ev:
  676|  1.23k|  {
  677|  1.23k|    set_short_type(fourcc("urim"));
  678|  1.23k|  }
_ZNK22Box_URIMetaSampleEntry14debug_box_nameEv:
  684|  1.00k|  const char* debug_box_name() const override { return "URI Meta Sample Entry"; }
_ZN7Box_uriC2Ev:
  699|  1.28k|  {
  700|  1.28k|    set_short_type(fourcc("uri "));
  701|  1.28k|  }
_ZNK7Box_uri14debug_box_nameEv:
  711|  1.17k|  const char* debug_box_name() const override { return "URI"; }
_ZN8Box_sbgpC2Ev:
  725|  1.69k|  {
  726|  1.69k|    set_short_type(fourcc("sbgp"));
  727|  1.69k|  }
_ZNK8Box_sbgp14debug_box_nameEv:
  733|  1.47k|  const char* debug_box_name() const override { return "Sample to Group"; }
_ZN8Box_sgpdC2Ev:
  786|  1.18k|  {
  787|  1.18k|    set_short_type(fourcc("sgpd"));
  788|  1.18k|  }
_ZNK8Box_sgpd14debug_box_nameEv:
  794|  1.13k|  const char* debug_box_name() const override { return "Sample Group Description"; }
_ZN8Box_btrtC2Ev:
  819|    812|  {
  820|    812|    set_short_type(fourcc("btrt"));
  821|    812|  }
_ZNK8Box_btrt14debug_box_nameEv:
  825|    793|  const char* debug_box_name() const override { return "Bitrate"; }
_ZN8Box_saizC2Ev:
  842|  1.15k|  {
  843|  1.15k|    set_short_type(fourcc("saiz"));
  844|  1.15k|  }
_ZNK8Box_saiz14debug_box_nameEv:
  864|    915|  const char* debug_box_name() const override { return "Sample Auxiliary Information Sizes"; }
_ZN8Box_saioC2Ev:
  885|  1.66k|  {
  886|  1.66k|    set_short_type(fourcc("saio"));
  887|  1.66k|  }
_ZNK8Box_saio14debug_box_nameEv:
  904|  1.48k|  const char* debug_box_name() const override { return "Sample Auxiliary Information Offsets"; }
_ZN8Box_sdtpC2Ev:
  930|    421|  {
  931|    421|    set_short_type(fourcc("sdtp"));
  932|    421|  }
_ZNK8Box_sdtp14debug_box_nameEv:
  936|    419|  const char* debug_box_name() const override { return "Independent and Disposable Samples"; }
_ZNK8Box_sdtp14get_is_leadingEj:
  940|  5.84M|  uint8_t get_is_leading(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 6) & 3; }
_ZNK8Box_sdtp14get_depends_onEj:
  942|  5.84M|  uint8_t get_depends_on(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 4) & 3; }
_ZNK8Box_sdtp18get_is_depended_onEj:
  944|  5.84M|  uint8_t get_is_depended_on(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx] >> 2) & 3; }
_ZNK8Box_sdtp18get_has_redundancyEj:
  946|  5.84M|  uint8_t get_has_redundancy(uint32_t sampleIdx) const { return (m_sample_information[sampleIdx]) & 3; }
_ZN8Box_trefC2Ev:
  960|  1.23k|  {
  961|  1.23k|    set_short_type(fourcc("tref"));
  962|  1.23k|  }
_ZNK8Box_tref14debug_box_nameEv:
  971|    919|  const char* debug_box_name() const override { return "Track Reference"; }
_ZN8Box_edtsC2Ev:
  998|    312|  Box_edts() : Box_container("edts") {}
_ZNK8Box_edts14debug_box_nameEv:
 1000|    251|  const char* debug_box_name() const override { return "Edit List Container"; }
_ZN8Box_elstC2Ev:
 1008|    943|  {
 1009|    943|    set_short_type(fourcc("elst"));
 1010|    943|  }
_ZNK8Box_elst14debug_box_nameEv:
 1018|    737|  const char* debug_box_name() const override { return "Edit List"; }
_ZN16SampleGroupEntryD2Ev:
  757|   143k|  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)  {}

